cawingbl now works at normal speed (only needs an IRQ 6 as VBlank IRQ)

This commit is contained in:
Barry Harris 2012-04-24 20:01:05 +00:00
parent 8799daa4a9
commit 211932cc3f
3 changed files with 10 additions and 9 deletions

View File

@ -169,6 +169,7 @@ extern UINT8 CpsReset;
extern UINT8 Cpi01A, Cpi01C, Cpi01E;
extern INT32 nIrqLine50, nIrqLine52; // The scanlines at which the interrupts are triggered
extern INT32 nCpsNumScanlines;
extern INT32 Cps1VBlankIRQLine;
extern INT32 CpsDrawSpritesInReverse;
INT32 CpsRunInit();
INT32 CpsRunExit();

View File

@ -18,6 +18,7 @@ INT32 CpsDrawSpritesInReverse = 0;
INT32 nIrqLine50, nIrqLine52;
INT32 nCpsNumScanlines = 259;
INT32 Cps1VBlankIRQLine = 2;
CpsRunInitCallback CpsRunInitCallbackFunction = NULL;
CpsRunInitCallback CpsRunExitCallbackFunction = NULL;
@ -194,6 +195,8 @@ INT32 CpsRunExit()
CpsRunFrameStartCallbackFunction = NULL;
CpsRunFrameMiddleCallbackFunction = NULL;
CpsRunFrameEndCallbackFunction = NULL;
Cps1VBlankIRQLine = 2;
return 0;
}
@ -326,7 +329,7 @@ INT32 Cps1Frame()
memcpy(CpsSaveReg[0], CpsReg, 0x100); // Registers correct now
SekSetIRQLine(2, SEK_IRQSTATUS_AUTO); // Trigger VBlank interrupt
SekSetIRQLine(Cps1VBlankIRQLine, SEK_IRQSTATUS_AUTO); // Trigger VBlank interrupt
}
SekRun(nNext - SekTotalCycles()); // run 68K

View File

@ -10800,6 +10800,8 @@ static INT32 DrvInit()
nRet = CpsRunInit(); if (nRet != 0) return 1;
Cps1VBlankIRQLine = 2;
return 0;
}
@ -10925,18 +10927,12 @@ void __fastcall CawingblInputWriteWord(UINT32 a, UINT16 d)
}
}
static void CawingblFrameMiddle()
{
// Needs an IRQ 6 to write scroll values (running it every frame results
// in the game running too fast
if (GetCurrentFrame() & 1) SekSetIRQLine(6, SEK_IRQSTATUS_AUTO);
}
static INT32 CawingblInit()
{
INT32 nRet = 0;
Cps1DisablePSnd = 1;
bCpsUpdatePalEveryFrame = 1;
CpsLayer1XOffs = -63;
CpsLayer2XOffs = -62;
@ -10949,7 +10945,6 @@ static INT32 CawingblInit()
CpsRunResetCallbackFunction = FcrashSoundReset;
CpsRunExitCallbackFunction = FcrashSoundExit;
CpsRunFrameStartCallbackFunction = FcrashSoundFrameStart;
CpsRunFrameMiddleCallbackFunction = CawingblFrameMiddle;
CpsRunFrameEndCallbackFunction = FcrashSoundFrameEnd;
CpsMemScanCallbackFunction = FcrashScanSound;
@ -10963,6 +10958,8 @@ static INT32 CawingblInit()
SekSetWriteWordHandler(1, CawingblInputWriteWord);
SekClose();
Cps1VBlankIRQLine = 6;
return 0;
}