Skip to content

Commit

Permalink
Reset behavior show gfx (libretro#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahoneyt944 authored May 29, 2024
1 parent 73e9729 commit b45be34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/cpuexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ static void cpu_pre_run(void)
cpu_vblankreset();
current_frame = 0;
cpu_pause_state = false;
toggle_showgfx = false;
state_save_dump_registry();
}

Expand Down
10 changes: 5 additions & 5 deletions src/usrintrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static int setup_via_menu = 0;
UINT8 ui_dirty;

/* show gfx */
bool toggle_showgfx;
static int mode,bank,color,firstdrawn;
static int palpage;
static int cpx,cpy,skip_chars,skip_tmap;
Expand Down Expand Up @@ -3257,7 +3258,6 @@ void CLIB_DECL usrintf_showmessage_secs(int seconds, const char *text,...)

int handle_user_interface(struct mame_bitmap *bitmap)
{
static bool toggle_gfx = false;
DoCheat(bitmap); /* This must be called once a frame */

if (setup_selected == 0)
Expand Down Expand Up @@ -3312,9 +3312,9 @@ int handle_user_interface(struct mame_bitmap *bitmap)
/* if the user pressed IPT_UI_SHOW_GFX, show the character set */
if (input_ui_pressed(IPT_UI_SHOW_GFX))
{
toggle_gfx = !toggle_gfx;
toggle_showgfx = !toggle_showgfx;

if (toggle_gfx) /* just changed - init variables */
if (toggle_showgfx) /* just changed - init variables */
{
mode = 0;
bank = 0;
Expand All @@ -3331,9 +3331,9 @@ int handle_user_interface(struct mame_bitmap *bitmap)
}
}

if(toggle_gfx) showcharset(bitmap);
if(toggle_showgfx) showcharset(bitmap);

if (!setup_active() && !toggle_gfx && cpu_pause_state)
if (!setup_active() && !toggle_showgfx && cpu_pause_state)
cpu_pause(false);

return 0;
Expand Down
1 change: 1 addition & 0 deletions src/usrintrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct DisplayText
#define SEL_MASK2 ((1<<SEL_BITS2)-1)

extern UINT8 ui_dirty;
extern bool toggle_showgfx;

struct GfxElement *builduifont(void);
void pick_uifont_colors(void);
Expand Down

0 comments on commit b45be34

Please sign in to comment.