batrider, baregga, bbakraid: hold coin logic

This commit is contained in:
dinkc64 2024-05-22 20:46:35 -04:00
parent d3af7cfcb2
commit 689a8ddf7b
3 changed files with 27 additions and 0 deletions

View File

@ -13,6 +13,8 @@ static UINT8 drvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static UINT8 drvRegion = 0;
static UINT8 drvReset = 0;
static HoldCoin<2> hold_coin;
static UINT8 nIRQPending;
static INT32 nData;
@ -336,6 +338,8 @@ static INT32 drvScan(INT32 nAction, INT32* pnMin)
SCAN_VAR(nCurrentBank);
SCAN_VAR(nData);
hold_coin.scan();
if (nAction & ACB_WRITE) {
INT32 n = nTextROMStatus;
nTextROMStatus = -1;
@ -699,6 +703,8 @@ static INT32 drvDoReset()
BurnYM2151Reset();
NMK112Reset();
hold_coin.reset();
HiscoreReset();
return 0;
@ -839,6 +845,9 @@ static INT32 drvFrame()
ToaClearOpposites(&drvInput[0]);
ToaClearOpposites(&drvInput[1]);
hold_coin.check(0, drvInput[2], 1 << 3, 1);
hold_coin.check(1, drvInput[2], 1 << 4, 1);
SekNewFrame();
nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60));

View File

@ -13,6 +13,8 @@ static UINT8 DrvInput[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static UINT8 DrvReset = 0;
static HoldCoin<2> hold_coin;
static UINT8 nIRQPending;
static INT32 nSoundCommand;
@ -566,6 +568,8 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
SCAN_VAR(nSoundCommand);
SCAN_VAR(nIRQPending);
hold_coin.scan();
if (nAction & ACB_WRITE) {
INT32 nBank = nCurrentBank;
nCurrentBank = -1;
@ -841,6 +845,8 @@ static INT32 DrvDoReset()
BurnYM2151Reset();
NMK112Reset();
hold_coin.reset();
HiscoreReset();
return 0;
@ -1014,6 +1020,9 @@ static INT32 DrvFrame()
ToaClearOpposites(&DrvInput[0]);
ToaClearOpposites(&DrvInput[1]);
hold_coin.check(0, DrvInput[2], 1 << 3, 1);
hold_coin.check(1, DrvInput[2], 1 << 4, 1);
SekNewFrame();
nCyclesTotal[0] = (INT32)((INT64)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60));

View File

@ -19,6 +19,8 @@ static UINT8 *DefaultEEPROM = NULL;
static UINT8 DrvRegion = 0;
static HoldCoin<2> hold_coin;
static UINT8 DrvReset = 0;
static UINT8 nIRQPending;
@ -754,6 +756,8 @@ static INT32 DrvDoReset()
BurnTimerSetRetrig(0, 1.0 / 445.0);
ZetClose();
hold_coin.reset();
HiscoreReset();
return 0;
@ -934,6 +938,9 @@ static INT32 DrvFrame()
ToaClearOpposites(&DrvInput[0]);
ToaClearOpposites(&DrvInput[1]);
hold_coin.check(0, DrvInput[2], 1 << 3, 1);
hold_coin.check(1, DrvInput[2], 1 << 4, 1);
SekNewFrame();
ZetNewFrame();
@ -1055,6 +1062,8 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
SCAN_VAR(nIRQPending);
SCAN_VAR(nTextROMStatus);
hold_coin.scan();
if (nAction & ACB_WRITE) {
INT32 n = nTextROMStatus;
nTextROMStatus = -1;