summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2021-09-04 09:04:28 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2021-09-04 09:04:28 +0200
commit565e8b6e9813154232cbe5d2c809c808c8490b3a (patch)
tree80467daa915480f9790e2d8c9151d02036344ab1
parentdfa5b141d632c7fc1d1ab4f15e73ce234f0c7f27 (diff)
d9final.cpp, ppmast93.cpp, tmspoker.cpp, ultrsprt.cpp: used finders instead of tagmap lookups for rombanks
-rw-r--r--src/emu/xtal.cpp2
-rw-r--r--src/mame/drivers/d9final.cpp65
-rw-r--r--src/mame/drivers/igs_m027.cpp2
-rw-r--r--src/mame/drivers/ppmast93.cpp86
-rw-r--r--src/mame/drivers/tmspoker.cpp85
-rw-r--r--src/mame/drivers/ultrsprt.cpp53
6 files changed, 159 insertions, 134 deletions
diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp
index d1105b187e2..30bea7b1a20 100644
--- a/src/emu/xtal.cpp
+++ b/src/emu/xtal.cpp
@@ -364,7 +364,7 @@ const double XTAL::known_xtals[] = {
27'562'000, /* 27.562_MHz_XTAL Visual 220 */
27'720'000, /* 27.72_MHz_XTAL AT&T 610 132-column display clock */
27'956'000, /* 27.956_MHz_XTAL CIT-101e 132-column display clock */
- 28'000'000, /* 28_MHz_XTAL Sega System H1 SH2 clock */
+ 28'000'000, /* 28_MHz_XTAL Sega System H1 SH2 clock, Kyukyoku Tiger / Twin Cobra */
28'224'000, /* 28.224_MHz_XTAL Roland JD-800 */
28'322'000, /* 28.322_MHz_XTAL Saitek RISC 2500, Mephisto Montreux */
28'375'160, /* 28.37516_MHz_XTAL Amiga PAL systems */
diff --git a/src/mame/drivers/d9final.cpp b/src/mame/drivers/d9final.cpp
index a4c7f9b80bf..a7e715bf37f 100644
--- a/src/mame/drivers/d9final.cpp
+++ b/src/mame/drivers/d9final.cpp
@@ -35,6 +35,8 @@
#include "tilemap.h"
+namespace {
+
class d9final_state : public driver_device
{
public:
@@ -44,11 +46,16 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_lo_vram(*this, "lo_vram"),
m_hi_vram(*this, "hi_vram"),
- m_cram(*this, "cram")
+ m_cram(*this, "cram"),
+ m_mainbank(*this, "mainbank")
{ }
void d9final(machine_config &config);
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
private:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
@@ -56,6 +63,7 @@ private:
required_shared_ptr<uint8_t> m_lo_vram;
required_shared_ptr<uint8_t> m_hi_vram;
required_shared_ptr<uint8_t> m_cram;
+ required_memory_bank m_mainbank;
tilemap_t *m_sc0_tilemap;
@@ -67,19 +75,16 @@ private:
TILE_GET_INFO_MEMBER(get_sc0_tile_info);
- virtual void machine_start() override;
- virtual void video_start() override;
-
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void d9final_io(address_map &map);
- void d9final_map(address_map &map);
+ void io_map(address_map &map);
+ void prg_map(address_map &map);
};
TILE_GET_INFO_MEMBER(d9final_state::get_sc0_tile_info)
{
- int tile = ((m_hi_vram[tile_index] & 0x3f)<<8) | m_lo_vram[tile_index];
+ int tile = ((m_hi_vram[tile_index] & 0x3f) << 8) | m_lo_vram[tile_index];
int color = m_cram[tile_index] & 0x3f;
tileinfo.set(0,
@@ -90,12 +95,12 @@ TILE_GET_INFO_MEMBER(d9final_state::get_sc0_tile_info)
void d9final_state::video_start()
{
- m_sc0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(d9final_state::get_sc0_tile_info)), TILEMAP_SCAN_ROWS, 8,8,64,32);
+ m_sc0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(d9final_state::get_sc0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
}
uint32_t d9final_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0);
+ m_sc0_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
@@ -119,10 +124,10 @@ void d9final_state::sc0_cram(offs_t offset, uint8_t data)
void d9final_state::bank_w(uint8_t data)
{
- membank("bank1")->set_entry(data & 0x7);
+ m_mainbank->set_entry(data & 0x7);
}
-/* game checks this after three attract cycles, otherwise coin inputs stop to work. */
+// game checks this after three attract cycles, otherwise coin inputs stop to work.
uint8_t d9final_state::prot_latch_r()
{
// printf("PC=%06x\n",m_maincpu->pc());
@@ -131,21 +136,21 @@ uint8_t d9final_state::prot_latch_r()
}
-void d9final_state::d9final_map(address_map &map)
+void d9final_state::prg_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xbfff).bankr("bank1");
+ map(0x8000, 0xbfff).bankr(m_mainbank);
map(0xc000, 0xc7ff).ram().share("nvram");
map(0xc800, 0xcbff).ram().w("palette", FUNC(palette_device::write8)).share("palette");
map(0xcc00, 0xcfff).ram().w("palette", FUNC(palette_device::write8_ext)).share("palette_ext");
- map(0xd000, 0xd7ff).ram().w(FUNC(d9final_state::sc0_lovram)).share("lo_vram");
- map(0xd800, 0xdfff).ram().w(FUNC(d9final_state::sc0_hivram)).share("hi_vram");
- map(0xe000, 0xe7ff).ram().w(FUNC(d9final_state::sc0_cram)).share("cram");
+ map(0xd000, 0xd7ff).ram().w(FUNC(d9final_state::sc0_lovram)).share(m_lo_vram);
+ map(0xd800, 0xdfff).ram().w(FUNC(d9final_state::sc0_hivram)).share(m_hi_vram);
+ map(0xe000, 0xe7ff).ram().w(FUNC(d9final_state::sc0_cram)).share(m_cram);
map(0xf000, 0xf007).r(FUNC(d9final_state::prot_latch_r)); //.rw("essnd", FUNC(es8712_device::read), FUNC(es8712_device::write));
map(0xf800, 0xf80f).rw("rtc", FUNC(rtc62421_device::read), FUNC(rtc62421_device::write));
}
-void d9final_state::d9final_io(address_map &map)
+void d9final_state::io_map(address_map &map)
{
map.global_mask(0xff);
// map(0x00, 0x00).nopw(); //bit 0: irq enable? screen enable?
@@ -194,9 +199,9 @@ static INPUT_PORTS_START( d9final )
PORT_DIPSETTING( 0x12, "5000" )
PORT_DIPSETTING( 0x22, "10000" )
PORT_DIPSETTING( 0x00, "20000" )
+ PORT_DIPSETTING( 0x10, "20000" )
+ PORT_DIPSETTING( 0x30, "20000" )
PORT_DIPSETTING( 0x02, "50000" )
-// 0x10 20000
-// 0x30 20000
PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" )
PORT_DIPNAME( 0x08, 0x08, "Auto Start" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
@@ -294,26 +299,26 @@ static const gfx_layout tiles16x8_layout =
};
static GFXDECODE_START( gfx_d9final )
- GFXDECODE_ENTRY( "gfx1", 0, tiles16x8_layout, 0, 16*4 )
+ GFXDECODE_ENTRY( "tiles", 0, tiles16x8_layout, 0, 16 * 4 )
GFXDECODE_END
void d9final_state::machine_start()
{
- membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
- membank("bank1")->set_entry(0);
+ m_mainbank->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_mainbank->set_entry(0);
}
void d9final_state::d9final(machine_config &config)
{
- /* basic machine hardware */
- Z80(config, m_maincpu, 24000000/4); /* ? MHz */
- m_maincpu->set_addrmap(AS_PROGRAM, &d9final_state::d9final_map);
- m_maincpu->set_addrmap(AS_IO, &d9final_state::d9final_io);
+ // basic machine hardware
+ Z80(config, m_maincpu, 24000000 / 4); /* ? MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &d9final_state::prg_map);
+ m_maincpu->set_addrmap(AS_IO, &d9final_state::io_map);
m_maincpu->set_vblank_int("screen", FUNC(d9final_state::irq0_line_hold));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // Sharp LH5116D-10 + battery
- /* video hardware */
+ // video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
@@ -325,11 +330,12 @@ void d9final_state::d9final(machine_config &config)
GFXDECODE(config, m_gfxdecode, "palette", gfx_d9final);
PALETTE(config, "palette", palette_device::BLACK).set_format(palette_device::xBRG_444, 0x400);
+ // sound hardware
SPEAKER(config, "mono").front_center();
YM2413(config, "ymsnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.5);
- //ES8712(config, "essnd", 24000000/3).add_route(ALL_OUTPUTS, "mono", 1.0); // clock unknown
+ //ES8712(config, "essnd", 24000000 / 3).add_route(ALL_OUTPUTS, "mono", 1.0); // clock unknown
RTC62421(config, "rtc", XTAL(32'768)); // internal oscillator
}
@@ -342,11 +348,12 @@ ROM_START( d9final )
ROM_COPY( "maincpu", 0x10000, 0x18000, 0x08000 ) //or just 0xff
ROM_LOAD( "1.2h", 0x20000, 0x10000, CRC(901281ec) SHA1(7b4cae343f1b025d988a507141c0fa8229a0fea1) )
- ROM_REGION( 0x80000, "gfx1", 0 )
+ ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "3.13h", 0x00001, 0x40000, CRC(a2de0cce) SHA1(d510671b75417c10ce479663f6f21367121384b4) )
ROM_LOAD16_BYTE( "4.15h", 0x00000, 0x40000, CRC(859b7105) SHA1(1b36f84706473afaa50b6546d7373a2ee6602b9a) )
ROM_END
+} // Anonymous namespace
GAME( 1992, d9final, 0, d9final, d9final, d9final_state, empty_init, ROT0, "Excellent System", "Dream 9 Final (v2.24)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/igs_m027.cpp b/src/mame/drivers/igs_m027.cpp
index 305edf8eb27..bb9a1a1b0f1 100644
--- a/src/mame/drivers/igs_m027.cpp
+++ b/src/mame/drivers/igs_m027.cpp
@@ -970,7 +970,7 @@ ROM_END
ROM_START( qlgs )
ROM_REGION( 0x04000, "maincpu", 0 )
// Internal rom of IGS027A type G ARM based MCU
- ROM_LOAD( "qlgs_igs027a", 0x00000, 0x4000, NO_DUMP )
+ ROM_LOAD( "qlgs_igs027a", 0x00000, 0x4000, NO_DUMP ) // has a 'DJ-2 U17' and a 'C3' sticker
ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg
ROM_LOAD( "s-501cn.u17", 0x000000, 0x200000, CRC(c80b61c0) SHA1(4e9920beb85fd559620f3136ea52ab6532657b1f) ) // 11xxxxxxxxxxxxxxxxxxx = 0xFF
diff --git a/src/mame/drivers/ppmast93.cpp b/src/mame/drivers/ppmast93.cpp
index 9172a79e3e5..6ab91cb042b 100644
--- a/src/mame/drivers/ppmast93.cpp
+++ b/src/mame/drivers/ppmast93.cpp
@@ -142,6 +142,8 @@ Dip locations added based on the notes above.
#include "tilemap.h"
+namespace {
+
class ppmast93_state : public driver_device
{
public:
@@ -150,17 +152,23 @@ public:
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_bgram(*this, "bgram"),
- m_fgram(*this, "fgram")
+ m_fgram(*this, "fgram"),
+ m_cpubank(*this, "cpubank")
{ }
void ppmast93(machine_config &config);
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
private:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_shared_ptr<uint8_t> m_bgram;
required_shared_ptr<uint8_t> m_fgram;
+ required_memory_bank m_cpubank;
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
@@ -172,32 +180,29 @@ private:
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
- virtual void machine_start() override;
- virtual void video_start() override;
-
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void ppmast93_cpu1_io(address_map &map);
- void ppmast93_cpu1_map(address_map &map);
- void ppmast93_cpu2_io(address_map &map);
- void ppmast93_cpu2_map(address_map &map);
+ void cpu1_io(address_map &map);
+ void cpu1_map(address_map &map);
+ void cpu2_io(address_map &map);
+ void cpu2_map(address_map &map);
};
void ppmast93_state::machine_start()
{
- membank("cpubank")->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000);
+ m_cpubank->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000);
}
void ppmast93_state::fgram_w(offs_t offset, uint8_t data)
{
m_fgram[offset] = data;
- m_fg_tilemap->mark_tile_dirty(offset/2);
+ m_fg_tilemap->mark_tile_dirty(offset / 2);
}
void ppmast93_state::bgram_w(offs_t offset, uint8_t data)
{
m_bgram[offset] = data;
- m_bg_tilemap->mark_tile_dirty(offset/2);
+ m_bg_tilemap->mark_tile_dirty(offset / 2);
}
void ppmast93_state::port4_w(uint8_t data)
@@ -205,20 +210,20 @@ void ppmast93_state::port4_w(uint8_t data)
machine().bookkeeping().coin_counter_w(0, data & 0x08);
machine().bookkeeping().coin_counter_w(1, data & 0x10);
- membank("cpubank")->set_entry(data & 0x07);
+ m_cpubank->set_entry(data & 0x07);
}
-void ppmast93_state::ppmast93_cpu1_map(address_map &map)
+void ppmast93_state::cpu1_map(address_map &map)
{
map(0x0000, 0x7fff).rom().nopw();
- map(0x8000, 0xbfff).bankr("cpubank");
- map(0xd000, 0xd7ff).ram().w(FUNC(ppmast93_state::bgram_w)).share("bgram");
+ map(0x8000, 0xbfff).bankr(m_cpubank);
+ map(0xd000, 0xd7ff).ram().w(FUNC(ppmast93_state::bgram_w)).share(m_bgram);
map(0xd800, 0xdfff).nopw();
- map(0xf000, 0xf7ff).ram().w(FUNC(ppmast93_state::fgram_w)).share("fgram");
+ map(0xf000, 0xf7ff).ram().w(FUNC(ppmast93_state::fgram_w)).share(m_fgram);
map(0xf800, 0xffff).ram();
}
-void ppmast93_state::ppmast93_cpu1_io(address_map &map)
+void ppmast93_state::cpu1_io(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).portr("P1").w("soundlatch", FUNC(generic_latch_8_device::write));
@@ -228,16 +233,16 @@ void ppmast93_state::ppmast93_cpu1_io(address_map &map)
map(0x08, 0x08).portr("DSW2");
}
-void ppmast93_state::ppmast93_cpu2_map(address_map &map)
+void ppmast93_state::cpu2_map(address_map &map)
{
- map(0x0000, 0xfbff).rom().region("sub", 0x10000);
+ map(0x0000, 0xfbff).rom().region("sub", 0x00000);
map(0xfc00, 0xfc00).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0xfd00, 0xffff).ram();
}
-void ppmast93_state::ppmast93_cpu2_io(address_map &map)
+void ppmast93_state::cpu2_io(address_map &map)
{
- map(0x0000, 0xffff).rom().region("sub", 0x20000);
+ map(0x0000, 0xffff).rom().region("sub", 0x10000);
map(0x0000, 0x0001).mirror(0xff00).w("ymsnd", FUNC(ym2413_device::write));
map(0x0002, 0x0002).mirror(0xff00).w("dac", FUNC(dac_byte_interface::data_w));
}
@@ -337,12 +342,12 @@ static const gfx_layout tiles8x8_layout =
};
static GFXDECODE_START( gfx_ppmast93 )
- GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 )
+ GFXDECODE_ENTRY( "tiles", 0, tiles8x8_layout, 0, 16 )
GFXDECODE_END
TILE_GET_INFO_MEMBER(ppmast93_state::get_bg_tile_info)
{
- int code = (m_bgram[tile_index*2+1] << 8) | m_bgram[tile_index*2];
+ int code = (m_bgram[tile_index * 2 + 1] << 8) | m_bgram[tile_index * 2];
tileinfo.set(0,
code & 0x0fff,
(code & 0xf000) >> 12,
@@ -351,9 +356,9 @@ TILE_GET_INFO_MEMBER(ppmast93_state::get_bg_tile_info)
TILE_GET_INFO_MEMBER(ppmast93_state::get_fg_tile_info)
{
- int code = (m_fgram[tile_index*2+1] << 8) | m_fgram[tile_index*2];
+ int code = (m_fgram[tile_index * 2 + 1] << 8) | m_fgram[tile_index * 2];
tileinfo.set(0,
- (code & 0x0fff)+0x1000,
+ (code & 0x0fff) + 0x1000,
(code & 0xf000) >> 12,
0);
}
@@ -375,23 +380,23 @@ uint32_t ppmast93_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
void ppmast93_state::ppmast93(machine_config &config)
{
- /* basic machine hardware */
- Z80(config, m_maincpu, 5000000); /* 5 MHz */
- m_maincpu->set_addrmap(AS_PROGRAM, &ppmast93_state::ppmast93_cpu1_map);
- m_maincpu->set_addrmap(AS_IO, &ppmast93_state::ppmast93_cpu1_io);
+ // basic machine hardware
+ Z80(config, m_maincpu, 5_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ppmast93_state::cpu1_map);
+ m_maincpu->set_addrmap(AS_IO, &ppmast93_state::cpu1_io);
m_maincpu->set_vblank_int("screen", FUNC(ppmast93_state::irq0_line_hold));
- z80_device &sub(Z80(config, "sub", 5000000)); /* 5 MHz */
- sub.set_addrmap(AS_PROGRAM, &ppmast93_state::ppmast93_cpu2_map);
- sub.set_addrmap(AS_IO, &ppmast93_state::ppmast93_cpu2_io);
+ z80_device &sub(Z80(config, "sub", 5_MHz_XTAL));
+ sub.set_addrmap(AS_PROGRAM, &ppmast93_state::cpu2_map);
+ sub.set_addrmap(AS_IO, &ppmast93_state::cpu2_io);
sub.set_periodic_int(FUNC(ppmast93_state::irq0_line_hold), attotime::from_hz(8000));
- /* video hardware */
+ // video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(55);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
screen.set_size(256, 256);
- screen.set_visarea(0, 256-1, 0, 256-1);
+ screen.set_visarea_full();
screen.set_screen_update(FUNC(ppmast93_state::screen_update));
screen.set_palette("palette");
@@ -399,12 +404,12 @@ void ppmast93_state::ppmast93(machine_config &config)
PALETTE(config, "palette", palette_device::RGB_444_PROMS, "proms", 0x100);
-
+ // sound hardware
SPEAKER(config, "speaker").front_center();
GENERIC_LATCH_8(config, "soundlatch");
- YM2413(config, "ymsnd", 5000000/2).add_route(ALL_OUTPUTS, "speaker", 1.0);
+ YM2413(config, "ymsnd", 5_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "speaker", 1.0);
DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.3); // unknown DAC
}
@@ -413,10 +418,10 @@ ROM_START( ppmast93 )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "2.up7", 0x00000, 0x20000, CRC(8854d8db) SHA1(9d93ddfb44d533772af6519747a6cb50b42065cd) )
- ROM_REGION( 0x30000, "sub", 0 )
- ROM_LOAD( "1.ue7", 0x10000, 0x20000, CRC(8e26939e) SHA1(e62441e523f5be6a3889064cc5e0f44545260e93) )
+ ROM_REGION( 0x20000, "sub", 0 )
+ ROM_LOAD( "1.ue7", 0x00000, 0x20000, CRC(8e26939e) SHA1(e62441e523f5be6a3889064cc5e0f44545260e93) )
- ROM_REGION( 0x40000, "gfx1", 0 )
+ ROM_REGION( 0x40000, "tiles", 0 )
ROM_LOAD( "3.ug16", 0x00000, 0x20000, CRC(8ab24641) SHA1(c0ebee90bf3fe208947ae5ea56f31469ed24d198) )
ROM_LOAD( "4.ug15", 0x20000, 0x20000, CRC(b16e9fb6) SHA1(53aa962c63319cd649e0c8cf0c26e2308598e1aa) )
@@ -426,4 +431,7 @@ ROM_START( ppmast93 )
ROM_LOAD( "prom1.ug26", 0x200, 0x100, CRC(d979c64e) SHA1(172c9579013d58e35a5b4f732e360811ac36295e) )
ROM_END
+} // Anonymous namespace
+
+
GAME( 1993, ppmast93, 0, ppmast93, ppmast93, ppmast93_state, empty_init, ROT0, "Electronic Devices S.R.L.", "Ping Pong Masters '93", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tmspoker.cpp b/src/mame/drivers/tmspoker.cpp
index a6f2efe0fb6..f641b398397 100644
--- a/src/mame/drivers/tmspoker.cpp
+++ b/src/mame/drivers/tmspoker.cpp
@@ -157,7 +157,7 @@
'-------------------'
- Both program ROMs are sharing the same adressing space.
+ Both program ROMs are sharing the same addressing space.
The switch placed below the program ROMs is connected to each PD /PGM line,
so you can switch between 2 different programs.
@@ -215,8 +215,7 @@
#include "tilemap.h"
-#define MASTER_CLOCK XTAL(6'000'000) /* confirmed */
-
+namespace {
class tmspoker_state : public driver_device
{
@@ -224,6 +223,7 @@ public:
tmspoker_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
+ m_gamebank(*this, "gamebank"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_outlatch(*this, "outlatch%u", 0U),
@@ -241,22 +241,23 @@ protected:
private:
required_shared_ptr<uint8_t> m_videoram;
+ required_memory_bank m_gamebank;
tilemap_t *m_bg_tilemap;
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device_array<ls259_device, 4> m_outlatch;
required_ioport_array<3> m_inputs;
- void tmspoker_videoram_w(offs_t offset, uint8_t data);
- //void debug_w(uint8_t data);
+ void videoram_w(offs_t offset, uint8_t data);
+ [[maybe_unused]] void debug_w(uint8_t data);
uint8_t inputs_r(offs_t offset);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
- void tmspoker_palette(palette_device &palette) const;
- uint32_t screen_update_tmspoker(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(tmspoker_interrupt);
+ void palette(palette_device &palette) const;
+ uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(interrupt);
- void tmspoker_cru_map(address_map &map);
- void tmspoker_map(address_map &map);
+ void cru_map(address_map &map);
+ void prg_map(address_map &map);
};
@@ -264,7 +265,7 @@ private:
* Video Hardware *
*************************/
-void tmspoker_state::tmspoker_videoram_w(offs_t offset, uint8_t data)
+void tmspoker_state::videoram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
@@ -289,13 +290,13 @@ void tmspoker_state::video_start()
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tmspoker_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
-uint32_t tmspoker_state::screen_update_tmspoker(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+uint32_t tmspoker_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
-void tmspoker_state::tmspoker_palette(palette_device &palette) const
+void tmspoker_state::palette(palette_device &palette) const
{
}
@@ -304,12 +305,12 @@ void tmspoker_state::tmspoker_palette(palette_device &palette) const
* Read / Write Handlers *
**************************/
-//void tmspoker_state::debug_w(uint8_t data)
-//{
-// popmessage("written : %02X", data);
-//}
+void tmspoker_state::debug_w(uint8_t data)
+{
+ popmessage("written : %02X", data);
+}
-INTERRUPT_GEN_MEMBER(tmspoker_state::tmspoker_interrupt)
+INTERRUPT_GEN_MEMBER(tmspoker_state::interrupt)
{
m_maincpu->set_input_line(INT_9980A_LEVEL1, ASSERT_LINE);
// MZ: The TMS9980A uses level-triggered interrupts, so this
@@ -328,8 +329,7 @@ INTERRUPT_GEN_MEMBER(tmspoker_state::tmspoker_interrupt)
void tmspoker_state::machine_start()
{
- uint8_t *ROM = memregion("maincpu")->base();
- membank("bank1")->configure_entries(0, 2, &ROM[0], 0x1000);
+ m_gamebank->configure_entries(0, 2, memregion("maincpu")->base(), 0x1000);
}
@@ -339,7 +339,7 @@ void tmspoker_state::machine_reset()
popmessage("ROM Bank: %02X", seldsw);
- membank("bank1")->set_entry(seldsw);
+ m_gamebank->set_entry(seldsw);
}
@@ -357,13 +357,13 @@ void tmspoker_state::machine_reset()
// 098E: RT 045B
//
-void tmspoker_state::tmspoker_map(address_map &map)
+void tmspoker_state::prg_map(address_map &map)
{
map.global_mask(0x3fff);
- map(0x0000, 0x0fff).bankr("bank1");
+ map(0x0000, 0x0fff).bankr(m_gamebank);
map(0x2800, 0x2800).nopr().w("crtc", FUNC(mc6845_device::address_w));
map(0x2801, 0x2801).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w));
- map(0x3000, 0x33ff).ram().w(FUNC(tmspoker_state::tmspoker_videoram_w)).share("videoram");
+ map(0x3000, 0x33ff).ram().w(FUNC(tmspoker_state::videoram_w)).share(m_videoram);
map(0x3800, 0x3fff).ram(); //NVRAM?
map(0x2000, 0x20ff).ram(); //color RAM?
}
@@ -379,7 +379,7 @@ uint8_t tmspoker_state::inputs_r(offs_t offset)
return 1;
}
-void tmspoker_state::tmspoker_cru_map(address_map &map)
+void tmspoker_state::cru_map(address_map &map)
{
map(0x0c80, 0x0c8f).w(m_outlatch[0], FUNC(ls259_device::write_d0));
map(0x0c90, 0x0c9f).r(FUNC(tmspoker_state::inputs_r)).w(m_outlatch[1], FUNC(ls259_device::write_d0));
@@ -551,12 +551,12 @@ INPUT_PORTS_END
static const gfx_layout charlayout =
{
8, 8,
- RGN_FRAC(1,1), /* 256 tiles */
+ RGN_FRAC(1,1), // 256 tiles
1,
{ 0 },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
- 8*8 /* every char takes 8 consecutive bytes */
+ 8*8 // every char takes 8 consecutive bytes
};
@@ -565,7 +565,7 @@ static const gfx_layout charlayout =
******************************/
static GFXDECODE_START( gfx_tmspoker )
- GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 )
+ GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 16 )
GFXDECODE_END
@@ -576,28 +576,28 @@ GFXDECODE_END
void tmspoker_state::tmspoker(machine_config &config)
{
// CPU TMS9980A; no line connections
- TMS9980A(config, m_maincpu, MASTER_CLOCK);
- m_maincpu->set_addrmap(AS_PROGRAM, &tmspoker_state::tmspoker_map);
- m_maincpu->set_addrmap(AS_IO, &tmspoker_state::tmspoker_cru_map);
- m_maincpu->set_vblank_int("screen", FUNC(tmspoker_state::tmspoker_interrupt));
+ TMS9980A(config, m_maincpu, 6_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &tmspoker_state::prg_map);
+ m_maincpu->set_addrmap(AS_IO, &tmspoker_state::cru_map);
+ m_maincpu->set_vblank_int("screen", FUNC(tmspoker_state::interrupt));
LS259(config, m_outlatch[0]);
LS259(config, m_outlatch[1]);
LS259(config, m_outlatch[2]);
LS259(config, m_outlatch[3]);
- /* video hardware */
+ // video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
screen.set_size(32*8, 32*8);
screen.set_visarea(0*8, 32*8-1, 0*8, 32*8-1);
- screen.set_screen_update(FUNC(tmspoker_state::screen_update_tmspoker));
+ screen.set_screen_update(FUNC(tmspoker_state::screen_update));
GFXDECODE(config, m_gfxdecode, "palette", gfx_tmspoker);
- PALETTE(config, "palette", FUNC(tmspoker_state::tmspoker_palette), 256);
+ PALETTE(config, "palette", FUNC(tmspoker_state::palette), 256);
- mc6845_device &crtc(MC6845(config, "crtc", MASTER_CLOCK/4)); /* guess */
+ mc6845_device &crtc(MC6845(config, "crtc", 6_MHz_XTAL / 4)); // guess
crtc.set_screen("screen");
crtc.set_show_border_area(false);
crtc.set_char_width(8);
@@ -609,14 +609,13 @@ void tmspoker_state::tmspoker(machine_config &config)
*************************/
ROM_START( tmspoker )
- ROM_REGION( 0x4000, "maincpu", 0 ) /* TMS9980 selectable code */
-
- ROM_LOAD( "0.bin", 0x0800, 0x0800, CRC(a20ae6cb) SHA1(d47780119b4ebb16dc759a50dfc880ddbc6a1112) ) /* Program 1 */
+ ROM_REGION( 0x4000, "maincpu", 0 ) // TMS9980 selectable code
+ ROM_LOAD( "0.bin", 0x0800, 0x0800, CRC(a20ae6cb) SHA1(d47780119b4ebb16dc759a50dfc880ddbc6a1112) ) // Program 1
ROM_CONTINUE( 0x0000, 0x0800 )
- ROM_LOAD( "8.bin", 0x1800, 0x0800, CRC(0c0a7159) SHA1(92cc3dc32a5bf4a7fa197e72c3931e583c96ef33) ) /* Program 2 */
+ ROM_LOAD( "8.bin", 0x1800, 0x0800, CRC(0c0a7159) SHA1(92cc3dc32a5bf4a7fa197e72c3931e583c96ef33) ) // Program 2
ROM_CONTINUE( 0x1000, 0x0800 )
- ROM_REGION( 0x0800, "gfx1", 0 )
+ ROM_REGION( 0x0800, "chars", 0 )
ROM_LOAD( "3.bin", 0x0000, 0x0800, CRC(55458dae) SHA1(bf96d1b287292ff89bc2dbd9451a88a2ab941f3e) )
ROM_REGION( 0x0100, "proms", 0 )
@@ -630,7 +629,7 @@ ROM_END
void tmspoker_state::init_bus()
{
- /* still need to decode the addressing lines */
+ // still need to decode the addressing lines
/* text found in the ROM (A at 6, B at 8, etc: consistent with gfx rom byte offsets) suggests
that the lower address lines are good already:
@@ -648,6 +647,8 @@ void tmspoker_state::init_bus()
*/
}
+} // Anonymous namespace
+
/*************************
* Game Drivers *
diff --git a/src/mame/drivers/ultrsprt.cpp b/src/mame/drivers/ultrsprt.cpp
index 315951ef4fa..12f5d0225f4 100644
--- a/src/mame/drivers/ultrsprt.cpp
+++ b/src/mame/drivers/ultrsprt.cpp
@@ -18,6 +18,8 @@
#include "speaker.h"
+namespace {
+
class ultrsprt_state : public driver_device
{
public:
@@ -30,11 +32,16 @@ public:
m_palette(*this, "palette"),
m_eeprom(*this, "eeprom"),
m_upd(*this, "upd%u", 1),
+ m_vrambank(*this, "vram"),
m_service(*this, "SERVICE")
{ }
void ultrsprt(machine_config &config);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
private:
static const u32 VRAM_PAGES = 2;
static const u32 VRAM_PAGE_BYTES = 512 * 1024;
@@ -47,6 +54,8 @@ private:
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device_array<upd4701_device, 2> m_upd;
+ required_memory_bank m_vrambank;
+
required_ioport m_service;
u8 eeprom_r();
@@ -55,13 +64,10 @@ private:
u16 upd2_r(offs_t offset);
void int_ack_w(u32 data);
- u32 screen_update_ultrsprt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void sound_map(address_map &map);
- void ultrsprt_map(address_map &map);
-
- virtual void machine_start() override;
- virtual void machine_reset() override;
+ void main_map(address_map &map);
std::unique_ptr<u8[]> m_vram;
u32 m_cpu_vram_page;
@@ -70,7 +76,7 @@ private:
/*****************************************************************************/
-u32 ultrsprt_state::screen_update_ultrsprt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 ultrsprt_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
u8 const *const vram = m_vram.get() + (m_cpu_vram_page ^ 1) * VRAM_PAGE_BYTES;
@@ -126,7 +132,7 @@ void ultrsprt_state::eeprom_w(u8 data)
u32 vram_page = (data & 0x08) >> 3;
if (vram_page != m_cpu_vram_page)
{
- membank("vram")->set_entry(vram_page);
+ m_vrambank->set_entry(vram_page);
m_cpu_vram_page = vram_page;
}
@@ -151,16 +157,16 @@ u16 ultrsprt_state::upd2_r(offs_t offset)
/*****************************************************************************/
-void ultrsprt_state::ultrsprt_map(address_map &map)
+void ultrsprt_state::main_map(address_map &map)
{
- map(0x00000000, 0x0007ffff).bankrw("vram");
+ map(0x00000000, 0x0007ffff).bankrw(m_vrambank);
map(0x70000000, 0x70000000).rw(FUNC(ultrsprt_state::eeprom_r), FUNC(ultrsprt_state::eeprom_w));
map(0x70000020, 0x70000023).r(FUNC(ultrsprt_state::upd1_r));
map(0x70000040, 0x70000043).r(FUNC(ultrsprt_state::upd2_r));
map(0x70000080, 0x7000008f).rw(m_k056800, FUNC(k056800_device::host_r), FUNC(k056800_device::host_w));
map(0x700000c0, 0x700000cf).nopw(); // Written following DMA interrupt - unused int ack?
map(0x700000e0, 0x700000e3).w(FUNC(ultrsprt_state::int_ack_w));
- map(0x7f000000, 0x7f01ffff).ram().share("workram");
+ map(0x7f000000, 0x7f01ffff).ram().share(m_workram);
map(0x7f700000, 0x7f703fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette");
map(0x7f800000, 0x7f9fffff).mirror(0x00600000).rom().region("program", 0);
}
@@ -212,15 +218,15 @@ INPUT_PORTS_END
void ultrsprt_state::machine_start()
{
- /* set conservative DRC options */
+ // set conservative DRC options
m_maincpu->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS);
- /* configure fast RAM regions for DRC */
+ // configure fast RAM regions for DRC
m_maincpu->ppcdrc_add_fastram(0xff000000, 0xff01ffff, false, m_workram);
m_vram = std::make_unique<u8[]>(VRAM_PAGE_BYTES * VRAM_PAGES);
- membank("vram")->configure_entries(0, VRAM_PAGES, m_vram.get(), VRAM_PAGE_BYTES);
+ m_vrambank->configure_entries(0, VRAM_PAGES, m_vram.get(), VRAM_PAGE_BYTES);
save_pointer(NAME(m_vram), VRAM_PAGE_BYTES * VRAM_PAGES);
save_item(NAME(m_cpu_vram_page));
@@ -231,7 +237,7 @@ void ultrsprt_state::machine_reset()
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
m_cpu_vram_page = 0;
- membank("vram")->set_entry(m_cpu_vram_page);
+ m_vrambank->set_entry(m_cpu_vram_page);
}
@@ -239,9 +245,9 @@ void ultrsprt_state::machine_reset()
void ultrsprt_state::ultrsprt(machine_config &config)
{
- /* basic machine hardware */
+ // basic machine hardware
PPC403GA(config, m_maincpu, 25000000);
- m_maincpu->set_addrmap(AS_PROGRAM, &ultrsprt_state::ultrsprt_map);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ultrsprt_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(ultrsprt_state::irq1_line_assert));
M68000(config, m_audiocpu, 8000000); // Unconfirmed
@@ -257,17 +263,17 @@ void ultrsprt_state::ultrsprt(machine_config &config)
m_upd[1]->set_portx_tag("P2X");
m_upd[1]->set_porty_tag("P2Y");
- /* video hardware */
+ // video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60); // TODO: Determine correct timings
screen.set_size(640, 480);
screen.set_visarea(0, 511, 0, 399);
- screen.set_screen_update(FUNC(ultrsprt_state::screen_update_ultrsprt));
+ screen.set_screen_update(FUNC(ultrsprt_state::screen_update));
screen.set_palette(m_palette);
PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 8192);
- /* sound hardware */
+ // sound hardware
K056800(config, m_k056800, XTAL(18'432'000));
m_k056800->int_callback().set_inputline(m_audiocpu, M68K_IRQ_6);
@@ -284,16 +290,16 @@ void ultrsprt_state::ultrsprt(machine_config &config)
/*****************************************************************************/
ROM_START( fiveside )
- ROM_REGION32_BE(0x200000, "program", 0) /* PowerPC program ROMs */
+ ROM_REGION32_BE(0x200000, "program", 0) // PowerPC program ROMs
ROM_LOAD32_BYTE("479uaa01.bin", 0x000000, 0x80000, CRC(1bc4893d) SHA1(2c9df38ecb7efa7b686221ee98fa3aad9a63e152))
ROM_LOAD32_BYTE("479uaa02.bin", 0x000001, 0x80000, CRC(ae74a6d0) SHA1(6113c2eea1628b22737c7b87af0e673d94984e88))
ROM_LOAD32_BYTE("479uaa03.bin", 0x000002, 0x80000, CRC(5c0b176f) SHA1(9560259bc081d4cfd72eb485c3fdcecf484ba7a8))
ROM_LOAD32_BYTE("479uaa04.bin", 0x000003, 0x80000, CRC(01a3e4cb) SHA1(819df79909d57fa12481698ffdb32b00586131d8))
- ROM_REGION(0x20000, "audiocpu", 0) /* M68K program */
+ ROM_REGION(0x20000, "audiocpu", 0) // M68K program
ROM_LOAD("479_a05.bin", 0x000000, 0x20000, CRC(251ae299) SHA1(5ffd74357e3c6ddb3a208c39a3b32b53fea90282))
- ROM_REGION(0x100000, "k054539", 0) /* Sound ROMs */
+ ROM_REGION(0x100000, "k054539", 0) // Sound ROMs
ROM_LOAD("479_a06.bin", 0x000000, 0x80000, CRC(8d6ac8a2) SHA1(7c4b8bd47cddc766cbdb6a486acc9221be55b579))
ROM_LOAD("479_a07.bin", 0x080000, 0x80000, CRC(75835df8) SHA1(105b95c16f2ce6902c2e4c9c2fd9f2f7a848c546))
@@ -301,5 +307,8 @@ ROM_START( fiveside )
ROM_LOAD( "fiveside.nv", 0x0000, 0x0080, CRC(aad11072) SHA1(8f777ee47801faa7ce8420c3052034720225aae7) )
ROM_END
+} // Anonymous namespace
+
+
// Undumped: Ultra Hockey
GAME(1995, fiveside, 0, ultrsprt, ultrsprt, ultrsprt_state, empty_init, ROT90, "Konami", "Five a Side Soccer (ver UAA)", 0)