X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fwin32%2FGenaDrive%2FMain.cpp;h=93db3cd9e6d6e5eeb86fc1e5829c0c1b60a812a9;hb=a5f80ce405bdb5377ed58a2525819ca1a8e11685;hp=4fbbf029d8ace36ae437230a8c3e4cdd55bbedf2;hpb=1b0ac8adc97d65c686a48c4375c07907de86be24;p=picodrive.git diff --git a/platform/win32/GenaDrive/Main.cpp b/platform/win32/GenaDrive/Main.cpp index 4fbbf02..93db3cd 100644 --- a/platform/win32/GenaDrive/Main.cpp +++ b/platform/win32/GenaDrive/Main.cpp @@ -11,6 +11,7 @@ int lock_to_1_1 = 1; int MainWidth=720,MainHeight=480; static HMENU mdisplay = 0; +static int rom_loaded = 0; static void UpdateRect() { @@ -24,7 +25,6 @@ static void UpdateRect() static void LoadROM(const char *cmdpath) { static char rompath[MAX_PATH] = { 0, }; - static unsigned char *rom_data = NULL; unsigned char *rom_data_new = NULL; unsigned int rom_size = 0; pm_file *rom = NULL; @@ -63,10 +63,10 @@ static void LoadROM(const char *cmdpath) LoopWait=1; for (i = 0; LoopWaiting == 0 && i < 10; i++) Sleep(100); + PicoUnloadCart(); PicoCartInsert(rom_data_new, rom_size); - if (rom_data) free(rom_data); - rom_data = rom_data_new; + rom_loaded = 1; romname = rompath; LoopWait=0; } @@ -106,7 +106,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam) lock_to_1_1=0; CheckMenuItem(mdisplay, 1104, MF_UNCHECKED); } - LoopWait=0; + if (rom_loaded) LoopWait=0; return 0; case 1104: lock_to_1_1=!lock_to_1_1; @@ -122,7 +122,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam) "NJ: CZ80\n" "MAME devs: YM2612 and SN76496 cores\n" "Stéphane Dallongeville: Gens code, base of Fame/C (C68K), CZ80\n" - "Tasco Deluxe: SVP RE work\n", + "Tasco Deluxe: SVP RE work\n" + "Pierpaolo Prazzoli: info about SSP16 chips\n", "About", 0); return 0; } @@ -181,7 +182,7 @@ static int FrameInit() InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, (UINT_PTR) mfile, "&File"); InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, (UINT_PTR) mdisplay, "&Display"); // InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, 1200, "&Config"); - InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING|MF_POPUP, 1300, "&About"); + InsertMenu(mmain, -1, MF_BYPOSITION|MF_STRING, 1300, "&About"); // Create the window: FrameWnd=CreateWindow(wc.lpszClassName,"PicoDrive " VERSION,style|WS_VISIBLE,