X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgizmondo%2Femu.c;h=90f66400929fd26b993f3d9c7d31f89855a9cc97;hb=9025b93159042e856af2fb1a1e7e5017f9fee99c;hp=cde2e47d65c153265cbd5aeaac91543fb4ce1709;hpb=84100c0fd5a5abb6b1e712aa1feb33388362695d;p=picodrive.git diff --git a/platform/gizmondo/emu.c b/platform/gizmondo/emu.c index cde2e47..90f6640 100644 --- a/platform/gizmondo/emu.c +++ b/platform/gizmondo/emu.c @@ -16,7 +16,7 @@ #include "giz.h" #include "asm_utils.h" -#include +#include #ifdef BENCHMARK #define OSD_FPS_X 220 @@ -26,8 +26,6 @@ // main 300K gfx-related buffer. Used by menu and renderers. unsigned char gfx_buffer[321*240*2*2]; -char romFileName[MAX_PATH]; -int engineState; unsigned char *PicoDraw2FB = gfx_buffer; // temporary buffer for alt renderer ( (8+320)*(8+240+8) ) int reset_timing = 0; @@ -45,9 +43,11 @@ void emu_noticeMsgUpdated(void) noticeMsgTime = GetTickCount(); } -void emu_getMainDir(char *dst, int len) +int emu_getMainDir(char *dst, int len) { if (len > 0) *dst = 0; + + return 0; } static void emu_msg_cb(const char *msg) @@ -143,16 +143,6 @@ void emu_prepareDefaultConfig(void) defaultConfig.turbo_rate = 15; } -void emu_setDefaultConfig(void) -{ - memcpy(¤tConfig, &defaultConfig, sizeof(currentConfig)); - PicoOpt = currentConfig.s_PicoOpt; - PsndRate = currentConfig.s_PsndRate; - PicoRegionOverride = currentConfig.s_PicoRegion; - PicoAutoRgnOrder = currentConfig.s_PicoAutoRgnOrder; - PicoCDBuffers = currentConfig.s_PicoCDBuffers; -} - static int EmuScanBegin16(unsigned int num) { @@ -398,10 +388,10 @@ static void RunEvents(unsigned int which) { int keys; blit("", (which & 0x1000) ? "LOAD STATE? (PLAY=yes, STOP=no)" : "OVERWRITE SAVE? (PLAY=yes, STOP=no)"); - while( !((keys = Framework_PollGetButtons()) & (BTN_PLAY|BTN_STOP)) ) + while( !((keys = Framework_PollGetButtons()) & (PBTN_PLAY|PBTN_STOP)) ) Sleep(50); - if (keys & BTN_STOP) do_it = 0; - while( ((keys = Framework_PollGetButtons()) & (BTN_PLAY|BTN_STOP)) ) // wait for release + if (keys & PBTN_STOP) do_it = 0; + while( ((keys = Framework_PollGetButtons()) & (PBTN_PLAY|PBTN_STOP)) ) // wait for release Sleep(50); clearArea(0); } @@ -456,40 +446,13 @@ static void updateKeys(void) static unsigned int prevEvents = 0; int i; + /* FIXME: port to input fw */ keys = Framework_PollGetButtons(); - if (keys & BTN_HOME) + if (keys & PBTN_HOME) engineState = PGS_Menu; keys &= CONFIGURABLE_KEYS; - for (i = 0; i < 32; i++) - { - if (keys & (1 << i)) - { - int pl, acts = currentConfig.KeyBinds[i]; - if (!acts) continue; - pl = (acts >> 16) & 1; - if (kb_combo_keys & (1 << i)) - { - int u = i+1, acts_c = acts & kb_combo_acts; - // let's try to find the other one - if (acts_c) { - for (; u < 32; u++) - if ( (keys & (1 << u)) && (currentConfig.KeyBinds[u] & acts_c) ) { - allActions[pl] |= acts_c & currentConfig.KeyBinds[u]; - keys &= ~((1 << i) | (1 << u)); - break; - } - } - // add non-combo actions if combo ones were not found - if (!acts_c || u == 32) - allActions[pl] |= acts & ~kb_combo_acts; - } else { - allActions[pl] |= acts; - } - } - } - PicoPad[0] = allActions[0] & 0xfff; PicoPad[1] = allActions[1] & 0xfff; @@ -558,7 +521,6 @@ void emu_Loop(void) else PicoOpt&=~0x4000; Pico.m.dirtyPal = 1; oldmodes = ((Pico.video.reg[12]&1)<<2) ^ 0xc; - emu_findKeyBindCombos(); // pal/ntsc might have changed, reset related stuff target_fps = Pico.m.pal ? 50 : 60;