From 689a8ddf7b471165f67a1368e5ae55d62aa2477c Mon Sep 17 00:00:00 2001 From: dinkc64 Date: Wed, 22 May 2024 20:46:35 -0400 Subject: [PATCH] batrider, baregga, bbakraid: hold coin logic --- src/burn/drv/toaplan/d_batrider.cpp | 9 +++++++++ src/burn/drv/toaplan/d_battleg.cpp | 9 +++++++++ src/burn/drv/toaplan/d_bbakraid.cpp | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/burn/drv/toaplan/d_batrider.cpp b/src/burn/drv/toaplan/d_batrider.cpp index 09068cfa8..2ea6d3fbf 100644 --- a/src/burn/drv/toaplan/d_batrider.cpp +++ b/src/burn/drv/toaplan/d_batrider.cpp @@ -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)); diff --git a/src/burn/drv/toaplan/d_battleg.cpp b/src/burn/drv/toaplan/d_battleg.cpp index bc0027f25..2c7fe78a3 100644 --- a/src/burn/drv/toaplan/d_battleg.cpp +++ b/src/burn/drv/toaplan/d_battleg.cpp @@ -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)); diff --git a/src/burn/drv/toaplan/d_bbakraid.cpp b/src/burn/drv/toaplan/d_bbakraid.cpp index 9ed776292..e68df4f7f 100644 --- a/src/burn/drv/toaplan/d_bbakraid.cpp +++ b/src/burn/drv/toaplan/d_bbakraid.cpp @@ -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;