Skip to content

Commit

Permalink
Fix show gfx crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mahoneyt944 authored May 17, 2024
1 parent 838f84f commit 2b54348
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/usrintrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,16 +1051,14 @@ static void showcharset(struct mame_bitmap *bitmap)
int cpx=0,cpy,skip_chars=0,skip_tmap=0;
int tilemap_xpos = 0;
int tilemap_ypos = 0;
static const struct rectangle fullrect = { 0, 10000, 0, 10000 };

mode = 0;
bank = 0;
color = 0;
firstdrawn = 0;
palpage = 0;

do
{
static const struct rectangle fullrect = { 0, 10000, 0, 10000 };

/* mark the whole thing dirty */
ui_markdirty(&fullrect);
Expand Down Expand Up @@ -1439,8 +1437,6 @@ static void showcharset(struct mame_bitmap *bitmap)
}
}
}
} while (!input_ui_pressed(IPT_UI_SHOW_GFX) &&
!input_ui_pressed(IPT_UI_CANCEL));

schedule_full_refresh();
}
Expand Down Expand Up @@ -3267,7 +3263,7 @@ 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 @@ -3320,9 +3316,11 @@ 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))
{
showcharset(bitmap);
toggle_gfx = !toggle_gfx;
}

if(toggle_gfx) showcharset(bitmap);

return 0;
}

Expand Down

0 comments on commit 2b54348

Please sign in to comment.