From a91e526f552c74121a1a11e9fbcc25e927e506db Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sun, 12 Nov 2023 08:43:58 +0100 Subject: skeleton/seoul88.cpp: fleshed the driver out a bit --- src/mame/skeleton/seoul88.cpp | 154 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 140 insertions(+), 14 deletions(-) diff --git a/src/mame/skeleton/seoul88.cpp b/src/mame/skeleton/seoul88.cpp index 9fdaad0c33f..5de6ae2d759 100644 --- a/src/mame/skeleton/seoul88.cpp +++ b/src/mame/skeleton/seoul88.cpp @@ -9,7 +9,7 @@ ||BATT| | ZILOG Z0840006PSC | | ROM U02 | |PAL22V10_| |74LS245N| |__DIPSx8_||__DIPSx8_| | ||____| |____________________| |____________| | | ________ ________ ___| - | ____________ |74LS273N| |74LS245N| ________ ___ | + | ____________ |74LS273N| |74LS245N| ________ ___ | | ___ ________ _________ |GM76C88AL-15| |74LS245N| |()| |___ | Xtal |74LS157N| |HY18CV8S_| |____________| ________ _________ Switch __| | 12.000 |74LS245N||PALCE22V10H ________ __| @@ -28,7 +28,7 @@ | ____________ |______________| |SN76489AN __| | ________ | HY6264P-12 | ________ ________ __| ||74LS157N| |____________| |74LS273N| |N82S129N| __| - | __| + | __| | ________ ________ ________ ___| ||74LS157N| ____________ ____________ |74LS273N| |N82S129N| | | | LH5168-10L | | A277308-90 | |___ @@ -43,14 +43,20 @@ | 24.000 | |____________________________________________________________________________________________________| + +Seems derived from igs/goldstar.cpp. + ***********************************************************************************************/ #include "emu.h" #include "cpu/z80/z80.h" +#include "sound/sn76496.h" +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" namespace { @@ -59,16 +65,116 @@ class seoul88_state : public driver_device public: seoul88_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_video_ram(*this, "video_ram"), + m_attribute_ram(*this, "attribute_ram") { } - void seoul88( machine_config &config ); + void seoul88(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; private: required_device m_maincpu; + required_device m_gfxdecode; + + required_shared_ptr m_video_ram; + required_shared_ptr m_attribute_ram; + + tilemap_t *m_tilemap = nullptr; + + void video_ram_w(offs_t offset, uint8_t data); + void attribute_ram_w(offs_t offset, uint8_t data); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + TILE_GET_INFO_MEMBER(get_tile_info); + + void program_map(address_map &map) ATTR_COLD; + void io_map(address_map &map) ATTR_COLD; }; + +void seoul88_state::video_start() +{ + m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(seoul88_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap->set_transparent_pen(0); +} + +TILE_GET_INFO_MEMBER(seoul88_state::get_tile_info) // TODO +{ + int const code = m_video_ram[tile_index]; + int const attr = m_attribute_ram[tile_index]; + + tileinfo.set(0, code | (attr & 0xf0) << 4, attr & 0x0f, 0); +} + +void seoul88_state::video_ram_w(offs_t offset, uint8_t data) +{ + m_video_ram[offset] = data; + m_tilemap->mark_tile_dirty(offset); +} + +void seoul88_state::attribute_ram_w(offs_t offset, uint8_t data) +{ + m_attribute_ram[offset] = data; + m_tilemap->mark_tile_dirty(offset); +} + +uint32_t seoul88_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + m_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +void seoul88_state::program_map(address_map &map) +{ + map(0x0000, 0xbfff).rom(); + map(0xc000, 0xcfff).ram(); // reels? + map(0xd000, 0xd03f).ram(); // reels attr? + map(0xd200, 0xd23f).ram(); // reels attr? + map(0xd400, 0xd43f).ram(); // reels attr? + map(0xd600, 0xd63f).ram(); // reels attr? + map(0xe000, 0xe7ff).ram().w(FUNC(seoul88_state::video_ram_w)).share(m_video_ram); + map(0xe800, 0xefff).ram().w(FUNC(seoul88_state::attribute_ram_w)).share(m_attribute_ram); + map(0xf000, 0xffff).ram(); +} + +void seoul88_state::io_map(address_map &map) +{ + map.global_mask(0xff); + + map(0x00, 0x00).portr("DSW1"); + map(0x01, 0x01).portr("DSW2"); + map(0x02, 0x02).portr("DSW3"); + map(0x10, 0x10).portr("IN0"); + map(0x11, 0x11).portr("IN1"); +} + static INPUT_PORTS_START( seoul88 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_START("DSW1") PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") @@ -100,31 +206,51 @@ static INPUT_PORTS_START( seoul88 ) PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW3:8") INPUT_PORTS_END +static GFXDECODE_START( gfx_seoul88 ) + GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_planar, 0, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_planar, 128, 8 ) // TODO +GFXDECODE_END + void seoul88_state::seoul88(machine_config &config) { // Basic machine hardware - Z80( config, m_maincpu, 12.000_MHz_XTAL / 2 ); + Z80(config, m_maincpu, 12.000_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &seoul88_state::program_map); + m_maincpu->set_addrmap(AS_IO, &seoul88_state::io_map); + m_maincpu->set_vblank_int("screen", FUNC(seoul88_state::irq0_line_hold)); // AT89C2051 MCU //... // Video hardware - //SCREEN(config, "screen", SCREEN_TYPE_RASTER ); + 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(64*8, 32*8); + screen.set_visarea(0*8, 64*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seoul88_state::screen_update)); + + GFXDECODE(config, m_gfxdecode, "palette", gfx_seoul88); + PALETTE(config, "palette").set_entries(0x100); // TODO // Audio hardware - SPEAKER( config, "mono" ).front_center(); + SPEAKER(config, "mono").front_center(); + + SN76489A(config, "sn", 12_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.30); // actually SN76489AN, clock not verified } ROM_START( seoul88 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "am27c512.u02", 0x00000, 0x10000, CRC(890b2d38) SHA1(28e6f5d84c9b283ad565236747aca39bc00c0efb) ) - ROM_REGION( 0x40000, "data", 0 ) + ROM_REGION( 0x4000, "mcu", 0 ) + ROM_LOAD( "at89c2051-24pc.u1", 0x0000, 0x4000, NO_DUMP ) // 2 Kbytes internal ROM + + ROM_REGION( 0x20000, "gfx1", 0 ) ROM_LOAD( "amic_a277308-90.u07", 0x00000, 0x20000, CRC(ea0aafdc) SHA1(232fc5a542d7b61f466e82bc0a8e14b3f2f81e1d) ) - ROM_LOAD( "mx_28f1000ppc.u43", 0x20000, 0x20000, CRC(b824f1c6) SHA1(a390e7cc4e5705770f4f8d9c604ad304982aabf8) ) - ROM_REGION( 0x4000, "mcu", 0 ) - ROM_LOAD("at89c2051-24pc.u1", 0x0000, 0x4000, NO_DUMP) // 2 Kbytes internal ROM + ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_LOAD( "mx_28f1000ppc.u43", 0x00000, 0x20000, CRC(b824f1c6) SHA1(a390e7cc4e5705770f4f8d9c604ad304982aabf8) ) ROM_REGION( 0x0700, "proms", 0 ) ROM_LOAD( "88-s1.bin", 0x00000, 0x00100, CRC(a18f1b83) SHA1(6ea1980c5f686933ae05922671e1d7c9561ba62a) ) @@ -135,10 +261,10 @@ ROM_START( seoul88 ) ROM_LOAD( "88-s6.bin", 0x00500, 0x00100, CRC(11c88e29) SHA1(16b07fe6a83b3a300fdb081609729595c16588e9) ) ROM_LOAD( "88-s7.bin", 0x00600, 0x00100, CRC(83c3ec8f) SHA1(4a6452ef73061a446e6a8ceb9d077bc71cc8e2b2) ) - ROM_REGION( 0x3e1f, "plds", 0 ) + ROM_REGION( 0x09ae, "plds", 0 ) ROM_LOAD( "hy18cv8s-25.u10", 0x00000, 0x00117, NO_DUMP ) - ROM_LOAD( "pal22v10-7pc.u18", 0x00117, 0x01e84, NO_DUMP ) - ROM_LOAD( "pal22v10-25pc.u17", 0x01f9b, 0x01e84, NO_DUMP ) + ROM_LOAD( "pal22v10-7pc.u18", 0x00117, 0x002dd, NO_DUMP ) + ROM_LOAD( "pal22v10-25pc.u17", 0x006d1, 0x002dd, NO_DUMP ) ROM_END } // anonymous namespace -- cgit v1.2.3