#include "debug.h"\r
#include "../Engine.h"\r
\r
-#include <Pico/PicoInt.h>\r
+#include <pico/pico_int.h>\r
#include "../../common/emu.h"\r
#include "../emu.h"\r
#include "vid.h"\r
int loadrom_result = 0;\r
static timeval noticeMsgTime = { 0, 0 }; // when started showing\r
static CGameAudioMS *gameAudio = 0; // the audio object itself\r
-static int reset_timing;\r
-extern int pico_was_reset;\r
+static int reset_timing = 0;\r
+static int pico_was_reset = 0;\r
extern RSemaphore initSemaphore;\r
extern RSemaphore pauseSemaphore;\r
extern RSemaphore loadWaitSemaphore;\r
int thissec = 0, frames_done = 0, frames_shown = 0;\r
int target_fps, target_frametime;\r
int i, lim_time;\r
- //TRawEvent blevent;\r
\r
MainInit();\r
buff[0] = 0;\r
\r
+ // try to start pico\r
+ DEBUGPRINT(_L("PicoInit()"));\r
PicoInit();\r
-\r
- // just to keep the backlight on (works only on UIQ2)\r
- //blevent.Set(TRawEvent::EActive);\r
+ PicoDrawSetColorFormat(2);\r
+ PicoWriteSound = updateSound;\r
\r
// loop?\r
for(;;)\r
{\r
if (gamestate == PGS_Running)\r
{\r
+ #ifdef __DEBUG_PRINT\r
+ TInt mem, cells = User::CountAllocCells();\r
+ User::AllocSize(mem);\r
+ DEBUGPRINT(_L("worker: cels=%d, size=%d KB"), cells, mem/1024);\r
+ #endif\r
+\r
// switch context to other thread\r
User::After(50000);\r
// prepare window and stuff\r
if(!noticeMsgTime.tv_sec) strcpy(noticeMsg, "NTSC@SYSTEM@/@60@FPS");\r
}\r
target_frametime = 1000000/target_fps;\r
- if(!noticeMsgTime.tv_sec && pico_was_reset)\r
+ if (!noticeMsgTime.tv_sec && pico_was_reset)\r
gettimeofday(¬iceMsgTime, 0);\r
\r
// prepare CD buffer\r
frames_shown -= target_fps; if (frames_shown < 0) frames_shown = 0;\r
if (frames_shown > frames_done) frames_shown = frames_done;\r
}\r
+ User::ResetInactivityTime();\r
}\r
\r
\r
CPolledActiveScheduler::Instance()->Schedule();\r
CGameWindow::FreeResources();\r
}\r
+ else if(gamestate == PGS_Reset)\r
+ {\r
+ PicoReset();\r
+ pico_was_reset = 1;\r
+ gamestate = PGS_Running;\r
+ }\r
else if(gamestate == PGS_ReloadRom)\r
{\r
loadrom_result = emu_ReloadRom(loadrom_fname);\r
pico_was_reset = 1;\r
if (loadrom_result)\r
gamestate = PGS_Running;\r
- else\r
+ else {\r
+ extern char menuErrorMsg[];\r
gamestate = PGS_Paused;\r
+ lprintf("%s\n", menuErrorMsg);\r
+ }\r
DEBUGPRINT(_L("done loading ROM, retval=%i"), loadrom_result);\r
loadWaitSemaphore.Signal();\r
User::After(50000);\r
User::After(150000);\r
}\r
\r
+ emu_WriteConfig(0);\r
CGameWindow::FreeResources();\r
- } else if(gamestate == PGS_DebugHeap) {\r
- #ifdef __DEBUG_PRINT\r
- TInt cells = User::CountAllocCells();\r
- TInt mem;\r
- User::AllocSize(mem);\r
- DEBUGPRINT(_L("worker: cels=%d, size=%d KB"), cells, mem/1024);\r
- gamestate = gamestate_next;\r
- #endif\r
} else if(gamestate == PGS_Quit) {\r
break;\r
}\r
\r
DumpMemInfo();\r
\r
- // try to start pico\r
- DEBUGPRINT(_L("PicoInit()"));\r
- PicoDrawSetColorFormat(2);\r
- PicoWriteSound = updateSound;\r
-\r
// if (pauseSemaphore.Handle() <= 0)\r
// pauseSemaphore.CreateLocal(0);\r
DEBUGPRINT(_L("initSemaphore.Signal()"));\r
areaActions = 0;\r
}\r
}\r
+\r
+ if (movie_data) emu_updateMovie();\r
}\r
\r
\r
sprintf(noticeMsg, "SAVE@SLOT@%i@SELECTED", state_slot);\r
gettimeofday(¬iceMsgTime, 0);\r
}\r
- if(which & 0x0020) if(gameAudio) currentConfig.volume = gameAudio->ChangeVolume(0);\r
- if(which & 0x0010) if(gameAudio) currentConfig.volume = gameAudio->ChangeVolume(1);\r
+ if ((which & 0x0030) && gameAudio != NULL) {\r
+ currentConfig.volume = gameAudio->ChangeVolume((which & 0x0010) ? 1 : 0);\r
+ sprintf(noticeMsg, "VOL@%02i@", currentConfig.volume);\r
+ gettimeofday(¬iceMsgTime, 0);\r
+ }\r
}\r
\r
\r