EXPORT void CALL RomOpen(void) { #ifdef DEBUGON // _break(); #endif InitConfiguration(); if( g_CritialSection.IsLocked() ) { g_CritialSection.Unlock(); TRACE0("g_CritialSection is locked when game is starting, unlock it now."); } status.bDisableFPS=false; #if defined(__GX__) # ifdef USE_EXPANSION g_dwRamSize = 0x800000; # else g_dwRamSize = 0x400000; # endif #else //__GX__ g_dwRamSize = 0x800000; #endif //!__GX__ #ifdef _DEBUG if( debuggerPause ) { debuggerPause = FALSE; usleep(100 * 1000); } #endif #ifdef USING_THREAD uint32 threadID; for(int i = 0; i < 5; i++) { threadMsg[i] = CreateEvent( NULL, FALSE, FALSE, NULL ); if (threadMsg[i] == NULL) { ErrorMsg( "Error creating thread message events"); return; } } threadFinished = CreateEvent( NULL, FALSE, FALSE, NULL ); if (threadFinished == NULL) { ErrorMsg( "Error creating video thread finished event"); return; } videoThread = CreateThread( NULL, 4096, VideoThreadProc, NULL, NULL, &threadID ); #else StartVideo(); #endif #ifdef __GX__ VIDEO_SetPreRetraceCallback(VI_GX_PreRetraceCallback); #endif // __GX__ }