mirror of
https://github.com/dborth/fceugx.git
synced 2024-11-01 15:05:05 +01:00
reduce frameskip to 1 for turbo. makes for a slower turbo but at least there's no more crashing.
This commit is contained in:
parent
15ebd5ff8c
commit
906517a7c0
@ -46,8 +46,10 @@
|
|||||||
|
|
||||||
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
|
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);
|
||||||
|
|
||||||
static uint8 *xbsave=NULL;
|
|
||||||
static int fskipc = 0;
|
static int fskipc = 0;
|
||||||
|
static uint8 *gfx=0;
|
||||||
|
static int32 *sound=0;
|
||||||
|
static int32 ssize=0;
|
||||||
int ScreenshotRequested = 0;
|
int ScreenshotRequested = 0;
|
||||||
int ConfigRequested = 0;
|
int ConfigRequested = 0;
|
||||||
int ShutdownRequested = 0;
|
int ShutdownRequested = 0;
|
||||||
@ -314,21 +316,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while(1) // emulation loop
|
while(1) // emulation loop
|
||||||
{
|
{
|
||||||
uint8 *gfx;
|
|
||||||
int32 *sound;
|
|
||||||
int32 ssize;
|
|
||||||
|
|
||||||
#ifdef FRAMESKIP
|
#ifdef FRAMESKIP
|
||||||
fskipc=(fskipc+1)%(frameskip+1);
|
fskipc=(fskipc+1)%(frameskip+1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FCEUI_Emulate(&gfx, &sound, &ssize, fskipc);
|
FCEUI_Emulate(&gfx, &sound, &ssize, fskipc);
|
||||||
|
|
||||||
if(!fskipc)
|
|
||||||
{
|
|
||||||
xbsave = gfx;
|
|
||||||
FCEUD_Update(gfx, sound, ssize);
|
FCEUD_Update(gfx, sound, ssize);
|
||||||
}
|
|
||||||
|
|
||||||
if(ResetRequested)
|
if(ResetRequested)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,9 @@ ArchiveScanRecord FCEUD_ScanArchive(std::string fname) { return ArchiveScanRecor
|
|||||||
// main interface to FCE Ultra
|
// main interface to FCE Ultra
|
||||||
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int32 Count)
|
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int32 Count)
|
||||||
{
|
{
|
||||||
|
if(Buffer && Count > 0)
|
||||||
PlaySound(Buffer, Count); // play sound
|
PlaySound(Buffer, Count); // play sound
|
||||||
|
if(XBuf)
|
||||||
RenderFrame(XBuf); // output video frame
|
RenderFrame(XBuf); // output video frame
|
||||||
GetJoy(); // check controller input
|
GetJoy(); // check controller input
|
||||||
}
|
}
|
||||||
|
@ -670,9 +670,6 @@ ResetVideo_Emu ()
|
|||||||
|
|
||||||
void RenderFrame(unsigned char *XBuf)
|
void RenderFrame(unsigned char *XBuf)
|
||||||
{
|
{
|
||||||
if(!XBuf)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Ensure previous vb has complete
|
// Ensure previous vb has complete
|
||||||
while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE))
|
while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE))
|
||||||
usleep (50);
|
usleep (50);
|
||||||
|
@ -640,7 +640,7 @@ void GetJoy()
|
|||||||
// Turbo mode
|
// Turbo mode
|
||||||
// RIGHT on c-stick and on classic ctrlr right joystick
|
// RIGHT on c-stick and on classic ctrlr right joystick
|
||||||
if(userInput[0].pad.substickX > 70 || userInput[0].WPAD_Stick(1,0) > 70)
|
if(userInput[0].pad.substickX > 70 || userInput[0].WPAD_Stick(1,0) > 70)
|
||||||
frameskip = 3;
|
frameskip = 1;
|
||||||
else
|
else
|
||||||
frameskip = 0;
|
frameskip = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user