From 71588b9c9151dae6c3652f632e273c272a7f539c Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 5 Mar 2024 18:02:39 +0100 Subject: seibu/deadang.cpp, seibu/kncljoe.cpp, seibu/stfight.cpp, seibu/wiz.cpp: consolidated drivers into single files --- src/mame/seibu/deadang.cpp | 748 +++++++++++++++++++++++++++++++++---------- src/mame/seibu/deadang.h | 121 ------- src/mame/seibu/deadang_v.cpp | 308 ------------------ src/mame/seibu/kncljoe.cpp | 392 ++++++++++++++++++++--- src/mame/seibu/kncljoe.h | 88 ----- src/mame/seibu/kncljoe_v.cpp | 214 ------------- src/mame/seibu/stfight.cpp | 679 +++++++++++++++++++++++++++++---------- src/mame/seibu/stfight.h | 108 ------- src/mame/seibu/stfight_m.cpp | 246 -------------- src/mame/seibu/wiz.cpp | 665 ++++++++++++++++++++++++++++---------- src/mame/seibu/wiz.h | 108 ------- src/mame/seibu/wiz_v.cpp | 221 ------------- 12 files changed, 1927 insertions(+), 1971 deletions(-) delete mode 100644 src/mame/seibu/deadang.h delete mode 100644 src/mame/seibu/deadang_v.cpp delete mode 100644 src/mame/seibu/kncljoe.h delete mode 100644 src/mame/seibu/kncljoe_v.cpp delete mode 100644 src/mame/seibu/stfight.h delete mode 100644 src/mame/seibu/stfight_m.cpp delete mode 100644 src/mame/seibu/wiz.h delete mode 100644 src/mame/seibu/wiz_v.cpp diff --git a/src/mame/seibu/deadang.cpp b/src/mame/seibu/deadang.cpp index 899e178c20a..67b53d66f0e 100644 --- a/src/mame/seibu/deadang.cpp +++ b/src/mame/seibu/deadang.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood +// copyright-holders: Bryan McPhail, David Haywood + /*************************************************************************** Pop'N Run (c) 1987 Seibu Kaihatsu & Yukai Tsukai @@ -36,7 +37,7 @@ Seibu SEI0100 YM3931 - 3.579545MHz [14.31818/4] VSync 60Hz HSync 15.37kHz -Gang Hunter as an additional daughter card attached to the top board call SEI-8712 GUN +Gang Hunter has an additional daughter card attached to the top board called SEI-8712 GUN 2008-08 Dip locations and factory settings verified with US manual @@ -44,63 +45,489 @@ Dip locations and factory settings verified with US manual */ #include "emu.h" -#include "deadang.h" + +#include "seibusound.h" #include "cpu/nec/nec.h" +#include "machine/timer.h" #include "machine/watchdog.h" #include "sound/msm5205.h" +#include "sound/ymopm.h" #include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class deadang_state : public driver_device +{ +public: + deadang_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_scroll_ram(*this, "scroll_ram"), + m_videoram(*this, "videoram"), + m_video_data(*this, "video_data"), + m_spriteram(*this, "spriteram"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_seibu_sound(*this, "seibu_sound"), + m_maincpu(*this, "maincpu"), + m_subcpu(*this, "sub"), + m_audiocpu(*this, "audiocpu"), + m_adpcm(*this, "adpcm%u", 1U), + m_track(*this, "TRACK%c", 'X') + { } + + void deadang(machine_config &config); + void ghunter(machine_config &config); + + void init_adpcm(); + void init_ghunter(); + +protected: + virtual void video_start() override; + + required_shared_ptr m_scroll_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_video_data; + required_shared_ptr m_spriteram; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_seibu_sound; + required_device m_maincpu; + required_device m_subcpu; + required_device m_audiocpu; + optional_device_array m_adpcm; + + optional_ioport_array<2> m_track; + + uint8_t m_tilebank = 0; + uint8_t m_oldtilebank = 0; + + tilemap_t *m_pf_layer[3]{}; + tilemap_t *m_text_layer = nullptr; + + void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + uint16_t ghunter_trackball_low_r(); + uint16_t ghunter_trackball_high_r(); + + void foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + TILEMAP_MAPPER_MEMBER(bg_scan); + TILE_GET_INFO_MEMBER(get_pf1_tile_info); + TILE_GET_INFO_MEMBER(get_pf3_tile_info); + TILE_GET_INFO_MEMBER(get_pf2_tile_info); + TILE_GET_INFO_MEMBER(get_text_tile_info); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + TIMER_DEVICE_CALLBACK_MEMBER(main_scanline); + TIMER_DEVICE_CALLBACK_MEMBER(sub_scanline); + + void main_map(address_map &map); + void ghunter_main_map(address_map &map); + void sound_decrypted_opcodes_map(address_map &map); + void sound_map(address_map &map); + void sub_map(address_map &map); +}; + +class popnrun_state : public deadang_state +{ +public: + popnrun_state(const machine_config &mconfig, device_type type, const char *tag) : + deadang_state(mconfig, type, tag) + { } + + void popnrun(machine_config &config); + +protected: + virtual void video_start() override; + +private: + TILE_GET_INFO_MEMBER(get_text_tile_info); + void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void main_map(address_map &map); + void sub_map(address_map &map); + void sound_map(address_map &map); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; + + +// video + +/******************************************************************************/ + +void deadang_state::foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_video_data[offset]); + m_pf_layer[0]->mark_tile_dirty(offset ); +} + +void deadang_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_videoram[offset]); + m_text_layer->mark_tile_dirty(offset ); +} + +void popnrun_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_videoram[offset]); + m_text_layer->mark_tile_dirty(offset / 2); +} + +void deadang_state::bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + if (ACCESSING_BITS_0_7) + { + m_tilebank = data & 1; + if (m_tilebank != m_oldtilebank) + { + m_oldtilebank = m_tilebank; + m_pf_layer[0]->mark_all_dirty(); + } + } +} + +/******************************************************************************/ + +TILEMAP_MAPPER_MEMBER(deadang_state::bg_scan) +{ + return (col & 0xf) | ((row & 0xf) << 4) | ((col & 0x70) << 4) | ((row & 0xf0) << 7); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_pf3_tile_info) +{ + const uint16_t *bgMap = (const uint16_t *)memregion("bgmap1")->base(); + int const code = bgMap[tile_index]; + tileinfo.set(4, code & 0x7ff, code >> 12, 0); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_pf2_tile_info) +{ + const uint16_t *bgMap = (const uint16_t *)memregion("bgmap2")->base(); + int const code = bgMap[tile_index]; + tileinfo.set(3, code & 0x7ff, code >> 12, 0); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_pf1_tile_info) +{ + int tile = m_video_data[tile_index]; + int const color = tile >> 12; + tile &= 0xfff; + + tileinfo.set(2, tile + m_tilebank * 0x1000, color, 0); +} + +TILE_GET_INFO_MEMBER(deadang_state::get_text_tile_info) +{ + int const tile = (m_videoram[tile_index] & 0xff) | ((m_videoram[tile_index] >> 6) & 0x300); + int const color = (m_videoram[tile_index] >> 8) & 0xf; + + tileinfo.set(0, tile, color, 0); +} + +void deadang_state::video_start() +{ + m_pf_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + m_pf_layer[1]->set_transparent_pen(15); + m_pf_layer[0]->set_transparent_pen(15); + m_text_layer->set_transparent_pen(15); + + save_item(NAME(m_tilebank)); + save_item(NAME(m_oldtilebank)); +} + + +TILE_GET_INFO_MEMBER(popnrun_state::get_text_tile_info) +{ + int tile = (m_videoram[tile_index * 2 + 0] & 0xff) << 1; // | ((m_videoram[tile_index] >> 6) & 0x300); + int const attr = (m_videoram[tile_index * 2 + 1]); + // TODO: not entirely correct (title screen/ranking colors) + // might be down to bitplanes too + int const color = (attr & 3) ^ 1; + if (attr & 0x40) + tile |= 1; -/* Read/Write Handlers */ + tileinfo.set(0, tile, color, 0); +} + +void popnrun_state::video_start() +{ + m_pf_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(popnrun_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(popnrun_state::bg_scan)), 16, 16, 128, 256); + m_pf_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + m_pf_layer[1]->set_transparent_pen(0); + m_pf_layer[0]->set_transparent_pen(0); + m_text_layer->set_transparent_pen(0); + + save_item(NAME(m_tilebank)); + save_item(NAME(m_oldtilebank)); +} + + +void deadang_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = 0; offs < 0x800 / 2; offs += 4) + { + // Don't draw empty sprite table entries + if ((m_spriteram[offs + 3] & 0xff00) != 0xf00) continue; + + int pri = 0; + + switch (m_spriteram[offs + 2] & 0xc000) + { + default: + case 0xc000: pri = 0; break; // Unknown + case 0x8000: pri = 0; break; // Over all playfields + case 0x4000: pri = 0xf0; break; // Under top playfield + case 0x0000: pri = 0xf0 | 0xcc; break; // Under middle playfield + } + + int fx = m_spriteram[offs + 0] & 0x2000; + int fy = m_spriteram[offs + 0] & 0x4000; + int y = m_spriteram[offs + 0] & 0xff; + int x = m_spriteram[offs + 2] & 0xff; + if (fy) fy = 0; else fy = 1; + if (m_spriteram[offs + 2] & 0x100) x = 0 - (0xff - x); + + int const color = (m_spriteram[offs + 1] >> 12) & 0xf; + int const sprite = m_spriteram[offs + 1] & 0xfff; + + if (flip_screen()) + { + x = 240 - x; + y = 240 - y; + if (fx) fx = 0; else fx = 1; + if (fy) fy = 0; else fy = 1; + } + + m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, + sprite, + color, fx, fy, x, y, + screen.priority(), pri, 15); + } +} + +uint32_t deadang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // Setup the tilemaps + m_pf_layer[2]->set_scrolly(0, ((m_scroll_ram[0x01] & 0xf0) << 4) + ((m_scroll_ram[0x02] & 0x7f) << 1) + ((m_scroll_ram[0x02] & 0x80) >> 7)); + m_pf_layer[2]->set_scrollx(0, ((m_scroll_ram[0x09] & 0xf0) << 4) + ((m_scroll_ram[0x0a] & 0x7f) << 1) + ((m_scroll_ram[0x0a] & 0x80) >> 7)); + m_pf_layer[0]->set_scrolly(0, ((m_scroll_ram[0x11] & 0x10) << 4) + ((m_scroll_ram[0x12] & 0x7f) << 1) + ((m_scroll_ram[0x12] & 0x80) >> 7)); + m_pf_layer[0]->set_scrollx(0, ((m_scroll_ram[0x19] & 0x10) << 4) + ((m_scroll_ram[0x1a] & 0x7f) << 1) + ((m_scroll_ram[0x1a] & 0x80) >> 7)); + m_pf_layer[1]->set_scrolly(0, ((m_scroll_ram[0x21] & 0xf0) << 4) + ((m_scroll_ram[0x22] & 0x7f) << 1) + ((m_scroll_ram[0x22] & 0x80) >> 7)); + m_pf_layer[1]->set_scrollx(0, ((m_scroll_ram[0x29] & 0xf0) << 4) + ((m_scroll_ram[0x2a] & 0x7f) << 1) + ((m_scroll_ram[0x2a] & 0x80) >> 7)); + + /* Control byte: + 0x01: Background playfield disable + 0x02: Middle playfield disable + 0x04: Top playfield disable + 0x08: ? Toggles at start of game + 0x10: Sprite disable + 0x20: Unused? + 0x40: Flipscreen + 0x80: Always set? + */ + m_pf_layer[2]->enable(!(m_scroll_ram[0x34] & 1)); + m_pf_layer[0]->enable(!(m_scroll_ram[0x34] & 2)); + m_pf_layer[1]->enable(!(m_scroll_ram[0x34] & 4)); + flip_screen_set(m_scroll_ram[0x34] & 0x40); + + bitmap.fill(m_palette->black_pen(), cliprect); + screen.priority().fill(0, cliprect); + m_pf_layer[2]->draw(screen, bitmap, cliprect, 0, 1); + m_pf_layer[0]->draw(screen, bitmap, cliprect, 0, 2); + m_pf_layer[1]->draw(screen, bitmap, cliprect, 0, 4); + if (!(m_scroll_ram[0x34] & 0x10)) draw_sprites(screen, bitmap, cliprect); + m_text_layer->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + +void popnrun_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // TODO: might have more bits in either 0x3800-0x3bff or 0x3e00-0x3fff + for (int offs = 0; offs < 0x200 / 2; offs += 2) + { + // Don't draw empty sprite table entries + //if ((m_spriteram[offs + 3] & 0xff00) != 0xf00) continue; + + int pri = 0; +#if 0 + switch (m_spriteram[offs + 2] & 0xc000) + { + default: + case 0xc000: pri = 0; break; // Unknown + case 0x8000: pri = 0; break; // Over all playfields + case 0x4000: pri = 0xf0; break; // Under top playfield + case 0x0000: pri = 0xf0 | 0xcc; break; // Under middle playfield + } +#endif + + int fx = m_spriteram[offs + 0] & 0x4000; + int fy = m_spriteram[offs + 0] & 0x8000; + int y = m_spriteram[offs + 1] & 0xff; + int x = (m_spriteram[offs + 1] >> 8) & 0xff; +#if 0 + if (fy) fy = 0; else fy = 1; + if (m_spriteram[offs + 2] & 0x100) x = 0 - (0xff - x); +#endif + + int const color = (m_spriteram[offs + 0] >> 12) & 0x7; + int const sprite = m_spriteram[offs + 0] & 0xfff; + +#if 0 + if (flip_screen()) + { + x = 240 - x; + y = 240 - y; + if (fx) fx = 0; else fx = 1; + if (fy) fy = 0; else fy = 1; + } +#endif + + m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, + sprite, + color, fx, fy, x, y, + screen.priority(), pri, 0); + } +} + +uint32_t popnrun_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // TODO: different scroll RAM hookup + // 0x18 seems to enable the various layers + // Setup the tilemaps +// m_pf_layer[2]->set_scrolly(0, ((m_scroll_ram[0x01] & 0xf0) << 4) + ((m_scroll_ram[0x02] & 0x7f) << 1) + ((m_scroll_ram[0x02] & 0x80) >> 7)); +// m_pf_layer[2]->set_scrollx(0, ((m_scroll_ram[0x09] & 0xf0) << 4) + ((m_scroll_ram[0x0a] & 0x7f) << 1) + ((m_scroll_ram[0x0a] & 0x80) >> 7)); +// m_pf_layer[0]->set_scrolly(0, ((m_scroll_ram[0x11] & 0x10) << 4) + ((m_scroll_ram[0x12] & 0x7f) << 1) + ((m_scroll_ram[0x12] & 0x80) >> 7)); +// m_pf_layer[0]->set_scrollx(0, ((m_scroll_ram[0x19] & 0x10) << 4) + ((m_scroll_ram[0x1a] & 0x7f) << 1) + ((m_scroll_ram[0x1a] & 0x80) >> 7)); +// m_pf_layer[1]->set_scrolly(0, ((m_scroll_ram[0x21] & 0xf0) << 4) + ((m_scroll_ram[0x22] & 0x7f) << 1) + ((m_scroll_ram[0x22] & 0x80) >> 7)); +// m_pf_layer[1]->set_scrollx(0, ((m_scroll_ram[0x29] & 0xf0) << 4) + ((m_scroll_ram[0x2a] & 0x7f) << 1) + ((m_scroll_ram[0x2a] & 0x80) >> 7)); + + m_pf_layer[2]->enable(!(m_scroll_ram[0x34] & 1)); + m_pf_layer[0]->enable(!(m_scroll_ram[0x34] & 2)); + m_pf_layer[1]->enable(!(m_scroll_ram[0x34] & 4)); +// flip_screen_set(m_scroll_ram[0x34]&0x40 ); + + bitmap.fill(1, cliprect); + screen.priority().fill(0, cliprect); + // 32 pixels? +// int scrollx = (m_scroll_ram[0x4 / 2] & 0x0f); + + // debug tilemap code + // this is likely to be collision data + for (int x = 0; x < 16; x++) + { + for (int y = 0; y < 8; y++) + { + int tile = m_video_data[y + x * 8 + 0xc0] & 0xff; + int res_x, res_y; + + if (tile != 0) + { + res_x = (x * 16) & 0xff; + res_y = y * 32; + //if (cliprect.contains(res_x, res_y)) + bitmap.plot_box(res_x, res_y, 16, 16, tile + 0x10); + } + + tile = m_video_data[y + x * 8 + 0xc0] >> 8; + + if (tile != 0) + { + res_x = (x * 16) & 0xff; + res_y = y * 32 + 16; + //if (cliprect.contains(res_x, res_y)) + bitmap.plot_box(res_x, res_y, 16, 16, tile + 0x10); + } + } + } + + //m_pf_layer[2]->draw(screen, bitmap, cliprect, 0, 1); + //m_pf_layer[0]->draw(screen, bitmap, cliprect, 0, 2); + //m_pf_layer[1]->draw(screen, bitmap, cliprect, 0, 4); + if (m_scroll_ram[0x18 / 2] & 0x1) + draw_sprites(screen, bitmap, cliprect); + m_text_layer->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + + +// machine + +// Read/Write Handlers uint16_t deadang_state::ghunter_trackball_low_r() { - return (ioport("TRACKX")->read() & 0xff) | ((ioport("TRACKY")->read() & 0xff) << 8); + return (m_track[0]->read() & 0xff) | ((m_track[1]->read() & 0xff) << 8); } uint16_t deadang_state::ghunter_trackball_high_r() { - return ((ioport("TRACKX")->read() & 0x0f00) >> 4) | (ioport("TRACKY")->read() & 0x0f00); + return ((m_track[0]->read() & 0x0f00) >> 4) | (m_track[1]->read() & 0x0f00); } -/* Memory Maps */ +// Memory Maps void deadang_state::main_map(address_map &map) { map(0x00000, 0x037ff).ram(); - map(0x03800, 0x03fff).ram().share("spriteram"); + map(0x03800, 0x03fff).ram().share(m_spriteram); map(0x04000, 0x04fff).ram().share("share1"); map(0x05000, 0x05fff).nopw(); map(0x06000, 0x0600f).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff); map(0x06010, 0x07fff).nopw(); - map(0x08000, 0x087ff).w(FUNC(deadang_state::text_w)).share("videoram"); + map(0x08000, 0x087ff).w(FUNC(deadang_state::text_w)).share(m_videoram); map(0x08800, 0x0bfff).nopw(); map(0x0a000, 0x0a001).portr("P1_P2"); map(0x0a002, 0x0a003).portr("DSW"); map(0x0c000, 0x0cfff).w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0d000, 0x0dfff).nopw(); - map(0x0e000, 0x0e0ff).ram().share("scroll_ram"); + map(0x0e000, 0x0e0ff).ram().share(m_scroll_ram); map(0x0e100, 0x0ffff).nopw(); map(0xc0000, 0xfffff).rom(); } -void popnrun_state::popnrun_main_map(address_map &map) +void deadang_state::ghunter_main_map(address_map &map) +{ + main_map(map); + + map(0x80000, 0x80001).r(FUNC(deadang_state::ghunter_trackball_low_r)); + map(0xb0000, 0xb0001).r(FUNC(deadang_state::ghunter_trackball_high_r)); +} + +void popnrun_state::main_map(address_map &map) { map(0x00000, 0x03bff).ram(); - map(0x03c00, 0x03dff).ram().share("spriteram"); + map(0x03c00, 0x03dff).ram().share(m_spriteram); map(0x03e00, 0x03fff).ram(); map(0x04000, 0x04fff).ram().share("share1"); map(0x05000, 0x05fff).nopw(); map(0x06000, 0x0600f).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff); map(0x06010, 0x07fff).nopw(); - map(0x08000, 0x08fff).ram().w(FUNC(popnrun_state::popnrun_text_w)).share("videoram"); + map(0x08000, 0x08fff).ram().w(FUNC(popnrun_state::text_w)).share(m_videoram); map(0x0a000, 0x0a001).portr("P1_P2"); map(0x0a002, 0x0a003).portr("DSW"); map(0x0c000, 0x0cfff).w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0d000, 0x0dfff).nopw(); - map(0x0e000, 0x0e0ff).ram().share("scroll_ram"); + map(0x0e000, 0x0e0ff).ram().share(m_scroll_ram); map(0x0e100, 0x0ffff).nopw(); map(0xc0000, 0xfffff).rom(); } @@ -108,16 +535,16 @@ void popnrun_state::popnrun_main_map(address_map &map) void deadang_state::sub_map(address_map &map) { map(0x00000, 0x037ff).ram(); - map(0x03800, 0x03fff).ram().w(FUNC(deadang_state::foreground_w)).share("video_data"); + map(0x03800, 0x03fff).ram().w(FUNC(deadang_state::foreground_w)).share(m_video_data); map(0x04000, 0x04fff).ram().share("share1"); map(0x08000, 0x08001).w(FUNC(deadang_state::bank_w)); map(0x0c000, 0x0c001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0xe0000, 0xfffff).rom(); } -void popnrun_state::popnrun_sub_map(address_map &map) +void popnrun_state::sub_map(address_map &map) { - map(0x00000, 0x003ff).ram().w(FUNC(deadang_state::foreground_w)).share("video_data"); + map(0x00000, 0x003ff).ram().w(FUNC(popnrun_state::foreground_w)).share(m_video_data); map(0x00400, 0x03fff).ram(); map(0x04000, 0x04fff).ram().share("share1"); map(0xe0000, 0xfffff).rom(); @@ -131,23 +558,23 @@ void deadang_state::sound_map(address_map &map) map(0x4001, 0x4001).w(m_seibu_sound, FUNC(seibu_sound_device::irq_clear_w)); map(0x4002, 0x4002).w(m_seibu_sound, FUNC(seibu_sound_device::rst10_ack_w)); map(0x4003, 0x4003).w(m_seibu_sound, FUNC(seibu_sound_device::rst18_ack_w)); - map(0x4005, 0x4006).w(m_adpcm1, FUNC(seibu_adpcm_device::adr_w)); + map(0x4005, 0x4006).w(m_adpcm[0], FUNC(seibu_adpcm_device::adr_w)); map(0x4007, 0x4007).w(m_seibu_sound, FUNC(seibu_sound_device::bank_w)); map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); map(0x4013, 0x4013).portr("COIN"); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); - map(0x401a, 0x401a).w(m_adpcm1, FUNC(seibu_adpcm_device::ctl_w)); + map(0x401a, 0x401a).w(m_adpcm[0], FUNC(seibu_adpcm_device::ctl_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); - map(0x6005, 0x6006).w(m_adpcm2, FUNC(seibu_adpcm_device::adr_w)); + map(0x6005, 0x6006).w(m_adpcm[1], FUNC(seibu_adpcm_device::adr_w)); map(0x6008, 0x6009).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); - map(0x601a, 0x601a).w(m_adpcm2, FUNC(seibu_adpcm_device::ctl_w)); + map(0x601a, 0x601a).w(m_adpcm[1], FUNC(seibu_adpcm_device::ctl_w)); map(0x8000, 0xffff).bankr("seibu_bank1"); } // Air Raid sound config with extra ROM bank -void popnrun_state::popnrun_sound_map(address_map &map) +void popnrun_state::sound_map(address_map &map) { map(0x0000, 0x1fff).r("sei80bu", FUNC(sei80bu_device::data_r)); map(0x2000, 0x27ff).ram(); @@ -172,10 +599,10 @@ void deadang_state::sound_decrypted_opcodes_map(address_map &map) } -/* Input Ports */ +// Input Ports static INPUT_PORTS_START( deadang ) - SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */ + SEIBU_COIN_INPUTS // coin inputs read through sound CPU PORT_START("P1_P2") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) @@ -259,13 +686,13 @@ static INPUT_PORTS_START( ghunter ) PORT_BIT( 0x0fff, 0x0000, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_PLAYER(1) INPUT_PORTS_END -/* Graphics Layouts */ +// Graphics Layouts static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ + 8,8, // 8*8 characters RGN_FRAC(1,2), - 4, /* 4 bits per pixel */ + 4, // 4 bits per pixel { RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4, 0, 4 }, { STEP4(3,-1), STEP4(11,-1) }, { STEP8(0,16) }, @@ -274,9 +701,9 @@ static const gfx_layout charlayout = static const gfx_layout spritelayout = { - 16,16, /* 16*16 tiles */ + 16,16, // 16*16 tiles RGN_FRAC(1,1), - 4, /* 4 bits per pixel */ + 4, // 4 bits per pixel { 8,12,0,4}, { STEP4(3,-1), STEP4(19,-1), STEP4(512+3,-1), STEP4(512+19,-1) }, { STEP16(0,32) }, @@ -285,9 +712,9 @@ static const gfx_layout spritelayout = static const gfx_layout popnrun_charlayout = { - 8,8, /* 8*8 characters */ + 8,8, // 8*8 characters RGN_FRAC(1,1), - 2, /* 2 bits per pixel */ + 2, // 2 bits per pixel { 4, 0 }, { STEP4(8,1), STEP4(0,1) }, { STEP8(0,16) }, @@ -298,9 +725,9 @@ static const gfx_layout popnrun_charlayout = // TODO: this is wrong static const gfx_layout popnrun_spritelayout = { - 16,16, /* 16*16 tiles */ + 16,16, // 16*16 tiles RGN_FRAC(1,1), - 2, /* 4 bits per pixel */ + 2, // 4 bits per pixel { 0,4 }, { STEP4(0,1), STEP4(16,1), STEP4(512,1), STEP4(512+16,1) }, { STEP16(0,32) }, @@ -311,60 +738,60 @@ static const gfx_layout popnrun_spritelayout = /* Graphics Decode Information */ static GFXDECODE_START( gfx_deadang ) - GFXDECODE_ENTRY( "gfx1", 0x000000, charlayout, 512, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x000000, spritelayout, 768, 16 ) - GFXDECODE_ENTRY( "gfx3", 0x000000, spritelayout, 1024, 16 ) - GFXDECODE_ENTRY( "gfx4", 0x000000, spritelayout, 256, 16 ) - GFXDECODE_ENTRY( "gfx5", 0x000000, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "chars", 0x000000, charlayout, 512, 16 ) + GFXDECODE_ENTRY( "sprites", 0x000000, spritelayout, 768, 16 ) + GFXDECODE_ENTRY( "tiles1", 0x000000, spritelayout, 1024, 16 ) + GFXDECODE_ENTRY( "tiles2", 0x000000, spritelayout, 256, 16 ) + GFXDECODE_ENTRY( "tiles3", 0x000000, spritelayout, 0, 16 ) GFXDECODE_END static GFXDECODE_START( gfx_popnrun ) - GFXDECODE_ENTRY( "gfx1", 0x000000, popnrun_charlayout, 0x20, 4 ) + GFXDECODE_ENTRY( "chars", 0x000000, popnrun_charlayout, 0x20, 4 ) // TODO: probably runs on ROM based palette or just uses the first three entries? - GFXDECODE_ENTRY( "gfx2", 0x000000, spritelayout, 0, 8 ) - GFXDECODE_ENTRY( "gfx3", 0x000000, spritelayout, 1024, 16 ) - GFXDECODE_ENTRY( "gfx4", 0x000000, spritelayout, 256, 16 ) - GFXDECODE_ENTRY( "gfx5", 0x000000, spritelayout, 0, 16 ) + GFXDECODE_ENTRY( "sprites", 0x000000, spritelayout, 0, 8 ) + GFXDECODE_ENTRY( "tiles1", 0x000000, spritelayout, 1024, 16 ) + GFXDECODE_ENTRY( "tiles2", 0x000000, spritelayout, 256, 16 ) + GFXDECODE_ENTRY( "tiles3", 0x000000, spritelayout, 0, 16 ) GFXDECODE_END -/* Interrupt Generators */ +// Interrupt Generators TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::main_scanline) { - int scanline = param; + int const scanline = param; - if(scanline == 240) // vblank-out irq - m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xc4/4); // V30 + if (scanline == 240) // vblank-out irq + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xc4 / 4); // V30 - if(scanline == 0) // vblank-in irq - m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xc8/4); // V30 + if (scanline == 0) // vblank-in irq + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xc8 / 4); // V30 } TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::sub_scanline) { - int scanline = param; + int const scanline = param; - if(scanline == 240) // vblank-out irq - m_subcpu->set_input_line_and_vector(0, HOLD_LINE,0xc4/4); // V30 + if (scanline == 240) // vblank-out irq + m_subcpu->set_input_line_and_vector(0, HOLD_LINE, 0xc4 / 4); // V30 - if(scanline == 0) // vblank-in irq - m_subcpu->set_input_line_and_vector(0, HOLD_LINE,0xc8/4); // V30 + if (scanline == 0) // vblank-in irq + m_subcpu->set_input_line_and_vector(0, HOLD_LINE, 0xc8 / 4); // V30 } -/* Machine Drivers */ +// Machine Drivers void deadang_state::deadang(machine_config &config) { - /* basic machine hardware */ - V30(config, m_maincpu, XTAL(16'000'000)/2); /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */ + // basic machine hardware + V30(config, m_maincpu, XTAL(16'000'000) / 2); // Sony 8623h9 CXQ70116D-8 (V30 compatible) m_maincpu->set_addrmap(AS_PROGRAM, &deadang_state::main_map); TIMER(config, "scantimer1").configure_scanline(FUNC(deadang_state::main_scanline), "screen", 0, 1); - V30(config, m_subcpu, XTAL(16'000'000)/2); /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */ + V30(config, m_subcpu, XTAL(16'000'000) / 2); // Sony 8623h9 CXQ70116D-8 (V30 compatible) m_subcpu->set_addrmap(AS_PROGRAM, &deadang_state::sub_map); TIMER(config, "scantimer2").configure_scanline(FUNC(deadang_state::sub_scanline), "screen", 0, 1); - Z80(config, m_audiocpu, XTAL(14'318'181)/4); + Z80(config, m_audiocpu, XTAL(14'318'181) / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &deadang_state::sound_map); m_audiocpu->set_addrmap(AS_OPCODES, &deadang_state::sound_decrypted_opcodes_map); m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); @@ -375,10 +802,10 @@ void deadang_state::deadang(machine_config &config) WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate m_screen->set_size(32*8, 32*8); m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); m_screen->set_screen_update(FUNC(deadang_state::screen_update)); @@ -387,7 +814,7 @@ void deadang_state::deadang(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_deadang); PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 2048); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SEIBU_SOUND(config, m_seibu_sound, 0); @@ -397,39 +824,46 @@ void deadang_state::deadang(machine_config &config) m_seibu_sound->ym_read_callback().set("ym1", FUNC(ym2203_device::read)); m_seibu_sound->ym_write_callback().set("ym1", FUNC(ym2203_device::write)); - ym2203_device &ym1(YM2203(config, "ym1", XTAL(14'318'181)/4)); + ym2203_device &ym1(YM2203(config, "ym1", XTAL(14'318'181) / 4)); ym1.irq_handler().set("seibu_sound", FUNC(seibu_sound_device::fm_irqhandler)); ym1.add_route(ALL_OUTPUTS, "mono", 0.15); - ym2203_device &ym2(YM2203(config, "ym2", XTAL(14'318'181)/4)); + ym2203_device &ym2(YM2203(config, "ym2", XTAL(14'318'181) / 4)); ym2.add_route(ALL_OUTPUTS, "mono", 0.15); - SEIBU_ADPCM(config, m_adpcm1, XTAL(12'000'000)/32/48, "msm1"); - SEIBU_ADPCM(config, m_adpcm2, XTAL(12'000'000)/32/48, "msm2"); + SEIBU_ADPCM(config, m_adpcm[0], XTAL(12'000'000) / 32 / 48, "msm1"); + SEIBU_ADPCM(config, m_adpcm[1], XTAL(12'000'000) / 32 / 48, "msm2"); - msm5205_device &msm1(MSM5205(config, "msm1", XTAL(12'000'000)/32)); - msm1.vck_callback().set(m_adpcm1, FUNC(seibu_adpcm_device::msm_int)); - msm1.set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */ + msm5205_device &msm1(MSM5205(config, "msm1", XTAL(12'000'000) / 32)); + msm1.vck_callback().set(m_adpcm[0], FUNC(seibu_adpcm_device::msm_int)); + msm1.set_prescaler_selector(msm5205_device::S48_4B); // 7.8125 kHz msm1.add_route(ALL_OUTPUTS, "mono", 0.40); - msm5205_device &msm2(MSM5205(config, "msm2", XTAL(12'000'000)/32)); - msm2.vck_callback().set(m_adpcm2, FUNC(seibu_adpcm_device::msm_int)); - msm2.set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */ + msm5205_device &msm2(MSM5205(config, "msm2", XTAL(12'000'000) / 32)); + msm2.vck_callback().set(m_adpcm[1], FUNC(seibu_adpcm_device::msm_int)); + msm2.set_prescaler_selector(msm5205_device::S48_4B); // 7.8125 kHz msm2.add_route(ALL_OUTPUTS, "mono", 0.40); } +void deadang_state::ghunter(machine_config &config) +{ + deadang(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &deadang_state::ghunter_main_map); +} + void popnrun_state::popnrun(machine_config &config) { deadang(config); - m_maincpu->set_addrmap(AS_PROGRAM, &popnrun_state::popnrun_main_map); + m_maincpu->set_addrmap(AS_PROGRAM, &popnrun_state::main_map); - m_subcpu->set_addrmap(AS_PROGRAM, &popnrun_state::popnrun_sub_map); + m_subcpu->set_addrmap(AS_PROGRAM, &popnrun_state::sub_map); - m_audiocpu->set_addrmap(AS_PROGRAM, &popnrun_state::popnrun_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &popnrun_state::sound_map); m_audiocpu->set_addrmap(AS_OPCODES, &popnrun_state::sound_decrypted_opcodes_map); - m_screen->set_screen_update(FUNC(popnrun_state::popnrun_screen_update)); + m_screen->set_screen_update(FUNC(popnrun_state::screen_update)); config.device_remove("watchdog"); @@ -445,14 +879,14 @@ void popnrun_state::popnrun(machine_config &config) m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); - ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181)/4)); + ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181) / 4)); ymsnd.irq_handler().set(m_seibu_sound, FUNC(seibu_sound_device::fm_irqhandler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); } -/* ROMs */ +// ROMs ROM_START( popnrun ) ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE( "popnrun-27512-1-6e.bin", 0xe0001, 0x010000, CRC(cf800494) SHA1(eaed51212c91ebb16e326f8133b60a0ecf0055e5) ) @@ -466,27 +900,27 @@ ROM_START( popnrun ) ROM_LOAD( "popnrun-2764-5-22c.bin", 0x000000, 0x002000, CRC(768a2ec7) SHA1(abc02ec6c6a495e612e8708377d9e7ca98981de4) ) ROM_LOAD( "popnrun-27512-6-20c.bin", 0x010000, 0x010000, CRC(47d168ce) SHA1(36c16a400408834fcf0561c3f097e84a287560bd) ) - ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASE00 ) + ROM_REGION( 0x2000, "chars", ROMREGION_ERASE00 ) ROM_LOAD( "popnrun-2764-7-1a.bin", 0x000000, 0x002000, CRC(5e508b8e) SHA1(3e49e8d25a3db83178965382295e7c437441b5fe) ) - ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASEFF ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", ROMREGION_ERASEFF ) ROM_LOAD( "gfx2.bin", 0x0000, 0x80000, NO_DUMP ) // debugging fill, remove me ROM_FILL( 0x0000, 0x80000, 0x33 ) - ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", ROMREGION_ERASE00 ) // pf1 layer ROM_LOAD( "gfx3.bin", 0x0000, 0x100000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx4", ROMREGION_ERASE00 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", ROMREGION_ERASE00 ) // pf2 layer ROM_LOAD( "gfx4.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx5", ROMREGION_ERASE00) // pf3 layer + ROM_REGION( 0x40000, "tiles3", ROMREGION_ERASE00) // pf3 layer ROM_LOAD( "gfx5.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx6", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", ROMREGION_ERASE00 ) ROM_LOAD( "gfx6.bin", 0x0000, 0x10000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx7", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", ROMREGION_ERASE00 ) ROM_LOAD( "gfx7.bin", 0x0000, 0x10000, NO_DUMP ) ROM_REGION( 0x10000, "adpcm1", ROMREGION_ERASE00 ) @@ -510,27 +944,27 @@ ROM_START( popnruna ) ROM_LOAD( "popnrun-2764-5-22c.bin", 0x000000, 0x002000, CRC(768a2ec7) SHA1(abc02ec6c6a495e612e8708377d9e7ca98981de4) ) ROM_LOAD( "popnrun-27512-6-20c.bin", 0x010000, 0x010000, CRC(47d168ce) SHA1(36c16a400408834fcf0561c3f097e84a287560bd) ) - ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASE00 ) + ROM_REGION( 0x2000, "chars", ROMREGION_ERASE00 ) ROM_LOAD( "popnrun-2764-7-1a.bin", 0x000000, 0x002000, CRC(5e508b8e) SHA1(3e49e8d25a3db83178965382295e7c437441b5fe) ) - ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASEFF ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", ROMREGION_ERASEFF ) ROM_LOAD( "gfx2.bin", 0x0000, 0x80000, NO_DUMP ) // debugging fill, remove me ROM_FILL( 0x0000, 0x80000, 0x33 ) - ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", ROMREGION_ERASE00 ) // pf1 layer ROM_LOAD( "gfx3.bin", 0x0000, 0x100000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx4", ROMREGION_ERASE00 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", ROMREGION_ERASE00 ) // pf2 layer ROM_LOAD( "gfx4.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION( 0x40000, "gfx5", ROMREGION_ERASE00) // pf3 layer + ROM_REGION( 0x40000, "tiles3", ROMREGION_ERASE00) // pf3 layer ROM_LOAD( "gfx5.bin", 0x0000, 0x40000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx6", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", ROMREGION_ERASE00 ) ROM_LOAD( "gfx6.bin", 0x0000, 0x10000, NO_DUMP ) - ROM_REGION16_BE( 0x10000, "gfx7", ROMREGION_ERASE00 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", ROMREGION_ERASE00 ) ROM_LOAD( "gfx7.bin", 0x0000, 0x10000, NO_DUMP ) ROM_REGION( 0x0100, "prom", ROMREGION_ERASE00 ) @@ -538,42 +972,42 @@ ROM_START( popnruna ) ROM_END ROM_START( deadang ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("2.18h", 0x0c0000, 0x10000, CRC(1bc05b7e) SHA1(21833150a1f5ab543999a67f5b3bfbaf703e5508) ) ROM_LOAD16_BYTE("4.22h", 0x0c0001, 0x10000, CRC(5751d4e7) SHA1(2e1a30c20199461fd876849f7563fef1d9a80c2d) ) ROM_LOAD16_BYTE("1.18f", 0x0e0000, 0x10000, CRC(8e7b15cc) SHA1(7e4766953c1adf04be18207a2aa6f5e861ea5f6c) ) ROM_LOAD16_BYTE("3.21f", 0x0e0001, 0x10000, CRC(e784b1fa) SHA1(3f41d31e0b36b9a2fab5e9998bb4146dfa0a97eb) ) - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("5.6b", 0x0e0000, 0x10000, CRC(9c69eb35) SHA1(d5a9714f279b71c419b4bae0f142c4cb1cc8d30e) ) ROM_LOAD16_BYTE("6.9b", 0x0e0001, 0x10000, CRC(34a44ce5) SHA1(621c69d8778d4c96ac3be06b033a5931a6a23da2) ) - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.21j", 0x000000, 0x4000, CRC(fe615fcd) SHA1(d67ee5e877b937173f4c188829d5bcbd354ceb29) ) ROM_LOAD( "8.21l", 0x004000, 0x4000, CRC(905d6b27) SHA1(952f1879e6c27dc87234a4dc572e0453dc2d59fa) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -585,42 +1019,42 @@ ROM_START( deadang ) ROM_END ROM_START( leadang ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("2.18h", 0x0c0000, 0x10000, CRC(611247e0) SHA1(1b9ad50f67ba3a3a9e5a0d6e33f4d4be2fc20446) ) // sldh ROM_LOAD16_BYTE("4.22h", 0x0c0001, 0x10000, CRC(348c1201) SHA1(277dd77dcbc950299de0fd56a4f66db8f90752ad) ) // sldh ROM_LOAD16_BYTE("1.18f", 0x0e0000, 0x10000, CRC(fb952d71) SHA1(c6578cddf019872e6005c3a9e8e3e024d17d8c6e) ) // sldh ROM_LOAD16_BYTE("3.22f", 0x0e0001, 0x10000, CRC(2271c6df) SHA1(774a92bb698606e58d0c74ea07d7eaecf766dddf) ) - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("5.6b", 0x0e0000, 0x10000, CRC(9c69eb35) SHA1(d5a9714f279b71c419b4bae0f142c4cb1cc8d30e) ) ROM_LOAD16_BYTE("6.9b", 0x0e0001, 0x10000, CRC(34a44ce5) SHA1(621c69d8778d4c96ac3be06b033a5931a6a23da2) ) - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.22k", 0x000000, 0x4000, CRC(490701e7) SHA1(2f5cbc0407d7fe41b9e7683c7531656fda7bf9f7) ) ROM_LOAD( "8.22l", 0x004000, 0x4000, CRC(18024c5e) SHA1(b02bcaa1ba6e7c188f3d2a6b20b52b2dcb8215e0) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -632,42 +1066,42 @@ ROM_START( leadang ) ROM_END ROM_START( ghunter ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("2.19h", 0x0c0000, 0x10000, CRC(5a511500) SHA1(69185a9efee0c3ee4d65643651eb9c613bc5f759) ) ROM_LOAD16_BYTE("4.22h", 0x0c0001, 0x10000, CRC(df5704f4) SHA1(a40848f1222253921982320155e6f7a01d2bb17f) ) // sldh ROM_LOAD16_BYTE("1.19f", 0x0e0000, 0x10000, CRC(30deb018) SHA1(099ab1f227d7e28f3e56a61d015813905a2dbc29) ) ROM_LOAD16_BYTE("3.22f", 0x0e0001, 0x10000, CRC(95f587c5) SHA1(b1431dd56200a5f849314b34daed5d3570633a77) ) // sldh - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("5.6b", 0x0e0000, 0x10000, CRC(c40bb5e5) SHA1(2a618f7db6fe6cd8d1a0e7eed91a831b721fec62) ) // sldh ROM_LOAD16_BYTE("6.10b", 0x0e0001, 0x10000, CRC(373f86a7) SHA1(6f7d219a3bc34d74fdadd812319a5387d217dffb) ) // sldh - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.22k", 0x000000, 0x4000, CRC(490701e7) SHA1(2f5cbc0407d7fe41b9e7683c7531656fda7bf9f7) ) ROM_LOAD( "8.22l", 0x004000, 0x4000, CRC(18024c5e) SHA1(b02bcaa1ba6e7c188f3d2a6b20b52b2dcb8215e0) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -679,42 +1113,42 @@ ROM_START( ghunter ) ROM_END ROM_START( ghunters ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */ + ROM_REGION( 0x100000, "maincpu", 0 ) // V30 ROM_LOAD16_BYTE("ggh-2.h18", 0x0c0000, 0x10000, CRC(7ccc6fee) SHA1(bccc283d82f080157f0521457b04fdd1d63caafe) ) ROM_LOAD16_BYTE("ggh-4.h22", 0x0c0001, 0x10000, CRC(d1f23ad7) SHA1(2668729af797ccab52ac2bf519d43ab2fa9e54ce) ) ROM_LOAD16_BYTE("ggh-1.f18", 0x0e0000, 0x10000, CRC(0d6ff111) SHA1(209d26170446b43d1d463737b447e30aaca614a7) ) ROM_LOAD16_BYTE("ggh-3.f22", 0x0e0001, 0x10000, CRC(66dec38d) SHA1(78dd3143265c3da90d1a0ab2c4f42b4e32716af8) ) - ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */ + ROM_REGION( 0x100000, "sub", 0 ) // V30 ROM_LOAD16_BYTE("ggh-5.b6", 0x0e0000, 0x10000, CRC(1f612f3b) SHA1(71840fa0e988828a819d371f082ce31d5a5e3a30) ) ROM_LOAD16_BYTE("ggh-6.b10", 0x0e0001, 0x10000, CRC(63e18e56) SHA1(5183d0909a7c795e76540723fb710a5a75730298) ) - ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound Z80 */ - ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) /* Encrypted */ - ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) /* Banked */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 + ROM_LOAD( "13.b1", 0x000000, 0x02000, CRC(13b956fb) SHA1(f7c21ad5e988ac59073659a427b1fa66ff49b0c1) ) // Encrypted + ROM_LOAD( "14.c1", 0x010000, 0x10000, CRC(98837d57) SHA1(291769a11478291a65c959d119d19960b100d135) ) // Banked - ROM_REGION( 0x08000, "gfx1", 0 ) /* Chars */ + ROM_REGION( 0x08000, "chars", 0 ) ROM_LOAD( "7.21j", 0x000000, 0x4000, CRC(fe615fcd) SHA1(d67ee5e877b937173f4c188829d5bcbd354ceb29) ) ROM_LOAD( "8.21l", 0x004000, 0x4000, CRC(905d6b27) SHA1(952f1879e6c27dc87234a4dc572e0453dc2d59fa) ) - ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "l12", 0x000000, 0x80000, CRC(c94d5cd2) SHA1(25ded13faaed90886c9fe40f85969dab2f511e31) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* pf1 layer */ + ROM_REGION( 0x100000, "tiles1", 0 ) // pf1 layer ROM_LOAD( "16n", 0x000000, 0x80000, CRC(fd70e1a5) SHA1(c3d1233f4dfe08f686ec99a556889f9ed6a21da3) ) // bank 0 (0x1000 tiles) ROM_LOAD( "16r", 0x080000, 0x80000, CRC(92f5e382) SHA1(2097b9e9bf3cd37c8613847e7aed677b5aeab7f9) ) // bank 1 (0x1000 tiles) - ROM_REGION( 0x40000, "gfx4", 0 ) // pf2 layer + ROM_REGION( 0x40000, "tiles2", 0 ) // pf2 layer ROM_LOAD( "11m", 0x000000, 0x40000, CRC(a366659a) SHA1(e2fcd82b0b2d4e3adcdf50c710984907d26acd04) ) // fixed (0x800 tiles) - ROM_REGION( 0x40000, "gfx5", 0 ) // pf3 layer + ROM_REGION( 0x40000, "tiles3", 0 ) // pf3 layer ROM_LOAD( "11k", 0x000000, 0x40000, CRC(9cf5bcc7) SHA1(cf96592e601fc373b1bf322d9b576668799130a5) ) // fixed (0x800 tiles) - ROM_REGION16_BE( 0x10000, "gfx6", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap1", 0 ) ROM_LOAD16_BYTE( "10.6l", 0x00000, 0x8000, CRC(ca99176b) SHA1(283e3769a1ff579c78a008b65cb8267e5770ba1f) ) ROM_LOAD16_BYTE( "9.6m", 0x00001, 0x8000, CRC(51d868ca) SHA1(3e9a4e6bc4bc68773c4ba18c5f4110e6c595d0c9) ) - ROM_REGION16_BE( 0x10000, "gfx7", 0 ) /* background map data */ + ROM_REGION16_BE( 0x10000, "bgmap2", 0 ) ROM_LOAD16_BYTE( "12.6j", 0x00000, 0x8000, CRC(2674d23f) SHA1(0533d80a23d917e20a703aeb833dcaccfa3a1967) ) ROM_LOAD16_BYTE( "11.6k", 0x00001, 0x8000, CRC(3dd4d81d) SHA1(94f0a13a8d3812f6879819ca186abf3a8665f7cb) ) @@ -725,34 +1159,22 @@ ROM_START( ghunters ) ROM_LOAD( "16.11a", 0x000000, 0x10000, CRC(a8d46fc9) SHA1(3ba51bdec4057413396a152b35015f9d95253e3f) ) ROM_END -/* Driver Initialization */ - -void deadang_state::init_deadang() -{ - m_adpcm1->decrypt(); - m_adpcm2->decrypt(); -} +// Driver Initialization -void popnrun_state::init_popnrun() +void deadang_state::init_adpcm() { -// m_adpcm1->decrypt(); -// m_adpcm2->decrypt(); + m_adpcm[0]->decrypt(); + m_adpcm[1]->decrypt(); } -void deadang_state::init_ghunter() -{ - m_adpcm1->decrypt(); - m_adpcm2->decrypt(); +} // anonymous namespace - m_maincpu->space(AS_PROGRAM).install_read_handler(0x80000, 0x80001, read16smo_delegate(*this, FUNC(deadang_state::ghunter_trackball_low_r))); - m_maincpu->space(AS_PROGRAM).install_read_handler(0xb0000, 0xb0001, read16smo_delegate(*this, FUNC(deadang_state::ghunter_trackball_high_r))); -} /* Game Drivers */ -GAME( 1987, popnrun, 0, popnrun, deadang, popnrun_state, init_popnrun, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 1)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1987, popnruna, popnrun, popnrun, deadang, popnrun_state, init_popnrun, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, popnrun, 0, popnrun, deadang, popnrun_state, empty_init, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 1)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, popnruna, popnrun, popnrun, deadang, popnrun_state, empty_init, ROT0, "Seibu Kaihatsu / Yukai Tsukai", "Pop'n Run - The Videogame (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1988, deadang, 0, deadang, deadang, deadang_state, init_deadang, ROT0, "Seibu Kaihatsu", "Dead Angle", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, leadang, deadang, deadang, deadang, deadang_state, init_deadang, ROT0, "Seibu Kaihatsu", "Lead Angle (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, ghunter, deadang, deadang, ghunter, deadang_state, init_ghunter, ROT0, "Seibu Kaihatsu", "Gang Hunter / Dead Angle", MACHINE_SUPPORTS_SAVE ) // Title is 'Gang Hunter' or 'Dead Angle' depending on control method dipswitch -GAME( 1988, ghunters, deadang, deadang, ghunter, deadang_state, init_ghunter, ROT0, "Seibu Kaihatsu (SegaSA / Sonic license)", "Gang Hunter / Dead Angle (Spain)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, deadang, 0, deadang, deadang, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu", "Dead Angle", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, leadang, deadang, deadang, deadang, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu", "Lead Angle (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, ghunter, deadang, ghunter, ghunter, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu", "Gang Hunter / Dead Angle", MACHINE_SUPPORTS_SAVE ) // Title is 'Gang Hunter' or 'Dead Angle' depending on control method dipswitch +GAME( 1988, ghunters, deadang, ghunter, ghunter, deadang_state, init_adpcm, ROT0, "Seibu Kaihatsu (SegaSA / Sonic license)", "Gang Hunter / Dead Angle (Spain)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/deadang.h b/src/mame/seibu/deadang.h deleted file mode 100644 index 791417d1ec1..00000000000 --- a/src/mame/seibu/deadang.h +++ /dev/null @@ -1,121 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood -#ifndef MAME_SEIBU_DEADANG_H -#define MAME_SEIBU_DEADANG_H - -#pragma once - -#include "seibusound.h" - -#include "machine/timer.h" -#include "sound/ymopm.h" - -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class deadang_state : public driver_device -{ -public: - deadang_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_scroll_ram(*this, "scroll_ram"), - m_videoram(*this, "videoram"), - m_video_data(*this, "video_data"), - m_spriteram(*this, "spriteram"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_seibu_sound(*this, "seibu_sound"), - m_maincpu(*this, "maincpu"), - m_subcpu(*this, "sub"), - m_audiocpu(*this, "audiocpu"), - m_adpcm1(*this, "adpcm1"), - m_adpcm2(*this, "adpcm2") - { } - - void deadang(machine_config &config); - - void init_deadang(); - void init_ghunter(); - - void foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - TILEMAP_MAPPER_MEMBER(bg_scan); - TILE_GET_INFO_MEMBER(get_pf1_tile_info); - TILE_GET_INFO_MEMBER(get_pf3_tile_info); - TILE_GET_INFO_MEMBER(get_pf2_tile_info); - TILE_GET_INFO_MEMBER(get_text_tile_info); - -protected: - virtual void video_start() override; - - void main_map(address_map &map); - - required_shared_ptr m_scroll_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_video_data; - required_shared_ptr m_spriteram; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_seibu_sound; - - int m_tilebank = 0; - int m_oldtilebank = 0; - - tilemap_t *m_pf3_layer = nullptr; - tilemap_t *m_pf2_layer = nullptr; - tilemap_t *m_pf1_layer = nullptr; - tilemap_t *m_text_layer = nullptr; - - void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - void sound_decrypted_opcodes_map(address_map &map); - void sound_map(address_map &map); - - required_device m_maincpu; - required_device m_subcpu; - required_device m_audiocpu; - optional_device m_adpcm1; - optional_device m_adpcm2; - - uint16_t ghunter_trackball_low_r(); - uint16_t ghunter_trackball_high_r(); - - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - TIMER_DEVICE_CALLBACK_MEMBER(main_scanline); - TIMER_DEVICE_CALLBACK_MEMBER(sub_scanline); - void sub_map(address_map &map); -}; - -class popnrun_state : public deadang_state -{ -public: - popnrun_state(const machine_config &mconfig, device_type type, const char *tag) : - deadang_state(mconfig, type, tag) - { } - - void popnrun(machine_config &config); - - void init_popnrun(); - -protected: - virtual void video_start() override; - -private: - TILE_GET_INFO_MEMBER(get_popnrun_text_tile_info); - void popnrun_text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void popnrun_main_map(address_map &map); - void popnrun_sub_map(address_map &map); - void popnrun_sound_map(address_map &map); - - uint32_t popnrun_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void popnrun_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); -}; - -#endif // MAME_SEIBU_DEADANG_H diff --git a/src/mame/seibu/deadang_v.cpp b/src/mame/seibu/deadang_v.cpp deleted file mode 100644 index e94def9c471..00000000000 --- a/src/mame/seibu/deadang_v.cpp +++ /dev/null @@ -1,308 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood -#include "emu.h" -#include "deadang.h" -#include "screen.h" - - -/******************************************************************************/ - -void deadang_state::foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_video_data[offset]); - m_pf1_layer->mark_tile_dirty(offset ); -} - -void deadang_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_videoram[offset]); - m_text_layer->mark_tile_dirty(offset ); -} - -void popnrun_state::popnrun_text_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_videoram[offset]); - m_text_layer->mark_tile_dirty(offset / 2); -} - -void deadang_state::bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if (ACCESSING_BITS_0_7) - { - m_tilebank = data&1; - if (m_tilebank!=m_oldtilebank) - { - m_oldtilebank = m_tilebank; - m_pf1_layer->mark_all_dirty(); - } - } -} - -/******************************************************************************/ - -TILEMAP_MAPPER_MEMBER(deadang_state::bg_scan) -{ - return (col&0xf) | ((row&0xf)<<4) | ((col&0x70)<<4) | ((row&0xf0)<<7); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_pf3_tile_info) -{ - const uint16_t *bgMap = (const uint16_t *)memregion("gfx6")->base(); - int code= bgMap[tile_index]; - tileinfo.set(4,code&0x7ff,code>>12,0); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_pf2_tile_info) -{ - const uint16_t *bgMap = (const uint16_t *)memregion("gfx7")->base(); - int code= bgMap[tile_index]; - tileinfo.set(3,code&0x7ff,code>>12,0); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_pf1_tile_info) -{ - int tile=m_video_data[tile_index]; - int color=tile >> 12; - tile=tile&0xfff; - - tileinfo.set(2,tile+m_tilebank*0x1000,color,0); -} - -TILE_GET_INFO_MEMBER(deadang_state::get_text_tile_info) -{ - int tile=(m_videoram[tile_index] & 0xff) | ((m_videoram[tile_index] >> 6) & 0x300); - int color=(m_videoram[tile_index] >> 8)&0xf; - - tileinfo.set(0,tile,color,0); -} - -void deadang_state::video_start() -{ - m_pf3_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf2_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf1_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); - m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_pf2_layer->set_transparent_pen(15); - m_pf1_layer->set_transparent_pen(15); - m_text_layer->set_transparent_pen(15); - - save_item(NAME(m_tilebank)); - save_item(NAME(m_oldtilebank)); -} - - -TILE_GET_INFO_MEMBER(popnrun_state::get_popnrun_text_tile_info) -{ - int tile = (m_videoram[tile_index*2+0] & 0xff) << 1; // | ((m_videoram[tile_index] >> 6) & 0x300); - int attr = (m_videoram[tile_index*2+1]); - // TODO: not entirely correct (title screen/ranking colors) - // might be down to bitplanes too - int color = (attr & 3) ^ 1; - - if(attr & 0x40) - tile |= 1; - - tileinfo.set(0,tile,color,0); -} - -void popnrun_state::video_start() -{ - m_pf3_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf3_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf2_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf2_tile_info)), tilemap_mapper_delegate(*this, FUNC(deadang_state::bg_scan)), 16, 16, 128, 256); - m_pf1_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deadang_state::get_pf1_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); - m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(popnrun_state::get_popnrun_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_pf2_layer->set_transparent_pen(0); - m_pf1_layer->set_transparent_pen(0); - m_text_layer->set_transparent_pen(0); - - save_item(NAME(m_tilebank)); - save_item(NAME(m_oldtilebank)); -} - - -void deadang_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int offs,fx,fy,x,y,color,sprite,pri; - - for (offs = 0; offs<0x800/2; offs+=4) - { - /* Don't draw empty sprite table entries */ - if ((m_spriteram[offs+3] & 0xff00)!=0xf00) continue; - - switch (m_spriteram[offs+2]&0xc000) { - default: - case 0xc000: pri=0; break; /* Unknown */ - case 0x8000: pri=0; break; /* Over all playfields */ - case 0x4000: pri=0xf0; break; /* Under top playfield */ - case 0x0000: pri=0xf0|0xcc; break; /* Under middle playfield */ - } - - fx= m_spriteram[offs+0]&0x2000; - fy= m_spriteram[offs+0]&0x4000; - y = m_spriteram[offs+0] & 0xff; - x = m_spriteram[offs+2] & 0xff; - if (fy) fy=0; else fy=1; - if (m_spriteram[offs+2]&0x100) x=0-(0xff-x); - - color = (m_spriteram[offs+1]>>12)&0xf; - sprite = m_spriteram[offs+1]&0xfff; - - if (flip_screen()) { - x=240-x; - y=240-y; - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - } - - m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect, - sprite, - color,fx,fy,x,y, - screen.priority(),pri,15); - } -} - -uint32_t deadang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - /* Setup the tilemaps */ - m_pf3_layer->set_scrolly(0, ((m_scroll_ram[0x01]&0xf0)<<4)+((m_scroll_ram[0x02]&0x7f)<<1)+((m_scroll_ram[0x02]&0x80)>>7) ); - m_pf3_layer->set_scrollx(0, ((m_scroll_ram[0x09]&0xf0)<<4)+((m_scroll_ram[0x0a]&0x7f)<<1)+((m_scroll_ram[0x0a]&0x80)>>7) ); - m_pf1_layer->set_scrolly(0, ((m_scroll_ram[0x11]&0x10)<<4)+((m_scroll_ram[0x12]&0x7f)<<1)+((m_scroll_ram[0x12]&0x80)>>7) ); - m_pf1_layer->set_scrollx(0, ((m_scroll_ram[0x19]&0x10)<<4)+((m_scroll_ram[0x1a]&0x7f)<<1)+((m_scroll_ram[0x1a]&0x80)>>7) ); - m_pf2_layer->set_scrolly(0, ((m_scroll_ram[0x21]&0xf0)<<4)+((m_scroll_ram[0x22]&0x7f)<<1)+((m_scroll_ram[0x22]&0x80)>>7) ); - m_pf2_layer->set_scrollx(0, ((m_scroll_ram[0x29]&0xf0)<<4)+((m_scroll_ram[0x2a]&0x7f)<<1)+((m_scroll_ram[0x2a]&0x80)>>7) ); - - /* Control byte: - 0x01: Background playfield disable - 0x02: Middle playfield disable - 0x04: Top playfield disable - 0x08: ? Toggles at start of game - 0x10: Sprite disable - 0x20: Unused? - 0x40: Flipscreen - 0x80: Always set? - */ - m_pf3_layer->enable(!(m_scroll_ram[0x34]&1)); - m_pf1_layer->enable(!(m_scroll_ram[0x34]&2)); - m_pf2_layer->enable(!(m_scroll_ram[0x34]&4)); - flip_screen_set(m_scroll_ram[0x34]&0x40 ); - - bitmap.fill(m_palette->black_pen(), cliprect); - screen.priority().fill(0, cliprect); - m_pf3_layer->draw(screen, bitmap, cliprect, 0,1); - m_pf1_layer->draw(screen, bitmap, cliprect, 0,2); - m_pf2_layer->draw(screen, bitmap, cliprect, 0,4); - if (!(m_scroll_ram[0x34]&0x10)) draw_sprites(screen, bitmap,cliprect); - m_text_layer->draw(screen, bitmap, cliprect, 0,0); - return 0; -} - -void popnrun_state::popnrun_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int offs,fx,fy,x,y,color,sprite,pri; - - // TODO: might have more bits in either 0x3800-0x3bff or 0x3e00-0x3fff - for (offs = 0; offs<0x200/2; offs+=2) - { - /* Don't draw empty sprite table entries */ - //if ((m_spriteram[offs+3] & 0xff00)!=0xf00) continue; - - pri = 0; -#if 0 - switch (m_spriteram[offs+2]&0xc000) { - default: - case 0xc000: pri=0; break; /* Unknown */ - case 0x8000: pri=0; break; /* Over all playfields */ - case 0x4000: pri=0xf0; break; /* Under top playfield */ - case 0x0000: pri=0xf0|0xcc; break; /* Under middle playfield */ - } -#endif - - fx = m_spriteram[offs+0]&0x4000; - fy = m_spriteram[offs+0]&0x8000; - y = m_spriteram[offs+1] & 0xff; - x = (m_spriteram[offs+1] >> 8) & 0xff; -#if 0 - if (fy) fy=0; else fy=1; - if (m_spriteram[offs+2]&0x100) x=0-(0xff-x); -#endif - - color = (m_spriteram[offs+0]>>12)&0x7; - sprite = m_spriteram[offs+0]&0xfff; - -#if 0 - if (flip_screen()) { - x=240-x; - y=240-y; - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - } -#endif - - m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect, - sprite, - color,fx,fy,x,y, - screen.priority(),pri,0); - } -} - -uint32_t popnrun_state::popnrun_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - // TODO: different scroll RAM hookup - // 0x18 seems to enable the various layers - /* Setup the tilemaps */ -// m_pf3_layer->set_scrolly(0, ((m_scroll_ram[0x01]&0xf0)<<4)+((m_scroll_ram[0x02]&0x7f)<<1)+((m_scroll_ram[0x02]&0x80)>>7) ); -// m_pf3_layer->set_scrollx(0, ((m_scroll_ram[0x09]&0xf0)<<4)+((m_scroll_ram[0x0a]&0x7f)<<1)+((m_scroll_ram[0x0a]&0x80)>>7) ); -// m_pf1_layer->set_scrolly(0, ((m_scroll_ram[0x11]&0x10)<<4)+((m_scroll_ram[0x12]&0x7f)<<1)+((m_scroll_ram[0x12]&0x80)>>7) ); -// m_pf1_layer->set_scrollx(0, ((m_scroll_ram[0x19]&0x10)<<4)+((m_scroll_ram[0x1a]&0x7f)<<1)+((m_scroll_ram[0x1a]&0x80)>>7) ); -// m_pf2_layer->set_scrolly(0, ((m_scroll_ram[0x21]&0xf0)<<4)+((m_scroll_ram[0x22]&0x7f)<<1)+((m_scroll_ram[0x22]&0x80)>>7) ); -// m_pf2_layer->set_scrollx(0, ((m_scroll_ram[0x29]&0xf0)<<4)+((m_scroll_ram[0x2a]&0x7f)<<1)+((m_scroll_ram[0x2a]&0x80)>>7) ); - - m_pf3_layer->enable(!(m_scroll_ram[0x34]&1)); - m_pf1_layer->enable(!(m_scroll_ram[0x34]&2)); - m_pf2_layer->enable(!(m_scroll_ram[0x34]&4)); -// flip_screen_set(m_scroll_ram[0x34]&0x40 ); - - bitmap.fill(1, cliprect); - screen.priority().fill(0, cliprect); - // 32 pixels? -// int scrollx = (m_scroll_ram[0x4/2] & 0x0f); - - // debug tilemap code - // this is likely to be collision data - for(int x=0;x<16;x++) - { - for(int y=0;y<8;y++) - { - int tile = m_video_data[y+x*8+0xc0] & 0xff; - int res_x, res_y; - - if(tile != 0) - { - res_x = (x*16) & 0xff; - res_y = y*32; - //if(cliprect.contains(res_x,res_y)) - bitmap.plot_box(res_x,res_y,16,16,tile+0x10); - } - - tile = m_video_data[y+x*8+0xc0] >> 8; - - if(tile != 0) - { - res_x = (x*16) & 0xff; - res_y = y*32+16; - //if(cliprect.contains(res_x,res_y)) - bitmap.plot_box(res_x,res_y,16,16,tile+0x10); - } - } - } - - //m_pf3_layer->draw(screen, bitmap, cliprect, 0,1); - //m_pf1_layer->draw(screen, bitmap, cliprect, 0,2); - //m_pf2_layer->draw(screen, bitmap, cliprect, 0,4); - if (m_scroll_ram[0x18/2]&0x1) - popnrun_draw_sprites(screen, bitmap,cliprect); - m_text_layer->draw(screen, bitmap, cliprect, 0,0); - return 0; -} diff --git a/src/mame/seibu/kncljoe.cpp b/src/mame/seibu/kncljoe.cpp index b9d9d1ad6d9..336f867b0eb 100644 --- a/src/mame/seibu/kncljoe.cpp +++ b/src/mame/seibu/kncljoe.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Ernesto Corvi +// copyright-holders: Ernesto Corvi + /*************************************************************************** Knuckle Joe - (c) 1985 Seibu Kaihatsu (Taito license) @@ -7,9 +8,10 @@ Knuckle Joe - (c) 1985 Seibu Kaihatsu (Taito license) driver by Ernesto Corvi This board seems to be an Irem design. -The sound hardware is modified the 6803-based one used by the classic Irem -games. There's only one AY 3-8910 chip and no MSM5205. There are also two -SN76489 controlled directly by main(!) cpu, and used only for in-game music. +The sound hardware is a modified version of the 6803-based one used by the +classic Irem games. There's only one AY 3-8910 chip and no MSM5205. There +are also two SN76489 controlled directly by main(!) CPU, and used only for +in-game music. The video hardware is pretty much like Irem games too. The only strange thing is that the screen is flipped vertically. @@ -27,12 +29,295 @@ BTANB: ***************************************************************************/ #include "emu.h" -#include "kncljoe.h" +#include "cpu/m6800/m6801.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "sound/ay8910.h" #include "sound/sn76496.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class kncljoe_state : public driver_device +{ +public: + kncljoe_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_scrollregs(*this, "scrollregs"), + m_spriteram(*this, "spriteram"), + m_maincpu(*this, "maincpu"), + m_soundcpu(*this, "soundcpu"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_ay8910(*this, "aysnd"), + m_soundlatch(*this, "soundlatch") + { } + + void kncljoe(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_shared_ptr m_videoram; + required_shared_ptr m_scrollregs; + required_shared_ptr m_spriteram; + + // video-related + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_tile_bank = 0U; + uint8_t m_sprite_bank = 0U; + uint8_t m_flipscreen = 0U; + + // misc + uint8_t m_port1 = 0U; + uint8_t m_port2 = 0U; + + required_device m_maincpu; + required_device m_soundcpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_ay8910; + required_device m_soundlatch; + + void sound_cmd_w(uint8_t data); + void sound_irq_ack_w(uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + void control_w(uint8_t data); + void scroll_w(offs_t offset, uint8_t data); + void m6803_port1_w(uint8_t data); + void m6803_port2_w(uint8_t data); + uint8_t m6803_port1_r(); + uint8_t m6803_port2_r(); + void unused_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(sound_nmi); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + +***************************************************************************/ + +void kncljoe_state::palette(palette_device &palette) const +{ + uint8_t const *color_prom = memregion("proms")->base(); + + // create a lookup table for the palette + for (int i = 0; i < 0x80; i++) + { + int const r = pal4bit(color_prom[i + 0x000]); + int const g = pal4bit(color_prom[i + 0x100]); + int const b = pal4bit(color_prom[i + 0x200]); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + for (int i = 0; i < 0x10; i++) + { + int bit0, bit1, bit2; + + // red component + bit0 = 0; + bit1 = BIT(color_prom[i + 0x300], 6); + bit2 = BIT(color_prom[i + 0x300], 7); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // green component + bit0 = BIT(color_prom[i + 0x300], 3); + bit1 = BIT(color_prom[i + 0x300], 4); + bit2 = BIT(color_prom[i + 0x300], 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // blue component + bit0 = BIT(color_prom[i + 0x300], 0); + bit1 = BIT(color_prom[i + 0x300], 1); + bit2 = BIT(color_prom[i + 0x300], 2); + int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + palette.set_indirect_color(i + 0x80, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x320; + + // chars + for (int i = 0; i < 0x80; i++) + palette.set_pen_indirect(i, i); + + // sprite lookup table + for (int i = 0; i < 0x80; i++) + { + uint8_t const ctabentry = (color_prom[i] & 0x0f) | 0x80; + palette.set_pen_indirect(i + 0x80, ctabentry); + } +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(kncljoe_state::get_bg_tile_info) +{ + int const attr = m_videoram[2 * tile_index + 1]; + int const code = m_videoram[2 * tile_index] + ((attr & 0xc0) << 2) + (m_tile_bank << 10); + + tileinfo.set(0, + code, + attr & 0xf, + TILE_FLIPXY((attr & 0x30) >> 4)); +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void kncljoe_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(kncljoe_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_bg_tilemap->set_scroll_rows(4); +} + + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void kncljoe_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + +void kncljoe_state::control_w(uint8_t data) +{ + /* + 0x01 screen flip + 0x02 coin counter#1 + 0x04 sprite bank + 0x10 character bank + 0x20 coin counter#2 + + reset when IN0 - Coin 1 goes low (active) + set after IN0 - Coin 1 goes high AND the credit has been added + */ + m_flipscreen = data & 0x01; + machine().tilemap().set_flip_all(m_flipscreen ? TILEMAP_FLIPX : TILEMAP_FLIPY); + + machine().bookkeeping().coin_counter_w(0, data & 0x02); + machine().bookkeeping().coin_counter_w(1, data & 0x20); + + if (m_tile_bank != BIT(data, 4)) + { + m_tile_bank = BIT(data, 4); + m_bg_tilemap->mark_all_dirty(); + } + + m_sprite_bank = BIT(data, 2); +} + +void kncljoe_state::scroll_w(offs_t offset, uint8_t data) +{ + m_scrollregs[offset] = data; + int const scrollx = m_scrollregs[0] | m_scrollregs[1] << 8; + m_bg_tilemap->set_scrollx(0, scrollx); + m_bg_tilemap->set_scrollx(1, scrollx); + m_bg_tilemap->set_scrollx(2, scrollx); + m_bg_tilemap->set_scrollx(3, 0); +} + + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +void kncljoe_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + gfx_element *gfx = m_gfxdecode->gfx(1 + m_sprite_bank); + + for (int i = 0; i < 4; i++) + { + // clip vertical strip for each layer + rectangle clip = cliprect; + clip.min_y = m_flipscreen ? (191 - i * 64) : (i * 64 + 1); + clip.max_y = clip.min_y + 63; + clip &= cliprect; + + for (int j = 0x7c; j >= 0; j -= 4) + { + int const offs = bitswap<2>(~i, 0, 1) << 7 | j; + int sy = m_spriteram[offs] + 1; + int sx = m_spriteram[offs + 3]; + int const attr = m_spriteram[offs + 1]; + int const code = m_spriteram[offs + 2] | ((attr & 0x10) << 5) | ((attr & 0x20) << 3); + int flipx = attr & 0x40; + int flipy = !(attr & 0x80); + int const color = attr & 0x0f; + + if (m_flipscreen) + { + flipx = !flipx; + flipy = !flipy; + sx = 240 - sx; + sy = 240 - sy; + } + + if (sx >= 256 - 8) + sx -= 256; + + gfx->transpen(bitmap, clip, + code, + color, + flipx, flipy, + sx, sy, 0); + } + } +} + +uint32_t kncljoe_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + +// machine void kncljoe_state::sound_cmd_w(uint8_t data) { @@ -46,20 +331,20 @@ void kncljoe_state::sound_cmd_w(uint8_t data) void kncljoe_state::main_map(address_map &map) { map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram().w(FUNC(kncljoe_state::kncljoe_videoram_w)).share("videoram"); - map(0xd000, 0xd001).w(FUNC(kncljoe_state::kncljoe_scroll_w)).share("scrollregs"); + map(0xc000, 0xcfff).ram().w(FUNC(kncljoe_state::videoram_w)).share(m_videoram); + map(0xd000, 0xd001).w(FUNC(kncljoe_state::scroll_w)).share(m_scrollregs); map(0xd800, 0xd800).portr("SYSTEM"); map(0xd801, 0xd801).portr("P1"); map(0xd802, 0xd802).portr("P2"); map(0xd803, 0xd803).portr("DSWA"); map(0xd804, 0xd804).portr("DSWB"); map(0xd800, 0xd800).w(FUNC(kncljoe_state::sound_cmd_w)); - map(0xd801, 0xd801).w(FUNC(kncljoe_state::kncljoe_control_w)); + map(0xd801, 0xd801).w(FUNC(kncljoe_state::control_w)); map(0xd802, 0xd802).w("sn1", FUNC(sn76489_device::write)); map(0xd803, 0xd803).w("sn2", FUNC(sn76489_device::write)); - map(0xd807, 0xd807).nopr(); /* unknown read */ - map(0xd817, 0xd817).nopr(); /* unknown read */ - map(0xe800, 0xefff).ram().share("spriteram"); + map(0xd807, 0xd807).nopr(); // unknown read + map(0xd817, 0xd817).nopr(); // unknown read + map(0xe800, 0xefff).ram().share(m_spriteram); map(0xf000, 0xffff).ram(); } @@ -99,7 +384,7 @@ void kncljoe_state::sound_irq_ack_w(uint8_t data) void kncljoe_state::unused_w(uint8_t data) { - // unused - no MSM on the pcb + // unused - no MSM on the PCB } void kncljoe_state::sound_map(address_map &map) @@ -207,9 +492,9 @@ static const gfx_layout spritelayout = }; static GFXDECODE_START( gfx_kncljoe ) - GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0x00, 16 ) /* colors 0x00-0x7f direct mapped */ - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 16 ) /* colors 0x80-0x8f with lookup table */ - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x3_planar, 0x00, 16 ) // colors 0x00-0x7f direct mapped + GFXDECODE_ENTRY( "sprites1", 0, spritelayout, 0x80, 16 ) // colors 0x80-0x8f with lookup table + GFXDECODE_ENTRY( "sprites2", 0, spritelayout, 0x80, 16 ) GFXDECODE_END @@ -238,12 +523,12 @@ void kncljoe_state::machine_reset() void kncljoe_state::kncljoe(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(6'000'000)); /* verified on pcb */ + // basic machine hardware + Z80(config, m_maincpu, XTAL(6'000'000)); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &kncljoe_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(kncljoe_state::irq0_line_hold)); - M6803(config, m_soundcpu, XTAL(3'579'545)); /* verified on pcb */ + M6803(config, m_soundcpu, XTAL(3'579'545)); // verified on PCB m_soundcpu->set_addrmap(AS_PROGRAM, &kncljoe_state::sound_map); m_soundcpu->in_p1_cb().set(FUNC(kncljoe_state::m6803_port1_r)); m_soundcpu->out_p1_cb().set(FUNC(kncljoe_state::m6803_port1_w)); @@ -251,32 +536,32 @@ void kncljoe_state::kncljoe(machine_config &config) m_soundcpu->out_p2_cb().set(FUNC(kncljoe_state::m6803_port2_w)); m_soundcpu->set_periodic_int(FUNC(kncljoe_state::sound_nmi), attotime::from_hz(3970)); // measured 3.970 kHz - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1500)); m_screen->set_size(32*8, 32*8); m_screen->set_visarea(1*8, 31*8-1, 0*8, 32*8-1); - m_screen->set_screen_update(FUNC(kncljoe_state::screen_update_kncljoe)); + m_screen->set_screen_update(FUNC(kncljoe_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_kncljoe); - PALETTE(config, m_palette, FUNC(kncljoe_state::kncljoe_palette), 16*8+16*8, 128+16); + PALETTE(config, m_palette, FUNC(kncljoe_state::palette), 16*8+16*8, 128+16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - AY8910(config, m_ay8910, XTAL(3'579'545)/4); /* verified on pcb */ + AY8910(config, m_ay8910, XTAL(3'579'545) / 4); // verified on PCB m_ay8910->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); m_ay8910->port_b_write_callback().set(FUNC(kncljoe_state::unused_w)); m_ay8910->add_route(ALL_OUTPUTS, "mono", 0.30); - SN76489(config, "sn1", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); /* verified on pcb */ + SN76489(config, "sn1", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); // verified on PCB - SN76489(config, "sn2", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); /* verified on pcb */ + SN76489(config, "sn2", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.30); // verified on PCB } @@ -287,30 +572,30 @@ ROM_START( kncljoe ) ROM_LOAD( "kj-2.bin", 0x4000, 0x4000, CRC(cb11514b) SHA1(c75d4019d1617493ff074ce8187a81ad70d9b60c) ) ROM_LOAD( "kj-3.bin", 0x8000, 0x4000, CRC(0f50697b) SHA1(412c6aba270824299ca2a74e9bea42b83e69797b) ) - ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for audio code */ + ROM_REGION( 0x8000, "soundcpu", 0 ) ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) ) - ROM_REGION( 0xc000, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0xc000, "tiles", 0 ) ROM_LOAD( "kj-10.bin", 0x0000, 0x4000, CRC(74d3ba33) SHA1(c7887d690cb7f7a7b24d59d490ffc088fb6cc49c) ) ROM_LOAD( "kj-11.bin", 0x4000, 0x4000, CRC(8ea01455) SHA1(b4b42fe373a1019b4f2a4b763a8a7219a5c9987e) ) ROM_LOAD( "kj-12.bin", 0x8000, 0x4000, CRC(33367c41) SHA1(e6c56bcad008f3af4bc0f7d7afe8e23c8eb9d943) ) - ROM_REGION( 0x18000, "gfx2", 0 ) /* sprites */ + ROM_REGION( 0x18000, "sprites1", 0 ) ROM_LOAD( "kj-4.bin", 0x00000, 0x8000, CRC(a499ea10) SHA1(cb671cc75b3c6029dd3529e62d83025f78b45271) ) ROM_LOAD( "kj-6.bin", 0x08000, 0x8000, CRC(815f5c0a) SHA1(ad0b59eeebb2e57035a3f643ac0ef575569bec0f) ) ROM_LOAD( "kj-5.bin", 0x10000, 0x8000, CRC(11111759) SHA1(504c62fc6778a4afa86cba69634652708535bef6) ) - ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ + ROM_REGION( 0xc000, "sprites2", 0 ) ROM_LOAD( "kj-7.bin", 0x0000, 0x4000, CRC(121fcccb) SHA1(77f3e7e49787d6a893c5d8c0c3ac612b1180e866) ) ROM_LOAD( "kj-9.bin", 0x4000, 0x4000, CRC(affbe3eb) SHA1(056111fc5b04ff14b114b5f724d02789c8e3ee10) ) ROM_LOAD( "kj-8.bin", 0x8000, 0x4000, CRC(e057e72a) SHA1(3a85750c72caaa027f302dc6ca4086bdbd49b5ff) ) ROM_REGION( 0x420, "proms", 0 ) - ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) /* tile red */ - ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) /* tile green */ - ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) /* tile blue */ - ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) /* sprite palette */ - ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) /* sprite clut */ + ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) // tile red + ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) // tile green + ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) // tile blue + ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) // sprite palette + ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) // sprite clut ROM_END ROM_START( kncljoea ) @@ -319,30 +604,30 @@ ROM_START( kncljoea ) ROM_LOAD( "kj-2.bin", 0x4000, 0x4000, CRC(cb11514b) SHA1(c75d4019d1617493ff074ce8187a81ad70d9b60c) ) ROM_LOAD( "kj-3.bin", 0x8000, 0x4000, CRC(0f50697b) SHA1(412c6aba270824299ca2a74e9bea42b83e69797b) ) - ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for audio code */ + ROM_REGION( 0x8000, "soundcpu", 0 ) ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) ) - ROM_REGION( 0xc000, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0xc000, "tiles", 0 ) ROM_LOAD( "kj-10.bin", 0x0000, 0x4000, CRC(74d3ba33) SHA1(c7887d690cb7f7a7b24d59d490ffc088fb6cc49c) ) ROM_LOAD( "kj-11.bin", 0x4000, 0x4000, CRC(8ea01455) SHA1(b4b42fe373a1019b4f2a4b763a8a7219a5c9987e) ) ROM_LOAD( "kj-12.bin", 0x8000, 0x4000, CRC(33367c41) SHA1(e6c56bcad008f3af4bc0f7d7afe8e23c8eb9d943) ) - ROM_REGION( 0x18000, "gfx2", 0 ) /* sprites */ + ROM_REGION( 0x18000, "sprites1", 0 ) ROM_LOAD( "kj-4.bin", 0x00000, 0x8000, CRC(a499ea10) SHA1(cb671cc75b3c6029dd3529e62d83025f78b45271) ) ROM_LOAD( "kj-6.bin", 0x08000, 0x8000, CRC(815f5c0a) SHA1(ad0b59eeebb2e57035a3f643ac0ef575569bec0f) ) ROM_LOAD( "kj-5.bin", 0x10000, 0x8000, CRC(11111759) SHA1(504c62fc6778a4afa86cba69634652708535bef6) ) - ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ + ROM_REGION( 0xc000, "sprites2", 0 ) ROM_LOAD( "kj-7.bin", 0x0000, 0x4000, CRC(121fcccb) SHA1(77f3e7e49787d6a893c5d8c0c3ac612b1180e866) ) ROM_LOAD( "kj-9.bin", 0x4000, 0x4000, CRC(affbe3eb) SHA1(056111fc5b04ff14b114b5f724d02789c8e3ee10) ) ROM_LOAD( "kj-8.bin", 0x8000, 0x4000, CRC(e057e72a) SHA1(3a85750c72caaa027f302dc6ca4086bdbd49b5ff) ) ROM_REGION( 0x420, "proms", 0 ) - ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) /* tile red */ - ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) /* tile green */ - ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) /* tile blue */ - ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) /* sprite palette */ - ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) /* sprite clut */ + ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) // tile red + ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) // tile green + ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) // tile blue + ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) // sprite palette + ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) // sprite clut ROM_END ROM_START( bcrusher ) @@ -351,34 +636,35 @@ ROM_START( bcrusher ) ROM_LOAD( "bcrush2.bin", 0x4000, 0x4000, CRC(1be4c731) SHA1(11f3a33263d66172902dfb6f3fe2d0ab5cad38d7) ) ROM_LOAD( "bcrush3.bin", 0x8000, 0x4000, CRC(0772d993) SHA1(430f0319bd4765add2f1ee197e7217fdf9ae79c8) ) - ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for audio code */ + ROM_REGION( 0x8000, "soundcpu", 0 ) ROM_LOAD( "kj-13.bin",0x6000, 0x2000, CRC(0a0be3f5) SHA1(00be47fc76500843b6f5de63622edb1748ef5f7d) ) - ROM_REGION( 0xc000, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0xc000, "tiles", 0 ) ROM_LOAD( "bcrush10.bin", 0x0000, 0x4000, CRC(a62f4572) SHA1(4e38e175e25a955e5f83cac8c935163e2e861e94) ) ROM_LOAD( "bcrush11.bin", 0x4000, 0x4000, CRC(79cc5644) SHA1(bc356065a2475d0e0921fc5c84fa46f6629caae7) ) ROM_LOAD( "bcrush12.bin", 0x8000, 0x4000, CRC(8f09641d) SHA1(5ccc423b15148d96c0a348d41a3f4fff7bbae7b9) ) - ROM_REGION( 0x18000, "gfx2", 0 ) /* sprites */ + ROM_REGION( 0x18000, "sprites1", 0 ) ROM_LOAD( "kj-4.bin", 0x00000, 0x8000, CRC(a499ea10) SHA1(cb671cc75b3c6029dd3529e62d83025f78b45271) ) ROM_LOAD( "kj-6.bin", 0x08000, 0x8000, CRC(815f5c0a) SHA1(ad0b59eeebb2e57035a3f643ac0ef575569bec0f) ) ROM_LOAD( "kj-5.bin", 0x10000, 0x8000, CRC(11111759) SHA1(504c62fc6778a4afa86cba69634652708535bef6) ) - ROM_REGION( 0xc000, "gfx3", 0 ) /* sprites */ + ROM_REGION( 0xc000, "sprites2", 0 ) ROM_LOAD( "kj-7.bin", 0x0000, 0x4000, CRC(121fcccb) SHA1(77f3e7e49787d6a893c5d8c0c3ac612b1180e866) ) ROM_LOAD( "kj-9.bin", 0x4000, 0x4000, CRC(affbe3eb) SHA1(056111fc5b04ff14b114b5f724d02789c8e3ee10) ) ROM_LOAD( "kj-8.bin", 0x8000, 0x4000, CRC(e057e72a) SHA1(3a85750c72caaa027f302dc6ca4086bdbd49b5ff) ) ROM_REGION( 0x420, "proms", 0 ) - ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) /* tile red */ - ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) /* tile green */ - ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) /* tile blue */ - ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) /* sprite palette */ - ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) /* sprite clut */ + ROM_LOAD( "kjclr1.bin", 0x000, 0x100, CRC(c3378ac2) SHA1(264fdc0718b36e02fc1fc1064a9566e349f4bf25) ) // tile red + ROM_LOAD( "kjclr2.bin", 0x100, 0x100, CRC(2126da97) SHA1(6ca394a5977fab72200a00716a1f25f2a9447896) ) // tile green + ROM_LOAD( "kjclr3.bin", 0x200, 0x100, CRC(fde62164) SHA1(d0f6b8d0dce63ce592a5f0c9dc8e6260f69a9141) ) // tile blue + ROM_LOAD( "kjprom5.bin", 0x300, 0x020, CRC(5a81dd9f) SHA1(090ec9135b12e85ed02ab71fca55cc8d1ea8215a) ) // sprite palette + ROM_LOAD( "kjprom4.bin", 0x320, 0x100, CRC(48dc2066) SHA1(b8007a5115d475b535284965681ae341f819d3db) ) // sprite clut ROM_END +} // anonymous namespace GAME( 1985, kncljoe, 0, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "Seibu Kaihatsu (Taito license)", "Knuckle Joe (set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, kncljoea, kncljoe, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "Seibu Kaihatsu (Taito license)", "Knuckle Joe (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, bcrusher, kncljoe, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "bootleg", "Bone Crusher", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, bcrusher, kncljoe, kncljoe, kncljoe, kncljoe_state, empty_init, ROT0, "bootleg", "Bone Crusher", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/kncljoe.h b/src/mame/seibu/kncljoe.h deleted file mode 100644 index 7b8a0ffbc18..00000000000 --- a/src/mame/seibu/kncljoe.h +++ /dev/null @@ -1,88 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi -/************************************************************************* - - Knuckle Joe - -*************************************************************************/ - -#ifndef MAME_SEIBU_KNCLJOE_H -#define MAME_SEIBU_KNCLJOE_H - -#pragma once - -#include "cpu/m6800/m6801.h" -#include "machine/gen_latch.h" -#include "sound/ay8910.h" - -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class kncljoe_state : public driver_device -{ -public: - kncljoe_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_scrollregs(*this, "scrollregs"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_ay8910(*this, "aysnd"), - m_soundlatch(*this, "soundlatch") - { } - - void kncljoe(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scrollregs; - required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - int m_tile_bank = 0; - int m_sprite_bank = 0; - int m_flipscreen = 0; - - /* misc */ - uint8_t m_port1 = 0U; - uint8_t m_port2 = 0U; - - /* devices */ - required_device m_maincpu; - required_device m_soundcpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_ay8910; - required_device m_soundlatch; - - void sound_cmd_w(uint8_t data); - void sound_irq_ack_w(uint8_t data); - void kncljoe_videoram_w(offs_t offset, uint8_t data); - void kncljoe_control_w(uint8_t data); - void kncljoe_scroll_w(offs_t offset, uint8_t data); - void m6803_port1_w(uint8_t data); - void m6803_port2_w(uint8_t data); - uint8_t m6803_port1_r(); - uint8_t m6803_port2_r(); - void unused_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void kncljoe_palette(palette_device &palette) const; - uint32_t screen_update_kncljoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(sound_nmi); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void main_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_SEIBU_KNCLJOE_H diff --git a/src/mame/seibu/kncljoe_v.cpp b/src/mame/seibu/kncljoe_v.cpp deleted file mode 100644 index f7e9bf8386f..00000000000 --- a/src/mame/seibu/kncljoe_v.cpp +++ /dev/null @@ -1,214 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ernesto Corvi -/*************************************************************************** - - Knuckle Joe - -***************************************************************************/ - -#include "emu.h" -#include "kncljoe.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - -***************************************************************************/ - -void kncljoe_state::kncljoe_palette(palette_device &palette) const -{ - uint8_t const *color_prom = memregion("proms")->base(); - - // create a lookup table for the palette - for (int i = 0; i < 0x80; i++) - { - int const r = pal4bit(color_prom[i + 0x000]); - int const g = pal4bit(color_prom[i + 0x100]); - int const b = pal4bit(color_prom[i + 0x200]); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - for (int i = 0; i < 0x10; i++) - { - int bit0, bit1, bit2; - - // red component - bit0 = 0; - bit1 = BIT(color_prom[i + 0x300], 6); - bit2 = BIT(color_prom[i + 0x300], 7); - int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // green component - bit0 = BIT(color_prom[i + 0x300], 3); - bit1 = BIT(color_prom[i + 0x300], 4); - bit2 = BIT(color_prom[i + 0x300], 5); - int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // blue component - bit0 = BIT(color_prom[i + 0x300], 0); - bit1 = BIT(color_prom[i + 0x300], 1); - bit2 = BIT(color_prom[i + 0x300], 2); - int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - palette.set_indirect_color(i + 0x80, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x320; - - // chars - for (int i = 0; i < 0x80; i++) - palette.set_pen_indirect(i, i); - - // sprite lookup table - for (int i = 0; i < 0x80; i++) - { - uint8_t const ctabentry = (color_prom[i] & 0x0f) | 0x80; - palette.set_pen_indirect(i + 0x80, ctabentry); - } -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(kncljoe_state::get_bg_tile_info) -{ - int attr = m_videoram[2 * tile_index + 1]; - int code = m_videoram[2 * tile_index] + ((attr & 0xc0) << 2) + (m_tile_bank << 10); - - tileinfo.set(0, - code, - attr & 0xf, - TILE_FLIPXY((attr & 0x30) >> 4)); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void kncljoe_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(kncljoe_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_bg_tilemap->set_scroll_rows(4); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void kncljoe_state::kncljoe_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -void kncljoe_state::kncljoe_control_w(uint8_t data) -{ - /* - 0x01 screen flip - 0x02 coin counter#1 - 0x04 sprite bank - 0x10 character bank - 0x20 coin counter#2 - - reset when IN0 - Coin 1 goes low (active) - set after IN0 - Coin 1 goes high AND the credit has been added - */ - m_flipscreen = data & 0x01; - machine().tilemap().set_flip_all(m_flipscreen ? TILEMAP_FLIPX : TILEMAP_FLIPY); - - machine().bookkeeping().coin_counter_w(0, data & 0x02); - machine().bookkeeping().coin_counter_w(1, data & 0x20); - - if (m_tile_bank != BIT(data, 4)) - { - m_tile_bank = BIT(data, 4); - m_bg_tilemap->mark_all_dirty(); - } - - m_sprite_bank = BIT(data, 2); -} - -void kncljoe_state::kncljoe_scroll_w(offs_t offset, uint8_t data) -{ - m_scrollregs[offset] = data; - int scrollx = m_scrollregs[0] | m_scrollregs[1] << 8; - m_bg_tilemap->set_scrollx(0, scrollx); - m_bg_tilemap->set_scrollx(1, scrollx); - m_bg_tilemap->set_scrollx(2, scrollx); - m_bg_tilemap->set_scrollx(3, 0); -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -void kncljoe_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - gfx_element *gfx = m_gfxdecode->gfx(1 + m_sprite_bank); - - for (int i = 0; i < 4; i++) - { - // clip vertical strip for each layer - rectangle clip = cliprect; - clip.min_y = m_flipscreen ? (191 - i * 64) : (i * 64 + 1); - clip.max_y = clip.min_y + 63; - clip &= cliprect; - - for (int j = 0x7c; j >= 0; j -= 4) - { - int offs = bitswap<2>(~i, 0, 1) << 7 | j; - int sy = m_spriteram[offs] + 1; - int sx = m_spriteram[offs + 3]; - int attr = m_spriteram[offs + 1]; - int code = m_spriteram[offs + 2] | ((attr & 0x10) << 5) | ((attr & 0x20) << 3); - int flipx = attr & 0x40; - int flipy = !(attr & 0x80); - int color = attr & 0x0f; - - if (m_flipscreen) - { - flipx = !flipx; - flipy = !flipy; - sx = 240 - sx; - sy = 240 - sy; - } - - if (sx >= 256-8) - sx -= 256; - - gfx->transpen(bitmap,clip, - code, - color, - flipx,flipy, - sx,sy,0); - } - } -} - -uint32_t kncljoe_state::screen_update_kncljoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect); - return 0; -} diff --git a/src/mame/seibu/stfight.cpp b/src/mame/seibu/stfight.cpp index b50d9fb96ca..0697caf216c 100644 --- a/src/mame/seibu/stfight.cpp +++ b/src/mame/seibu/stfight.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Mark McDougall +// copyright-holders: Mark McDougall + /***************************** (by Mark McDougall) *** STREET FIGHT hardware *** This has been adapted from the excellent ***************************** Psychic 5 description (by Roberto Ventura) @@ -31,7 +32,7 @@ Screen resolution is 256x224 (horizontal CRT). 1) ROM CONTENTS. SF01 Main program code (encrypted) -SF02 Main program code bank-switched? into main cpu space +SF02 Main program code bank-switched? into main CPU space SF03 Sound program code SF04 ADPCM voice data SF05-07 Foreground tile pixel data @@ -43,10 +44,10 @@ SF16 Background map/tile data SF17 Character pixel data SF18-21 Sprite pixel data -All ROMS are 32K except SF17 which is 8K. +All ROMs are 32K except SF17 which is 8K. Graphics format is a little messy, the 4 planes come from a bit in -the high and low nibble of each byte of a consecutive pair of roms. +the high and low nibble of each byte of a consecutive pair of ROMs. All graphics are made of 16x16 (composite) tiles, each of which is composed of 4 consecutive 8x8 tiles. In all there are 1024 composite (16x16) tiles @@ -226,13 +227,13 @@ The top and bottom rows of the screen are not visible - resulting in a 256x224 viewport rather than 256 square. The layers can be individually enabled/disabled. Inactive sprites are 'parked' at row 0. -The rom layout for the foreground and sprite tiles are as you would expect, +The ROM layout for the foreground and sprite tiles are as you would expect, with the four 8x8 tiles that make a single composite tile consecutive in address. The background tiles are interleaved for presumably some good reason, the first two 8x8 tiles from composite tile n are followed by two 8x8 tiles from the (n+512)'th composite tile. -The map roms are similarly interleaved for the background layer only. +The map ROMs are similarly interleaved for the background layer only. 7) SPRITES @@ -244,11 +245,11 @@ conventional RAM. See the memory map for sprite data format. TODO: - handle transparency in text layer properly (how?) -- second bank of sf02 is this used? (probably NOT) +- is the second bank of sf02 used? (probably NOT) - empcity/stfight never writes the YM2203s' divider registers but it expects 0x2f, there's a workaround for it in the driver init - if empcity turns out to really be a bootleg, maybe it doesn't have an MCU, - and instead does the ADPCM with the audiocpu? (see the driver notes above + and instead does the ADPCM with the audio CPU? (see the driver notes above mentioning an unused NMI handler) - Each version of empcity/stfight has a different protection code stored in the MCU (at $1D2) so each 68705 will need to be dumped. @@ -264,18 +265,297 @@ TODO: *****************************************************************************/ #include "emu.h" -#include "stfight.h" +#include "airraid_dev.h" +#include "stfight_dev.h" + +#include "cpu/m6805/m68705.h" #include "cpu/z80/z80.h" +#include "sound/msm5205.h" #include "sound/ymopn.h" #include "speaker.h" +namespace { + +class stfight_state : public driver_device +{ +public: + stfight_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_mcu(*this, "mcu") + , m_msm(*this, "msm") + , m_ym(*this, "ym%u", 0) + , m_main_bank(*this, "mainbank") + , m_samples(*this, "adpcm") + , m_decrypted_opcodes(*this, "decrypted_opcodes") + , m_coin_mech(*this, "COIN") + , m_coin_state(0) + , m_fm_data(0) + , m_cpu_to_mcu_empty(true) + , m_cpu_to_mcu_data(0x0f) + , m_port_a_out(0xff) + , m_port_c_out(0xff) + , m_vck2(false) + , m_adpcm_reset(true) + , m_adpcm_data_offs(0x0000) + { + } + + void stfight_base(machine_config &config); + void stfight(machine_config &config); + void cshooter(machine_config &config); + + void init_stfight(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_mcu; + required_device m_msm; + required_device_array m_ym; + + required_memory_bank m_main_bank; + + required_region_ptr m_samples; + optional_shared_ptr m_decrypted_opcodes; + + required_ioport m_coin_mech; + + uint8_t m_coin_state = 0; + + uint8_t m_fm_data = 0; + + bool m_cpu_to_mcu_empty = false; + uint8_t m_cpu_to_mcu_data = 0; + uint8_t m_port_a_out = 0; + uint8_t m_port_c_out = 0; + + bool m_vck2 = false; + bool m_adpcm_reset = false; + uint16_t m_adpcm_data_offs = 0; + + emu_timer *m_int1_timer = nullptr; + + void adpcm_int(int state); + + void io_w(uint8_t data); + uint8_t coin_r(); + void coin_w(uint8_t data); + void fm_w(uint8_t data); + void mcu_w(uint8_t data); + + void cshooter_bank_w(uint8_t data); + + uint8_t fm_r(); + + INTERRUPT_GEN_MEMBER(vb_interrupt); + TIMER_CALLBACK_MEMBER(rst08_tick); + + // MCU specifics + uint8_t _68705_port_b_r(); + void _68705_port_a_w(uint8_t data); + void _68705_port_b_w(uint8_t data); + void _68705_port_c_w(uint8_t data); + + void cpu1_map(address_map &map); + void cpu2_map(address_map &map); + void cshooter_cpu1_map(address_map &map); + void decrypted_opcodes_map(address_map &map); + void stfight_cpu1_map(address_map &map); +}; + + +void stfight_state::machine_start() +{ + m_main_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); + m_main_bank->set_entry(0); + + m_int1_timer = timer_alloc(FUNC(stfight_state::rst08_tick), this); + + save_item(NAME(m_coin_state)); + save_item(NAME(m_fm_data)); + + save_item(NAME(m_cpu_to_mcu_empty)); + save_item(NAME(m_cpu_to_mcu_data)); + save_item(NAME(m_port_a_out)); + save_item(NAME(m_port_c_out)); + + save_item(NAME(m_vck2)); + save_item(NAME(m_adpcm_reset)); + save_item(NAME(m_adpcm_data_offs)); +} + + +void stfight_state::machine_reset() +{ + m_fm_data = 0; + m_cpu_to_mcu_empty = true; + m_adpcm_reset = true; + + // Coin signals are active low + m_coin_state = 3; +} + +// It's entirely possible that this bank is never switched out +// - in fact I don't even know how/where it's switched in! +void stfight_state::cshooter_bank_w(uint8_t data) +{ + m_main_bank->set_entry(bitswap(data, 7, 2)); +} + +/* + * CPU 1 timed interrupt - 60Hz??? + */ + +TIMER_CALLBACK_MEMBER(stfight_state::rst08_tick) +{ + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 +} + +INTERRUPT_GEN_MEMBER(stfight_state::vb_interrupt) +{ + // Do a RST10 + device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 + m_int1_timer->adjust(attotime::from_hz(120)); +} + +/* + * Hardware handlers + */ + +void stfight_state::io_w(uint8_t data) +{ + // TODO: What is bit 4? + machine().bookkeeping().coin_counter_w(0, data & 1); + machine().bookkeeping().coin_counter_w(1, data & 2); +} + +uint8_t stfight_state::coin_r() +{ + return m_coin_state; +} + +void stfight_state::coin_w(uint8_t data) +{ + // Acknowledge coin signals (active low) + if (!BIT(data, 0)) + m_coin_state |= 1; + + if (!BIT(data, 1)) + m_coin_state |= 2; +} + +/* + * Machine hardware for MSM5205 ADPCM sound control + */ + +void stfight_state::adpcm_int(int state) +{ + if (!state) + return; + + // Falling edge triggered interrupt at half the rate of /VCK? + m_mcu->set_input_line(M68705_IRQ_LINE, m_vck2 ? ASSERT_LINE : CLEAR_LINE); + m_vck2 = !m_vck2; + + if (!m_adpcm_reset) + { + uint8_t adpcm_data = m_samples[(m_adpcm_data_offs >> 1) & 0x7fff]; + + if (!BIT(m_adpcm_data_offs, 0)) + adpcm_data >>= 4; + ++m_adpcm_data_offs; + + m_msm->data_w(adpcm_data & 0x0f); + } +} + + +/* + * Machine hardware for YM2303 FM sound control + */ + +void stfight_state::fm_w(uint8_t data) +{ + // The sound CPU ignores any FM data without bit 7 set + m_fm_data = 0x80 | data; +} + +uint8_t stfight_state::fm_r() +{ + uint8_t const data = m_fm_data; + + // Acknowledge the command + if (!machine().side_effects_disabled()) + m_fm_data &= ~0x80; + + return data; +} + + +/* + * MCU communications + */ + +void stfight_state::mcu_w(uint8_t data) +{ + m_cpu_to_mcu_data = data & 0x0f; + m_cpu_to_mcu_empty = false; +} + +void stfight_state::_68705_port_a_w(uint8_t data) +{ + m_port_a_out = data; +} + +uint8_t stfight_state::_68705_port_b_r() +{ + return + (m_coin_mech->read() << 6) | + (m_cpu_to_mcu_empty ? 0x10 : 0x00) | + (m_cpu_to_mcu_data & 0x0f); +} + +void stfight_state::_68705_port_b_w(uint8_t data) +{ + // Acknowledge Z80 command + if (!BIT(data, 5)) + m_cpu_to_mcu_empty = true; +} + +void stfight_state::_68705_port_c_w(uint8_t data) +{ + // Signal a valid coin on the falling edge + if (BIT(m_port_c_out, 0) && !BIT(data, 0)) + m_coin_state &= ~1; + if (BIT(m_port_c_out, 1) && !BIT(data, 1)) + m_coin_state &= ~2; + + // Latch ADPCM data address when dropping the reset line + m_adpcm_reset = BIT(data, 2); + if (!m_adpcm_reset && BIT(m_port_c_out, 2)) + m_adpcm_data_offs = m_port_a_out << 9; + m_msm->reset_w(m_adpcm_reset ? ASSERT_LINE : CLEAR_LINE); + + // Generate NMI on host CPU (used on handshake error or stuck coin) + m_maincpu->set_input_line(INPUT_LINE_NMI, BIT(data, 3) ? CLEAR_LINE : ASSERT_LINE); + + m_port_c_out = data; +} + + void stfight_state::cpu1_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("mainbank"); /* sf02.bin */ + map(0x8000, 0xbfff).bankr(m_main_bank); // sf02.bin map(0xc000, 0xc0ff).ram().w("palette", FUNC(palette_device::write8)).share("palette"); map(0xc100, 0xc1ff).ram().w("palette", FUNC(palette_device::write8_ext)).share("palette_ext"); map(0xc200, 0xc200).portr("P1"); @@ -283,12 +563,12 @@ void stfight_state::cpu1_map(address_map &map) map(0xc202, 0xc202).portr("START"); map(0xc203, 0xc203).portr("DSW0"); map(0xc204, 0xc204).portr("DSW1"); - map(0xc205, 0xc205).r(FUNC(stfight_state::stfight_coin_r)); - map(0xc500, 0xc500).w(FUNC(stfight_state::stfight_fm_w)); - map(0xc600, 0xc600).w(FUNC(stfight_state::stfight_mcu_w)); - map(0xc700, 0xc700).w(FUNC(stfight_state::stfight_coin_w)); - map(0xc804, 0xc804).w(FUNC(stfight_state::stfight_io_w)); - map(0xc806, 0xc806).nopw(); /* TBD */ + map(0xc205, 0xc205).r(FUNC(stfight_state::coin_r)); + map(0xc500, 0xc500).w(FUNC(stfight_state::fm_w)); + map(0xc600, 0xc600).w(FUNC(stfight_state::mcu_w)); + map(0xc700, 0xc700).w(FUNC(stfight_state::coin_w)); + map(0xc804, 0xc804).w(FUNC(stfight_state::io_w)); + map(0xc806, 0xc806).nopw(); // TBD map(0xe000, 0xefff).ram(); } @@ -304,14 +584,14 @@ void stfight_state::stfight_cpu1_map(address_map &map) void stfight_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0x7fff).rom().share("decrypted_opcodes"); + map(0x0000, 0x7fff).rom().share(m_decrypted_opcodes); } void stfight_state::cshooter_cpu1_map(address_map &map) { cpu1_map(map); - map(0xc801, 0xc801).w(FUNC(stfight_state::stfight_bank_w)); + map(0xc801, 0xc801).w(FUNC(stfight_state::cshooter_bank_w)); map(0xd000, 0xd7ff).ram().w("airraid_vid", FUNC(airraid_video_device::txram_w)).share("txram"); map(0xd800, 0xd80f).ram().w("airraid_vid", FUNC(airraid_video_device::vregs_w)).share("vregs"); // wrong? map(0xf000, 0xfdff).ram(); @@ -328,13 +608,13 @@ void stfight_state::cpu2_map(address_map &map) map(0xd000, 0xd000).nopr(); map(0xd800, 0xd800).nopw(); map(0xe800, 0xe800).nopw(); - map(0xf000, 0xf000).r(FUNC(stfight_state::stfight_fm_r)); + map(0xf000, 0xf000).r(FUNC(stfight_state::fm_r)); map(0xf800, 0xffff).ram(); } static INPUT_PORTS_START( stfight ) - PORT_START("P1") /* PLAYER 1 */ + PORT_START("P1") // PLAYER 1 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY @@ -344,7 +624,7 @@ static INPUT_PORTS_START( stfight ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P2") /* PLAYER 2 */ + PORT_START("P2") // PLAYER 2 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL @@ -354,13 +634,13 @@ static INPUT_PORTS_START( stfight ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("START") /* START BUTTONS */ + PORT_START("START") // START BUTTONS PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0xe7, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") /* DSW1 */ - /* Manual refers to these as Dip-Switch Bank B, but TEST mode shows them as DIP-SW 1 */ + PORT_START("DSW0") // DSW1 + // Manual refers to these as Dip-Switch Bank B, but TEST mode shows them as DIP-SW 1 PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) @@ -383,8 +663,8 @@ static INPUT_PORTS_START( stfight ) PORT_DIPSETTING( 0x00, "Red" ) PORT_DIPSETTING( 0x80, "Blue" ) - PORT_START("DSW1") /* DSWA */ - /* Manual refers to these as Dip-Switch Bank A, but TEST mode shows them as DIP-SW 2 */ + PORT_START("DSW1") // DSWA + // Manual refers to these as Dip-Switch Bank A, but TEST mode shows them as DIP-SW 2 PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) @@ -407,7 +687,7 @@ static INPUT_PORTS_START( stfight ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("COIN") /* COIN MECH */ + PORT_START("COIN") // COIN MECH PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) INPUT_PORTS_END @@ -415,7 +695,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( cshooter ) PORT_INCLUDE(stfight) - PORT_MODIFY("DSW0") /* DSW2 (0xc203) */ + PORT_MODIFY("DSW0") // DSW2 (0xc203) PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) @@ -434,7 +714,7 @@ static INPUT_PORTS_START( cshooter ) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) - PORT_MODIFY("DSW1") /* DSW1 (0xc204) */ + PORT_MODIFY("DSW1") // DSW1 (0xc204) PORT_DIPNAME( 0x01, 0x01, "Coin Slots" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, "1" ) PORT_DIPSETTING( 0x00, "2" ) @@ -459,26 +739,25 @@ INPUT_PORTS_END void stfight_state::stfight_base(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware Z80(config, m_maincpu, 12_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &stfight_state::cpu1_map); - m_maincpu->set_vblank_int("stfight_vid:screen", FUNC(stfight_state::stfight_vb_interrupt)); Z80(config, m_audiocpu, 12_MHz_XTAL / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &stfight_state::cpu2_map); m_audiocpu->set_periodic_int(FUNC(stfight_state::irq0_line_hold), attotime::from_hz(120)); M68705P5(config, m_mcu, 12_MHz_XTAL / 4); - m_mcu->portb_r().set(FUNC(stfight_state::stfight_68705_port_b_r)); - m_mcu->porta_w().set(FUNC(stfight_state::stfight_68705_port_a_w)); - m_mcu->portb_w().set(FUNC(stfight_state::stfight_68705_port_b_w)); - m_mcu->portc_w().set(FUNC(stfight_state::stfight_68705_port_c_w)); + m_mcu->portb_r().set(FUNC(stfight_state::_68705_port_b_r)); + m_mcu->porta_w().set(FUNC(stfight_state::_68705_port_a_w)); + m_mcu->portb_w().set(FUNC(stfight_state::_68705_port_b_w)); + m_mcu->portc_w().set(FUNC(stfight_state::_68705_port_c_w)); config.set_maximum_quantum(attotime::from_hz(600)); PALETTE(config, "palette").set_format(palette_device::xBRG_444, 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); YM2203(config, m_ym[0], 12_MHz_XTAL / 8); @@ -494,7 +773,7 @@ void stfight_state::stfight_base(machine_config &config) m_ym[1]->add_route(3, "mono", 0.10); MSM5205(config, m_msm, 384_kHz_XTAL); - m_msm->vck_callback().set(FUNC(stfight_state::stfight_adpcm_int)); // Interrupt function + m_msm->vck_callback().set(FUNC(stfight_state::adpcm_int)); // Interrupt function m_msm->set_prescaler_selector(msm5205_device::S48_4B); // 8KHz, 4-bit m_msm->add_route(ALL_OUTPUTS, "mono", 0.50); } @@ -504,7 +783,7 @@ void stfight_state::stfight(machine_config &config) stfight_base(config); m_maincpu->set_addrmap(AS_PROGRAM, &stfight_state::stfight_cpu1_map); m_maincpu->set_addrmap(AS_OPCODES, &stfight_state::decrypted_opcodes_map); - m_maincpu->set_vblank_int("stfight_vid:screen", FUNC(stfight_state::stfight_vb_interrupt)); + m_maincpu->set_vblank_int("stfight_vid:screen", FUNC(stfight_state::vb_interrupt)); STFIGHT_VIDEO(config, "stfight_vid", 0); } @@ -513,7 +792,7 @@ void stfight_state::cshooter(machine_config &config) { stfight_base(config); m_maincpu->set_addrmap(AS_PROGRAM, &stfight_state::cshooter_cpu1_map); - m_maincpu->set_vblank_int("airraid_vid:screen", FUNC(stfight_state::stfight_vb_interrupt)); + m_maincpu->set_vblank_int("airraid_vid:screen", FUNC(stfight_state::vb_interrupt)); AIRRAID_VIDEO(config, "airraid_vid", 0); } @@ -527,503 +806,504 @@ void stfight_state::cshooter(machine_config &config) // Is this a bootleg? The MCU protection check at $00A7 has been disabled ROM_START( empcity ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "ec_01.rom", 0x00000, 0x8000, CRC(fe01d9b1) SHA1(c4b62d1b7e3a062f6a7a75f49cce5712f9016f98) ) - ROM_LOAD( "ec_02.rom", 0x10000, 0x8000, CRC(b3cf1ef7) SHA1(91bc92293cbb47c38a2552c5beea53894b87d446) ) /* bank switched */ + ROM_LOAD( "ec_02.rom", 0x10000, 0x8000, CRC(b3cf1ef7) SHA1(91bc92293cbb47c38a2552c5beea53894b87d446) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "ec_04.rom", 0x0000, 0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityu_68705.3j", 0x0000, 0x0800, CRC(182f7616) SHA1(38b4f23a559ae13f8ca1b974407a2a40fc52879f) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) + + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END -/* set just contained the 3 roms cpu.4u, cpu.2u and vid.2p and the prom 82s123.a7 */ +// set just contained the 3 ROMs cpu.4u, cpu.2u and vid.2p and the PROM 82s123.a7 ROM_START( empcityu ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "cpu.4u", 0x00000, 0x8000, CRC(e2c40ea3) SHA1(fd3c21fe3b5faf323a16be54ad2eed23b12c977e) ) - ROM_LOAD( "cpu.2u", 0x10000, 0x8000, CRC(96ee8b81) SHA1(95b516c023766fae79241d4422814e39e268ae7d) ) /* bank switched */ + ROM_LOAD( "cpu.2u", 0x10000, 0x8000, CRC(96ee8b81) SHA1(95b516c023766fae79241d4422814e39e268ae7d) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "ec_04.rom", 0x0000, 0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityu_68705.3j", 0x0000, 0x0800, CRC(182f7616) SHA1(38b4f23a559ae13f8ca1b974407a2a40fc52879f) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "vid.2p", 0x0000, 0x2000, CRC(15593793) SHA1(ac9ca8a0aa0ce3810f45aa41e74d4946ecced245) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_REGION( 0x020, "user1", 0 ) - ROM_LOAD( "82s123.a7", 0x0000, 0x0020, CRC(93e2d292) SHA1(af8edd0cfe85f28ede9604cfaf4516d54e5277c9) ) /* ?*/ + ROM_LOAD( "82s123.a7", 0x0000, 0x0020, CRC(93e2d292) SHA1(af8edd0cfe85f28ede9604cfaf4516d54e5277c9) ) // ? ROM_END ROM_START( empcityj ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "1.bin", 0x00000, 0x8000, CRC(8162331c) SHA1(f2fdf5fbc52d4ea692fb87fa049c48935a73d67b) ) // sldh - ROM_LOAD( "2.bin", 0x10000, 0x8000, CRC(960edea6) SHA1(fd19475e841defe42625a94c40c6390b7e6e7682) ) /* bank switched */ // sldh + ROM_LOAD( "2.bin", 0x10000, 0x8000, CRC(960edea6) SHA1(fd19475e841defe42625a94c40c6390b7e6e7682) ) // bank switched // sldh - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "ec_04.rom", 0x0000, 0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityj_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(19bdb0a9) SHA1(6baba9a46d64ae8349c7e9713419141f76a7af96) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( stfight ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "a-1.4q", 0x00000, 0x8000, CRC(ff83f316) SHA1(84553ebd96ddbf59a1bcb221d53781980a006925) ) - ROM_LOAD( "sf02.bin", 0x10000, 0x8000, CRC(e626ce9e) SHA1(2c6c5a5cf15cc50217c9864a4d861af8a1b1b5ad) ) /* bank switched */ + ROM_LOAD( "sf02.bin", 0x10000, 0x8000, CRC(e626ce9e) SHA1(2c6c5a5cf15cc50217c9864a4d861af8a1b1b5ad) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "sf03.bin", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) - ROM_LOAD( "stfight_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) + ROM_LOAD( "_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END -/* not sure if this is a bootleg or not, it still displays the seibu copyright on a screen during the attract mode +/* not sure if this is a bootleg or not, it still displays the Seibu copyright on a screen during the attract mode but not during the initial startup, must investigate this set more later */ ROM_START( stfighta ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ - ROM_LOAD( "sfight2.bin", 0x00000, 0x8000, CRC(8fb4dfc9) SHA1(0350f4a8749883a4e2e9c4aed2447a64a078f9ce) )// 2.bin 58.532715% - ROM_LOAD( "sfight1.bin", 0x10000, 0x8000, CRC(983ce746) SHA1(3c7b9498f1adf253ba651558ee40641ec3dbc5eb) )/* bank switched */ // a-1.4q 99.737549% + ROM_REGION( 2*0x18000, "maincpu", 0 ) + ROM_LOAD( "sfight2.bin", 0x00000, 0x8000, CRC(8fb4dfc9) SHA1(0350f4a8749883a4e2e9c4aed2447a64a078f9ce) ) // 2.bin 58.532715% + ROM_LOAD( "sfight1.bin", 0x10000, 0x8000, CRC(983ce746) SHA1(3c7b9498f1adf253ba651558ee40641ec3dbc5eb) ) // bank switched // a-1.4q 99.737549% - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "sf03.bin", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) - ROM_LOAD( "stfight_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) + ROM_LOAD( "_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(f4cc50d6) SHA1(2ff62a349b74fa965b5d19615e52b867c04988dc) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( empcityi ) // very similar to above set - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "1.bin", 0x00000, 0x8000, CRC(32378e47) SHA1(1194e5a6b77ee754450ce532e048a55cf48d416c) ) ROM_LOAD( "2.bin", 0x10000, 0x8000, CRC(d20010c6) SHA1(8f30b385cbe733a4256461ab6f4aa82bc6694a6e) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "sf03.bin", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityi_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(b1817d44) SHA1(395aad763eb054514f658a14c12b92c1b90c02ce) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( empcityfr ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "pr.4t", 0x00000, 0x8000, CRC(aa1f84ac) SHA1(b484b85270091511860f5b4041099c5335ff1204) ) ROM_LOAD( "pr.2t", 0x10000, 0x8000, CRC(af381247) SHA1(93812d6b6a2dead07670b789597d23f29b8f0c5d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "092-5c", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "empcityfr_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(d66ac61f) SHA1(5f44d69886d4db46f2e4c07ebdf01e337ee4fd35) ) - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "115.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "116.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "113.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "114.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "109.4j", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "110.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "097.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "108.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "095.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "096.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "093.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "094.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "117.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "118.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "111.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "112.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "091.5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END ROM_START( stfightgb ) - ROM_REGION( 2*0x18000, "maincpu", 0 ) /* 96k for code + 96k for decrypted opcodes */ + ROM_REGION( 2*0x18000, "maincpu", 0 ) ROM_LOAD( "1.4t", 0x00000, 0x8000, CRC(0ce5ca11) SHA1(f753107a0c4ce52fe761ea2edce4c5e96169dfbd) ) - ROM_LOAD( "2.2t", 0x10000, 0x8000, CRC(936ba873) SHA1(bab519c587692a44a9cd1e9af2aeb7e3347c3f1b) ) /* bank switched */ + ROM_LOAD( "2.2t", 0x10000, 0x8000, CRC(936ba873) SHA1(bab519c587692a44a9cd1e9af2aeb7e3347c3f1b) ) // bank switched - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the second CPU */ + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "c5", 0x0000, 0x8000, CRC(6a8cb7a6) SHA1(dc123cc48d3623752b78e7c23dd8d2f5adf84f92) ) ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "stfightgb_68705.3j", 0x0000, 0x0800, BAD_DUMP CRC(3b1b2660) SHA1(8d5d853a0861ff9cdea27eb3588586b441cc77b1) ) //hand-crafted, to be dumped - ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) /* character data */ + ROM_REGION( 0x02000, "stfight_vid:tx_gfx", 0 ) ROM_LOAD( "17.2n", 0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) ) - ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) /* foreground tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:fg_gfx", 0 ) ROM_LOAD( "7.4c", 0x10000, 0x8000, CRC(2c6caa5f) SHA1(f6893cb87004979ead331897c684f995f850447e) ) ROM_LOAD( "8.5c", 0x18000, 0x8000, CRC(e11ded31) SHA1(e3e634ad324d51e52d79dd79e5e6e5697cb8d21f) ) ROM_LOAD( "5.2c", 0x00000, 0x8000, CRC(0c099a31) SHA1(dabaf8edc59e4954941cd8176031a358f45a1956) ) ROM_LOAD( "6.3c", 0x08000, 0x8000, CRC(3cc77c31) SHA1(13d2324df5a322d499c9959a6bb3a844edaefb45) ) - ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) /* background tile pixel data */ + ROM_REGION( 0x20000, "stfight_vid:bg_gfx", 0 ) ROM_LOAD( "13.4c", 0x10000, 0x8000, CRC(0ae48dd3) SHA1(ca3d9aeb9f4343c379cef9282e408fbf8aa67d99) ) ROM_LOAD( "14.5j", 0x18000, 0x8000, CRC(debf5d76) SHA1(eb18c35166eb5f93be98b3c30c7d909c0a68eada) ) ROM_LOAD( "11.2j", 0x00000, 0x8000, CRC(8261ecfe) SHA1(5817f4a0458a949298414fe09c86bbcf50be52f3) ) ROM_LOAD( "12.3j", 0x08000, 0x8000, CRC(71137301) SHA1(087a9f401939bc30f1dafa9916e8d8c564595a57) ) - ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) /* sprite data */ + ROM_REGION( 0x20000, "stfight_vid:spr_gfx", 0 ) ROM_LOAD( "20.8w", 0x10000, 0x8000, CRC(8299f247) SHA1(71891f7b1fbfaed14c3854b7f6e10a3ddb4bd479) ) ROM_LOAD( "21.9w", 0x18000, 0x8000, CRC(b57dc037) SHA1(69ac79a95ba9ace7c9ca7af480a4a10176be5ace) ) ROM_LOAD( "18.6w", 0x00000, 0x8000, CRC(68acd627) SHA1(f98ff9ccb0913711079a2988e8dd08695fb5e107) ) ROM_LOAD( "19.7w", 0x08000, 0x8000, CRC(5170a057) SHA1(9222f9febc222fa0c2eead258ad77c857f6d40c8) ) - ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) /* foreground map data */ + ROM_REGION( 0x10000, "stfight_vid:fg_map", 0 ) ROM_LOAD( "9.7c", 0x00000, 0x8000, CRC(8ceaf4fe) SHA1(5698f2ff44c109825b8d9d0b6dd2426624df668b) ) ROM_LOAD( "10.8c", 0x08000, 0x8000, CRC(5a1a227a) SHA1(24928ab218824ae1f5380398ceb90dcad525cc08) ) - ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) /* background map data */ + ROM_REGION( 0x10000, "stfight_vid:bg_map", 0 ) ROM_LOAD( "15.7j", 0x00000, 0x8000, CRC(27a310bc) SHA1(dd30d72bc33b0bf7ddaf3ab730e028f51b20152a) ) ROM_LOAD( "16.8j", 0x08000, 0x8000, CRC(3d19ce18) SHA1(38f691a23c96ef672637965c1a13f6d1595f9d51) ) ROM_REGION( 0x0100, "stfight_vid:tx_clut", 0 ) - ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) /* text lookup table */ + ROM_LOAD( "82s129.006", 0x0000, 0x0100, CRC(f9424b5b) SHA1(e3bc23213406d35d54f1221f17f25d433df273a2) ) ROM_REGION( 0x0100, "stfight_vid:fg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) /* fg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.002", 0x0000, 0x0100, CRC(c883d49b) SHA1(e84900ccf6f27e5043e43c0d85ea1e4eee7e52d3) ) ROM_LOAD_NIB_LOW( "82s129.003", 0x0000, 0x0100, CRC(af81882a) SHA1(b1008c991bd8d1157b3479e465ab286c70418b58) ) ROM_REGION( 0x0100, "stfight_vid:bg_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) /* bg lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.004", 0x0000, 0x0100, CRC(1831ce7c) SHA1(57afbee9225f0efd63895a5f522e96dc87ca2616) ) ROM_LOAD_NIB_LOW( "82s129.005", 0x0000, 0x0100, CRC(96cb6293) SHA1(1dcdeaa995e6ffa3753b742842c5ffe0f68ef8cd) ) ROM_REGION( 0x0100, "stfight_vid:spr_clut", 0 ) - ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) /* sprite lookup table */ + ROM_LOAD_NIB_HIGH( "82s129.052", 0x0000, 0x0100, CRC(3d915ffc) SHA1(921be6d5e5fc0fdee9c9f545c1c4a0c334e9844c) ) ROM_LOAD_NIB_LOW( "82s129.066", 0x0000, 0x0100, CRC(51e8832f) SHA1(ed8c00559e7a02bb8c11861d747c8c64c01b7437) ) ROM_REGION( 0x0800, "proms", 0 ) - ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* timing? (not used) */ + ROM_LOAD( "82s129.015", 0x0700, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // timing? (not used) - ROM_REGION( 0x08000, "adpcm", 0 ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", 0 ) ROM_LOAD( "5j", 0x00000, 0x8000, CRC(1b8d0c07) SHA1(c163ccd2b7ed6c84facc075eb1564ca399f3ba17) ) ROM_END @@ -1073,16 +1353,16 @@ See airraid.cpp for notes about custom modules */ ROM_START( cshootert ) - ROM_REGION( 0x20000, "maincpu", 0 ) // Main CPU + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "r1.4u", 0x00000, 0x08000, CRC(fbe8c518) SHA1(bff8319f4892e6d06f1c7a679f67dc8407279cfa) ) ROM_LOAD( "r2.2u", 0x10000, 0x10000, CRC(5ddf9f4e) SHA1(69e4d422ca272bf2e9f00edbe7d23760485fdfe6) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) // Sub/Sound CPU + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "r4.5c", 0x00000, 0x08000, CRC(84fed017) SHA1(9a564c9379eb48569cfba48562889277991864d8) ) - ROM_REGION( 0x08000, "adpcm", ROMREGION_ERASEFF ) /* ADPCM voice data */ + ROM_REGION( 0x08000, "adpcm", ROMREGION_ERASEFF ) - ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */ + ROM_REGION( 0x0800, "mcu", 0 ) ROM_LOAD( "crshooter.3j", 0x0000, 0x0800, CRC(aae61ce7) SHA1(bb2b9887ec73a5b82604b9b64c533c2242d20d0f) ) ROM_REGION( 0x820, "proms", 0 ) @@ -1092,13 +1372,13 @@ ROM_START( cshootert ) // below are from the video board - ROM_REGION( 0x02000, "airraid_vid:tx_gfx", 0 ) // TX Layer + ROM_REGION( 0x02000, "airraid_vid:tx_gfx", 0 ) ROM_LOAD( "r3.11a", 0x00000, 0x02000, CRC(67b50a47) SHA1(b1f4aefc9437edbeefba5371149cc08c0b55c741) ) ROM_REGION( 0x100, "airraid_vid:tx_clut", 0 ) - ROM_LOAD( "63s281.16a", 0x0000, 0x0100, CRC(0b8b914b) SHA1(8cf4910b846de79661cc187887171ed8ebfd6719) ) // clut + ROM_LOAD( "63s281.16a", 0x0000, 0x0100, CRC(0b8b914b) SHA1(8cf4910b846de79661cc187887171ed8ebfd6719) ) - /* ### MODULE 1 ### Background generation / graphics */ + // ### MODULE 1 ### Background generation / graphics ROM_REGION( 0x40000, "airraid_vid:bg_map", 0 ) ROM_LOAD16_BYTE( "bg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "bg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -1108,7 +1388,7 @@ ROM_START( cshootert ) ROM_REGION( 0x100, "airraid_vid:bg_clut", 0 ) ROM_LOAD( "bg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 2 ### Foreground generation / graphics */ + // ### MODULE 2 ### Foreground generation / graphics ROM_REGION( 0x40000, "airraid_vid:fg_map", 0 ) ROM_LOAD16_BYTE( "fg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "fg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -1118,7 +1398,7 @@ ROM_START( cshootert ) ROM_REGION( 0x100, "airraid_vid:fg_clut", 0 ) ROM_LOAD( "fg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 3 ### Sprite graphics */ + // ### MODULE 3 ### Sprite graphics ROM_REGION( 0x40000, "airraid_vid:spr_gfx", 0 ) ROM_LOAD16_BYTE( "sprite_tiles_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "sprite_tiles_odd", 0x00001, 0x20000, NO_DUMP ) @@ -1127,6 +1407,59 @@ ROM_START( cshootert ) ROM_END +/* + +Encryption PAL 16R4 on CPU board + + +---U---+ + CP --| |-- VCC + ROM D1 --| |-- ROM D0 M1 = 0 M1 = 1 + ROM D3 --| |-- (NC) + ROM D4 --| |-- D6 D6 = D1 ^^ D3 D6 = / ( D1 ^^ D0 ) + ROM D6 --| |-- D4 D4 = / ( D6 ^^ A7 ) D4 = D3 ^^ A0 + A0 --| |-- D3 D3 = / ( D0 ^^ A1 ) D3 = D4 ^^ A4 + A1 --| |-- D0 D0 = D1 ^^ D4 D0 = / ( D6 ^^ A0 ) + A4 --| |-- (NC) + A7 --| |-- /M1 + GND --| |-- /OE + +-------+ + +*/ + + +void stfight_state::init_stfight() +{ + uint8_t *rom = memregion("maincpu")->base(); + + for (uint32_t A = 0; A < 0x8000; ++A) + { + uint8_t src = rom[A]; + + // decode opcode + m_decrypted_opcodes[A] = + ( src & 0xa6 ) | + ( ( ( ( src << 2 ) ^ src ) << 3 ) & 0x40 ) | + ( ~( ( src ^ ( A >> 1 ) ) >> 2 ) & 0x10 ) | + ( ~( ( ( src << 1 ) ^ A ) << 2 ) & 0x08 ) | + ( ( ( src ^ ( src >> 3 ) ) >> 1 ) & 0x01 ); + + // decode operand + rom[A] = + ( src & 0xa6 ) | + ( ~( ( src ^ ( src << 1 ) ) << 5 ) & 0x40 ) | + ( ( ( src ^ ( A << 3 ) ) << 1 ) & 0x10 ) | + ( ( ( src ^ A ) >> 1 ) & 0x08 ) | + ( ~( ( src >> 6 ) ^ A ) & 0x01 ); + } + + // Set clock prescaler FM:1/2 PSG:1/1 + m_ym[0]->write(0, 0x2f); + m_ym[1]->write(0, 0x2f); +} + +} // anonymous namespace + + // Note: Marked MACHINE_IMPERFECT_SOUND due to YM2203 clock issue GAME( 1986, empcity, 0, stfight, stfight, stfight_state, init_stfight, ROT0, "Seibu Kaihatsu", "Empire City: 1931 (bootleg?)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1986, empcityu, empcity, stfight, stfight, stfight_state, init_stfight, ROT0, "Seibu Kaihatsu (Taito / Romstar license)", "Empire City: 1931 (US)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // different title logo @@ -1138,4 +1471,4 @@ GAME( 1986, stfighta, empcity, stfight, stfight, stfight_state, init_stfight, GAME( 1986, stfightgb, empcity, stfight, stfight, stfight_state, init_stfight, ROT0, "Seibu Kaihatsu (Tuning license)", "Street Fight (Germany - Benelux)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // Cross Shooter uses the same base board, but different video board -GAME( 1987, cshootert, airraid, cshooter, cshooter, stfight_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Cross Shooter (2 PCB Stack)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, cshootert, airraid, cshooter, cshooter, stfight_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Cross Shooter (2 PCB Stack)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/stfight.h b/src/mame/seibu/stfight.h deleted file mode 100644 index 08d28e4d728..00000000000 --- a/src/mame/seibu/stfight.h +++ /dev/null @@ -1,108 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Mark McDougall -#ifndef MAME_SEIBU_STFIGHT_H -#define MAME_SEIBU_STFIGHT_H - -#pragma once - -#include "cpu/m6805/m68705.h" -#include "sound/ymopn.h" -#include "sound/msm5205.h" -#include "stfight_dev.h" -#include "airraid_dev.h" - -class stfight_state : public driver_device -{ -public: - stfight_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_coin_mech(*this, "COIN") - , m_maincpu(*this, "maincpu") - , m_audiocpu(*this, "audiocpu") - , m_mcu(*this, "mcu") - , m_msm(*this, "msm") - , m_ym(*this, "ym%u", 0) - , m_main_bank(*this, "mainbank") - , m_samples(*this, "adpcm") - , m_decrypted_opcodes(*this, "decrypted_opcodes") - , m_coin_state(0) - , m_fm_data(0) - , m_cpu_to_mcu_empty(true) - , m_cpu_to_mcu_data(0x0f) - , m_port_a_out(0xff) - , m_port_c_out(0xff) - , m_vck2(false) - , m_adpcm_reset(true) - , m_adpcm_data_offs(0x0000) - { - } - - void stfight_base(machine_config &config); - void stfight(machine_config &config); - void cshooter(machine_config &config); - - void init_stfight(); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - TIMER_CALLBACK_MEMBER(rst08_tick); - -private: - void stfight_adpcm_int(int state); - - void stfight_io_w(uint8_t data); - uint8_t stfight_coin_r(); - void stfight_coin_w(uint8_t data); - void stfight_fm_w(uint8_t data); - void stfight_mcu_w(uint8_t data); - - void stfight_bank_w(uint8_t data); - - uint8_t stfight_fm_r(); - - INTERRUPT_GEN_MEMBER(stfight_vb_interrupt); - - // MCU specifics - uint8_t stfight_68705_port_b_r(); - void stfight_68705_port_a_w(uint8_t data); - void stfight_68705_port_b_w(uint8_t data); - void stfight_68705_port_c_w(uint8_t data); - - void cpu1_map(address_map &map); - void cpu2_map(address_map &map); - void cshooter_cpu1_map(address_map &map); - void decrypted_opcodes_map(address_map &map); - void stfight_cpu1_map(address_map &map); - - required_ioport m_coin_mech; - - required_device m_maincpu; - required_device m_audiocpu; - required_device m_mcu; - required_device m_msm; - required_device_array m_ym; - - required_memory_bank m_main_bank; - - required_region_ptr m_samples; - optional_shared_ptr m_decrypted_opcodes; - - uint8_t m_coin_state = 0; - - uint8_t m_fm_data = 0; - - bool m_cpu_to_mcu_empty = false; - uint8_t m_cpu_to_mcu_data = 0; - uint8_t m_port_a_out = 0; - uint8_t m_port_c_out = 0; - - bool m_vck2 = false; - bool m_adpcm_reset = false; - uint16_t m_adpcm_data_offs = 0; - - emu_timer *m_int1_timer = nullptr; -}; - -#endif // MAME_SEIBU_STFIGHT_H diff --git a/src/mame/seibu/stfight_m.cpp b/src/mame/seibu/stfight_m.cpp deleted file mode 100644 index ab701c738ff..00000000000 --- a/src/mame/seibu/stfight_m.cpp +++ /dev/null @@ -1,246 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Mark McDougall -/*************************************************************************** - - stfight.c - - Functions to emulate general aspects of the machine (RAM, ROM, interrupts, - I/O ports) - -***************************************************************************/ - -#include "emu.h" -#include "stfight.h" - -#include "cpu/m6805/m68705.h" -#include "cpu/z80/z80.h" -#include "sound/msm5205.h" - - -/* - -Encryption PAL 16R4 on CPU board - - +---U---+ - CP --| |-- VCC - ROM D1 --| |-- ROM D0 M1 = 0 M1 = 1 - ROM D3 --| |-- (NC) - ROM D4 --| |-- D6 D6 = D1 ^^ D3 D6 = / ( D1 ^^ D0 ) - ROM D6 --| |-- D4 D4 = / ( D6 ^^ A7 ) D4 = D3 ^^ A0 - A0 --| |-- D3 D3 = / ( D0 ^^ A1 ) D3 = D4 ^^ A4 - A1 --| |-- D0 D0 = D1 ^^ D4 D0 = / ( D6 ^^ A0 ) - A4 --| |-- (NC) - A7 --| |-- /M1 - GND --| |-- /OE - +-------+ - -*/ - - -void stfight_state::init_stfight() -{ - uint8_t *rom = memregion("maincpu")->base(); - - for (uint32_t A = 0; A < 0x8000; ++A) - { - uint8_t src = rom[A]; - - // decode opcode - m_decrypted_opcodes[A] = - ( src & 0xA6 ) | - ( ( ( ( src << 2 ) ^ src ) << 3 ) & 0x40 ) | - ( ~( ( src ^ ( A >> 1 ) ) >> 2 ) & 0x10 ) | - ( ~( ( ( src << 1 ) ^ A ) << 2 ) & 0x08 ) | - ( ( ( src ^ ( src >> 3 ) ) >> 1 ) & 0x01 ); - - // decode operand - rom[A] = - ( src & 0xA6 ) | - ( ~( ( src ^ ( src << 1 ) ) << 5 ) & 0x40 ) | - ( ( ( src ^ ( A << 3 ) ) << 1 ) & 0x10 ) | - ( ( ( src ^ A ) >> 1 ) & 0x08 ) | - ( ~( ( src >> 6 ) ^ A ) & 0x01 ); - } - - // Set clock prescaler FM:1/2 PSG:1/1 - m_ym[0]->write(0, 0x2f); - m_ym[1]->write(0, 0x2f); -} - -void stfight_state::machine_start() -{ - m_main_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); - m_main_bank->set_entry(0); - - m_int1_timer = timer_alloc(FUNC(stfight_state::rst08_tick), this); - - save_item(NAME(m_coin_state)); - save_item(NAME(m_fm_data)); - - save_item(NAME(m_cpu_to_mcu_empty)); - save_item(NAME(m_cpu_to_mcu_data)); - save_item(NAME(m_port_a_out)); - save_item(NAME(m_port_c_out)); - - save_item(NAME(m_vck2)); - save_item(NAME(m_adpcm_reset)); - save_item(NAME(m_adpcm_data_offs)); -} - - -void stfight_state::machine_reset() -{ - m_fm_data = 0; - m_cpu_to_mcu_empty = true; - m_adpcm_reset = true; - - // Coin signals are active low - m_coin_state = 3; -} - -// It's entirely possible that this bank is never switched out -// - in fact I don't even know how/where it's switched in! -void stfight_state::stfight_bank_w(uint8_t data) -{ - m_main_bank->set_entry(bitswap(data, 7, 2)); -} - -/* - * CPU 1 timed interrupt - 60Hz??? - */ - -TIMER_CALLBACK_MEMBER(stfight_state::rst08_tick) -{ - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 -} - -INTERRUPT_GEN_MEMBER(stfight_state::stfight_vb_interrupt) -{ - // Do a RST10 - device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 - m_int1_timer->adjust(attotime::from_hz(120)); -} - -/* - * Hardware handlers - */ - -void stfight_state::stfight_io_w(uint8_t data) -{ - // TODO: What is bit 4? - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); -} - -uint8_t stfight_state::stfight_coin_r() -{ - return m_coin_state; -} - -void stfight_state::stfight_coin_w(uint8_t data) -{ - // Acknowledge coin signals (active low) - if (!BIT(data, 0)) - m_coin_state |= 1; - - if (!BIT(data, 1)) - m_coin_state |= 2; -} - -/* - * Machine hardware for MSM5205 ADPCM sound control - */ - -void stfight_state::stfight_adpcm_int(int state) -{ - if (!state) - return; - - // Falling edge triggered interrupt at half the rate of /VCK? - m_mcu->set_input_line(M68705_IRQ_LINE, m_vck2 ? ASSERT_LINE : CLEAR_LINE); - m_vck2 = !m_vck2; - - if (!m_adpcm_reset) - { - uint8_t adpcm_data = m_samples[(m_adpcm_data_offs >> 1) & 0x7fff]; - - if (!BIT(m_adpcm_data_offs, 0)) - adpcm_data >>= 4; - ++m_adpcm_data_offs; - - m_msm->data_w(adpcm_data & 0x0f); - } -} - - -/* - * Machine hardware for YM2303 FM sound control - */ - -void stfight_state::stfight_fm_w(uint8_t data) -{ - // The sound cpu ignores any FM data without bit 7 set - m_fm_data = 0x80 | data; -} - -uint8_t stfight_state::stfight_fm_r() -{ - uint8_t const data = m_fm_data; - - // Acknowledge the command - if (!machine().side_effects_disabled()) - m_fm_data &= ~0x80; - - return data; -} - - -/* - * MCU communications - */ - -void stfight_state::stfight_mcu_w(uint8_t data) -{ - m_cpu_to_mcu_data = data & 0x0f; - m_cpu_to_mcu_empty = false; -} - -void stfight_state::stfight_68705_port_a_w(uint8_t data) -{ - m_port_a_out = data; -} - -uint8_t stfight_state::stfight_68705_port_b_r() -{ - return - (m_coin_mech->read() << 6) | - (m_cpu_to_mcu_empty ? 0x10 : 0x00) | - (m_cpu_to_mcu_data & 0x0f); -} - -void stfight_state::stfight_68705_port_b_w(uint8_t data) -{ - // Acknowledge Z80 command - if (!BIT(data, 5)) - m_cpu_to_mcu_empty = true; -} - -void stfight_state::stfight_68705_port_c_w(uint8_t data) -{ - // Signal a valid coin on the falling edge - if (BIT(m_port_c_out, 0) && !BIT(data, 0)) - m_coin_state &= ~1; - if (BIT(m_port_c_out, 1) && !BIT(data, 1)) - m_coin_state &= ~2; - - // Latch ADPCM data address when dropping the reset line - m_adpcm_reset = BIT(data, 2); - if (!m_adpcm_reset && BIT(m_port_c_out, 2)) - m_adpcm_data_offs = m_port_a_out << 9; - m_msm->reset_w(m_adpcm_reset ? ASSERT_LINE : CLEAR_LINE); - - // Generate NMI on host CPU (used on handshake error or stuck coin) - m_maincpu->set_input_line(INPUT_LINE_NMI, BIT(data, 3) ? CLEAR_LINE : ASSERT_LINE); - - m_port_c_out = data; -} diff --git a/src/mame/seibu/wiz.cpp b/src/mame/seibu/wiz.cpp index 59abd0dfaf7..0134f32892e 100644 --- a/src/mame/seibu/wiz.cpp +++ b/src/mame/seibu/wiz.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari +// copyright-holders: Zsolt Vasvari + /*************************************************************************** Seibu Stinger/Wiz hardware @@ -78,7 +79,7 @@ I/O write: TODO: - Verify sprite colors in stinger/scion -- Global palette is wrong in stinger/scion compared to pcb, or could it be +- Global palette is wrong in stinger/scion compared to PCB, or could it be due to gamma/hue? - cpu/video/interrupt frequency measurements - sprite-sprite priorities are not correct yet, eg: @@ -86,7 +87,7 @@ TODO: than that 'vacuum cleaner' enemy sphere, * the cloud in kungfut should have higher prio than player char - Improve stinger/scion discrete sound, shot sound should include noise -- stinger/scion audiocpu jumps to lalaland after receiving a soundlatch of 0x90, +- stinger/scion audio CPU jumps to lalaland after receiving a soundlatch of 0x90, basically resetting itself. I assume this is a game bug - scion insert-coin sound sometimes repeats or is silent due to soundlatch timing, this could be a game bug as well @@ -106,7 +107,7 @@ TODO: 2xZ80 , 3x AY8910 (DSW 1 , bit 2 ) "THE MICROPHONE IS OUT OF CONTROL, SO THIS GAME DEPENDS ON THE BUTTONS" - There's no additional hw or connectors on the pcb + There's no additional hw or connectors on the PCB (except for small (bit 0 - ON, bit 1 - ON) DSW near AY chips ) Tomasz Slanina @@ -177,16 +178,332 @@ Stephh's notes (based on the games Z80 code and some tests) : ***************************************************************************/ #include "emu.h" -#include "wiz.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/ay8910.h" +#include "sound/discrete.h" +#include "video/resnet.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + +class wiz_state : public driver_device +{ +public: + wiz_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_videoram(*this, "videoram%u", 1U), + m_colorram(*this, "colorram%u", 1U), + m_attrram(*this, "attrram%u", 1U), + m_spriteram(*this, "spriteram%u", 1U) + { } + + void wiz(machine_config &config); + void kungfut(machine_config &config); + void kungfuta(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_gfxdecode; + required_device m_palette; + + required_shared_ptr_array m_videoram; + required_shared_ptr_array m_colorram; + required_shared_ptr_array m_attrram; + required_shared_ptr_array m_spriteram; + + uint8_t m_flipx = 0; + uint8_t m_flipy = 0; + uint8_t m_bgcolor = 0; + uint8_t m_charbank[2]{}; + uint8_t m_palbank[2]{}; + uint8_t m_main_nmi_mask = 0; + uint8_t m_sound_nmi_mask = 0; + uint8_t m_sprite_bank = 0; + + uint8_t wiz_protection_r(); + uint8_t kungfuta_protection_r(); + void wiz_coin_counter_w(offs_t offset, uint8_t data); + void main_nmi_mask_w(uint8_t data); + void sound_nmi_mask_w(uint8_t data); + void palette_bank_w(offs_t offset, uint8_t data); + void wiz_sprite_bank_w(uint8_t data); + void bgcolor_w(uint8_t data); + void char_bank_w(offs_t offset, uint8_t data); + void flipx_w(uint8_t data); + void flipy_w(uint8_t data); + + void palette(palette_device &palette) const; + uint32_t screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(vblank_interrupt); + INTERRUPT_GEN_MEMBER(sound_interrupt); + void draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank); + + void kungfut_main_map(address_map &map); + void kungfuta_main_map(address_map &map); + void sound_map(address_map &map); + void wiz_main_map(address_map &map); +}; + +class stinger_state : public wiz_state +{ +public: + stinger_state(const machine_config &mconfig, device_type type, const char *tag) : + wiz_state(mconfig, type, tag), + m_discrete(*this, "discrete"), + m_decrypted_opcodes(*this, "decrypted_opcodes") + { } + + void scion(machine_config &config); + void stinger(machine_config &config); + + void init_stinger(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_discrete; + + optional_shared_ptr m_decrypted_opcodes; + + uint8_t m_dsc0 = 0; + uint8_t m_dsc1 = 0; + + void explosion_w(uint8_t data); + void shot_w(uint8_t data); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void decrypted_opcodes_map(address_map &map); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Stinger has three 256x4 palette PROMs (one per gun). + The palette PROMs are connected to the RGB output this way: + + bit 3 -- 100 ohm resistor -- RED/GREEN/BLUE + -- 220 ohm resistor -- RED/GREEN/BLUE + -- 470 ohm resistor -- RED/GREEN/BLUE + bit 0 -- 1 kohm resistor -- RED/GREEN/BLUE + +***************************************************************************/ + +void wiz_state::palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + static constexpr int resistances[4] = { 1000, 470, 220, 100 }; + + // compute the color output resistor weights + double rweights[4], gweights[4], bweights[4]; + compute_resistor_weights(0, 255, -1.0, + 4, resistances, rweights, 470, 0, + 4, resistances, gweights, 470, 0, + 4, resistances, bweights, 470, 0); + + // initialize the palette with these colors + for (int i = 0; i < 0x100; i++) + { + int bit0, bit1, bit2, bit3; + + // red component + bit0 = BIT(color_prom[i + 0x000], 0); + bit1 = BIT(color_prom[i + 0x000], 1); + bit2 = BIT(color_prom[i + 0x000], 2); + bit3 = BIT(color_prom[i + 0x000], 3); + int const r = combine_weights(rweights, bit0, bit1, bit2, bit3); + + // green component + bit0 = BIT(color_prom[i + 0x100], 0); + bit1 = BIT(color_prom[i + 0x100], 1); + bit2 = BIT(color_prom[i + 0x100], 2); + bit3 = BIT(color_prom[i + 0x100], 3); + int const g = combine_weights(gweights, bit0, bit1, bit2, bit3); + + // blue component + bit0 = BIT(color_prom[i + 0x200], 0); + bit1 = BIT(color_prom[i + 0x200], 1); + bit2 = BIT(color_prom[i + 0x200], 2); + bit3 = BIT(color_prom[i + 0x200], 3); + int const b = combine_weights(bweights, bit0, bit1, bit2, bit3); + + m_palette->set_pen_color(i, rgb_t(r, g, b)); + } +} + + + +/*************************************************************************** + + I/O + +***************************************************************************/ + +void wiz_state::palette_bank_w(offs_t offset, uint8_t data) +{ + m_palbank[offset] = data & 1; +} + +void wiz_state::char_bank_w(offs_t offset, uint8_t data) +{ + m_charbank[offset] = data & 1; +} + +void wiz_state::wiz_sprite_bank_w(uint8_t data) +{ + m_sprite_bank = data & 1; +} + +void wiz_state::bgcolor_w(uint8_t data) +{ + m_bgcolor = data; +} + +void wiz_state::flipx_w(uint8_t data) +{ + m_flipx = data & 1; +} + +void wiz_state::flipy_w(uint8_t data) +{ + m_flipy = data & 1; +} + + + +/*************************************************************************** + + Screen Update + +***************************************************************************/ + +void wiz_state::draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype) +{ + gfx_element *gfx = m_gfxdecode->gfx(charbank); + int const palbank = m_palbank[1] << 4 | m_palbank[0] << 3; + + // draw the tiles. They are characters, but draw them as sprites. + for (int offs = 0x400 - 1; offs >= 0; offs--) + { + int const code = m_videoram[layer][offs]; + int sx = offs & 0x1f; + int const sy = offs >> 5; + int color = m_attrram[layer][sx << 1 | 1] & 7; + + // wiz/kungfut hw allows more color variety on screen + if (colortype) + color = layer ? (m_colorram[layer][offs] & 7) : ((color & 4) | (code & 3)); + + int scroll = (8 * sy + 256 - m_attrram[layer][sx << 1]) & 0xff; + if (m_flipy) + scroll = (248 - scroll) & 0xff; + if (m_flipx) + sx = 31 - sx; + + gfx->transpen(bitmap, cliprect, + code, + palbank | color, + m_flipx, m_flipy, + 8 * sx, scroll, 0); + } +} + + +void wiz_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank) +{ + gfx_element *gfx = m_gfxdecode->gfx(charbank); + int const palbank = m_palbank[1] << 4 | m_palbank[0] << 3; + + for (int offs = 0x20 - 4; offs >= 0; offs -= 4) + { + int const code = m_spriteram[set][offs + 1]; + int sx = m_spriteram[set][offs + 3]; + int sy = m_spriteram[set][offs]; + int const color = m_spriteram[set][offs + 2] & 7; // high bits unused + + if (!sx || !sy) continue; + + // like on galaxian hw, the first three sprites match against y-1 (not on m_spriteram[1]) + if (set == 0 && offs <= 8) + sy += (m_flipy) ? 1 : -1; + + if (m_flipx) sx = 240 - sx; + if (!m_flipy) sy = 240 - sy; + + gfx->transpen(bitmap, cliprect, + code, + palbank | color, + m_flipx, m_flipy, + sx, sy, 0); + } +} + + +/**************************************************************************/ + +uint32_t wiz_state::screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_bgcolor, cliprect); + draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 1); + draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); + draw_sprites(bitmap, cliprect, 1, 4); + draw_sprites(bitmap, cliprect, 0, 5); + return 0; +} + +uint32_t wiz_state::screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_bgcolor, cliprect); + draw_tiles(bitmap, cliprect, 0, 2 + ((m_charbank[0] << 1) | m_charbank[1]), 1); + draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); + + const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); + const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); + const rectangle &visible_area = m_flipx ? spritevisibleareaflipx : spritevisiblearea; + + draw_sprites(bitmap, visible_area, 1, 6); + draw_sprites(bitmap, visible_area, 0, 7 + m_sprite_bank); + return 0; +} + + +uint32_t stinger_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_bgcolor, cliprect); + draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 0); + draw_tiles(bitmap, cliprect, 1, m_charbank[1], 0); + draw_sprites(bitmap, cliprect, 1, 4); + draw_sprites(bitmap, cliprect, 0, 5); + return 0; +} + + +// machine + /*************************************************************************** Stinger/Scion discrete sound @@ -202,16 +519,16 @@ Stephh's notes (based on the games Z80 code and some tests) : static const discrete_lfsr_desc stinger_lfsr = { DISC_CLK_IS_FREQ, - 16, /* Bit Length */ - 0, /* Reset Value */ - 6, /* Use Bit 6 as XOR input 0 */ - 14, /* Use Bit 14 as XOR input 1 */ - DISC_LFSR_XNOR, /* Feedback stage1 is XNOR */ - DISC_LFSR_OR, /* Feedback stage2 is just stage 1 output OR with external feed */ - DISC_LFSR_REPLACE, /* Feedback stage3 replaces the shifted register contents */ - 0x000001, /* Everything is shifted into the first bit only */ - 0, /* Output is already inverted by XNOR */ - 16 /* Output bit is feedback bit */ + 16, // Bit Length + 0, // Reset Value + 6, // Use Bit 6 as XOR input 0 + 14, // Use Bit 14 as XOR input 1 + DISC_LFSR_XNOR, // Feedback stage1 is XNOR + DISC_LFSR_OR, // Feedback stage2 is just stage 1 output OR with external feed + DISC_LFSR_REPLACE, // Feedback stage3 replaces the shifted register contents + 0x000001, // Everything is shifted into the first bit only + 0, // Output is already inverted by XNOR + 16 // Output bit is feedback bit }; static DISCRETE_SOUND_START(stinger_discrete) @@ -221,10 +538,10 @@ static DISCRETE_SOUND_START(stinger_discrete) #define STINGER_FINAL_MIX NODE_99 // triggers are interleaved to give each circuit sufficient time to reset - DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN1) // even-inteval shots - DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN2) // odd-inteval shots - DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN1) // even-inteval explosions - DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN2) // odd-inteval explosions + DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN1) // even-interval shots + DISCRETE_INPUT_LOGIC (STINGER_SHOT_EN2) // odd-interval shots + DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN1) // even-interval explosions + DISCRETE_INPUT_LOGIC (STINGER_BOOM_EN2) // odd-interval explosions //--------------------------------------- // Sample Shot Sound Circuit @@ -264,18 +581,18 @@ static DISCRETE_SOUND_START(stinger_discrete) DISCRETE_SOUND_END -void wiz_state::stinger_explosion_w(uint8_t data) +void stinger_state::explosion_w(uint8_t data) { // explosion sound trigger(analog?) m_discrete->write(STINGER_BOOM_EN1, m_dsc1); - m_discrete->write(STINGER_BOOM_EN2, m_dsc1^=1); + m_discrete->write(STINGER_BOOM_EN2, m_dsc1 ^= 1); } -void wiz_state::stinger_shot_w(uint8_t data) +void stinger_state::shot_w(uint8_t data) { // player shot sound trigger(analog?) m_discrete->write(STINGER_SHOT_EN1, m_dsc0); - m_discrete->write(STINGER_SHOT_EN2, m_dsc0^=1); + m_discrete->write(STINGER_SHOT_EN2, m_dsc0 ^= 1); } @@ -288,24 +605,24 @@ void wiz_state::stinger_shot_w(uint8_t data) uint8_t wiz_state::wiz_protection_r() { - switch (m_colorram2[0]) + switch (m_colorram[1][0]) { - case 0x35: return 0x25; /* FIX: sudden player death + free play afterwards */ - case 0x8f: return 0x1f; /* FIX: early boss appearance with corrupt graphics */ - case 0xa0: return 0x00; /* FIX: executing junk code after defeating the boss */ + case 0x35: return 0x25; // FIX: sudden player death + free play afterwards + case 0x8f: return 0x1f; // FIX: early boss appearance with corrupt graphics + case 0xa0: return 0x00; // FIX: executing junk code after defeating the boss } - return m_colorram2[0]; + return m_colorram[1][0]; } uint8_t wiz_state::kungfuta_protection_r() { - // this cases are based on looking at the code, the kungfut set has no such checks + // these cases are based on looking at the code, the kungfut set has no such checks // and is a very different version of the game // much like wiz, kungfuta writes a value to the first byte of 'colorram2' reads it // back, then checks against a fixed value - switch (m_colorram2[0]) + switch (m_colorram[1][0]) { case 0x3a: return 0x0a; case 0x5a: return 0xda; // after bonus round, prevents infinite loop @@ -316,7 +633,7 @@ uint8_t wiz_state::kungfuta_protection_r() case 0xff: return 0xff; // done before other checks, although code at 0xacc8 will skip 2nd check like this } - return m_colorram2[0]; + return m_colorram[1][0]; } void wiz_state::wiz_coin_counter_w(offs_t offset, uint8_t data) @@ -324,7 +641,7 @@ void wiz_state::wiz_coin_counter_w(offs_t offset, uint8_t data) machine().bookkeeping().coin_counter_w(offset, data & 1); } -void wiz_state::wiz_main_nmi_mask_w(uint8_t data) +void wiz_state::main_nmi_mask_w(uint8_t data) { m_main_nmi_mask = data & 1; } @@ -334,30 +651,30 @@ void wiz_state::kungfut_main_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xc7ff).ram(); - map(0xd000, 0xd3ff).ram().share("videoram2"); - map(0xd400, 0xd7ff).ram().share("colorram2"); - map(0xd800, 0xd83f).ram().share("attrram2"); - map(0xd840, 0xd85f).ram().share("spriteram2"); - map(0xe000, 0xe3ff).ram().share("videoram"); - map(0xe400, 0xe7ff).ram().share("colorram"); - map(0xe800, 0xe83f).ram().share("attrram"); - map(0xe840, 0xe85f).ram().share("spriteram"); + map(0xd000, 0xd3ff).ram().share(m_videoram[1]); + map(0xd400, 0xd7ff).ram().share(m_colorram[1]); + map(0xd800, 0xd83f).ram().share(m_attrram[1]); + map(0xd840, 0xd85f).ram().share(m_spriteram[1]); + map(0xe000, 0xe3ff).ram().share(m_videoram[0]); + map(0xe400, 0xe7ff).ram().share(m_colorram[0]); + map(0xe800, 0xe83f).ram().share(m_attrram[0]); + map(0xe840, 0xe85f).ram().share(m_spriteram[0]); map(0xf000, 0xf000).portr("DSW0"); - map(0xf001, 0xf001).w(FUNC(wiz_state::wiz_main_nmi_mask_w)); - map(0xf002, 0xf003).w(FUNC(wiz_state::wiz_palette_bank_w)); - map(0xf004, 0xf005).w(FUNC(wiz_state::wiz_char_bank_w)); - map(0xf006, 0xf006).w(FUNC(wiz_state::wiz_flipx_w)); - map(0xf007, 0xf007).w(FUNC(wiz_state::wiz_flipy_w)); + map(0xf001, 0xf001).w(FUNC(wiz_state::main_nmi_mask_w)); + map(0xf002, 0xf003).w(FUNC(wiz_state::palette_bank_w)); + map(0xf004, 0xf005).w(FUNC(wiz_state::char_bank_w)); + map(0xf006, 0xf006).w(FUNC(wiz_state::flipx_w)); + map(0xf007, 0xf007).w(FUNC(wiz_state::flipy_w)); map(0xf008, 0xf008).portr("DSW1"); map(0xf010, 0xf010).portr("IN0"); map(0xf018, 0xf018).portr("IN1"); map(0xf800, 0xf800).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0xf818, 0xf818).w(FUNC(wiz_state::wiz_bgcolor_w)); + map(0xf818, 0xf818).w(FUNC(wiz_state::bgcolor_w)); } -void wiz_state::decrypted_opcodes_map(address_map &map) +void stinger_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0xbfff).rom().share("decrypted_opcodes"); + map(0x0000, 0xbfff).rom().share(m_decrypted_opcodes); } void wiz_state::kungfuta_main_map(address_map &map) @@ -375,25 +692,25 @@ void wiz_state::wiz_main_map(address_map &map) } -void wiz_state::stinger_main_map(address_map &map) +void stinger_state::main_map(address_map &map) { kungfut_main_map(map); // map(0xf008, 0xf00f).nopw(); // ? map(0xf800, 0xf800).r("watchdog", FUNC(watchdog_timer_device::reset_r)); - map(0xf808, 0xf808).w(FUNC(wiz_state::stinger_explosion_w)); - map(0xf80a, 0xf80a).w(FUNC(wiz_state::stinger_shot_w)); + map(0xf808, 0xf808).w(FUNC(stinger_state::explosion_w)); + map(0xf80a, 0xf80a).w(FUNC(stinger_state::shot_w)); } /**************************************************************************/ -void wiz_state::wiz_sound_nmi_mask_w(uint8_t data) +void wiz_state::sound_nmi_mask_w(uint8_t data) { m_sound_nmi_mask = data & 1; } -void wiz_state::kungfut_sound_map(address_map &map) +void wiz_state::sound_map(address_map &map) { map.global_mask(0x7fff); map(0x0000, 0x1fff).rom(); @@ -401,19 +718,19 @@ void wiz_state::kungfut_sound_map(address_map &map) map(0x4000, 0x4001).w("8910.3", FUNC(ay8910_device::address_data_w)); map(0x5000, 0x5001).w("8910.1", FUNC(ay8910_device::address_data_w)); map(0x6000, 0x6001).w("8910.2", FUNC(ay8910_device::address_data_w)); - map(0x7000, 0x7000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(wiz_state::wiz_sound_nmi_mask_w)); + map(0x7000, 0x7000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(wiz_state::sound_nmi_mask_w)); } -void wiz_state::stinger_sound_map(address_map &map) +void stinger_state::sound_map(address_map &map) { map.global_mask(0x7fff); map(0x0000, 0x1fff).rom(); map(0x2000, 0x23ff).ram(); - map(0x3000, 0x3000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(wiz_state::wiz_sound_nmi_mask_w)); + map(0x3000, 0x3000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(stinger_state::sound_nmi_mask_w)); map(0x4000, 0x4000).nopw(); // ? map(0x5000, 0x5001).w("8910.1", FUNC(ay8910_device::address_data_w)); map(0x6000, 0x6001).w("8910.2", FUNC(ay8910_device::address_data_w)); - map(0x5000, 0x7fff).nopr(); // prevent error.log spam, cpu jumps here by accident + map(0x5000, 0x7fff).nopr(); // prevent error.log spam, CPU jumps here by accident } @@ -471,7 +788,7 @@ static INPUT_PORTS_START( stinger ) PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, "Debug Mode" ) /* See notes */ + PORT_DIPNAME( 0x01, 0x00, "Debug Mode" ) // See notes PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coin_B ) ) @@ -509,7 +826,7 @@ static INPUT_PORTS_START( stinger2 ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x70, 0x20, DEF_STR( Coin_B ) ) /* See notes */ + PORT_DIPNAME( 0x70, 0x20, DEF_STR( Coin_B ) ) // See notes PORT_DIPSETTING( 0x70, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 1C_3C ) ) @@ -570,13 +887,13 @@ static INPUT_PORTS_START( scion ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x20, DEF_STR( On ) ) /* See notes */ +// PORT_DIPSETTING( 0x20, DEF_STR( On ) ) // See notes PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x40, DEF_STR( On ) ) /* See notes */ +// PORT_DIPSETTING( 0x40, DEF_STR( On ) ) // See notes PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) -// PORT_DIPSETTING( 0x80, DEF_STR( On ) ) /* See notes */ +// PORT_DIPSETTING( 0x80, DEF_STR( On ) ) // See notes INPUT_PORTS_END static INPUT_PORTS_START( kungfut ) @@ -632,7 +949,7 @@ static INPUT_PORTS_START( kungfut ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "Microphone" ) /* See notes */ + PORT_DIPNAME( 0x04, 0x04, "Microphone" ) // See notes PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x18, 0x08, DEF_STR( Lives ) ) @@ -642,7 +959,7 @@ static INPUT_PORTS_START( kungfut ) PORT_DIPSETTING( 0x18, "5" ) PORT_DIPNAME( 0x60, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x00, "20000 40000" ) -// PORT_DIPSETTING( 0x20, "20000 40000" ) // duplicated setting + PORT_DIPSETTING( 0x20, "20000 40000" ) // duplicated setting PORT_DIPSETTING( 0x10, "20000 80000" ) PORT_DIPSETTING( 0x30, "30000 90000" ) PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) @@ -728,26 +1045,26 @@ INPUT_PORTS_END static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ - 256, /* 256 characters */ - 3, /* 3 bits per pixel */ - { 0x4000*8, 0x2000*8, 0 }, /* the three bitplanes are separated */ + 8,8, // 8*8 characters + 256, // 256 characters + 3, // 3 bits per pixel + { 0x4000*8, 0x2000*8, 0 }, // the three bitplanes are separated { 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 }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 256, /* 256 sprites */ - 3, /* 3 bits per pixel */ - { 0x4000*8, 0x2000*8, 0 }, /* the three bitplanes are separated */ + 16,16, // 16*16 sprites + 256, // 256 sprites + 3, // 3 bits per pixel + { 0x4000*8, 0x2000*8, 0 }, // the three bitplanes are separated { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, - 32*8 /* every sprite takes 32 consecutive bytes */ + 32*8 // every sprite takes 32 consecutive bytes }; @@ -778,7 +1095,6 @@ void wiz_state::machine_reset() { m_main_nmi_mask = 0; m_sound_nmi_mask = 0; - m_dsc0 = m_dsc1 = 1; m_sprite_bank = 0; m_charbank[0] = m_charbank[1] = 0; @@ -788,13 +1104,18 @@ void wiz_state::machine_reset() m_bgcolor = 0; } +void stinger_state::machine_reset() +{ + wiz_state::machine_reset(); + + m_dsc0 = m_dsc1 = 1; +} + void wiz_state::machine_start() { // register for savestates save_item(NAME(m_main_nmi_mask)); save_item(NAME(m_sound_nmi_mask)); - save_item(NAME(m_dsc0)); - save_item(NAME(m_dsc1)); save_item(NAME(m_sprite_bank)); save_item(NAME(m_charbank)); @@ -804,15 +1125,24 @@ void wiz_state::machine_start() save_item(NAME(m_bgcolor)); } +void stinger_state::machine_start() +{ + wiz_state::machine_start(); + + // register for savestates + save_item(NAME(m_dsc0)); + save_item(NAME(m_dsc1)); +} + /**************************************************************************/ -INTERRUPT_GEN_MEMBER(wiz_state::wiz_vblank_interrupt) +INTERRUPT_GEN_MEMBER(wiz_state::vblank_interrupt) { if (m_main_nmi_mask & 1) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -INTERRUPT_GEN_MEMBER(wiz_state::wiz_sound_interrupt) +INTERRUPT_GEN_MEMBER(wiz_state::sound_interrupt) { if (m_sound_nmi_mask & 1) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); @@ -820,37 +1150,37 @@ INTERRUPT_GEN_MEMBER(wiz_state::wiz_sound_interrupt) void wiz_state::kungfut(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 18432000/6); /* 3.072 MHz ??? */ + // basic machine hardware + Z80(config, m_maincpu, 18'432'000 / 6); // 3.072 MHz ??? m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::kungfut_main_map); - m_maincpu->set_vblank_int("screen", FUNC(wiz_state::wiz_vblank_interrupt)); + m_maincpu->set_vblank_int("screen", FUNC(wiz_state::vblank_interrupt)); - Z80(config, m_audiocpu, 18432000/6); /* 3.072 MHz ??? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &wiz_state::kungfut_sound_map); - m_audiocpu->set_periodic_int(FUNC(wiz_state::wiz_sound_interrupt), attotime::from_hz(4*60)); /* ??? */ + Z80(config, m_audiocpu, 18'432'000 / 6); // 3.072 MHz ??? + m_audiocpu->set_addrmap(AS_PROGRAM, &wiz_state::sound_map); + m_audiocpu->set_periodic_int(FUNC(wiz_state::sound_interrupt), attotime::from_hz(4*60)); // ??? - /* 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(2500) /* not accurate */ ); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); screen.set_screen_update(FUNC(wiz_state::screen_update_kungfut)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_stinger); - PALETTE(config, m_palette, FUNC(wiz_state::wiz_palette), 256); + PALETTE(config, m_palette, FUNC(wiz_state::palette), 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - AY8910(config, "8910.1", 18432000/12).add_route(ALL_OUTPUTS, "mono", 0.10); + AY8910(config, "8910.1", 18'432'000 / 12).add_route(ALL_OUTPUTS, "mono", 0.10); - AY8910(config, "8910.2", 18432000/12).add_route(ALL_OUTPUTS, "mono", 0.10); + AY8910(config, "8910.2", 18'432'000 / 12).add_route(ALL_OUTPUTS, "mono", 0.10); - AY8910(config, "8910.3", 18432000/12).add_route(ALL_OUTPUTS, "mono", 0.10); + AY8910(config, "8910.3", 18'432'000 / 12).add_route(ALL_OUTPUTS, "mono", 0.10); } void wiz_state::kungfuta(machine_config &config) @@ -864,46 +1194,43 @@ void wiz_state::wiz(machine_config &config) { kungfut(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::wiz_main_map); - /* video hardware */ + // video hardware m_gfxdecode->set_info(gfx_wiz); subdevice("screen")->set_screen_update(FUNC(wiz_state::screen_update_wiz)); } -void wiz_state::stinger(machine_config &config) +void stinger_state::stinger(machine_config &config) { kungfut(config); - /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::stinger_main_map); - m_maincpu->set_addrmap(AS_OPCODES, &wiz_state::decrypted_opcodes_map); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &stinger_state::main_map); + m_maincpu->set_addrmap(AS_OPCODES, &stinger_state::decrypted_opcodes_map); - /* basic machine hardware */ - m_audiocpu->set_addrmap(AS_PROGRAM, &wiz_state::stinger_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &stinger_state::sound_map); WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ - subdevice("screen")->set_screen_update(FUNC(wiz_state::screen_update_stinger)); + // video hardware + subdevice("screen")->set_screen_update(FUNC(stinger_state::screen_update)); - /* sound hardware */ + // sound hardware config.device_remove("8910.3"); DISCRETE(config, m_discrete, stinger_discrete).add_route(ALL_OUTPUTS, "mono", 0.5); } -void wiz_state::scion(machine_config &config) +void stinger_state::scion(machine_config &config) { stinger(config); - Z80(config.replace(), m_maincpu, 18432000/6); /* 3.072 MHz ??? */ - m_maincpu->set_addrmap(AS_PROGRAM, &wiz_state::stinger_main_map); - m_maincpu->set_vblank_int("screen", FUNC(wiz_state::wiz_vblank_interrupt)); + m_maincpu->set_addrmap(AS_OPCODES, address_map_constructor()); - /* video hardware */ + // video hardware subdevice("screen")->set_visarea(2*8, 32*8-1, 2*8, 30*8-1); } @@ -974,12 +1301,12 @@ ROM_START( wiz ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "ic57_10.bin", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "ic12_04.bin", 0x0000, 0x2000, CRC(8969acdd) SHA1(f37c4697232b4fb4171d6290c9407f740e7d1448) ) ROM_LOAD( "ic13_05.bin", 0x2000, 0x2000, CRC(2868e6a5) SHA1(1b8ac71a6b901df845bab945bfcf11df47932990) ) ROM_LOAD( "ic14_06.bin", 0x4000, 0x2000, CRC(b398e142) SHA1(1cafaf5cbfa96b410ae236a298473ff51122d9fc) ) - ROM_REGION( 0xc000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0xc000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "ic03_07.bin", 0x0000, 0x2000, CRC(297c02fc) SHA1(8eee765a660e3ff1b6cdcdac0d068177098cc339) ) ROM_CONTINUE( 0x6000, 0x2000 ) ROM_LOAD( "ic02_08.bin", 0x2000, 0x2000, CRC(ede77d37) SHA1(01fe35fc3373b7513ea90e8262d66200629b89fe) ) @@ -988,9 +1315,9 @@ ROM_START( wiz ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) /* palette red component */ - ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) /* palette green component */ - ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) /* palette blue component */ + ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) // palette red component + ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) // palette green component + ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) // palette blue component ROM_END ROM_START( wizt ) @@ -1002,12 +1329,12 @@ ROM_START( wizt ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "ic57_10.bin", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "wiz4.bin", 0x0000, 0x2000, CRC(e6c636b3) SHA1(0d5b98d404d2d87f375cde5d5a90c7d6318ea197) ) ROM_LOAD( "wiz5.bin", 0x2000, 0x2000, CRC(77986058) SHA1(8002affdd9ac246a0b9c887654d0db8d3a6913b2) ) ROM_LOAD( "wiz6.bin", 0x4000, 0x2000, CRC(f6970b23) SHA1(82d1fe0fee6bf9c6c2f472ed3479c02da85d5f69) ) - ROM_REGION( 0xc000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0xc000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "wiz7.bin", 0x0000, 0x2000, CRC(601f2f3f) SHA1(6c0cc7de5fd94628eaecca409c4faa155f684bdc) ) ROM_CONTINUE( 0x6000, 0x2000 ) ROM_LOAD( "wiz8.bin", 0x2000, 0x2000, CRC(f5ab982d) SHA1(5e0e72ec702dd5f48814a15f1a92bcdd29c944d8) ) @@ -1016,12 +1343,12 @@ ROM_START( wizt ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) /* palette red component */ - ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) /* palette green component */ - ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) /* palette blue component */ + ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) // palette red component + ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) // palette green component + ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) // palette blue component ROM_END -/* was marked as Wiz Alt Sound */ +// was marked as Wiz Alt Sound ROM_START( wizta ) ROM_REGION( 0xc000, "maincpu", 0 ) ROM_LOAD( "ic7", 0x0000, 0x4000, CRC(b2ec49ad) SHA1(f1624995e9d426dd69d6567a91713aa023e716ad) ) @@ -1031,12 +1358,12 @@ ROM_START( wizta ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "ic57", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "ic12", 0x0000, 0x2000, CRC(e6c636b3) SHA1(0d5b98d404d2d87f375cde5d5a90c7d6318ea197) ) ROM_LOAD( "ic13", 0x2000, 0x2000, CRC(77986058) SHA1(8002affdd9ac246a0b9c887654d0db8d3a6913b2) ) ROM_LOAD( "ic14", 0x4000, 0x2000, CRC(f6970b23) SHA1(82d1fe0fee6bf9c6c2f472ed3479c02da85d5f69) ) - ROM_REGION( 0xc000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0xc000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "ic3", 0x0000, 0x2000, CRC(601f2f3f) SHA1(6c0cc7de5fd94628eaecca409c4faa155f684bdc) ) ROM_CONTINUE( 0x6000, 0x2000 ) ROM_LOAD( "ic2", 0x2000, 0x2000, CRC(f5ab982d) SHA1(5e0e72ec702dd5f48814a15f1a92bcdd29c944d8) ) @@ -1045,63 +1372,63 @@ ROM_START( wizta ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) /* palette red component */ - ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) /* palette green component */ - ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) /* palette blue component */ + ROM_LOAD( "ic23_3-1.bin", 0x0000, 0x0100, CRC(2dd52fb2) SHA1(61722aba7a370f4a97cafbd5df88ec7c6263c4ad) ) // palette red component + ROM_LOAD( "ic23_3-2.bin", 0x0100, 0x0100, CRC(8c2880c9) SHA1(9b4c17f7fa5d6dc01d79c40cec9725ab97f514cb) ) // palette green component + ROM_LOAD( "ic23_3-3.bin", 0x0200, 0x0100, CRC(a488d761) SHA1(6dade1dd16905b4751778d49f374936795c3fb6e) ) // palette blue component ROM_END ROM_START( stinger ) ROM_REGION( 0xc000, "maincpu", 0 ) - ROM_LOAD( "1-5j.bin", 0x0000, 0x2000, CRC(1a2ca600) SHA1(473e89f2c49f6e6f38df5d6fc2267ffecf84c6c8) ) /* encrypted */ - ROM_LOAD( "2-6j.bin", 0x2000, 0x2000, CRC(957cd39c) SHA1(38bb589b3bfd962415b31d1151adf4bdb661122f) ) /* encrypted */ - ROM_LOAD( "3-8j.bin", 0x4000, 0x2000, CRC(404c932e) SHA1(c23eac49e06ff38564062c0e8c8cdadf877f1d6a) ) /* encrypted */ - ROM_LOAD( "4-9j.bin", 0x6000, 0x2000, CRC(2d570f91) SHA1(31d54d9fd5254c33f07c605bd6112c7eb53c42a1) ) /* encrypted */ - ROM_LOAD( "5-10j.bin", 0x8000, 0x2000, CRC(c841795c) SHA1(e03860813c03ca1c737935accc2b5fe87c6b624a) ) /* encrypted */ + ROM_LOAD( "1-5j.bin", 0x0000, 0x2000, CRC(1a2ca600) SHA1(473e89f2c49f6e6f38df5d6fc2267ffecf84c6c8) ) // encrypted + ROM_LOAD( "2-6j.bin", 0x2000, 0x2000, CRC(957cd39c) SHA1(38bb589b3bfd962415b31d1151adf4bdb661122f) ) // encrypted + ROM_LOAD( "3-8j.bin", 0x4000, 0x2000, CRC(404c932e) SHA1(c23eac49e06ff38564062c0e8c8cdadf877f1d6a) ) // encrypted + ROM_LOAD( "4-9j.bin", 0x6000, 0x2000, CRC(2d570f91) SHA1(31d54d9fd5254c33f07c605bd6112c7eb53c42a1) ) // encrypted + ROM_LOAD( "5-10j.bin", 0x8000, 0x2000, CRC(c841795c) SHA1(e03860813c03ca1c737935accc2b5fe87c6b624a) ) // encrypted ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "6-9f.bin", 0x0000, 0x2000, CRC(79757f0c) SHA1(71be938c32c6a84618763761786ecc5d7d47581a) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7-9e.bin", 0x0000, 0x2000, CRC(775489be) SHA1(5fccede323895626cf2eabd606ed21282aa36356) ) ROM_LOAD( "8-11e.bin", 0x2000, 0x2000, CRC(43c61b3f) SHA1(5cdb6a5096b42406c2f2784d37e4e39207c35d40) ) ROM_LOAD( "9-14e.bin", 0x4000, 0x2000, CRC(c9ed8fc7) SHA1(259d7681b663adb1c5fe057e2ef08469ddcbd3c3) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10-9h.bin", 0x0000, 0x2000, CRC(6fc3a22d) SHA1(6875b86d60a06aa329d8ff18d0eb48d158074c5d) ) ROM_LOAD( "11-11h.bin", 0x2000, 0x2000, CRC(3df1f57e) SHA1(e365ee4cc8c055cc39abb4598ad80597d3ae19c7) ) ROM_LOAD( "12-14h.bin", 0x4000, 0x2000, CRC(2fbe1391) SHA1(669edc154164944d82dfccda328774ea4a2318ba) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) /* red component */ - ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) /* green component */ - ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) /* blue component */ + ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) // palette red component + ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) // palette green component + ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) // palette blue component ROM_END ROM_START( stinger2 ) ROM_REGION( 0xc000, "maincpu", 0 ) - ROM_LOAD( "n1.bin", 0x0000, 0x2000, CRC(f2d2790c) SHA1(0e5e92ef45b5bc27b0818f83c89b3bda0e701403) ) /* encrypted */ - ROM_LOAD( "n2.bin", 0x2000, 0x2000, CRC(8fd2d8d8) SHA1(d3318a81fddeb3fa50d01569c1e1145e26ce7277) ) /* encrypted */ - ROM_LOAD( "n3.bin", 0x4000, 0x2000, CRC(f1794d36) SHA1(7954500f489c0bc58cda8e7ffc2e4474759fdc33) ) /* encrypted */ - ROM_LOAD( "n4.bin", 0x6000, 0x2000, CRC(230ba682) SHA1(c419ffebd021d41b3f5021948007fb6bcdb1cdf7) ) /* encrypted */ - ROM_LOAD( "n5.bin", 0x8000, 0x2000, CRC(a03a01da) SHA1(28fecac7a821ac4718242919840266a907160df0) ) /* encrypted */ + ROM_LOAD( "n1.bin", 0x0000, 0x2000, CRC(f2d2790c) SHA1(0e5e92ef45b5bc27b0818f83c89b3bda0e701403) ) // encrypted + ROM_LOAD( "n2.bin", 0x2000, 0x2000, CRC(8fd2d8d8) SHA1(d3318a81fddeb3fa50d01569c1e1145e26ce7277) ) // encrypted + ROM_LOAD( "n3.bin", 0x4000, 0x2000, CRC(f1794d36) SHA1(7954500f489c0bc58cda8e7ffc2e4474759fdc33) ) // encrypted + ROM_LOAD( "n4.bin", 0x6000, 0x2000, CRC(230ba682) SHA1(c419ffebd021d41b3f5021948007fb6bcdb1cdf7) ) // encrypted + ROM_LOAD( "n5.bin", 0x8000, 0x2000, CRC(a03a01da) SHA1(28fecac7a821ac4718242919840266a907160df0) ) // encrypted ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "6-9f.bin", 0x0000, 0x2000, CRC(79757f0c) SHA1(71be938c32c6a84618763761786ecc5d7d47581a) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7-9e.bin", 0x0000, 0x2000, CRC(775489be) SHA1(5fccede323895626cf2eabd606ed21282aa36356) ) ROM_LOAD( "8-11e.bin", 0x2000, 0x2000, CRC(43c61b3f) SHA1(5cdb6a5096b42406c2f2784d37e4e39207c35d40) ) ROM_LOAD( "9-14e.bin", 0x4000, 0x2000, CRC(c9ed8fc7) SHA1(259d7681b663adb1c5fe057e2ef08469ddcbd3c3) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10.bin", 0x0000, 0x2000, CRC(f6721930) SHA1(fb903f1deb5f093ff5fe129e213966af58a68339) ) ROM_LOAD( "11.bin", 0x2000, 0x2000, CRC(a4404e63) SHA1(50ae99748547af20e04f6c6c8c7eba85f967b9dc) ) ROM_LOAD( "12.bin", 0x4000, 0x2000, CRC(b60fa88c) SHA1(2d3bca35076625251933989f5e566d5d3290542b) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) /* red component */ - ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) /* green component */ - ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) /* blue component */ + ROM_LOAD( "stinger.a7", 0x0000, 0x0100, CRC(52c06fc2) SHA1(b416077fcfabe0dbb1ca30752de6a219ea896f75) ) // palette red component + ROM_LOAD( "stinger.b7", 0x0100, 0x0100, CRC(9985e575) SHA1(b0d609968917121325760f8d4777066abdb7ccfc) ) // palette green component + ROM_LOAD( "stinger.a8", 0x0200, 0x0100, CRC(76b57629) SHA1(836763948753b7fed97c9e5d90a16dc4ba68f42a) ) // palette blue component ROM_END ROM_START( finger ) // AFC 02300 Rev.0 + AFC 03300 Rev.0 PCBs. Only the first three main CPU ROMs differ. Basically just a GFX hack of the stinger2 set. @@ -1142,20 +1469,20 @@ ROM_START( scion ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "sc6", 0x0000, 0x2000, CRC(09f5f9c1) SHA1(83e489f32597880fb1a13f0bafedd275facb21f7) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7.10e", 0x0000, 0x2000, CRC(223e0d2a) SHA1(073638172ce0762d103cc07705fc493432e5aa63) ) ROM_LOAD( "8.12e", 0x2000, 0x2000, CRC(d3e39b48) SHA1(c686ef35bf866d044637df295bb70c9c005fc98c) ) ROM_LOAD( "9.15e", 0x4000, 0x2000, CRC(630861b5) SHA1(a6ccfa10e43e92407c452f9744aa1735b257c28e) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10.10h", 0x0000, 0x2000, CRC(0d2a0d1e) SHA1(518689f91019e64138ed3560e161d3ef93d0671d) ) ROM_LOAD( "11.12h", 0x2000, 0x2000, CRC(dc6ef8ab) SHA1(ba93392a494a66336197d28e45832b9f8f3e4376) ) ROM_LOAD( "12.15h", 0x4000, 0x2000, CRC(c82c28bf) SHA1(8952b515f01027a94bee0186221a1989ea2cd919) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) /* red component */ - ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) /* green component */ - ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) /* blue component */ + ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) // palette red component + ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) // palette green component + ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) // palette blue component ROM_END ROM_START( scionc ) @@ -1169,24 +1496,24 @@ ROM_START( scionc ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "6.9f", 0x0000, 0x2000, CRC(a66a0ce6) SHA1(b2d6a8ded007c362c58496ead33d1561a982440a) ) - ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx1", 0 ) // sprites/chars ROM_LOAD( "7.10e", 0x0000, 0x2000, CRC(223e0d2a) SHA1(073638172ce0762d103cc07705fc493432e5aa63) ) ROM_LOAD( "8.12e", 0x2000, 0x2000, CRC(d3e39b48) SHA1(c686ef35bf866d044637df295bb70c9c005fc98c) ) ROM_LOAD( "9.15e", 0x4000, 0x2000, CRC(630861b5) SHA1(a6ccfa10e43e92407c452f9744aa1735b257c28e) ) - ROM_REGION( 0x6000, "gfx2", 0 ) /* sprites/chars */ + ROM_REGION( 0x6000, "gfx2", 0 ) // sprites/chars ROM_LOAD( "10.10h", 0x0000, 0x2000, CRC(0d2a0d1e) SHA1(518689f91019e64138ed3560e161d3ef93d0671d) ) ROM_LOAD( "11.12h", 0x2000, 0x2000, CRC(dc6ef8ab) SHA1(ba93392a494a66336197d28e45832b9f8f3e4376) ) ROM_LOAD( "12.15h", 0x4000, 0x2000, CRC(c82c28bf) SHA1(8952b515f01027a94bee0186221a1989ea2cd919) ) ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) /* red component */ - ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) /* green component */ - ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) /* blue component */ + ROM_LOAD( "82s129.7a", 0x0000, 0x0100, CRC(2f89d9ea) SHA1(37adbddb9b3253b995a02a74e0de27ad594dc544) ) // palette red component + ROM_LOAD( "82s129.7b", 0x0100, 0x0100, CRC(ba151e6a) SHA1(3d3139936de9e1913dee94317420a171bd3d2062) ) // palette green component + ROM_LOAD( "82s129.8a", 0x0200, 0x0100, CRC(f681ce59) SHA1(4ac74c1d04e6b3f14a0f4530a41ba188f5a8f6be) ) // palette blue component ROM_END -void wiz_state::init_stinger() +void stinger_state::init_stinger() { static const uint8_t swap_xor_table[4][4] = { @@ -1203,31 +1530,33 @@ void wiz_state::init_stinger() { if (a & 0x2040) { - /* not encrypted */ + // not encrypted m_decrypted_opcodes[a] = rom[a]; } else { const uint8_t src = rom[a]; - /* pick the translation table from bits 3 and 5 of the address */ + // pick the translation table from bits 3 and 5 of the address int row = ((a >> 3) & 1) + (((a >> 5) & 1) << 1); - /* decode the opcodes */ + // decode the opcodes tbl = swap_xor_table[row]; m_decrypted_opcodes[a] = bitswap<8>(src, tbl[0], 6, tbl[1], 4, tbl[2], 2, 1, 0) ^ tbl[3]; } } } +} // anonymous namespace + -GAME( 1983, stinger, 0, stinger, stinger, wiz_state, init_stinger, ROT90, "Seibu Denshi", "Stinger", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, stinger2, stinger, stinger, stinger2, wiz_state, init_stinger, ROT90, "Seibu Denshi", "Stinger (prototype?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, finger, stinger, stinger, stinger2, wiz_state, init_stinger, ROT90, "bootleg", "Finger (bootleg of Stinger)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, scion, 0, scion, scion, wiz_state, empty_init, ROT0, "Seibu Denshi", "Scion", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, scionc, scion, scion, scion, wiz_state, empty_init, ROT0, "Seibu Denshi (Cinematronics license)", "Scion (Cinematronics)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, kungfut, 0, kungfut, kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) -GAME( 1984, kungfuta, kungfut, kungfuta,kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) /* board was a bootleg but set might still be original */ -GAME( 1985, wiz, 0, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu", "Wiz", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, wizt, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, wizta, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, stinger, 0, stinger, stinger, stinger_state, init_stinger, ROT90, "Seibu Denshi", "Stinger", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, stinger2, stinger, stinger, stinger2, stinger_state, init_stinger, ROT90, "Seibu Denshi", "Stinger (prototype?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, finger, stinger, stinger, stinger2, stinger_state, init_stinger, ROT90, "bootleg", "Finger (bootleg of Stinger)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, scion, 0, scion, scion, stinger_state, empty_init, ROT0, "Seibu Denshi", "Scion", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, scionc, scion, scion, scion, stinger_state, empty_init, ROT0, "Seibu Denshi (Cinematronics license)", "Scion (Cinematronics)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, kungfut, 0, kungfut, kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) +GAME( 1984, kungfuta, kungfut, kungfuta,kungfut, wiz_state, empty_init, ROT0, "Seibu Kaihatsu", "Kung-Fu Taikun (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_MICROPHONE ) /* board was a bootleg but set might still be original */ +GAME( 1985, wiz, 0, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu", "Wiz", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, wizt, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, wizta, wiz, wiz, wiz, wiz_state, empty_init, ROT270, "Seibu Kaihatsu (Taito license)", "Wiz (Taito, set 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/wiz.h b/src/mame/seibu/wiz.h deleted file mode 100644 index 440f2520e8b..00000000000 --- a/src/mame/seibu/wiz.h +++ /dev/null @@ -1,108 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/*************************************************************************** - - Seibu Stinger/Wiz hardware - -***************************************************************************/ -#ifndef MAME_SEIBU_WIZ_H -#define MAME_SEIBU_WIZ_H - -#pragma once - -#include "sound/discrete.h" -#include "emupal.h" - -class wiz_state : public driver_device -{ -public: - wiz_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_discrete(*this, "discrete"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_videoram(*this, "videoram"), - m_videoram2(*this, "videoram2"), - m_colorram(*this, "colorram"), - m_colorram2(*this, "colorram2"), - m_attrram(*this, "attrram"), - m_attrram2(*this, "attrram2"), - m_spriteram(*this, "spriteram"), - m_spriteram2(*this, "spriteram2"), - m_decrypted_opcodes(*this, "decrypted_opcodes") - { } - - void wiz(machine_config &config); - void kungfut(machine_config &config); - void kungfuta(machine_config &config); - void scion(machine_config &config); - void stinger(machine_config &config); - - void init_stinger(); - -private: - required_device m_maincpu; - required_device m_audiocpu; - optional_device m_discrete; - required_device m_gfxdecode; - required_device m_palette; - - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_attrram; - required_shared_ptr m_attrram2; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - optional_shared_ptr m_decrypted_opcodes; - - int32_t m_flipx = 0; - int32_t m_flipy = 0; - int32_t m_bgcolor = 0; - uint8_t m_charbank[2]{}; - uint8_t m_palbank[2]{}; - uint8_t m_main_nmi_mask = 0; - uint8_t m_sound_nmi_mask = 0; - uint8_t m_sprite_bank = 0; - - int m_dsc0 = 0; - int m_dsc1 = 0; - - uint8_t wiz_protection_r(); - uint8_t kungfuta_protection_r(); - void wiz_coin_counter_w(offs_t offset, uint8_t data); - void wiz_main_nmi_mask_w(uint8_t data); - void wiz_sound_nmi_mask_w(uint8_t data); - void wiz_palette_bank_w(offs_t offset, uint8_t data); - void wiz_sprite_bank_w(uint8_t data); - void wiz_bgcolor_w(uint8_t data); - void wiz_char_bank_w(offs_t offset, uint8_t data); - void wiz_flipx_w(uint8_t data); - void wiz_flipy_w(uint8_t data); - void stinger_explosion_w(uint8_t data); - void stinger_shot_w(uint8_t data); - - virtual void machine_reset() override; - virtual void machine_start() override; - void wiz_palette(palette_device &palette) const; - uint32_t screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(wiz_vblank_interrupt); - INTERRUPT_GEN_MEMBER(wiz_sound_interrupt); - void draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank); - - void decrypted_opcodes_map(address_map &map); - void kungfut_main_map(address_map &map); - void kungfuta_main_map(address_map &map); - void kungfut_sound_map(address_map &map); - void stinger_main_map(address_map &map); - void stinger_sound_map(address_map &map); - void wiz_main_map(address_map &map); -}; - -#endif // MAME_SEIBU_WIZ_H diff --git a/src/mame/seibu/wiz_v.cpp b/src/mame/seibu/wiz_v.cpp deleted file mode 100644 index 7a2c2322d67..00000000000 --- a/src/mame/seibu/wiz_v.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/*************************************************************************** - - Seibu Stinger/Wiz hardware - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "wiz.h" - -#include "video/resnet.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Stinger has three 256x4 palette PROMs (one per gun). - The palette PROMs are connected to the RGB output this way: - - bit 3 -- 100 ohm resistor -- RED/GREEN/BLUE - -- 220 ohm resistor -- RED/GREEN/BLUE - -- 470 ohm resistor -- RED/GREEN/BLUE - bit 0 -- 1 kohm resistor -- RED/GREEN/BLUE - -***************************************************************************/ - -void wiz_state::wiz_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - static constexpr int resistances[4] = { 1000, 470, 220, 100 }; - - // compute the color output resistor weights - double rweights[4], gweights[4], bweights[4]; - compute_resistor_weights(0, 255, -1.0, - 4, resistances, rweights, 470, 0, - 4, resistances, gweights, 470, 0, - 4, resistances, bweights, 470, 0); - - // initialize the palette with these colors - for (int i = 0; i < 0x100; i++) - { - int bit0, bit1, bit2, bit3; - - // red component - bit0 = BIT(color_prom[i + 0x000], 0); - bit1 = BIT(color_prom[i + 0x000], 1); - bit2 = BIT(color_prom[i + 0x000], 2); - bit3 = BIT(color_prom[i + 0x000], 3); - int const r = combine_weights(rweights, bit0, bit1, bit2, bit3); - - // green component - bit0 = BIT(color_prom[i + 0x100], 0); - bit1 = BIT(color_prom[i + 0x100], 1); - bit2 = BIT(color_prom[i + 0x100], 2); - bit3 = BIT(color_prom[i + 0x100], 3); - int const g = combine_weights(gweights, bit0, bit1, bit2, bit3); - - // blue component - bit0 = BIT(color_prom[i + 0x200], 0); - bit1 = BIT(color_prom[i + 0x200], 1); - bit2 = BIT(color_prom[i + 0x200], 2); - bit3 = BIT(color_prom[i + 0x200], 3); - int const b = combine_weights(bweights, bit0, bit1, bit2, bit3); - - m_palette->set_pen_color(i, rgb_t(r, g, b)); - } -} - - - -/*************************************************************************** - - I/O - -***************************************************************************/ - -void wiz_state::wiz_palette_bank_w(offs_t offset, uint8_t data) -{ - m_palbank[offset] = data & 1; -} - -void wiz_state::wiz_char_bank_w(offs_t offset, uint8_t data) -{ - m_charbank[offset] = data & 1; -} - -void wiz_state::wiz_sprite_bank_w(uint8_t data) -{ - m_sprite_bank = data & 1; -} - -void wiz_state::wiz_bgcolor_w(uint8_t data) -{ - m_bgcolor = data; -} - -void wiz_state::wiz_flipx_w(uint8_t data) -{ - m_flipx = data & 1; -} - -void wiz_state::wiz_flipy_w(uint8_t data) -{ - m_flipy = data & 1; -} - - - -/*************************************************************************** - - Screen Update - -***************************************************************************/ - -void wiz_state::draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype) -{ - uint8_t *vram = layer ? m_videoram2 : m_videoram; - uint8_t *aram = layer ? m_attrram2 : m_attrram; - uint8_t *cram = layer ? m_colorram2 : m_colorram; - gfx_element *gfx = m_gfxdecode->gfx(charbank); - int palbank = m_palbank[1] << 4 | m_palbank[0] << 3; - - /* draw the tiles. They are characters, but draw them as sprites. */ - for (int offs = 0x400-1; offs >= 0; offs--) - { - int code = vram[offs]; - int sx = offs & 0x1f; - int sy = offs >> 5; - int color = aram[sx << 1 | 1] & 7; - - // wiz/kungfut hw allows more color variety on screen - if (colortype) - color = layer ? (cram[offs] & 7) : ((color & 4) | (code & 3)); - - int scroll = (8*sy + 256 - aram[sx << 1]) & 0xff; - if (m_flipy) - scroll = (248 - scroll) & 0xff; - if (m_flipx) - sx = 31 - sx; - - gfx->transpen(bitmap,cliprect, - code, - palbank | color, - m_flipx,m_flipy, - 8*sx,scroll,0); - } -} - - -void wiz_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int set, int charbank) -{ - uint8_t *sram = set ? m_spriteram2 : m_spriteram; - gfx_element *gfx = m_gfxdecode->gfx(charbank); - int palbank = m_palbank[1] << 4 | m_palbank[0] << 3; - - for (int offs = 0x20-4; offs >= 0; offs -= 4) - { - int code = sram[offs + 1]; - int sx = sram[offs + 3]; - int sy = sram[offs]; - int color = sram[offs + 2] & 7; // high bits unused - - if (!sx || !sy) continue; - - // like on galaxian hw, the first three sprites match against y-1 (not on m_spriteram2) - if (set == 0 && offs <= 8) - sy += (m_flipy) ? 1 : -1; - - if ( m_flipx) sx = 240 - sx; - if (!m_flipy) sy = 240 - sy; - - gfx->transpen(bitmap,cliprect, - code, - palbank | color, - m_flipx,m_flipy, - sx,sy,0); - } -} - - -/**************************************************************************/ - -uint32_t wiz_state::screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_bgcolor, cliprect); - draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 1); - draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); - draw_sprites(bitmap, cliprect, 1, 4); - draw_sprites(bitmap, cliprect, 0, 5); - return 0; -} - -uint32_t wiz_state::screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_bgcolor, cliprect); - draw_tiles(bitmap, cliprect, 0, 2 + ((m_charbank[0] << 1) | m_charbank[1]), 1); - draw_tiles(bitmap, cliprect, 1, m_charbank[1], 1); - - const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); - const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); - const rectangle &visible_area = m_flipx ? spritevisibleareaflipx : spritevisiblearea; - - draw_sprites(bitmap, visible_area, 1, 6); - draw_sprites(bitmap, visible_area, 0, 7 + m_sprite_bank); - return 0; -} - - -uint32_t wiz_state::screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_bgcolor, cliprect); - draw_tiles(bitmap, cliprect, 0, 2 + m_charbank[0], 0); - draw_tiles(bitmap, cliprect, 1, m_charbank[1], 0); - draw_sprites(bitmap, cliprect, 1, 4); - draw_sprites(bitmap, cliprect, 0, 5); - return 0; -} -- cgit v1.2.3