summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar mamehaze <mamehaze@users.noreply.github.com>2014-12-02 20:16:43 +0000
committerGravatarGravatar mamehaze <mamehaze@users.noreply.github.com>2014-12-02 20:16:43 +0000
commitb9d27cd05a054339876a84d6600d2106c14d7449 (patch) (github)
tree3c9f79b5b44a62c805251da16e650b1fc75cbb8c
parent569f24de125cf675daa2555a9db984bac44be778 (diff)
downloadmame-b9d27cd05a054339876a84d6600d2106c14d7449.tar.bz2
mame-b9d27cd05a054339876a84d6600d2106c14d7449.zip
use rombank instead of custom handler (nw)
-rw-r--r--src/mame/drivers/galpani2.c43
-rw-r--r--src/mame/includes/galpani2.h5
2 files changed, 26 insertions, 22 deletions
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 584367c6f88..1303317e057 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -120,6 +120,13 @@ WRITE16_MEMBER(galpani2_state::galpani2_eeprom_w)
***************************************************************************/
+void galpani2_state::machine_start()
+{
+ UINT8 *ROM = memregion("subdata")->base();
+ membank("subdatabank")->configure_entries(0, 0x2000000/0x0800000, ROM, 0x0800000);
+ membank("subdatabank")->set_entry(0);
+
+}
void galpani2_state::machine_reset()
{
@@ -389,17 +396,15 @@ ADDRESS_MAP_END
***************************************************************************/
-READ16_MEMBER(galpani2_state::galpani2_bankedrom_r)
+WRITE16_MEMBER(galpani2_state::subdatabank_select_w)
{
- UINT16 *ROM = (UINT16 *) memregion( "user1" )->base();
- size_t len = memregion( "user1" )->bytes() / 2;
+ data &= mem_mask;
- offset += (0x800000/2) * (*m_rombank & 0x0003);
-
- if ( offset < len ) return ROM[offset];
- else return 0xffff; //floating bus for absent ROMs
+ if (data & 0xfffc) printf("subdatabank_select_w %04x\n", data);
+ membank("subdatabank")->set_entry(data&3);
}
+
static ADDRESS_MAP_START( galpani2_mem2, AS_PROGRAM, 16, galpani2_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM
AM_RANGE(0x100000, 0x13ffff) AM_RAM AM_SHARE("ram2") // Work RAM
@@ -411,8 +416,8 @@ static ADDRESS_MAP_START( galpani2_mem2, AS_PROGRAM, 16, galpani2_state )
AM_RANGE(0x700000, 0x700001) AM_NOP // Watchdog
// AM_RANGE(0x740000, 0x740001) AM_WRITENOP // ? Reset mcu
AM_RANGE(0x780000, 0x780001) AM_WRITE8(galpani2_mcu_nmi2_w, 0x00ff) // ? 0 -> 1 -> 0 (lev 5)
- AM_RANGE(0x7c0000, 0x7c0001) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank
- AM_RANGE(0x800000, 0xffffff) AM_READ(galpani2_bankedrom_r ) // Banked ROM
+ AM_RANGE(0x7c0000, 0x7c0001) AM_WRITE(subdatabank_select_w) // Rom Bank
+ AM_RANGE(0x800000, 0xffffff) AM_ROMBANK("subdatabank")
ADDRESS_MAP_END
/***************************************************************************
@@ -735,7 +740,7 @@ ROM_START( galpani2 )
ROM_LOAD16_BYTE( "g002a2.u64-1", 0x000000, 0x020000, CRC(c0b94eaf) SHA1(4f3a65b238b31ee8d256b7025253f01eaf6e55d5) )
ROM_LOAD16_BYTE( "g003a2.u63-1", 0x000001, 0x020000, CRC(0d30725d) SHA1(d4614f9ffb930c4ea36cb3fbacffe63060e92402) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300a.052", 0x0000000, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
ROM_LOAD( "gp2-300b.053", 0x0100000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
ROM_LOAD( "gp2-301.035", 0x0200000, 0x200000, CRC(e71e749d) SHA1(420c4c085e89d9641a84e34fa870df2bc02165b6) )
@@ -781,7 +786,7 @@ ROM_START( galpani2e )
ROM_LOAD16_BYTE( "g002a1-u125-1.bin", 0x000000, 0x020000, CRC(100e76b3) SHA1(24a259ee427cd7a6e487520a712dc7ef632dc5d6) )
ROM_LOAD16_BYTE( "g003a1-u126-1.bin", 0x000001, 0x020000, CRC(0efe7835) SHA1(c7eecacdf101c0515da504cc77512f27b61b2ab7) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300a.052", 0x0000000, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
ROM_LOAD( "gp2-300b.053", 0x0100000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
ROM_LOAD( "gp2-301.035", 0x0200000, 0x200000, CRC(e71e749d) SHA1(420c4c085e89d9641a84e34fa870df2bc02165b6) )
@@ -828,7 +833,7 @@ ROM_START( galpani2i )
ROM_LOAD16_BYTE( "g002a2.u64-1", 0x000000, 0x020000, CRC(c0b94eaf) SHA1(4f3a65b238b31ee8d256b7025253f01eaf6e55d5) )
ROM_LOAD16_BYTE( "g003a2.u63-1", 0x000001, 0x020000, CRC(0d30725d) SHA1(d4614f9ffb930c4ea36cb3fbacffe63060e92402) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300a.052", 0x0000000, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
ROM_LOAD( "gp2-300b.053", 0x0100000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
ROM_LOAD( "gp2-301.035", 0x0200000, 0x200000, CRC(e71e749d) SHA1(420c4c085e89d9641a84e34fa870df2bc02165b6) )
@@ -877,7 +882,7 @@ ROM_START( galpani2gs ) // basically the same as the Italy set but with differen
ROM_LOAD16_BYTE( "g003g1.u65-2", 0x000000, 0x020000, CRC(c0b94eaf) SHA1(4f3a65b238b31ee8d256b7025253f01eaf6e55d5) )
ROM_LOAD16_BYTE( "g002g1.u64-2", 0x000001, 0x020000, CRC(0d30725d) SHA1(d4614f9ffb930c4ea36cb3fbacffe63060e92402) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300a.052", 0x0000000, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
ROM_LOAD( "gp2-300b.053", 0x0100000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
ROM_LOAD( "gp2-301.035", 0x0200000, 0x200000, CRC(e71e749d) SHA1(420c4c085e89d9641a84e34fa870df2bc02165b6) )
@@ -925,7 +930,7 @@ ROM_START( galpani2g )
ROM_LOAD16_BYTE( "g002t1.125", 0x000000, 0x020000, CRC(a3034e1c) SHA1(493e4be36f2aea0083d5d37e16486ed66dab952e) )
ROM_LOAD16_BYTE( "g003t1.126", 0x000001, 0x020000, CRC(20d3a2ad) SHA1(93450e5a23456c242ebf1a3560013a17c6b05354) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD16_BYTE( "g300a0.u44-00", 0x0000000, 0x080000, CRC(50406294) SHA1(fc1165b7b31a44ab204cd5ac3e7b2733ed6b1534) )
ROM_LOAD16_BYTE( "g300a1.u41-00", 0x0000001, 0x080000, CRC(d26b7c4f) SHA1(b491170010977ba1e5111893937cc6bab0539e7d) )
ROM_LOAD16_BYTE( "g300b0.u45-00", 0x0100000, 0x080000, CRC(9637934c) SHA1(d3b39d9f44825bdf24d4aa39ca32035bc5af4905) )
@@ -977,7 +982,7 @@ ROM_START( galpani2e2 )
ROM_LOAD16_BYTE( "g002i1.125", 0x000000, 0x020000, CRC(a3034e1c) SHA1(493e4be36f2aea0083d5d37e16486ed66dab952e) )
ROM_LOAD16_BYTE( "g003i1.126", 0x000001, 0x020000, CRC(20d3a2ad) SHA1(93450e5a23456c242ebf1a3560013a17c6b05354) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD16_BYTE( "g300a0.u44-00", 0x0000000, 0x080000, CRC(50406294) SHA1(fc1165b7b31a44ab204cd5ac3e7b2733ed6b1534) )
ROM_LOAD16_BYTE( "g300a1.u41-00", 0x0000001, 0x080000, CRC(d26b7c4f) SHA1(b491170010977ba1e5111893937cc6bab0539e7d) )
ROM_LOAD16_BYTE( "g300b0.u45-00", 0x0100000, 0x080000, CRC(9637934c) SHA1(d3b39d9f44825bdf24d4aa39ca32035bc5af4905) )
@@ -1029,7 +1034,7 @@ ROM_START( galpani2t )
ROM_LOAD16_BYTE( "g002t1.125", 0x000000, 0x020000, CRC(a3034e1c) SHA1(493e4be36f2aea0083d5d37e16486ed66dab952e) )
ROM_LOAD16_BYTE( "g003t1.126", 0x000001, 0x020000, CRC(20d3a2ad) SHA1(93450e5a23456c242ebf1a3560013a17c6b05354) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300a.052", 0x0000000, 0x100000, CRC(09ebedba) SHA1(3c06614633f0da03facb5199deac492b8ce07257) )
ROM_LOAD( "gp2-300b.053", 0x0100000, 0x100000, CRC(d7d12920) SHA1(4b6e01cc0ac5192758f4b3d26f102905b2b5e8ac) )
ROM_LOAD( "gp2-301.035", 0x0200000, 0x200000, CRC(e71e749d) SHA1(420c4c085e89d9641a84e34fa870df2bc02165b6) )
@@ -1094,7 +1099,7 @@ ROM_START( galpani2j )
ROM_LOAD16_BYTE( "g002j1.64", 0x000000, 0x020000, CRC(5e523829) SHA1(dad11e4a3348c988ff658609cf78a3fbee58064e) )
ROM_LOAD16_BYTE( "g003j1.63", 0x000001, 0x020000, CRC(2a0d5f89) SHA1(0a7031c4b8b7bc757da25250dbb5fa1004205aeb) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300j.175", 0x000000, 0x200000, CRC(3a0afc1d) SHA1(91fba9074cc3c28e919053f0ea07b28d88b2ce5f) )
ROM_LOAD( "gp2-301j.176", 0x200000, 0x200000, CRC(5b6d1709) SHA1(a7d35247fe71895f2b6169409aa0bdaef446804c) )
ROM_LOAD16_BYTE( "gp2-302a.177", 0x400000, 0x100000, CRC(311fa273) SHA1(c2adeac45be701f6f474841755fac4347d44f844) )
@@ -1125,7 +1130,7 @@ ROM_START( gp2se )
ROM_LOAD16_BYTE( "g002j4.u64", 0x000000, 0x020000, CRC(bcd4edd9) SHA1(17ae6fbf75d8e5333133737de926a36f5cd29661) )
ROM_LOAD16_BYTE( "g003j4.u63", 0x000001, 0x020000, CRC(2fbe0194) SHA1(52da771ba813b27ec1a996b237c14dab9b33db82) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300-j-0071.u175", 0x000000, 0x200000, CRC(3a0afc1d) SHA1(91fba9074cc3c28e919053f0ea07b28d88b2ce5f) )
ROM_LOAD( "gp2-301-j-0072.u176", 0x200000, 0x200000, CRC(5b6d1709) SHA1(a7d35247fe71895f2b6169409aa0bdaef446804c) )
ROM_LOAD16_BYTE( "gp2-302a-0057.u177", 0x400000, 0x100000, CRC(311fa273) SHA1(c2adeac45be701f6f474841755fac4347d44f844) )
@@ -1162,7 +1167,7 @@ ROM_START( gp2quiz )
ROM_LOAD16_BYTE( "g002e3.u64-3", 0x000000, 0x020000, CRC(5e523829) SHA1(dad11e4a3348c988ff658609cf78a3fbee58064e) )
ROM_LOAD16_BYTE( "g003e3.u63-3", 0x000001, 0x020000, CRC(2a0d5f89) SHA1(0a7031c4b8b7bc757da25250dbb5fa1004205aeb) )
- ROM_REGION16_BE( 0x2000000, "user1", 0 ) /* Backgrounds (CPU2) */
+ ROM_REGION16_BE( 0x2000000, "subdata", ROMREGION_ERASEFF ) /* Backgrounds (CPU2) */
ROM_LOAD( "gp2-300-j-0071.u175", 0x000000, 0x200000, CRC(3a0afc1d) SHA1(91fba9074cc3c28e919053f0ea07b28d88b2ce5f) )
ROM_LOAD( "gp2-301-j-0072.u176", 0x200000, 0x200000, CRC(5b6d1709) SHA1(a7d35247fe71895f2b6169409aa0bdaef446804c) )
ROM_LOAD16_BYTE( "gp2-302a-0057.u177", 0x400000, 0x100000, CRC(311fa273) SHA1(c2adeac45be701f6f474841755fac4347d44f844) )
diff --git a/src/mame/includes/galpani2.h b/src/mame/includes/galpani2.h
index 7dcb80b1a28..668628ef422 100644
--- a/src/mame/includes/galpani2.h
+++ b/src/mame/includes/galpani2.h
@@ -14,7 +14,6 @@ public:
m_bg15(*this, "bg15"),
m_ram(*this, "ram"),
m_ram2(*this, "ram2"),
- m_rombank(*this, "rombank"),
m_maincpu(*this,"maincpu"),
m_subcpu(*this,"sub"),
m_kaneko_spr(*this, "kan_spr"),
@@ -36,7 +35,6 @@ public:
required_shared_ptr<UINT16> m_ram2;
UINT16 m_old_mcu_nmi1;
UINT16 m_old_mcu_nmi2;
- required_shared_ptr<UINT16> m_rombank;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
@@ -47,11 +45,12 @@ public:
DECLARE_WRITE8_MEMBER(galpani2_mcu_nmi1_w);
DECLARE_WRITE8_MEMBER(galpani2_mcu_nmi2_w);
DECLARE_WRITE8_MEMBER(galpani2_coin_lockout_w);
- DECLARE_READ16_MEMBER(galpani2_bankedrom_r);
DECLARE_READ16_MEMBER(galpani2_eeprom_r);
DECLARE_WRITE16_MEMBER(galpani2_eeprom_w);
DECLARE_WRITE8_MEMBER(galpani2_oki1_bank_w);
DECLARE_WRITE8_MEMBER(galpani2_oki2_bank_w);
+ DECLARE_WRITE16_MEMBER(subdatabank_select_w);
+ virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
DECLARE_PALETTE_INIT(galpani2);