add logic and CLI for game-specific workarounds
This commit is contained in:
parent
99f68c8a51
commit
cfae9c7674
|
@ -1485,15 +1485,24 @@ static void execHardware_hstart()
|
|||
gfx3d_VBlankEndSignal(frameSkipper.ShouldSkip3D());
|
||||
}
|
||||
|
||||
if(nds.VCount==261)
|
||||
nds.overclock = 0;
|
||||
|
||||
if(nds.VCount==263)
|
||||
{
|
||||
//when the vcount hits 263 it rolls over to 0
|
||||
nds.VCount=0;
|
||||
nds.VCount=0;
|
||||
}
|
||||
else if(nds.VCount==262)
|
||||
{
|
||||
//when the vcount hits 262, vblank ends (oam pre-renders by one scanline)
|
||||
execHardware_hstart_vblankEnd();
|
||||
if(!(NDS_ARM9.waitIRQ) && nds.overclock < 200 && CommonSettings.pokehax) {
|
||||
nds.overclock++;
|
||||
nds.VCount = 261;
|
||||
}
|
||||
else
|
||||
{
|
||||
//when the vcount hits 262, vblank ends (oam pre-renders by one scanline)
|
||||
execHardware_hstart_vblankEnd();
|
||||
}
|
||||
}
|
||||
else if(nds.VCount==192)
|
||||
{
|
||||
|
@ -2515,6 +2524,7 @@ void NDS_Reset()
|
|||
nds.isTouch = 0;
|
||||
nds.isFakeBooted = false;
|
||||
nds.paddle = 0;
|
||||
nds.overclock = 0;
|
||||
nds.ConsoleType = CommonSettings.ConsoleType;
|
||||
nds._DebugConsole = CommonSettings.DebugConsole;
|
||||
nds.ensataEmulation = CommonSettings.EnsataEmulation;
|
||||
|
|
|
@ -176,6 +176,7 @@ struct NDSSystem
|
|||
u64 timerCycle[2][4];
|
||||
u32 VCount;
|
||||
u32 old;
|
||||
u8 overclock;
|
||||
|
||||
//raw adc touch coords for old NDS
|
||||
u16 adc_touchX;
|
||||
|
@ -577,6 +578,7 @@ extern struct TCommonSettings {
|
|||
int num_cores;
|
||||
bool single_core() { return num_cores==1; }
|
||||
bool rigorous_timing;
|
||||
bool pokehax;
|
||||
|
||||
int StylusPressure;
|
||||
bool StylusJitter;
|
||||
|
|
|
@ -124,6 +124,7 @@ ENDL
|
|||
#endif
|
||||
" --advanced-timing Use advanced bus-level timing; default ON" ENDL
|
||||
" --rigorous-timing Use more realistic component timings; default OFF" ENDL
|
||||
" --pokehax Use game-specific hacks; default OFF" ENDL
|
||||
" --spu-advanced Enable advanced SPU capture functions (reverb)" ENDL
|
||||
" --backupmem-db Use DB for autodetecting backup memory type" ENDL
|
||||
ENDL
|
||||
|
@ -244,6 +245,7 @@ bool CommandLine::parse(int argc,char **argv)
|
|||
#endif
|
||||
{ "rigorous-timing", no_argument, &_rigorous_timing, 1},
|
||||
{ "advanced-timing", no_argument, &_advanced_timing, 1},
|
||||
{ "pokehax", no_argument, &_pokehax, 1},
|
||||
{ "spu-advanced", no_argument, &_spu_advanced, 1},
|
||||
{ "backupmem-db", no_argument, &autodetect_method, 1},
|
||||
|
||||
|
@ -352,6 +354,7 @@ bool CommandLine::parse(int argc,char **argv)
|
|||
if(_num_cores != -1) CommonSettings.num_cores = _num_cores;
|
||||
if(_rigorous_timing) CommonSettings.rigorous_timing = true;
|
||||
if(_advanced_timing != -1) CommonSettings.advanced_timing = _advanced_timing==1;
|
||||
if(_advanced_timing != -1) CommonSettings.pokehax = _pokehax==1;
|
||||
|
||||
#ifdef HAVE_JIT
|
||||
if(_cpu_mode != -1) CommonSettings.use_jit = (_cpu_mode==1);
|
||||
|
|
|
@ -97,6 +97,7 @@ private:
|
|||
int _num_cores;
|
||||
int _rigorous_timing;
|
||||
int _advanced_timing;
|
||||
int _pokehax;
|
||||
int _texture_deposterize;
|
||||
int _texture_smooth;
|
||||
#ifdef HAVE_JIT
|
||||
|
|
|
@ -206,6 +206,7 @@ SFORMAT SF_NDS[]={
|
|||
{ "_FBS", 4, 1, &nds.freezeBus},
|
||||
{ "_CEJ", 4, 1, &nds.cardEjected},
|
||||
{ "_PDL", 2, 1, &nds.paddle},
|
||||
{ "_OVR", 1, 1, &nds.overclock},
|
||||
{ "_P00", 1, 1, &nds.power1.lcd},
|
||||
{ "_P01", 1, 1, &nds.power1.gpuMain},
|
||||
{ "_P02", 1, 1, &nds.power1.gfx3d_render},
|
||||
|
|
Loading…
Reference in New Issue