Esempio n. 1
0
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__
}
Esempio n. 2
0
/******************************************************************
  Function: RomOpen
  Purpose:  This function is called when a rom is open. (from the 
            emulation thread)
  input:    none
  output:   none
*******************************************************************/ 
EXPORT void CALL RomOpen (void)
{
#ifdef __PPC__
   vi = new VI_GX(gfxInfo);
   VIDEO_SetPreRetraceCallback(gfx_PreRetraceCallback);
#else // __PPC__
#ifndef _WIN32
   vi = new VI_SDL(gfxInfo);
   //vi->setGamma(2.222);
   vi->setGamma(1.0);
#else
   vi = new VI_WIN(gfxInfo);
   //vi->setGamma(2.222);
   vi->setGamma(1.0);
#endif
#endif
}
Esempio n. 3
0
static void setup_video_mode(GXRModeObj *mode)
{
   VIDEO_Configure(mode);
   for (unsigned i = 0; i < 3; i++)
   {
      g_framebuf[i] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(mode));
      VIDEO_ClearFrameBuffer(mode, g_framebuf[i], COLOR_BLACK);
   }

   g_vi_framebuf = 0;
   g_render_framebuf = 1;
   VIDEO_SetNextFramebuffer(g_framebuf[0]);
   VIDEO_SetPreRetraceCallback(retrace_callback);
   VIDEO_SetBlack(false);
   VIDEO_Flush();
   VIDEO_WaitVSync();
   if (mode->viTVMode & VI_NON_INTERLACE)
      VIDEO_WaitVSync();
}
Esempio n. 4
0
/******************************************************************
  Function: RomClosed
  Purpose:  This function is called when a rom is closed.
  input:    none
  output:   none
*******************************************************************/ 
EXPORT void CALL RomClosed (void)
{
   //vi->setGamma(1.0);
   VIDEO_SetPreRetraceCallback(NULL);
   delete vi;
}