diff options
Diffstat (limited to 'src/mame/excellent/witch.cpp')
-rw-r--r-- | src/mame/excellent/witch.cpp | 602 |
1 files changed, 373 insertions, 229 deletions
diff --git a/src/mame/excellent/witch.cpp b/src/mame/excellent/witch.cpp index b053a61bcf0..2b530f067fe 100644 --- a/src/mame/excellent/witch.cpp +++ b/src/mame/excellent/witch.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Tomasz Slanina +// copyright-holders: Tomasz Slanina + /* Witch / Pinball Champ '95 @@ -215,24 +216,167 @@ Interesting memory locations TODO : - - Figure out the ports for the "PayOut" stuff (a006/a00c?); - - Hook up the OKI M5202; - lagging sprites on witch (especially noticeable when game scrolls up/down) */ #include "emu.h" -#include "witch.h" +#include "cpu/z80/z80.h" +#include "machine/i8255.h" +#include "machine/nvram.h" +#include "machine/ticket.h" +#include "sound/ay8910.h" +#include "sound/es8712.h" +#include "sound/ymopn.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +// configurable logging +#define LOG_INPUTS (1U << 1) + +//#define VERBOSE (LOG_GENERAL | LOG_INPUTS) + +#include "logmacro.h" + +#define LOGINPUTS(...) LOGMASKED(LOG_INPUTS, __VA_ARGS__) + + +namespace { + +class base_state : public driver_device +{ +public: + base_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_subcpu(*this, "sub") + , m_ppi(*this, "ppi%u", 1U) + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") + , m_hopper(*this, "hopper") + , m_gfx_vram(*this, "gfx%u_vram", 0U) + , m_gfx_cram(*this, "gfx%u_cram", 0U) + , m_sprite_ram(*this, "sprite_ram") + , m_inputs(*this, { "UNK", "INPUTS", "A005" }) + { } + +protected: + virtual void machine_reset() override; + + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_subcpu; + required_device_array<i8255_device, 2> m_ppi; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + required_device<ticket_dispenser_device> m_hopper; + + required_shared_ptr_array<uint8_t, 2> m_gfx_vram; + required_shared_ptr_array<uint8_t, 2> m_gfx_cram; + required_shared_ptr<uint8_t> m_sprite_ram; + + required_ioport_array<3> m_inputs; + + uint8_t m_scrollx = 0; + uint8_t m_scrolly = 0; + uint8_t m_reg_a002 = 0; + uint8_t m_motor_active = 0; + tilemap_t *m_gfx_tilemap[2]{}; + bool m_has_spr_rom_bank = false; + uint8_t m_spr_bank = 0; + + void base(machine_config &config); + + template <uint8_t Which> void gfx_vram_w(offs_t offset, uint8_t data); + template <uint8_t Which> void gfx_cram_w(offs_t offset, uint8_t data); + uint8_t gfx1_vram_r(offs_t offset); + uint8_t gfx1_cram_r(offs_t offset); + uint8_t a000_r(); + void a006_w(uint8_t data); + void main_a008_w(uint8_t data); + void sub_a008_w(uint8_t data); + void xscroll_w(uint8_t data); + void yscroll_w(uint8_t data); + + void common_map(address_map &map); + + TILE_GET_INFO_MEMBER(get_gfx0_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void video_common_init(); +}; -TILE_GET_INFO_MEMBER(witch_state::get_gfx0_tile_info) +class witch_state : public base_state { - int code = m_gfx0_vram[tile_index]; - int color = m_gfx0_cram[tile_index]; +public: + witch_state(const machine_config &mconfig, device_type type, const char *tag) + : base_state(mconfig, type, tag) + , m_mainbank(*this, "mainbank") + , m_sub_rom(*this, "sub") + { } + + void witch(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void video_start() override; + +private: + required_memory_bank m_mainbank; + required_region_ptr<uint8_t> m_sub_rom; - code=code | ((color & 0xe0) << 3); + static constexpr uint16_t UNBANKED_SIZE = 0x800; + + void a002_w(uint8_t data); + uint8_t prot_read_700x(offs_t offset); + TILE_GET_INFO_MEMBER(get_gfx1_tile_info); + + void common_map(address_map &map); + void main_map(address_map &map); + void sub_map(address_map &map); +}; + +class keirinou_state : public base_state +{ +public: + keirinou_state(const machine_config &mconfig, device_type type, const char *tag) + : base_state(mconfig, type, tag), + m_paletteram(*this, "paletteram") + { } + + void keirinou(machine_config &config); + +protected: + virtual void video_start() override; + +private: + required_shared_ptr<uint8_t> m_paletteram; + + uint8_t m_bg_bank = 0; + + void common_map(address_map &map); + void main_map(address_map &map); + void sub_map(address_map &map); + + void a002_w(uint8_t data); + void palette_w(offs_t offset, uint8_t data); + TILE_GET_INFO_MEMBER(get_gfx1_tile_info); +}; + + +TILE_GET_INFO_MEMBER(base_state::get_gfx0_tile_info) +{ + int code = m_gfx_vram[0][tile_index]; + int const color = m_gfx_cram[0][tile_index]; + + code |= ((color & 0xe0) << 3); tileinfo.set(1, - code, //tiles beyond 0x7ff only for sprites? + code, // tiles beyond 0x7ff only for sprites? color & 0x0f, 0); @@ -241,31 +385,31 @@ TILE_GET_INFO_MEMBER(witch_state::get_gfx0_tile_info) TILE_GET_INFO_MEMBER(witch_state::get_gfx1_tile_info) { - int code = m_gfx1_vram[tile_index]; - int color = m_gfx1_cram[tile_index]; + int const code = m_gfx_vram[1][tile_index]; + int const color = m_gfx_cram[1][tile_index]; tileinfo.set(0, code | ((color & 0xf0) << 4), - (color>>0) & 0x0f, + (color >> 0) & 0x0f, 0); } -TILE_GET_INFO_MEMBER(keirinou_state::get_keirinou_gfx1_tile_info) +TILE_GET_INFO_MEMBER(keirinou_state::get_gfx1_tile_info) { - int code = m_gfx1_vram[tile_index]; - int color = m_gfx1_cram[tile_index]; + int const code = m_gfx_vram[1][tile_index]; + int const color = m_gfx_cram[1][tile_index]; tileinfo.set(0, code | ((color & 0xc0) << 2) | (m_bg_bank << 10), - (color>>0) & 0xf, + (color >> 0) & 0xf, 0); } -void witch_state::video_common_init() +void base_state::video_common_init() { - m_gfx0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(witch_state::get_gfx0_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 32,32); + m_gfx_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(base_state::get_gfx0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_gfx0_tilemap->set_transparent_pen(0); + m_gfx_tilemap[0]->set_transparent_pen(0); save_item(NAME(m_scrollx)); save_item(NAME(m_scrolly)); @@ -276,144 +420,135 @@ void witch_state::video_common_init() void witch_state::video_start() { video_common_init(); - m_gfx1_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(witch_state::get_gfx1_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 32,32); + m_gfx_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(witch_state::get_gfx1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_gfx0_tilemap->set_palette_offset(0x100); - m_gfx1_tilemap->set_palette_offset(0x200); + m_gfx_tilemap[0]->set_palette_offset(0x100); + m_gfx_tilemap[1]->set_palette_offset(0x200); - has_spr_rom_bank = false; + m_has_spr_rom_bank = false; } void keirinou_state::video_start() { - //witch_state::video_start(); video_common_init(); - m_gfx1_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(keirinou_state::get_keirinou_gfx1_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 32,32); + m_gfx_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(keirinou_state::get_gfx1_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_gfx0_tilemap->set_palette_offset(0x000); - m_gfx1_tilemap->set_palette_offset(0x100); + m_gfx_tilemap[0]->set_palette_offset(0x000); + m_gfx_tilemap[1]->set_palette_offset(0x100); save_item(NAME(m_spr_bank)); save_item(NAME(m_bg_bank)); - has_spr_rom_bank = true; + m_has_spr_rom_bank = true; } -void witch_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +void base_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - int i,sx,sy,tileno,flags,color; - int flipx=0; - int flipy=0; - int region = has_spr_rom_bank == true ? 2 : 1; - - for(i=0;i<0x800;i+=0x20) { - sx = m_sprite_ram[i+1]; - if(sx!=0xF8) { - tileno = (m_sprite_ram[i]<<2); - tileno+= (has_spr_rom_bank == true ? m_spr_bank : ( m_sprite_ram[i+0x800] & 0x07 )) << 10; + int const region = m_has_spr_rom_bank == true ? 2 : 1; - sy = m_sprite_ram[i+2]; - flags = m_sprite_ram[i+3]; + for (int i = 0; i < 0x800; i += 0x20) + { + int const sx = m_sprite_ram[i + 1]; + if (sx != 0xf8) + { + int tileno = (m_sprite_ram[i] << 2); + tileno += (m_has_spr_rom_bank == true ? m_spr_bank : (m_sprite_ram[i + 0x800] & 0x07)) << 10; - flipx = (flags & 0x10 ) ? 1 : 0; - flipy = (flags & 0x20 ) ? 1 : 0; + int const sy = m_sprite_ram[i + 2]; + int const flags = m_sprite_ram[i + 3]; - color = (flags & 0x0f); + int const flipx = BIT(flags, 4); + int const flipy = BIT(flags, 5); + int const color = (flags & 0x0f); - m_gfxdecode->gfx(region)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(region)->transpen(bitmap, cliprect, tileno, color, flipx, flipy, - sx+8*flipx,sy+8*flipy,0); + sx + 8 * flipx, sy + 8 * flipy, 0); - m_gfxdecode->gfx(region)->transpen(bitmap,cliprect, - tileno+1, color, + m_gfxdecode->gfx(region)->transpen(bitmap, cliprect, + tileno + 1, color, flipx, flipy, - sx+8-8*flipx,sy+8*flipy,0); + sx + 8 - 8 * flipx, sy + 8 * flipy, 0); - m_gfxdecode->gfx(region)->transpen(bitmap,cliprect, - tileno+2, color, + m_gfxdecode->gfx(region)->transpen(bitmap, cliprect, + tileno + 2, color, flipx, flipy, - sx+8*flipx,sy+8-8*flipy,0); + sx + 8 * flipx, sy + 8 - 8 * flipy, 0); - m_gfxdecode->gfx(region)->transpen(bitmap,cliprect, - tileno+3, color, + m_gfxdecode->gfx(region)->transpen(bitmap, cliprect, + tileno + 3, color, flipx, flipy, - sx+8-8*flipx,sy+8-8*flipy,0); + sx + 8 - 8 * flipx, sy + 8 - 8 * flipy, 0); } } } -uint32_t witch_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - m_gfx1_tilemap->set_scrollx(0, m_scrollx-7 ); //offset to have it aligned with the sprites - m_gfx1_tilemap->set_scrolly(0, m_scrolly+8 ); + m_gfx_tilemap[1]->set_scrollx(0, m_scrollx - 7); //offset to have it aligned with the sprites + m_gfx_tilemap[1]->set_scrolly(0, m_scrolly + 8); - m_gfx1_tilemap->draw(screen, bitmap, cliprect, 0,0); - m_gfx0_tilemap->draw(screen, bitmap, cliprect, 1,0); + m_gfx_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + m_gfx_tilemap[0]->draw(screen, bitmap, cliprect, 1, 0); draw_sprites(bitmap, cliprect); - m_gfx0_tilemap->draw(screen, bitmap, cliprect, 0,0); + m_gfx_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); return 0; } -void witch_state::gfx0_vram_w(offs_t offset, uint8_t data) -{ - m_gfx0_vram[offset] = data; - m_gfx0_tilemap->mark_tile_dirty(offset); -} - -void witch_state::gfx0_cram_w(offs_t offset, uint8_t data) -{ - m_gfx0_cram[offset] = data; - m_gfx0_tilemap->mark_tile_dirty(offset); -} - #define FIX_OFFSET() do { \ - offset=(((offset + ((m_scrolly & 0xf8) << 2) ) & 0x3e0)+((offset + (m_scrollx >> 3) ) & 0x1f)+32)&0x3ff; } while(0) + offset = (((offset + ((m_scrolly & 0xf8) << 2)) & 0x3e0) + ((offset + (m_scrollx >> 3)) & 0x1f) + 32) & 0x3ff; } while(0) -void witch_state::gfx1_vram_w(offs_t offset, uint8_t data) +template <uint8_t Which> +void base_state::gfx_vram_w(offs_t offset, uint8_t data) { - FIX_OFFSET(); - m_gfx1_vram[offset] = data; - m_gfx1_tilemap->mark_tile_dirty(offset); + if (Which) + FIX_OFFSET(); + + m_gfx_vram[Which][offset] = data; + m_gfx_tilemap[Which]->mark_tile_dirty(offset); } -void witch_state::gfx1_cram_w(offs_t offset, uint8_t data) +template <uint8_t Which> +void base_state::gfx_cram_w(offs_t offset, uint8_t data) { - FIX_OFFSET(); - m_gfx1_cram[offset] = data; - m_gfx1_tilemap->mark_tile_dirty(offset); + if (Which) + FIX_OFFSET(); + + m_gfx_cram[Which][offset] = data; + m_gfx_tilemap[Which]->mark_tile_dirty(offset); } -uint8_t witch_state::gfx1_vram_r(offs_t offset) +uint8_t base_state::gfx1_vram_r(offs_t offset) { FIX_OFFSET(); - return m_gfx1_vram[offset]; + return m_gfx_vram[1][offset]; } -uint8_t witch_state::gfx1_cram_r(offs_t offset) +uint8_t base_state::gfx1_cram_r(offs_t offset) { FIX_OFFSET(); - return m_gfx1_cram[offset]; + return m_gfx_cram[1][offset]; } -uint8_t witch_state::read_a000() +uint8_t base_state::a000_r() { switch (m_reg_a002 & 0x3f) { case 0x3b: - return ioport("UNK")->read(); //bet10 / pay out + return m_inputs[0]->read(); //bet10 / pay out case 0x3e: - return ioport("INPUTS")->read(); //TODO : trace f564 + return m_inputs[1]->read(); //TODO : trace f564 case 0x3d: - return ioport("A005")->read(); + return m_inputs[2]->read(); default: - logerror("A000 read with mux=0x%02x\n", m_reg_a002 & 0x3f); + LOGINPUTS("A000 read with mux = 0x%02x\n", m_reg_a002 & 0x3f); return 0xff; } } -void witch_state::write_a002(uint8_t data) +void witch_state::a002_w(uint8_t data) { //A002 bit 7&6 = m_bank ???? m_reg_a002 = data; @@ -421,23 +556,22 @@ void witch_state::write_a002(uint8_t data) m_mainbank->set_entry((data >> 6) & 3); } -void keirinou_state::write_keirinou_a002(uint8_t data) +void keirinou_state::a002_w(uint8_t data) { - uint8_t new_bg_bank; m_reg_a002 = data; - m_spr_bank = BIT(data,7); - new_bg_bank = BIT(data,6); + m_spr_bank = BIT(data, 7); + uint8_t new_bg_bank = BIT(data, 6); - if(m_bg_bank != new_bg_bank) + if (m_bg_bank != new_bg_bank) { m_bg_bank = new_bg_bank; - m_gfx1_tilemap->mark_all_dirty(); + m_gfx_tilemap[1]->mark_all_dirty(); } // m_mainbank->set_entry((data >> 6) & 3); } -void witch_state::write_a006(uint8_t data) +void base_state::a006_w(uint8_t data) { // don't write when zeroed on reset if (data == 0) @@ -451,12 +585,12 @@ void witch_state::write_a006(uint8_t data) machine().bookkeeping().coin_counter_w(0, !BIT(data, 6)); // coin in counter } -void witch_state::main_write_a008(uint8_t data) +void base_state::main_a008_w(uint8_t data) { m_maincpu->set_input_line(0, CLEAR_LINE); } -void witch_state::sub_write_a008(uint8_t data) +void base_state::sub_a008_w(uint8_t data) { m_subcpu->set_input_line(0, CLEAR_LINE); } @@ -464,12 +598,12 @@ void witch_state::sub_write_a008(uint8_t data) uint8_t witch_state::prot_read_700x(offs_t offset) { /* - Code @$21a looks like simple protection check. + Code @$21a looks like a simple protection check. - write 7,6,0 to $700f - - read 5 bytes from $7000-$7004 ( bit 1 of $700d is data "READY" status) + - read 5 bytes from $7000-$7004 (bit 1 of $700d is data "READY" status) - Data @ $7000 must differs from data @$7001-04. + Data @ $7000 must differ from data @$7001-04. Otherwise later in game some I/O (controls) reads are skipped. */ @@ -481,56 +615,52 @@ uint8_t witch_state::prot_read_700x(offs_t offset) case 0x252: case 0x258: case 0x25e: - return offset;//enough to pass... + return offset; //enough to pass... } - return memregion("sub")->base()[0x7000+offset]; + return m_sub_rom[0x7000 + offset]; } -void witch_state::xscroll_w(uint8_t data) +void base_state::xscroll_w(uint8_t data) { m_scrollx = data; // need to mark tiles dirty here, as the tilemap writes are affected by scrollx, see FIX_OFFSET macro. // without it keirin ou can seldomly draw garbage after a big/small bonus game // TODO: rewrite tilemap code so that it doesn't need FIX_OFFSET at all! - m_gfx1_tilemap->mark_all_dirty(); + m_gfx_tilemap[1]->mark_all_dirty(); } -void witch_state::yscroll_w(uint8_t data) +void base_state::yscroll_w(uint8_t data) { m_scrolly = data; } void keirinou_state::palette_w(offs_t offset, uint8_t data) { - int r,g,b; - m_paletteram[offset] = data; // TODO: bit 0? - r = ((m_paletteram[offset] & 0xe)>>1); - g = ((m_paletteram[offset] & 0x30)>>4); - b = ((m_paletteram[offset] & 0xc0)>>6); + int const r = ((m_paletteram[offset] & 0x0e) >> 1); + int const g = ((m_paletteram[offset] & 0x30) >> 4); + int const b = ((m_paletteram[offset] & 0xc0) >> 6); m_palette->set_pen_color(offset, pal3bit(r), pal2bit(g), pal2bit(b)); // sprite palette uses an indirect table // sprites are only used to draw cyclists, and pens 0x01-0x05 are directly tied to a specific sprite entry. - // this probably translates in HW by selecting a specific pen for the lowest bit in GFX roms instead of the typical color entry offset. + // this probably translates in HW by selecting a specific pen for the lowest bit in GFX ROMs instead of the typical color entry offset. // we do some massaging of the data here, the alternative is to use custom drawing code but that quite doesn't fit with witch - if((offset & 0x1f0) == 0x00) + if ((offset & 0x1f0) == 0x00) { - int i; - - if(offset > 5) + if (offset > 5) { - for(i=0;i<0x80;i+=0x10) - m_palette->set_pen_color(offset+0x200+i, pal3bit(r), pal2bit(g), pal2bit(b)); + for (int i = 0; i < 0x80; i += 0x10) + m_palette->set_pen_color(offset + 0x200 + i, pal3bit(r), pal2bit(g), pal2bit(b)); } else { - for(i=(offset & 7) * 0x10;i<((offset & 7) * 0x10)+8;i++) - m_palette->set_pen_color(0x200+i, pal3bit(r), pal2bit(g), pal2bit(b)); + for (int i = (offset & 7) * 0x10; i < ((offset & 7) * 0x10) + 8; i++) + m_palette->set_pen_color(0x200 + i, pal3bit(r), pal2bit(g), pal2bit(b)); } } } @@ -541,16 +671,16 @@ void keirinou_state::palette_w(offs_t offset, uint8_t data) * *********************************************/ -void witch_state::common_map(address_map &map) +void base_state::common_map(address_map &map) { map(0xa000, 0xa003).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0xa004, 0xa007).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0xa00c, 0xa00c).portr("SERVICE"); // stats / reset map(0xa00e, 0xa00e).portr("COINS"); // coins/attendant keys - map(0xc000, 0xc3ff).ram().w(FUNC(witch_state::gfx0_vram_w)).share("gfx0_vram"); - map(0xc400, 0xc7ff).ram().w(FUNC(witch_state::gfx0_cram_w)).share("gfx0_cram"); - map(0xc800, 0xcbff).rw(FUNC(witch_state::gfx1_vram_r), FUNC(witch_state::gfx1_vram_w)).share("gfx1_vram"); - map(0xcc00, 0xcfff).rw(FUNC(witch_state::gfx1_cram_r), FUNC(witch_state::gfx1_cram_w)).share("gfx1_cram"); + map(0xc000, 0xc3ff).ram().w(FUNC(base_state::gfx_vram_w<0>)).share(m_gfx_vram[0]); + map(0xc400, 0xc7ff).ram().w(FUNC(base_state::gfx_cram_w<0>)).share(m_gfx_cram[0]); + map(0xc800, 0xcbff).rw(FUNC(base_state::gfx1_vram_r), FUNC(base_state::gfx_vram_w<1>)).share(m_gfx_vram[1]); + map(0xcc00, 0xcfff).rw(FUNC(base_state::gfx1_cram_r), FUNC(base_state::gfx_cram_w<1>)).share(m_gfx_cram[1]); } /************************************ @@ -559,13 +689,13 @@ void witch_state::common_map(address_map &map) * ***********************************/ -void witch_state::witch_common_map(address_map &map) +void witch_state::common_map(address_map &map) { - common_map(map); + base_state::common_map(map); map(0x8000, 0x8001).rw("ym1", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x8008, 0x8009).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x8010, 0x8016).rw("essnd", FUNC(es8712_device::read), FUNC(es8712_device::write)); - map(0xd000, 0xdfff).ram().share("sprite_ram"); + map(0xd000, 0xdfff).ram().share(m_sprite_ram); map(0xe000, 0xe7ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0xe800, 0xefff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); map(0xf000, 0xf0ff).ram().share("share1"); @@ -573,20 +703,21 @@ void witch_state::witch_common_map(address_map &map) map(0xf200, 0xffff).ram().share("share2"); } -void witch_state::witch_main_map(address_map &map) +void witch_state::main_map(address_map &map) { - witch_common_map(map); - map(0x0000, UNBANKED_SIZE-1).rom(); - map(UNBANKED_SIZE, 0x7fff).bankr("mainbank"); - map(0xa008, 0xa008).w(FUNC(witch_state::main_write_a008)); + common_map(map); + map(0x0000, UNBANKED_SIZE - 1).rom(); + map(UNBANKED_SIZE, 0x7fff).bankr(m_mainbank); + map(0xa008, 0xa008).w(FUNC(witch_state::main_a008_w)); } -void witch_state::witch_sub_map(address_map &map) +void witch_state::sub_map(address_map &map) { - witch_common_map(map); + common_map(map); map(0x0000, 0x7fff).rom(); - map(0xa008, 0xa008).w(FUNC(witch_state::sub_write_a008)); + map(0x7000, 0x700f).r(FUNC(witch_state::prot_read_700x)); + map(0xa008, 0xa008).w(FUNC(witch_state::sub_a008_w)); } /************************************ @@ -595,29 +726,29 @@ void witch_state::witch_sub_map(address_map &map) * ***********************************/ -void keirinou_state::keirinou_common_map(address_map &map) +void keirinou_state::common_map(address_map &map) { - common_map(map); + base_state::common_map(map); map(0x8000, 0x8001).rw("ay1", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_data_w)); map(0x8002, 0x8003).rw("ay2", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_data_w)); - map(0xd000, 0xd7ff).ram().share("sprite_ram"); - map(0xd800, 0xd9ff).ram().w(FUNC(keirinou_state::palette_w)).share("paletteram"); + map(0xd000, 0xd7ff).ram().share(m_sprite_ram); + map(0xd800, 0xd9ff).ram().w(FUNC(keirinou_state::palette_w)).share(m_paletteram); map(0xe000, 0xe7ff).ram(); map(0xe800, 0xefff).ram().share("nvram"); // shared with sub } -void keirinou_state::keirinou_main_map(address_map &map) +void keirinou_state::main_map(address_map &map) { - keirinou_common_map(map); + common_map(map); map(0x0000, 0x7fff).rom(); - map(0xa008, 0xa008).w(FUNC(witch_state::main_write_a008)); + map(0xa008, 0xa008).w(FUNC(keirinou_state::main_a008_w)); } -void keirinou_state::keirinou_sub_map(address_map &map) +void keirinou_state::sub_map(address_map &map) { - keirinou_common_map(map); + common_map(map); map(0x0000, 0x7fff).rom(); - map(0xa008, 0xa008).w(FUNC(witch_state::sub_write_a008)); + map(0xa008, 0xa008).w(FUNC(keirinou_state::sub_a008_w)); } static INPUT_PORTS_START( witch ) @@ -636,12 +767,12 @@ static INPUT_PORTS_START( witch ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("UNK") /* Not a DSW */ + PORT_START("UNK") // Not a DSW PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Payout 2") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("INPUTS") /* Inputs */ + PORT_START("INPUTS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Left Flipper") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Small") @@ -657,7 +788,7 @@ F180 kkkbbppp ; Read onPORT 0xA005 bb = MAX BET | 20 ; 30 ; 40 ; 60 kkk = KEY IN | 1-10 ; 1-20 ; 1-40 ; 1-50 ; 1-100 ; 1-200 ; 1-250 ; 1-500 */ - PORT_START("A005") /* DSW "SW2" */ + PORT_START("A005") // DSW "SW2" PORT_DIPNAME( 0x07, 0x07, "Pay Out" ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x07, "60" ) PORT_DIPSETTING( 0x06, "65" ) @@ -686,7 +817,7 @@ F180 kkkbbppp ; Read onPORT 0xA005 d = DOUBLE UP | ON ; OFF cccc = COIN IN1 | 1-1 ; 1-2 ; 1-3 ; 1-4 ; 1-5 ; 1-6 ; 1-7 ; 1-8 ; 1-9 ; 1-10 ; 1-15 ; 1-20 ; 1-25 ; 1-30 ; 1-40 ; 1-50 */ - PORT_START("A004") /* DSW "SW3" Switches 2-4 not defined in manual */ + PORT_START("A004") // DSW "SW3" Switches 2-4 not defined in manual PORT_DIPNAME( 0x01, 0x00, "Double Up" ) PORT_DIPLOCATION("SW3:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -718,7 +849,7 @@ F180 kkkbbppp ; Read onPORT 0xA005 tt = TIME | 40 ; 45 ; 50 ; 55 s = DEMO SOUND | ON ; OFF */ - PORT_START("YM_PortA") /* DSW "SW4" */ + PORT_START("YM_PortA") // DSW "SW4" PORT_DIPNAME( 0x0f, 0x0f, "Coin In 2" ) PORT_DIPLOCATION("SW4:1,2,3,4") PORT_DIPSETTING( 0x0f, "1-1" ) PORT_DIPSETTING( 0x0e, "1-2" ) @@ -754,7 +885,7 @@ F180 kkkbbppp ; Read onPORT 0xA005 ll = GAME LIMIT | 500 ; 1000 ; 5000 ; 990000 h = HOPPER ACTIVE | LOW ; HIGH */ - PORT_START("YM_PortB") /* DSW "SW5" Switches 5, 6 & 8 undefined in manual */ + PORT_START("YM_PortB") // DSW "SW5" Switches 5, 6 & 8 undefined in manual PORT_DIPNAME( 0x01, 0x01, "Auto Bet" ) PORT_DIPLOCATION("SW5:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -762,13 +893,13 @@ F180 kkkbbppp ; Read onPORT 0xA005 PORT_DIPSETTING( 0x06, "500" ) PORT_DIPSETTING( 0x04, "1000" ) PORT_DIPSETTING( 0x02, "5000" ) - PORT_DIPSETTING( 0x00, "990000" ) /* 10000 as defined in the Excellent System version manual */ + PORT_DIPSETTING( 0x00, "990000" ) // 10000 as defined in the Excellent System version manual PORT_DIPNAME( 0x08, 0x08, "Hopper Active" ) PORT_DIPLOCATION("SW5:4") PORT_DIPSETTING( 0x08, DEF_STR(Low) ) PORT_DIPSETTING( 0x00, DEF_STR(High) ) PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW5:5" ) PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW5:6" ) - PORT_DIPNAME( 0x40, 0x00, "Unknown Use" ) PORT_DIPLOCATION("SW5:7") /* As defined in the Excellent System version manual */ + PORT_DIPNAME( 0x40, 0x00, "Unknown Use" ) PORT_DIPLOCATION("SW5:7") // As defined in the Excellent System version manual PORT_DIPSETTING( 0x40, "Matrix" ) PORT_DIPSETTING( 0x00, "Straight (Normal)" ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW5:8" ) @@ -777,7 +908,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( keirinou ) PORT_INCLUDE( witch ) - PORT_MODIFY("INPUTS") /* Inputs */ + PORT_MODIFY("INPUTS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P 1-2") PORT_CODE(KEYCODE_A) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("1P 1-3") PORT_CODE(KEYCODE_S) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1P 1-4") PORT_CODE(KEYCODE_D) @@ -823,12 +954,12 @@ static INPUT_PORTS_START( keirinou ) PORT_DIPNAME( 0x07, 0x07, "Game Rate" ) PORT_DIPSETTING( 0x02, "70%" ) PORT_DIPSETTING( 0x07, "80%" ) + PORT_DIPSETTING( 0x01, "80%" ) PORT_DIPSETTING( 0x06, "85%" ) PORT_DIPSETTING( 0x05, "90%" ) + PORT_DIPSETTING( 0x00, "90%" ) PORT_DIPSETTING( 0x04, "95%" ) PORT_DIPSETTING( 0x03, "100%" ) -// PORT_DIPSETTING( 0x01, "80%" ) -// PORT_DIPSETTING( 0x00, "90%" ) PORT_DIPNAME( 0x08, 0x08, "Double-Up Rate" ) PORT_DIPSETTING( 0x08, "90%" ) PORT_DIPSETTING( 0x00, "100%" ) @@ -921,71 +1052,91 @@ static GFXDECODE_START( gfx_keirinou ) GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0x200, 8 ) GFXDECODE_END -void witch_state::machine_reset() +void witch_state::machine_start() +{ + m_mainbank->configure_entries(0, 4, memregion("maincpu")->base() + UNBANKED_SIZE, 0x8000); + m_mainbank->set_entry(0); +} + +void base_state::machine_reset() { // Keep track of the "Hopper Active" DSW value because the program will use it m_motor_active = (ioport("YM_PortB")->read() & 0x08) ? 0 : 1; } -void witch_state::witch(machine_config &config) +void base_state::base(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, CPU_CLOCK); /* 3 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &witch_state::witch_main_map); - m_maincpu->set_vblank_int("screen", FUNC(witch_state::irq0_line_assert)); + static constexpr XTAL MAIN_CLOCK = XTAL(12'000'000); + static constexpr XTAL CPU_CLOCK = MAIN_CLOCK / 4; + + // basic machine hardware + Z80(config, m_maincpu, CPU_CLOCK); // 3 MHz + m_maincpu->set_vblank_int("screen", FUNC(base_state::irq0_line_assert)); - /* 2nd z80 */ - Z80(config, m_subcpu, CPU_CLOCK); /* 3 MHz */ - m_subcpu->set_addrmap(AS_PROGRAM, &witch_state::witch_sub_map); - m_subcpu->set_vblank_int("screen", FUNC(witch_state::irq0_line_assert)); + Z80(config, m_subcpu, CPU_CLOCK); // 3 MHz + m_subcpu->set_vblank_int("screen", FUNC(base_state::irq0_line_assert)); config.set_maximum_quantum(attotime::from_hz(6000)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // time between hopper pulses in milliseconds (not right for attendant pay) // 82C255 (actual chip on PCB) is equivalent to two 8255s I8255(config, m_ppi[0]); - m_ppi[0]->in_pa_callback().set(FUNC(witch_state::read_a000)); + m_ppi[0]->in_pa_callback().set(FUNC(base_state::a000_r)); m_ppi[0]->in_pb_callback().set_ioport("UNK"); - m_ppi[0]->out_pc_callback().set(FUNC(witch_state::write_a002)); I8255(config, m_ppi[1]); m_ppi[1]->in_pa_callback().set_ioport("A004"); m_ppi[1]->in_pb_callback().set_ioport("A005"); - m_ppi[1]->out_pc_callback().set(FUNC(witch_state::write_a006)); + m_ppi[1]->out_pc_callback().set(FUNC(base_state::a006_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(256, 256); screen.set_visarea(8, 256-1-8, 8*4, 256-8*4-1); - screen.set_screen_update(FUNC(witch_state::screen_update)); + screen.set_screen_update(FUNC(base_state::screen_update)); screen.set_palette(m_palette); + // sound hardware + SPEAKER(config, "mono").front_center(); +} + +void witch_state::witch(machine_config &config) +{ + base(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &witch_state::main_map); + + m_subcpu->set_addrmap(AS_PROGRAM, &witch_state::sub_map); + + m_ppi[0]->out_pc_callback().set(FUNC(witch_state::a002_w)); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_witch); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x800); - /* sound hardware */ - SPEAKER(config, "mono").front_center(); + static constexpr XTAL MAIN_CLOCK = XTAL(12'000'000); + static constexpr XTAL YM2203_CLOCK = MAIN_CLOCK / 4; + static constexpr XTAL MSM5202_CLOCK = 384_kHz_XTAL; es8712_device &essnd(ES8712(config, "essnd", 0)); essnd.msm_write_handler().set("msm", FUNC(msm5205_device::data_w)); essnd.set_msm_tag("msm"); - msm5205_device &msm(MSM5205(config, "msm", MSM5202_CLOCK)); /* actually MSM5202 */ + msm5205_device &msm(MSM5205(config, "msm", MSM5202_CLOCK)); // actually MSM5202 msm.vck_legacy_callback().set("essnd", FUNC(es8712_device::msm_int)); - msm.set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ + msm.set_prescaler_selector(msm5205_device::S48_4B); // 8 kHz msm.add_route(ALL_OUTPUTS, "mono", 1.0); - ym2203_device &ym1(YM2203(config, "ym1", YM2203_CLOCK)); /* 3 MHz */ + ym2203_device &ym1(YM2203(config, "ym1", YM2203_CLOCK)); // 3 MHz ym1.port_a_read_callback().set_ioport("YM_PortA"); ym1.port_b_read_callback().set_ioport("YM_PortB"); ym1.add_route(ALL_OUTPUTS, "mono", 0.5); - ym2203_device &ym2(YM2203(config, "ym2", YM2203_CLOCK)); /* 3 MHz */ + ym2203_device &ym2(YM2203(config, "ym2", YM2203_CLOCK)); // 3 MHz ym2.port_a_write_callback().set(FUNC(witch_state::xscroll_w)); ym2.port_b_write_callback().set(FUNC(witch_state::yscroll_w)); ym2.add_route(ALL_OUTPUTS, "mono", 0.5); @@ -993,19 +1144,22 @@ void witch_state::witch(machine_config &config) void keirinou_state::keirinou(machine_config &config) { - witch(config); + base(config); - m_maincpu->set_addrmap(AS_PROGRAM, &keirinou_state::keirinou_main_map); + m_maincpu->set_addrmap(AS_PROGRAM, &keirinou_state::main_map); - m_subcpu->set_addrmap(AS_PROGRAM, &keirinou_state::keirinou_sub_map); + m_subcpu->set_addrmap(AS_PROGRAM, &keirinou_state::sub_map); - PALETTE(config.replace(), m_palette).set_entries(0x200+0x80); - m_gfxdecode->set_info(gfx_keirinou); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_keirinou); + PALETTE(config, m_palette).set_entries(0x200 + 0x80); -// m_palette->set_format(palette_device::IIBBGGRR, 0x200+0x80); +// m_palette->set_format(palette_device::IIBBGGRR, 0x200 + 0x80); // Keirin Ou does have two individual PPIs (NEC D8255AC-2) - m_ppi[0]->out_pc_callback().set(FUNC(keirinou_state::write_keirinou_a002)); + m_ppi[0]->out_pc_callback().set(FUNC(keirinou_state::a002_w)); + + static constexpr XTAL MAIN_CLOCK = XTAL(12'000'000); + static constexpr XTAL AY8910_CLOCK = MAIN_CLOCK / 8; ay8910_device &ay1(AY8910(config, "ay1", AY8910_CLOCK)); ay1.port_a_read_callback().set_ioport("YM_PortA"); @@ -1013,14 +1167,9 @@ void keirinou_state::keirinou(machine_config &config) ay1.add_route(ALL_OUTPUTS, "mono", 0.5); ay8910_device &ay2(AY8910(config, "ay2", AY8910_CLOCK)); - ay2.port_a_write_callback().set(FUNC(witch_state::xscroll_w)); - ay2.port_b_write_callback().set(FUNC(witch_state::yscroll_w)); + ay2.port_a_write_callback().set(FUNC(keirinou_state::xscroll_w)); + ay2.port_b_write_callback().set(FUNC(keirinou_state::yscroll_w)); ay2.add_route(ALL_OUTPUTS, "mono", 0.5); - - config.device_remove("essnd"); - config.device_remove("msm"); - config.device_remove("ym1"); - config.device_remove("ym2"); } ROM_START( witch ) @@ -1040,11 +1189,11 @@ ROM_START( witch ) ROM_LOAD( "1.v10", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) ROM_REGION( 0x100, "prom", 0 ) - ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) /* Currently unused, unknown use */ + ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) // Currently unused, unknown use ROM_END -ROM_START( witchb ) /* Witch (With ranking) */ +ROM_START( witchb ) // Witch (with ranking) ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "x.u5", 0x00000, 0x20000, CRC(d0818777) SHA1(a6232fef84bec3cfb4a6122a48e96e7b7950e013) ) @@ -1061,74 +1210,74 @@ ROM_START( witchb ) /* Witch (With ranking) */ ROM_LOAD( "1.v10", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) ROM_REGION( 0x100, "prom", 0 ) - ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) /* Currently unused, unknown use */ + ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) // Currently unused, unknown use ROM_END -ROM_START( witchs ) /* this set has (c)1992 Sega / Vic Tokai in the roms */ +ROM_START( witchs ) // this set has (c)1992 Sega / Vic Tokai in the ROMs ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "rom.u5", 0x00000, 0x20000, CRC(348fccb8) SHA1(947defd86c4a597fbfb9327eec4903aa779b3788) ) ROM_REGION( 0x10000, "sub", 0 ) - ROM_LOAD( "6.s6", 0x00000, 0x08000, CRC(82460b82) SHA1(d85a9d77edaa67dfab8ff6ac4cb6273f0904b3c0) ) /* Same data as the Witch set */ + ROM_LOAD( "6.s6", 0x00000, 0x08000, CRC(82460b82) SHA1(d85a9d77edaa67dfab8ff6ac4cb6273f0904b3c0) ) // Same data as the Witch set ROM_REGION( 0x20000, "gfx1", 0 ) - ROM_LOAD( "3.u3", 0x00000, 0x20000, CRC(7007ced4) SHA1(6a0aac3ff9a4d5360c8ba1142f010add1b430ada) ) /* Same data as the Witch set */ + ROM_LOAD( "3.u3", 0x00000, 0x20000, CRC(7007ced4) SHA1(6a0aac3ff9a4d5360c8ba1142f010add1b430ada) ) // Same data as the Witch set ROM_REGION( 0x40000, "gfx2", 0 ) ROM_LOAD( "rom.a1", 0x00000, 0x40000, CRC(512300a5) SHA1(1e9ba58d1ddbfb8276c68f6d5c3591e6b77abf21) ) ROM_REGION( 0x40000, "essnd", 0 ) - ROM_LOAD( "1.v10", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) /* Same data as the Witch set */ + ROM_LOAD( "1.v10", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) // Same data as the Witch set ROM_REGION( 0x100, "prom", 0 ) - ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) /* Currently unused, unknown use */ + ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) // Currently unused, unknown use ROM_END -ROM_START( witchstar ) /* Licensed for Korea */ +ROM_START( witchstar ) // Licensed for Korea ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "7_excellent.u5", 0x00000, 0x20000, CRC(303c3a6d) SHA1(38983b0925d2a018b6718b3af5e95cf91b1850d6) ) ROM_REGION( 0x10000, "sub", 0 ) - ROM_LOAD( "8_excellent.s6", 0x00000, 0x08000, CRC(82460b82) SHA1(d85a9d77edaa67dfab8ff6ac4cb6273f0904b3c0) ) /* Same data as the Witch set */ + ROM_LOAD( "8_excellent.s6", 0x00000, 0x08000, CRC(82460b82) SHA1(d85a9d77edaa67dfab8ff6ac4cb6273f0904b3c0) ) // Same data as the Witch set ROM_REGION( 0x20000, "gfx1", 0 ) - ROM_LOAD( "6_excellent.u3", 0x00000, 0x20000, CRC(7007ced4) SHA1(6a0aac3ff9a4d5360c8ba1142f010add1b430ada) ) /* Same data as the Witch set */ + ROM_LOAD( "6_excellent.u3", 0x00000, 0x20000, CRC(7007ced4) SHA1(6a0aac3ff9a4d5360c8ba1142f010add1b430ada) ) // Same data as the Witch set ROM_REGION( 0x40000, "gfx2", 0 ) ROM_LOAD( "5_excellent.a1", 0x00000, 0x40000, CRC(257dc030) SHA1(ada08c3f8e93fd00d4ec7d152cdcf49c130be08e) ) ROM_REGION( 0x40000, "essnd", 0 ) - ROM_LOAD( "9_excellent.v10", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) /* Same data as the Witch set */ + ROM_LOAD( "9_excellent.v10", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) // Same data as the Witch set ROM_REGION( 0x100, "prom", 0 ) - ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) /* Currently unused, unknown use */ + ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) // Currently unused, unknown use ROM_END -ROM_START( pbchmp95 ) /* Licensed for Germany? */ +ROM_START( pbchmp95 ) // Licensed for Netherlands? ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "3.bin", 0x00000, 0x20000, CRC(e881aa05) SHA1(10d259396cac4b9a1b72c262c11ffa5efbdac433) ) ROM_REGION( 0x10000, "sub", 0 ) - ROM_LOAD( "4.bin", 0x00000, 0x08000, CRC(82460b82) SHA1(d85a9d77edaa67dfab8ff6ac4cb6273f0904b3c0) ) /* Same data as the Witch set */ + ROM_LOAD( "4.bin", 0x00000, 0x08000, CRC(82460b82) SHA1(d85a9d77edaa67dfab8ff6ac4cb6273f0904b3c0) ) // Same data as the Witch set ROM_REGION( 0x20000, "gfx1", 0 ) - ROM_LOAD( "2.bin", 0x00000, 0x20000, CRC(7007ced4) SHA1(6a0aac3ff9a4d5360c8ba1142f010add1b430ada) ) /* Same data as the Witch set */ + ROM_LOAD( "2.bin", 0x00000, 0x20000, CRC(7007ced4) SHA1(6a0aac3ff9a4d5360c8ba1142f010add1b430ada) ) // Same data as the Witch set ROM_REGION( 0x40000, "gfx2", 0 ) ROM_LOAD( "1.bin", 0x00000, 0x40000, CRC(f6cf7ed6) SHA1(327580a17eb2740fad974a01d97dad0a4bef9881) ) ROM_REGION( 0x40000, "essnd", 0 ) - ROM_LOAD( "5.bin", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) /* Same data as the Witch set */ + ROM_LOAD( "5.bin", 0x00000, 0x40000, CRC(62e42371) SHA1(5042abc2176d0c35fd6b698eca4145f93b0a3944) ) // Same data as the Witch set ROM_REGION( 0x100, "prom", 0 ) - ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) /* Currently unused, unknown use */ + ROM_LOAD( "tbp24s10n.10k", 0x000, 0x100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) // Currently unused, unknown use ROM_END -ROM_START( keirinou ) /* ES8611 PCB */ +ROM_START( keirinou ) // ES8611 PCB ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "y5-03.y5", 0x000000, 0x008000, CRC(df2acc37) SHA1(9ad953843ba7859a55888fb87591cc8d322136ad) ) @@ -1148,21 +1297,16 @@ ROM_START( keirinou ) /* ES8611 PCB */ ROM_CONTINUE( 0x4000, 0x04000 ) ROM_CONTINUE( 0xc000, 0x04000 ) - ROM_REGION( 0x100, "prom", 0 ) /* Same data as the Witch set, currently unused, unknown use */ - ROM_LOAD( "n82s129an.r8", 0x000000, 0x000100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) /* N82S129AN BPROM stamped K */ + ROM_REGION( 0x100, "prom", 0 ) // Same data as the Witch set, currently unused, unknown use + ROM_LOAD( "n82s129an.r8", 0x000000, 0x000100, CRC(ee7b9d8f) SHA1(3a7b75befab83bc37e4e403ad3632841c2d37707) ) // N82S129AN BPROM stamped K ROM_END -void witch_state::init_witch() -{ - m_mainbank->configure_entries(0, 4, memregion("maincpu")->base() + UNBANKED_SIZE, 0x8000); - m_mainbank->set_entry(0); +} // anonymous namespace - m_subcpu->space(AS_PROGRAM).install_read_handler(0x7000, 0x700f, read8sm_delegate(*this, FUNC(witch_state::prot_read_700x))); -} -GAME( 1987, keirinou, 0, keirinou, keirinou, keirinou_state, empty_init, ROT0, "Excellent System", "Keirin Ou", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, witch, 0, witch, witch, witch_state, init_witch, ROT0, "Vic Tokai (Excellent System license)", "Witch", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, witchb, witch, witch, witch, witch_state, init_witch, ROT0, "Vic Tokai (Excellent System license)", "Witch (with ranking)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, witchs, witch, witch, witch, witch_state, init_witch, ROT0, "Vic Tokai (Sega license)", "Witch (Sega license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, witchstar, witch, witch, witch, witch_state, init_witch, ROT0, "Fovis Korea Co. Ltd.", "Witch Star", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, pbchmp95, witch, witch, witch, witch_state, init_witch, ROT0, "Veltmeijer Automaten", "Pinball Champ '95", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, keirinou, 0, keirinou, keirinou, keirinou_state, empty_init, ROT0, "Excellent System", "Keirin Ou", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, witch, 0, witch, witch, witch_state, empty_init, ROT0, "Vic Tokai (Excellent System license)", "Witch", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, witchb, witch, witch, witch, witch_state, empty_init, ROT0, "Vic Tokai (Excellent System license)", "Witch (with ranking)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, witchs, witch, witch, witch, witch_state, empty_init, ROT0, "Vic Tokai (Sega license)", "Witch (Sega license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, witchstar, witch, witch, witch, witch_state, empty_init, ROT0, "Fovis Korea Co. Ltd.", "Witch Star", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, pbchmp95, witch, witch, witch, witch_state, empty_init, ROT0, "Veltmeijer Automaten", "Pinball Champ '95", MACHINE_SUPPORTS_SAVE ) |