mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 14:57:46 -04:00
new code to collect/use more stats, some debug tools
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@520 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
4306047f67
commit
2707a9cbaa
1 changed files with 40 additions and 4 deletions
44
gp2x/menu.c
44
gp2x/menu.c
|
@ -432,8 +432,10 @@ rescan:
|
|||
// ------------ debug menu ------------
|
||||
|
||||
char *debugString(void);
|
||||
void PicoDrawShowSpriteStats(unsigned short *screen);
|
||||
void PicoDrawShowPalette(unsigned short *screen);
|
||||
|
||||
static void draw_debug(void)
|
||||
static void draw_main_debug(void)
|
||||
{
|
||||
char *p, *str = debugString();
|
||||
int len, line;
|
||||
|
@ -450,13 +452,47 @@ static void draw_debug(void)
|
|||
if (*p == 0) break;
|
||||
p++; str = p;
|
||||
}
|
||||
menu_flip();
|
||||
}
|
||||
|
||||
static void draw_frame_debug(void)
|
||||
{
|
||||
char layer_str[48] = "layers: ";
|
||||
if (PicoDrawMask & PDRAW_LAYERB_ON) memcpy(layer_str + 8, "B", 1);
|
||||
if (PicoDrawMask & PDRAW_LAYERA_ON) memcpy(layer_str + 10, "A", 1);
|
||||
if (PicoDrawMask & PDRAW_SPRITES_LOW_ON) memcpy(layer_str + 12, "spr_lo", 6);
|
||||
if (PicoDrawMask & PDRAW_SPRITES_HI_ON) memcpy(layer_str + 19, "spr_hi", 6);
|
||||
|
||||
memset(gp2x_screen, 0, 320*240*2);
|
||||
emu_forcedFrame();
|
||||
smalltext_out16(4, 232, layer_str, 0xffff);
|
||||
}
|
||||
|
||||
static void debug_menu_loop(void)
|
||||
{
|
||||
draw_debug();
|
||||
wait_for_input(GP2X_B|GP2X_X);
|
||||
int inp, mode = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case 0: draw_main_debug(); break;
|
||||
case 1: draw_frame_debug(); break;
|
||||
case 2: PicoDrawShowSpriteStats(gp2x_screen); break;
|
||||
case 3: PicoDrawShowPalette(gp2x_screen); break;
|
||||
}
|
||||
menu_flip();
|
||||
|
||||
inp = wait_for_input(GP2X_B|GP2X_X|GP2X_L|GP2X_R|GP2X_UP|GP2X_DOWN|GP2X_LEFT|GP2X_RIGHT);
|
||||
if (inp & (GP2X_B|GP2X_X)) return;
|
||||
if (inp & GP2X_L) { mode--; if (mode < 0) mode = 3; }
|
||||
if (inp & GP2X_R) { mode++; if (mode > 3) mode = 0; }
|
||||
if (mode == 1) {
|
||||
if (inp & GP2X_LEFT) PicoDrawMask ^= PDRAW_LAYERB_ON;
|
||||
if (inp & GP2X_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON;
|
||||
if (inp & GP2X_DOWN) PicoDrawMask ^= PDRAW_SPRITES_LOW_ON;
|
||||
if (inp & GP2X_UP) PicoDrawMask ^= PDRAW_SPRITES_HI_ON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------ patch/gg menu ------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue