X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Fmenu.c;h=25c886f09fb79227539f695646b7a535798bd986;hp=12d6dc652e3f38962a64e12f7690996bee012f6a;hb=e6ee752982da44a60a9a6b5916d7642ba2dd8b9e;hpb=989672f4f2b4b4b2b373271374e6546546091c10 diff --git a/drivers/gp2x/menu.c b/drivers/gp2x/menu.c index 12d6dc6..25c886f 100644 --- a/drivers/gp2x/menu.c +++ b/drivers/gp2x/menu.c @@ -25,10 +25,7 @@ #error "need d_type for file browser #endif -static int GP2X_PORT_REV = -#include "rev.h" -; - +extern int GP2X_PORT_REV; extern char lastLoadedGameName[PATH_MAX]; extern int mmuhack_status; extern int soundvol; @@ -682,7 +679,7 @@ static void draw_key_config(const bind_action_t *opts, int opt_cnt, int player_i // draw cursor gp2x_text_out15(x - 16, tl_y + sel*10, ">"); - if (sel < 10) { + if (sel < opt_cnt) { gp2x_text_out15(30, 190, "Press a button to bind/unbind"); gp2x_text_out15(30, 200, "Use VOL+ to clear"); gp2x_text_out15(30, 210, "To bind UP/DOWN, hold VOL-"); @@ -787,8 +784,13 @@ static bind_action_t ctrl_actions[] = static bind_action_t emuctrl_actions[] = { - { "Save State ", 1<<31 }, - { "Load State ", 1<<30 }, + { "Save State ", 1<<31 }, + { "Load State ", 1<<30 }, + { "Next State Slot ", 1<<29 }, + { "Prev State Slot ", 1<<28 }, + { "FDS Insert/Eject ", 1<<27 }, + { "FDS Select Disk ", 1<<26 }, + { "VSUni Insert Coin", 1<<25 }, }; static void kc_sel_loop(void) @@ -818,6 +820,19 @@ static void kc_sel_loop(void) // --------- FCEU options ---------- +extern int ntsccol,ntschue,ntsctint; +extern int srendlinev[2]; +extern int erendlinev[2]; +extern int eoptions; + + +static void int_incdec(int *p, int inc, int min, int max) +{ + *p += inc; + if (*p < min) *p = min; + else if (*p > max) *p = max; +} + static void draw_fcemenu_options(int menu_sel) { int tl_x = 25, tl_y = 60, y; @@ -825,8 +840,16 @@ static void draw_fcemenu_options(int menu_sel) y = tl_y; gp2x_fceu_copy_bg(); - gp2x_text_out15(tl_x, y, " %s", "OFF"); // 0 - gp2x_text_out15(tl_x, (y+=10), "Done"); + gp2x_text_out15(tl_x, y, "NTSC Color Emulation %s", ntsccol?"ON":"OFF"); // 0 + gp2x_text_out15(tl_x, (y+=10), " Tint (default: 56) %i", ntsctint); + gp2x_text_out15(tl_x, (y+=10), " Hue (default: 72) %i", ntschue); + gp2x_text_out15(tl_x, (y+=10), "First visible line (NTSC) %i", srendlinev[0]); + gp2x_text_out15(tl_x, (y+=10), "Last visible line (NTSC) %i", erendlinev[0]); + gp2x_text_out15(tl_x, (y+=10), "First visible line (PAL) %i", srendlinev[1]); // 5 + gp2x_text_out15(tl_x, (y+=10), "Last visible line (PAL) %i", erendlinev[1]); + gp2x_text_out15(tl_x, (y+=10), "Clip 8 left/right columns %s", (eoptions&EO_CLIPSIDES)?"ON":"OFF"); + gp2x_text_out15(tl_x, (y+=10), "Disable 8 sprite limit %s", "TODO"); + gp2x_text_out15(tl_x, (y+=10), "Done"); // 9 // draw cursor gp2x_text_out15(tl_x - 16, tl_y + menu_sel*10, ">"); @@ -836,9 +859,11 @@ static void draw_fcemenu_options(int menu_sel) static void fcemenu_loop_options(void) { - int menu_sel = 0, menu_sel_max = 1; + int menu_sel = 0, menu_sel_max = 9, i; unsigned long inp = 0; + FCEUI_GetNTSCTH(&ntsctint, &ntschue); + for(;;) { draw_fcemenu_options(menu_sel); @@ -847,15 +872,29 @@ static void fcemenu_loop_options(void) if(inp & GP2X_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; } if((inp& GP2X_B)||(inp&GP2X_LEFT)||(inp&GP2X_RIGHT)) { // toggleable options switch (menu_sel) { - case 0: break; - case 1: return; + case 0: ntsccol = !ntsccol; break; + case 7: eoptions^=EO_CLIPSIDES; break; + case 9: return; + } + } + if(inp & (GP2X_X|GP2X_A)) { + for(i=0;i<2;i++) + { + if(srendlinev[i]<0 || srendlinev[i]>239) srendlinev[i]=0; + if(erendlinev[i]239) erendlinev[i]=239; } + FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue); + FCEUI_SetRenderedLines(srendlinev[0],erendlinev[0],srendlinev[1],erendlinev[1]); + return; } - if(inp & (GP2X_X|GP2X_A)) return; if(inp & (GP2X_LEFT|GP2X_RIGHT)) { // multi choise switch (menu_sel) { - case 0: - break; + case 1: int_incdec(&ntsctint, (inp & GP2X_LEFT) ? -1 : 1, 0, 128); break; + case 2: int_incdec(&ntschue, (inp & GP2X_LEFT) ? -1 : 1, 0, 128); break; + case 3: int_incdec(&srendlinev[0], (inp & GP2X_LEFT) ? -1 : 1, 0, 239); break; + case 4: int_incdec(&erendlinev[0], (inp & GP2X_LEFT) ? -1 : 1, 0, 239); break; + case 5: int_incdec(&srendlinev[1], (inp & GP2X_LEFT) ? -1 : 1, 0, 239); break; + case 6: int_incdec(&erendlinev[1], (inp & GP2X_LEFT) ? -1 : 1, 0, 239); break; } } } @@ -927,13 +966,6 @@ static int sndrate_prevnext(int rate, int dir) return rates[i]; } -static void int_incdec(int *p, int inc, int min, int max) -{ - *p += inc; - if (*p < min) *p = min; - else if (*p > max) *p = max; -} - static void config_commit(void) { gp2x_cpuclock_gamma_update(); @@ -1012,10 +1044,26 @@ static int menu_loop_options(void) static void draw_menu_credits(void) { + char vstr[16]; + //int tl_x = 15, tl_y = 70; gp2x_fceu_copy_bg(); - // TODO + sprintf(vstr, "GPFCE v" GP2X_PORT_VERSION " rev%i", GP2X_PORT_REV); + gp2x_text_out15(20, 30, vstr); + gp2x_text_out15(20, 40, "(c) notaz, 2007"); + + gp2x_text_out15(20, 70, "Based on FCE Ultra versions"); + gp2x_text_out15(20, 80, "0.81 and 0.98.15"); + + gp2x_text_out15(20, 110, " - Credits - "); + gp2x_text_out15(20, 130, "Bero: FCE"); + gp2x_text_out15(20, 140, "Xodnizel: FCE Ultra"); + gp2x_text_out15(20, 150, "zzhu8192: original port"); + gp2x_text_out15(20, 160, "rlyeh: minimal lib"); + gp2x_text_out15(20, 170, "Hermes, theoddbot, god_at_hell:"); + gp2x_text_out15(20, 180, " cpuctrl, gamma libs"); + gp2x_text_out15(20, 190, "Squidge: squidgehack"); gp2x_video_flip(); } @@ -1114,6 +1162,8 @@ static int menu_loop_root(void) /*if(savestate_menu_loop(0)) continue;*/ FCEUI_SaveState(); + Exit = 0; + while (gp2x_joystick_read(1) & GP2X_B) usleep(50*1000); return 0; } break; @@ -1122,6 +1172,8 @@ static int menu_loop_root(void) /*if(savestate_menu_loop(1)) continue;*/ FCEUI_LoadState(); + Exit = 0; + while (gp2x_joystick_read(1) & GP2X_B) usleep(50*1000); return 0; } break; @@ -1136,6 +1188,7 @@ static int menu_loop_root(void) selfname = romsel_loop(curr_path); if (selfname) { printf("selected file: %s\n", selfname); + while (gp2x_joystick_read(1) & GP2X_B) usleep(50*1000); return 2; } break;