mirror of
https://github.com/libretro/snes9xherd.git
synced 2024-11-22 23:20:37 +00:00
Remove setjmp regression
This commit is contained in:
parent
7709d09f63
commit
2030902e42
26
src/fxemu.c
26
src/fxemu.c
@ -177,7 +177,6 @@
|
||||
***********************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#include "snes9x.h"
|
||||
#include "memmap.h"
|
||||
#include "getset.h"
|
||||
@ -187,8 +186,6 @@
|
||||
/* Set this define if you wish the plot instruction to check for y-pos limits (I don't think it's nessecary)*/
|
||||
/* #define CHECK_LIMITS*/
|
||||
|
||||
jmp_buf beforesfx;//speedhack
|
||||
|
||||
/*
|
||||
Codes used:
|
||||
rn = a GSU register (r0 - r15)
|
||||
@ -214,7 +211,6 @@ static void fx_stop (void)
|
||||
GSU.vPipe = 1;
|
||||
CLRFLAGS;
|
||||
R15++;
|
||||
longjmp(beforesfx,1);//speedhack
|
||||
}
|
||||
|
||||
/* 01 - nop - no operation*/
|
||||
@ -4623,41 +4619,22 @@ void S9xSuperFXExec (void)
|
||||
/* Execute GSU session*/
|
||||
CF(IRQ);
|
||||
|
||||
//setjmp,longjmp is better since no "isRunning" check needs to be performed every opcode
|
||||
int location = setjmp(beforesfx);//speedhack
|
||||
|
||||
if(location == 1){//if above just returned
|
||||
/* Store GSU registers*/
|
||||
fx_writeRegisterSpace();
|
||||
/* EOF EMULATE FX CHIP*/
|
||||
|
||||
GSUStatus = Memory.FillRAM[0x3000 + GSU_SFR] | (Memory.FillRAM[0x3000 + GSU_SFR + 1] << 8);
|
||||
if ((GSUStatus & (FLG_G | FLG_IRQ)) == FLG_IRQ)
|
||||
{
|
||||
S9X_SET_IRQ(GSU_IRQ_SOURCE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* GSU executions functions*/
|
||||
GSU.vCounter = nInstructions;
|
||||
READR14;
|
||||
while (GSU.vCounter-- > 0)
|
||||
while (TF(G) && GSU.vCounter-- > 0)
|
||||
{
|
||||
/* Execute instruction from the pipe, and fetch next byte to the pipe*/
|
||||
uint32 vOpcode = (uint32) PIPE;
|
||||
FETCHPIPE;
|
||||
(*fx_OpcodeTable[(GSU.vStatusReg & 0x300) | vOpcode])();
|
||||
}
|
||||
longjmp(beforesfx,1);//speedhack
|
||||
}
|
||||
else
|
||||
{
|
||||
CF(G);
|
||||
}
|
||||
|
||||
//if address is invalid sfx does not run,meaning varibles stay the same and this is not needed
|
||||
#if 0
|
||||
/* Store GSU registers*/
|
||||
fx_writeRegisterSpace();
|
||||
/* EOF EMULATE FX CHIP*/
|
||||
@ -4667,7 +4644,6 @@ void S9xSuperFXExec (void)
|
||||
{
|
||||
S9X_SET_IRQ(GSU_IRQ_SOURCE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user