mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
gb.cpp: Added Rumble emulation to the MBC-5 Game Boy
Color games which supported it. MAME will now output a "Rumble" output bit (0 for Rumble=OFF and 1 for Rumble=ON) whenever the games try to access the Rumble component… third party applications can now listen to the output and redirect it to some hardware that can "rumble" in sync with the gameplay. [Fabio Priuli] gb.cpp: Added partial RTC emulation to the MBC-3 Game Boy Color games which supported it. Clock proceeds a bit too fast during gameplay, but at least it is not stuck anymore to the time of first configuration. [Fabio Priuli]
This commit is contained in:
parent
0169416ae3
commit
ad3b07d17f
@ -86,7 +86,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="10pinbu" cloneof="10pinb">
|
<software name="10pinbu" cloneof="10pinb">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>10-Pin Bowling (USA)</description>
|
<description>10-Pin Bowling (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Majesco</publisher>
|
<publisher>Majesco</publisher>
|
||||||
@ -177,7 +177,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="3dupinb">
|
<software name="3dupinb">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>3-D Ultra Pinball - Thrillride (USA)</description>
|
<description>3-D Ultra Pinball - Thrillride (USA)</description>
|
||||||
<year>2000</year>
|
<year>2000</year>
|
||||||
<publisher>Sierra</publisher>
|
<publisher>Sierra</publisher>
|
||||||
@ -3051,7 +3051,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="cheechai">
|
<software name="cheechai">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Chee-Chai Alien (Jpn)</description>
|
<description>Chee-Chai Alien (Jpn)</description>
|
||||||
<year>2001</year>
|
<year>2001</year>
|
||||||
<publisher>Creatures</publisher>
|
<publisher>Creatures</publisher>
|
||||||
@ -6698,7 +6698,6 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="getchuu">
|
<software name="getchuu">
|
||||||
<!-- Notes: Rumble support -->
|
|
||||||
<description>Get Chuu Club - Minna no Konchuu Daizukan (Jpn)</description>
|
<description>Get Chuu Club - Minna no Konchuu Daizukan (Jpn)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Jaleco</publisher>
|
<publisher>Jaleco</publisher>
|
||||||
@ -8057,7 +8056,6 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="holein1">
|
<software name="holein1">
|
||||||
<!-- Notes: Rumble support -->
|
|
||||||
<description>Hole In One Golf (USA)</description>
|
<description>Hole In One Golf (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Natsume</publisher>
|
<publisher>Natsume</publisher>
|
||||||
@ -9197,7 +9195,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="kawanus4" cloneof="rivking2">
|
<software name="kawanus4" cloneof="rivking2">
|
||||||
<!-- Notes: SGB enhanced, Rumble support -->
|
<!-- Notes: SGB enhanced -->
|
||||||
<description>Kawa no Nushi Tsuri 4 (Jpn)</description>
|
<description>Kawa no Nushi Tsuri 4 (Jpn)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Victor Interactive Software</publisher>
|
<publisher>Victor Interactive Software</publisher>
|
||||||
@ -10446,7 +10444,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="mermaid2u" cloneof="mermaid2">
|
<software name="mermaid2u" cloneof="mermaid2">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Disney's The Little Mermaid II - Pinball Frenzy (USA)</description>
|
<description>Disney's The Little Mermaid II - Pinball Frenzy (USA)</description>
|
||||||
<year>2000</year>
|
<year>2000</year>
|
||||||
<publisher>Disney Interactive</publisher>
|
<publisher>Disney Interactive</publisher>
|
||||||
@ -12538,7 +12536,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="missileu" cloneof="missile">
|
<software name="missileu" cloneof="missile">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Missile Command (USA)</description>
|
<description>Missile Command (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Hasbro Interactive</publisher>
|
<publisher>Hasbro Interactive</publisher>
|
||||||
@ -13556,7 +13554,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="nascchal">
|
<software name="nascchal">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>NASCAR Challenge (USA)</description>
|
<description>NASCAR Challenge (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Hasbro Interactive</publisher>
|
<publisher>Hasbro Interactive</publisher>
|
||||||
@ -14086,7 +14084,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="nushiadv">
|
<software name="nushiadv">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Nushi Tsuri Adventure - Kite no Bouken (Jpn)</description>
|
<description>Nushi Tsuri Adventure - Kite no Bouken (Jpn)</description>
|
||||||
<year>2000</year>
|
<year>2000</year>
|
||||||
<publisher>Victor Interactive Software</publisher>
|
<publisher>Victor Interactive Software</publisher>
|
||||||
@ -14477,7 +14475,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="pdark">
|
<software name="pdark">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Perfect Dark (Euro, USA)</description>
|
<description>Perfect Dark (Euro, USA)</description>
|
||||||
<year>2000</year>
|
<year>2000</year>
|
||||||
<publisher>Nintendo</publisher>
|
<publisher>Nintendo</publisher>
|
||||||
@ -15502,7 +15500,6 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="pokepinb">
|
<software name="pokepinb">
|
||||||
<!-- Notes: Rumble support -->
|
|
||||||
<description>Pokémon Pinball (Euro)</description>
|
<description>Pokémon Pinball (Euro)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Nintendo</publisher>
|
<publisher>Nintendo</publisher>
|
||||||
@ -15526,7 +15523,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="pokepinbj" cloneof="pokepinb">
|
<software name="pokepinbj" cloneof="pokepinb">
|
||||||
<!-- Notes: SGB enhanced, Rumble support -->
|
<!-- Notes: SGB enhanced -->
|
||||||
<description>Pokémon Pinball (Jpn)</description>
|
<description>Pokémon Pinball (Jpn)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Nintendo</publisher>
|
<publisher>Nintendo</publisher>
|
||||||
@ -15545,7 +15542,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="pokepinbu" cloneof="pokepinb">
|
<software name="pokepinbu" cloneof="pokepinb">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Pokémon Pinball (Aus, USA)</description>
|
<description>Pokémon Pinball (Aus, USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Nintendo</publisher>
|
<publisher>Nintendo</publisher>
|
||||||
@ -15645,7 +15642,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="polarsno" cloneof="snowcros">
|
<software name="polarsno" cloneof="snowcros">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Polaris SnoCross (USA)</description>
|
<description>Polaris SnoCross (USA)</description>
|
||||||
<year>2000</year>
|
<year>2000</year>
|
||||||
<publisher>Vatical Entertainment</publisher>
|
<publisher>Vatical Entertainment</publisher>
|
||||||
@ -17088,7 +17085,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="r2rumbleu" cloneof="r2rumble">
|
<software name="r2rumbleu" cloneof="r2rumble">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Ready 2 Rumble Boxing (USA)</description>
|
<description>Ready 2 Rumble Boxing (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Midway</publisher>
|
<publisher>Midway</publisher>
|
||||||
@ -19194,7 +19191,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="swracer">
|
<software name="swracer">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Star Wars Episode I - Racer (Euro, USA)</description>
|
<description>Star Wars Episode I - Racer (Euro, USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Nintendo</publisher>
|
<publisher>Nintendo</publisher>
|
||||||
@ -19304,7 +19301,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="sblkbass">
|
<software name="sblkbass">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Super Black Bass - Real Fight (Jpn)</description>
|
<description>Super Black Bass - Real Fight (Jpn)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Starfish</publisher>
|
<publisher>Starfish</publisher>
|
||||||
@ -19545,7 +19542,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="srfish">
|
<software name="srfish">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Super Real Fishing (Jpn)</description>
|
<description>Super Real Fishing (Jpn)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Bottom Up</publisher>
|
<publisher>Bottom Up</publisher>
|
||||||
@ -20151,7 +20148,6 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="tdoffr3" cloneof="4x4world">
|
<software name="tdoffr3" cloneof="4x4world">
|
||||||
<!-- Notes: Rumble support -->
|
|
||||||
<description>Test Drive Off-Road 3 (USA)</description>
|
<description>Test Drive Off-Road 3 (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Infogrames</publisher>
|
<publisher>Infogrames</publisher>
|
||||||
@ -20684,7 +20680,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="tonkaracua" cloneof="tonkarac">
|
<software name="tonkaracua" cloneof="tonkarac">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Tonka Raceway (USA, Rumble Version)</description>
|
<description>Tonka Raceway (USA, Rumble Version)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Hasbro Interactive</publisher>
|
<publisher>Hasbro Interactive</publisher>
|
||||||
@ -20828,7 +20824,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="topgearj" cloneof="tgrally">
|
<software name="topgearj" cloneof="tgrally">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Top Gear Pocket (Jpn)</description>
|
<description>Top Gear Pocket (Jpn)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Kemco</publisher>
|
<publisher>Kemco</publisher>
|
||||||
@ -20845,7 +20841,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="topgear" cloneof="tgrally">
|
<software name="topgear" cloneof="tgrally">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Top Gear Pocket (USA)</description>
|
<description>Top Gear Pocket (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Kemco</publisher>
|
<publisher>Kemco</publisher>
|
||||||
@ -20860,7 +20856,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="topgear2j" cloneof="tgrally2">
|
<software name="topgear2j" cloneof="tgrally2">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Top Gear Pocket 2 (Jpn)</description>
|
<description>Top Gear Pocket 2 (Jpn)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Kemco</publisher>
|
<publisher>Kemco</publisher>
|
||||||
@ -20895,7 +20891,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="tgrally">
|
<software name="tgrally">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Top Gear Rally (Euro)</description>
|
<description>Top Gear Rally (Euro)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Kemco</publisher>
|
<publisher>Kemco</publisher>
|
||||||
@ -21645,7 +21641,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="vigilnt8">
|
<software name="vigilnt8">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Vigilante 8 (USA)</description>
|
<description>Vigilante 8 (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Vatical Entertainment</publisher>
|
<publisher>Vatical Entertainment</publisher>
|
||||||
@ -22909,7 +22905,7 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
|||||||
</software>
|
</software>
|
||||||
|
|
||||||
<software name="zebco">
|
<software name="zebco">
|
||||||
<!-- Notes: GBC only, Rumble support -->
|
<!-- Notes: GBC only -->
|
||||||
<description>Zebco Fishing! (USA)</description>
|
<description>Zebco Fishing! (USA)</description>
|
||||||
<year>1999</year>
|
<year>1999</year>
|
||||||
<publisher>Vatical Entertainment</publisher>
|
<publisher>Vatical Entertainment</publisher>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
Game Boy carts with MBC (Memory Bank Controller)
|
Game Boy carts with MBC (Memory Bank Controller)
|
||||||
|
|
||||||
|
|
||||||
TODO: add proper RTC and Rumble support
|
TODO: RTC runs too fast while in-game, in MBC-3 games... find the problem!
|
||||||
|
|
||||||
***********************************************************************************************************/
|
***********************************************************************************************************/
|
||||||
|
|
||||||
@ -179,13 +179,15 @@ void gb_rom_mbc_device::shared_reset()
|
|||||||
void gb_rom_mbc3_device::device_start()
|
void gb_rom_mbc3_device::device_start()
|
||||||
{
|
{
|
||||||
shared_start();
|
shared_start();
|
||||||
save_item(NAME(m_rtc_map));
|
save_item(NAME(m_rtc_regs));
|
||||||
|
save_item(NAME(m_rtc_ready));
|
||||||
}
|
}
|
||||||
|
|
||||||
void gb_rom_mbc3_device::device_reset()
|
void gb_rom_mbc3_device::device_reset()
|
||||||
{
|
{
|
||||||
shared_reset();
|
shared_reset();
|
||||||
memset(m_rtc_map, 0, sizeof(m_rtc_map));
|
memset(m_rtc_regs, 0, sizeof(m_rtc_regs));
|
||||||
|
m_rtc_ready = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gb_rom_mbc6_device::device_start()
|
void gb_rom_mbc6_device::device_start()
|
||||||
@ -446,6 +448,18 @@ WRITE8_MEMBER(gb_rom_mbc2_device::write_ram)
|
|||||||
|
|
||||||
// MBC3
|
// MBC3
|
||||||
|
|
||||||
|
void gb_rom_mbc3_device::update_rtc()
|
||||||
|
{
|
||||||
|
system_time curtime;
|
||||||
|
machine().current_datetime(curtime);
|
||||||
|
|
||||||
|
m_rtc_regs[0] = curtime.local_time.second;
|
||||||
|
m_rtc_regs[1] = curtime.local_time.minute;
|
||||||
|
m_rtc_regs[2] = curtime.local_time.hour;
|
||||||
|
m_rtc_regs[3] = curtime.local_time.day & 0xff;
|
||||||
|
m_rtc_regs[4] = (m_rtc_regs[4] & 0xf0) | (curtime.local_time.day >> 8);
|
||||||
|
}
|
||||||
|
|
||||||
READ8_MEMBER(gb_rom_mbc3_device::read_rom)
|
READ8_MEMBER(gb_rom_mbc3_device::read_rom)
|
||||||
{
|
{
|
||||||
if (offset < 0x4000)
|
if (offset < 0x4000)
|
||||||
@ -472,16 +486,14 @@ WRITE8_MEMBER(gb_rom_mbc3_device::write_bank)
|
|||||||
{
|
{
|
||||||
m_ram_bank = data;
|
m_ram_bank = data;
|
||||||
}
|
}
|
||||||
else
|
else if (has_timer)
|
||||||
{
|
{
|
||||||
if (has_timer)
|
if (m_rtc_ready == 1 && data == 0)
|
||||||
|
m_rtc_ready = 0;
|
||||||
|
if (m_rtc_ready == 0 && data == 1)
|
||||||
{
|
{
|
||||||
/* FIXME: RTC Latch goes here */
|
m_rtc_ready = 1;
|
||||||
m_rtc_map[0] = 50; /* Seconds */
|
update_rtc();
|
||||||
m_rtc_map[1] = 40; /* Minutes */
|
|
||||||
m_rtc_map[2] = 15; /* Hours */
|
|
||||||
m_rtc_map[3] = 25; /* Day counter lowest 8 bits */
|
|
||||||
m_rtc_map[4] = 0x01; /* Day counter upper bit, timer off, no day overflow occurred (bit7) */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -489,14 +501,16 @@ WRITE8_MEMBER(gb_rom_mbc3_device::write_bank)
|
|||||||
READ8_MEMBER(gb_rom_mbc3_device::read_ram)
|
READ8_MEMBER(gb_rom_mbc3_device::read_ram)
|
||||||
{
|
{
|
||||||
if (m_ram_bank < 4 && m_ram_enable)
|
if (m_ram_bank < 4 && m_ram_enable)
|
||||||
{ // RAM
|
{
|
||||||
|
// RAM
|
||||||
if (!m_ram.empty())
|
if (!m_ram.empty())
|
||||||
return m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)];
|
return m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)];
|
||||||
}
|
}
|
||||||
if (m_ram_bank >= 0x8 && m_ram_bank <= 0xc)
|
if (m_ram_bank >= 0x8 && m_ram_bank <= 0xc)
|
||||||
{ // RAM
|
{
|
||||||
|
// RTC registers
|
||||||
if (has_timer)
|
if (has_timer)
|
||||||
return m_rtc_map[m_ram_bank - 8];
|
return m_rtc_regs[m_ram_bank - 8];
|
||||||
}
|
}
|
||||||
return 0xff;
|
return 0xff;
|
||||||
}
|
}
|
||||||
@ -504,16 +518,16 @@ READ8_MEMBER(gb_rom_mbc3_device::read_ram)
|
|||||||
WRITE8_MEMBER(gb_rom_mbc3_device::write_ram)
|
WRITE8_MEMBER(gb_rom_mbc3_device::write_ram)
|
||||||
{
|
{
|
||||||
if (m_ram_bank < 4 && m_ram_enable)
|
if (m_ram_bank < 4 && m_ram_enable)
|
||||||
{ // RAM
|
{
|
||||||
|
// RAM
|
||||||
if (!m_ram.empty())
|
if (!m_ram.empty())
|
||||||
m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)] = data;
|
m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)] = data;
|
||||||
}
|
}
|
||||||
if (m_ram_bank >= 0x8 && m_ram_bank <= 0xc)
|
if (m_ram_bank >= 0x8 && m_ram_bank <= 0xc && m_ram_enable)
|
||||||
{ // RAM
|
{
|
||||||
|
// RTC registers are writeable too
|
||||||
if (has_timer)
|
if (has_timer)
|
||||||
{
|
m_rtc_regs[m_ram_bank - 8] = data;
|
||||||
// what to do here?
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,7 +561,10 @@ WRITE8_MEMBER(gb_rom_mbc5_device::write_bank)
|
|||||||
{
|
{
|
||||||
data &= 0x0f;
|
data &= 0x0f;
|
||||||
if (has_rumble)
|
if (has_rumble)
|
||||||
|
{
|
||||||
|
machine().output().set_value("Rumble", BIT(data, 3));
|
||||||
data &= 0x7;
|
data &= 0x7;
|
||||||
|
}
|
||||||
m_ram_bank = data;
|
m_ram_bank = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1071,8 +1088,6 @@ WRITE8_MEMBER(gb_rom_sintax_device::write_bank)
|
|||||||
else if (offset < 0x5000)
|
else if (offset < 0x5000)
|
||||||
{
|
{
|
||||||
data &= 0x0f;
|
data &= 0x0f;
|
||||||
if (has_rumble)
|
|
||||||
data &= 0x7;
|
|
||||||
m_ram_bank = data;
|
m_ram_bank = data;
|
||||||
}
|
}
|
||||||
else if (offset < 0x6000)
|
else if (offset < 0x6000)
|
||||||
@ -1167,8 +1182,6 @@ WRITE8_MEMBER(gb_rom_digimon_device::write_bank)
|
|||||||
{
|
{
|
||||||
// printf("written $05-$06 %X at %X\n", data, offset);
|
// printf("written $05-$06 %X at %X\n", data, offset);
|
||||||
data &= 0x0f;
|
data &= 0x0f;
|
||||||
if (has_rumble)
|
|
||||||
data &= 0x7;
|
|
||||||
m_ram_bank = data;
|
m_ram_bank = data;
|
||||||
}
|
}
|
||||||
// else
|
// else
|
||||||
|
@ -93,7 +93,11 @@ public:
|
|||||||
virtual DECLARE_WRITE8_MEMBER(write_bank) override;
|
virtual DECLARE_WRITE8_MEMBER(write_bank) override;
|
||||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||||
UINT8 m_rtc_map[5];
|
|
||||||
|
private:
|
||||||
|
void update_rtc();
|
||||||
|
UINT8 m_rtc_regs[5];
|
||||||
|
int m_rtc_ready;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ======================> gb_rom_mbc5_device
|
// ======================> gb_rom_mbc5_device
|
||||||
|
Loading…
Reference in New Issue
Block a user