X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fuiq3%2FEngine.cpp;h=adb32b45789cd43cf4746971dbb32c8b60333eda;hb=74e1b42b9256870c7e9f70f5b4ca71ed0e8a63d5;hp=ee9b6a528e4112ca543fc00eb5d36f580e7801b4;hpb=ca482e5de8bacb70db55f43afe02f93fe6fe3f16;p=picodrive.git diff --git a/platform/uiq3/Engine.cpp b/platform/uiq3/Engine.cpp index ee9b6a5..adb32b4 100644 --- a/platform/uiq3/Engine.cpp +++ b/platform/uiq3/Engine.cpp @@ -23,7 +23,7 @@ #include #include "version.h" -#include +#include #include "../common/emu.h" #include "engine/debug.h" #include "App.h" @@ -37,7 +37,6 @@ extern const char *actionNames[]; RSemaphore initSemaphore; RSemaphore pauseSemaphore; RSemaphore loadWaitSemaphore; -int pico_was_reset = 0; static CPicolAppView *appView = 0; @@ -47,11 +46,11 @@ TInt CPicoGameSession::Do(const TPicoServRqst what, TAny *param) { case PicoMsgLoadState: if(!rom_loaded) return -1; // no ROM - return emu_SaveLoadGame(1, 0); + return emu_save_load_game(1, 0); case PicoMsgSaveState: if(!rom_loaded) return -1; - return emu_SaveLoadGame(0, 0); + return emu_save_load_game(0, 0); case PicoMsgLoadROM: return loadROM((TPtrC16 *)param); @@ -65,9 +64,7 @@ TInt CPicoGameSession::Do(const TPicoServRqst what, TAny *param) case PicoMsgReset: if(rom_loaded) { - PicoReset(); - pico_was_reset = 1; - return ChangeRunState(PGS_Running); + return ChangeRunState(PGS_Reset); } return 1; @@ -182,15 +179,16 @@ TInt CPicoGameSession::loadROM(TPtrC16 *pptr) // If successful, in will enter PGS_Running state by itself. loadrom_fname = (char *)writeBuf.PtrZ(); loadrom_result = 0; + loadWaitSemaphore.Wait(1); // make sure sem is not set ret = ChangeRunState(PGS_ReloadRom); if(ret) return ret; - loadWaitSemaphore.Wait(20*1000*1000); + loadWaitSemaphore.Wait(60*1000*1000); if (loadrom_result == 0) - return PicoErrNotRom; + return PicoErrRomOpenFailed; - emu_getGameName(buff); + emu_get_game_name(buff); TPtrC8 buff8((TUint8*) buff); iRomInternalName.Copy(buff8); @@ -198,11 +196,9 @@ TInt CPicoGameSession::loadROM(TPtrC16 *pptr) // debug #ifdef __DEBUG_PRINT - TInt cells = User::CountAllocCells(); - TInt mem; + TInt mem, cells = User::CountAllocCells(); User::AllocSize(mem); DEBUGPRINT(_L("comm: cels=%d, size=%d KB"), cells, mem/1024); - ChangeRunState(PGS_DebugHeap, PGS_Running); #endif return 0;