Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
14 contributors

Users who have contributed to this file

@cuavas @galibert @MooglyGuy @mmicko @Osso13 @cam900 @LucaElia @briantro @ajrhacker @Firehawke @wilbertpol @happppp @system11b @smf-
5247 lines (4087 sloc) 238 KB
// license:BSD-3-Clause
// copyright-holders:Luca Elia
/***************************************************************************
-= Cave Hardware =-
driver by Luca Elia (l.elia@tin.it)
Main CPU : MC68000
Sound CPU : Z80 [Optional]
Sound Chips : YMZ280B or
OKIM6295 x (1|2) + YM2203 / YM2151 [Optional]
Other : 93C46 EEPROM
-----------------------------------------------------------------------------------------
Year + Game License PCB Tilemaps Sprites Other
-----------------------------------------------------------------------------------------
94 Mazinger Z Banpresto BP943A 038 9335EX706 013 9341E7009 Z80
94 Power Instinct 2 Atlus ATG02? 038 9429WX709 013 9341E7009 Z80 NMK 112
95 Gogetsuji Legends Atlus AT047G2-B 038 9429WX709 013 9341E7009 Z80 NMK 112
95 Metamoqester Banpresto BP947A 038 9437WX711 013 9346E7002 Z80
95 Sailor Moon Banpresto BP945A 038 9437WX711 013 9346E7002 Z80
95 Donpachi Atlus AT-C01DP-2 038 9429WX727 013 9347E7003 NMK 112
96 Air Gallet Banpresto BP962A 038 9437WX711 013 9346E7002 Z80
96 Hotdog Storm Marble ASTC9501 038 9341EX702 013 Z80
96 Pac-Slot Namco N-44 EM 038 9444WX010 013 9345E7006
96 Poka Poka Satan Kato's PPS-MAIN 038 9444WX010 013 9607EX013
97 Tekken Card World Namco EMG4 038 9701WX001 013 9651EX001
97 Dodonpachi Atlus AT-C03 D2 038 9341E7010 013 9338EX701
98 Dangun Feveron Nihon System CV01 038 9808WX003 013 9807EX004
98 ESP Ra.De. Atlus ATC04 038 9841WX002 013 9838EX002
98 Tekken Battle Scratch Namco EMG4 038 9748WX001 013
98 Uo Poko Jaleco CV02 038 9749WX001 013 9749EX004
99 Guwange Atlus ATC05 038 9919WX004 013
99 Gaia Crusaders Noise Factory ? 038 9838WX003 013 9918EX008
99 Koro Koro Quest Takumi TUG-01B 038 9838WX004 013 9838EX004
99 Crusher Makochan Takumi TUG-01B 038 9838WX004 013 9838EX004
99 Tobikose! Jumpman Namco EMG4 038 9919WX007 013 9934WX002
01 Thunder Heroes Primetek ? 038 9838WX003 013 9918EX008
-----------------------------------------------------------------------------------------
To Do:
- Sprite lag in some games (e.g. metmqstr). The sprites chip probably
generates interrupts (unknown_irq)
- Max sprite number is possibly less than 1024
(ex: Boss explosion scene at most of cave shmups on real hardware)
- Tilemap scrolling issue in ppsatan right screen
Stephh's notes (based on the games M68000 code and some tests) :
1) 'gaia'
- Difficulty Dip Switch also affects "Bonus Life" Dip Switch
2) 'theroes'
- This is a English/Chinese version, but from the manual, there might exist a English/Japanese one
- Difficulty Dip Switch also affects "Bonus Life" Dip Switch
- There are less degrees of difficulty in this version
- DSW2 bit 5 effect remains unknown :
* it is checked at address 0x008d16 at the beginning of each sub-level
* it is checked at address 0x00c382 when you quickly push the joystick left or right twice
Any info is welcome !
Versions known to exist but not dumped:
Dodonpachi Campaign Version
Reportedly only 3 ever made, one was given out as a prize to a high score contest winner. The other two
PCBs were shown running (and could be played) at a Cave fan show known as Cave Festival 2006. There are
videos of the game being played floating around the internet and on YouTube. AKA DDP-CV or DDP BLUE ROM
***************************************************************************/
#include "emu.h"
#include "includes/cave.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "machine/nmk112.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "sound/ym2151.h"
#include "sound/ymz280b.h"
#include "speaker.h"
#include <algorithm>
#include "ppsatan.lh"
/***************************************************************************
Interrupt Handling Routines
***************************************************************************/
/* Update the IRQ state based on all possible causes */
void cave_state::update_irq_state()
{
if (m_vblank_irq || m_sound_irq || m_unknown_irq)
m_maincpu->set_input_line(m_irq_level, ASSERT_LINE);
else
m_maincpu->set_input_line(m_irq_level, CLEAR_LINE);
}
TIMER_CALLBACK_MEMBER(cave_state::vblank_end)
{
if (m_kludge == 3) /* mazinger metmqstr */
{
m_unknown_irq = 1;
update_irq_state();
}
m_agallet_vblank_irq = 0;
}
TIMER_DEVICE_CALLBACK_MEMBER(cave_state::vblank_start)
{
m_vblank_irq = 1;
update_irq_state();
get_sprite_info(0);
m_agallet_vblank_irq = 1;
m_vblank_end_timer->adjust(attotime::from_usec(2000));
}
TIMER_DEVICE_CALLBACK_MEMBER(cave_state::vblank_start_left)
{
get_sprite_info(1);
}
TIMER_DEVICE_CALLBACK_MEMBER(cave_state::vblank_start_right)
{
get_sprite_info(2);
}
/* Called once/frame to generate the VBLANK interrupt */
INTERRUPT_GEN_MEMBER(cave_state::interrupt)
{
m_int_timer->adjust(attotime::from_usec(17376 - m_time_vblank_irq));
}
INTERRUPT_GEN_MEMBER(cave_state::interrupt_ppsatan)
{
m_int_timer->adjust (attotime::from_usec(17376 - m_time_vblank_irq));
m_int_timer_left->adjust (attotime::from_usec(17376 - m_time_vblank_irq));
m_int_timer_right->adjust(attotime::from_usec(17376 - m_time_vblank_irq));
}
/* Called by the YMZ280B to set the IRQ state */
WRITE_LINE_MEMBER(cave_state::sound_irq_gen)
{
m_sound_irq = (state != 0);
update_irq_state();
}
/* Level 1 irq routines:
Game |first read | bit==0->routine + |
|offset: | read this offset |
ddonpach 4,0 0 -> vblank + 4 1 -> rte 2 -> like 0 read sound
dfeveron 0 0 -> vblank + 4 1 -> + 6 - read sound
uopoko 0 0 -> vblank + 4 1 -> + 6 - read sound
esprade 0 0 -> vblank + 4 1 -> rte 2 must be 0 read sound
guwange 0 0 -> vblank + 6,4 1 -> + 6,4 2 must be 0 read sound
mazinger 0 0 -> vblank + 4 rest -> scroll + 6
*/
/* Reads the cause of the interrupt and clears the state */
u16 cave_state::irq_cause_r(offs_t offset)
{
u16 result = 0x0003;
if (m_vblank_irq)
result ^= 0x01;
if (m_unknown_irq)
result ^= 0x02;
if (!machine().side_effects_disabled())
{
if (offset == 4/2)
m_vblank_irq = 0;
if (offset == 6/2)
m_unknown_irq = 0;
update_irq_state();
}
/*
sailormn and agallet wait for bit 2 of $b80001 to go 1 -> 0.
It must happen once per frame as agallet uses this to show
the copyright notice screen for ~8.5s
*/
if (offset == 0)
{
result &= ~4;
result |= (m_agallet_vblank_irq ? 0 : 4);
}
return result;
}
/***************************************************************************
Sound Handling Routines
***************************************************************************/
/* We need a FIFO buffer for sailormn, where the inter-CPUs
communication is *really* tight */
u8 cave_state::soundflags_r()
{
// bit 2 is low: can read command (lo)
// bit 3 is low: can read command (hi)
// return (m_sound_flag[0] ? 0 : 4) |
// (m_sound_flag[1] ? 0 : 8) ;
return 0;
}
u16 cave_state::soundflags_ack_r()
{
// bit 0 is low: can write command
// bit 1 is low: can read answer
// return ((m_sound_flag[0] | m_sound_flag[1]) ? 1 : 0) |
// (m_soundbuf_empty ? 0 : 2) ;
return m_soundbuf_empty ? 2 : 0;
}
/* Main CPU: write a 16 bit sound latch and generate a NMI on the sound CPU */
void cave_state::sound_cmd_w(u16 data)
{
// m_sound_flag[0] = 1;
// m_sound_flag[1] = 1;
m_soundlatch->write(data);
m_maincpu->spin_until_time(attotime::from_usec(50)); // Allow the other cpu to reply
}
/* Sound CPU: read the low 8 bits of the 16 bit sound latch */
u8 cave_state::soundlatch_lo_r()
{
// m_sound_flag[0] = 0;
return m_soundlatch->read() & 0xff;
}
/* Sound CPU: read the high 8 bits of the 16 bit sound latch */
u8 cave_state::soundlatch_hi_r()
{
// m_sound_flag[1] = 0;
return m_soundlatch->read() >> 8;
}
/* Main CPU: read the latch written by the sound CPU (acknowledge) */
u16 cave_state::soundlatch_ack_r()
{
if (!m_soundbuf_empty)
{
const u8 data = m_soundbuf_data[m_soundbuf_rptr];
if (!machine().side_effects_disabled())
{
m_soundbuf_rptr = (m_soundbuf_rptr + 1) & 0x1f;
m_soundbuf_empty = m_soundbuf_rptr == m_soundbuf_wptr;
}
return data;
}
else
{
logerror("CPU #1 - PC %04X: Sound Buffer 2 Underflow Error\n", m_maincpu->pc());
return 0xff;
}
}
/* Sound CPU: write latch for the main CPU (acknowledge) */
void cave_state::soundlatch_ack_w(u8 data)
{
if (m_soundbuf_empty || (m_soundbuf_wptr != m_soundbuf_rptr))
{
m_soundbuf_data[m_soundbuf_wptr] = data;
m_soundbuf_wptr = (m_soundbuf_wptr + 1) & 0x1f;
m_soundbuf_empty = false;
}
else
logerror("CPU #2 - PC %04X: Sound Buffer 2 Overflow Error\n", m_audiocpu->pc());
}
/***************************************************************************
EEPROM
***************************************************************************/
void cave_state::eeprom_w(u8 data)
{
if (data & ~0xfe)
logerror("%s: Unknown EEPROM bit written %04X\n", machine().describe_context(), data);
machine().bookkeeping().coin_lockout_w(1, BIT(~data, 7));
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 6));
machine().bookkeeping().coin_counter_w(1, BIT( data, 5));
machine().bookkeeping().coin_counter_w(0, BIT( data, 4));
// latch the bit
m_eeprom->di_write(BIT(data, 3));
// reset line asserted: reset.
m_eeprom->cs_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE);
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write(BIT(data, 2) ? ASSERT_LINE : CLEAR_LINE);
}
void cave_state::sailormn_eeprom_w(u8 data)
{
sailormn_tilebank_w(BIT(data, 0));
eeprom_w(data & ~0x01);
}
void cave_state::hotdogst_eeprom_w(u8 data)
{
// latch the bit
m_eeprom->di_write(BIT(data, 3));
// reset line asserted: reset.
m_eeprom->cs_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE);
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write(BIT(data, 2) ? ASSERT_LINE : CLEAR_LINE);
}
void cave_state::ppsatan_eeprom_w(offs_t offset, u16 data, u16 mem_mask)
{
if (data & ~0x000f)
logerror("%s: Unknown EEPROM bit written %04X\n",machine().describe_context(),data);
if (ACCESSING_BITS_0_7) // odd address
{
// bit 11?
// latch the bit
m_eeprom->di_write((data & 0x0400) >> 10);
// reset line asserted: reset.
m_eeprom->cs_write((data & 0x0100) ? CLEAR_LINE : ASSERT_LINE);
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write((data & 0x0200) ? ASSERT_LINE : CLEAR_LINE);
}
}
void cave_state::guwange_eeprom_w(u8 data)
{
if (data & ~0xef)
logerror("%s: Unknown EEPROM bit written %04X\n",machine().describe_context(),data);
machine().bookkeeping().coin_lockout_w(1, BIT(~data, 3));
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2));
machine().bookkeeping().coin_counter_w(1, BIT( data, 1));
machine().bookkeeping().coin_counter_w(0, BIT( data, 0));
// latch the bit
m_eeprom->di_write(BIT(data, 7));
// reset line asserted: reset.
m_eeprom->cs_write(BIT(data, 5) ? ASSERT_LINE : CLEAR_LINE);
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write(BIT(data, 6) ? ASSERT_LINE : CLEAR_LINE);
}
/* - No eeprom or lockouts */
void cave_state::gaia_coin_w(u8 data)
{
machine().bookkeeping().coin_counter_w(1, BIT(data, 1));
machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
}
/* - No coin lockouts
- Writing 0xcf shouldn't send a 1 bit to the EEPROM */
void cave_state::metmqstr_eeprom_w(u8 data)
{
machine().bookkeeping().coin_counter_w(1, BIT(data, 5));
machine().bookkeeping().coin_counter_w(0, BIT(data, 4));
if (BIT(~data, 0))
{
// latch the bit
m_eeprom->di_write(BIT(data, 3));
// reset line asserted: reset.
m_eeprom->cs_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE);
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write(BIT(data, 2) ? ASSERT_LINE : CLEAR_LINE);
}
}
/***************************************************************************
VRAM
***************************************************************************/
template<int Chip>
void cave_state::vram_w(offs_t offset, u16 data, u16 mem_mask)
{
u16 *VRAM = m_vram[Chip];
const bool TDIM = m_tiledim[Chip];
tilemap_t *TILEMAP = m_tilemap[Chip];
if ((VRAM[offset] & mem_mask) == (data & mem_mask))
return;
COMBINE_DATA(&VRAM[offset]);
offset /= 2;
if ((offset < 0x1000 / 4) && (TDIM)) // 16x16 tilemap
{
offset = (offset % (512 / 16)) * 2 + (offset / (512 / 16)) * (512 / 8) * 2;
TILEMAP->mark_tile_dirty(offset + 0);
TILEMAP->mark_tile_dirty(offset + 1);
TILEMAP->mark_tile_dirty(offset + 0 + 512 / 8);
TILEMAP->mark_tile_dirty(offset + 1 + 512 / 8);
}
else if ((offset >= 0x4000 / 4) && (!TDIM)) // 8x8 tilemap
TILEMAP->mark_tile_dirty(offset - 0x4000 / 4);
}
/* Some games, that only ever use the 8x8 tiles and no line scroll,
use mirror ram. For example in donpachi, writes to 400000-403fff
and 408000-407fff both go to the 8x8 tilemap ram. Use this function
in this cases. Note that the get_tile_info function looks in the
4000-7fff range for tiles, so we have to write the data there. */
template<int Chip>
void cave_state::vram_8x8_w(offs_t offset, u16 data, u16 mem_mask)
{
u16 *VRAM = m_vram[Chip];
tilemap_t *TILEMAP = m_tilemap[Chip];
offset %= 0x4000 / 2;
if ((VRAM[offset] & mem_mask) == (data & mem_mask))
return;
COMBINE_DATA(&VRAM[offset + 0x0000 / 2]);
COMBINE_DATA(&VRAM[offset + 0x4000 / 2]);
TILEMAP->mark_tile_dirty(offset / 2);
}
/***************************************************************************
Memory Maps - Main CPU
***************************************************************************/
/* Lines starting with an empty comment in the following MemoryReadAddress
arrays are there for debug (e.g. the game does not read from those ranges
AFAIK) */
/***************************************************************************
Dangun Feveron
***************************************************************************/
void cave_state::dfeveron_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x708000, 0x708fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x710000, 0x710bff).readonly(); // ?
map(0x710c00, 0x710fff).ram(); // ?
map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs
map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control
map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control
map(0xb00000, 0xb00001).portr("IN0"); // Inputs
map(0xb00002, 0xb00003).portr("IN1"); // Inputs + EEPROM
map(0xc00000, 0xc00000).w(FUNC(cave_state::eeprom_w)); // EEPROM
}
/***************************************************************************
Dodonpachi
***************************************************************************/
void cave_state::ddonpach_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x700000, 0x70ffff).ram().w(FUNC(cave_state::vram_8x8_w<2>)).share("vram.2"); // Layer 2
map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs
map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control
map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control
map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control
map(0xc00000, 0xc0ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0xd00000, 0xd00001).portr("IN0"); // Inputs
map(0xd00002, 0xd00003).portr("IN1"); // Inputs + EEPROM
map(0xe00000, 0xe00000).w(FUNC(cave_state::eeprom_w)); // EEPROM
}
/***************************************************************************
Donpachi
***************************************************************************/
u16 cave_state::donpachi_videoregs_r(offs_t offset)
{
switch (offset)
{
case 0:
case 1:
case 2:
case 3: return irq_cause_r(offset);
default: return 0x0000;
}
}
void cave_state::donpachi_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x200000, 0x207fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x400000, 0x407fff).ram().w(FUNC(cave_state::vram_8x8_w<2>)).share("vram.2"); // Layer 2
map(0x500000, 0x50ffff).ram().share("spriteram.0"); // Sprites
map(0x600000, 0x600005).ram().share("vctrl.1"); // Layer 1 Control
map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control
map(0x800000, 0x800005).ram().share("vctrl.2"); // Layer 2 Control
map(0x900000, 0x90007f).ram().r(FUNC(cave_state::donpachi_videoregs_r)).share("videoregs.0"); // Video Regs
map(0xa08000, 0xa08fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0xb00000, 0xb00003).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); // M6295
map(0xb00010, 0xb00013).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); //
map(0xb00020, 0xb0002f).w("nmk112", FUNC(nmk112_device::okibank_w)).umask16(0x00ff); //
map(0xc00000, 0xc00001).portr("IN0"); // Inputs
map(0xc00002, 0xc00003).portr("IN1"); // Inputs + EEPROM
map(0xd00000, 0xd00000).w(FUNC(cave_state::eeprom_w)); // EEPROM
}
/***************************************************************************
Esprade
***************************************************************************/
void cave_state::esprade_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2
map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs
map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control
map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control
map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control
map(0xc00000, 0xc0ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0xd00000, 0xd00001).portr("IN0"); // Inputs
map(0xd00002, 0xd00003).portr("IN1"); // Inputs + EEPROM
map(0xe00000, 0xe00000).w(FUNC(cave_state::eeprom_w)); // EEPROM
}
/***************************************************************************
Gaia Crusaders
***************************************************************************/
void cave_state::gaia_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprite
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x508000, 0x50ffff).ram(); // More Layer 0, Tested but not used?
map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x608000, 0x60ffff).ram(); // More Layer 1, Tested but not used?
map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2
map(0x708000, 0x70ffff).ram(); // More Layer 2, Tested but not used?
map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs
map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control
map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control
map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control
map(0xc00000, 0xc0ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0xd00010, 0xd00011).portr("IN0"); // Inputs
map(0xd00011, 0xd00011).w(FUNC(cave_state::gaia_coin_w)); // Coin counter only
map(0xd00012, 0xd00013).portr("IN1"); // Inputs
map(0xd00014, 0xd00015).portr("DSW"); // Dips
map(0xd00014, 0xd00015).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog?
}
/***************************************************************************
Guwange
***************************************************************************/
void cave_state::guwange_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x300000, 0x30007f).writeonly().share("videoregs.0"); // Video Regs
map(0x300000, 0x300007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2
map(0x800000, 0x800003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control
map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control
map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control
/**/map(0xc00000, 0xc0ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0xd00010, 0xd00011).portr("IN0"); // Inputs
map(0xd00011, 0xd00011).w(FUNC(cave_state::guwange_eeprom_w)); // EEPROM
map(0xd00012, 0xd00013).portr("IN1"); // Inputs + EEPROM
// map(0xd00012, 0xd00013).nopw(); // ?
// map(0xd00014, 0xd00015).nopw(); // ? $800068 in dfeveron ? probably Watchdog
}
/***************************************************************************
Hotdog Storm
***************************************************************************/
void cave_state::hotdogst_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x300000, 0x30ffff).ram(); // RAM
map(0x408000, 0x408fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x880000, 0x887fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x980000, 0x987fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2
map(0xa80000, 0xa8007f).writeonly().share("videoregs.0"); // Video Regs
map(0xa80000, 0xa80007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
// map(0xa8006e, 0xa8006f).r(FUNC(cave_state::soundlatch_ack_r)); // From Sound CPU
map(0xa8006e, 0xa8006f).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU
map(0xb00000, 0xb00005).ram().share("vctrl.0"); // Layer 0 Control
map(0xb80000, 0xb80005).ram().share("vctrl.1"); // Layer 1 Control
map(0xc00000, 0xc00005).ram().share("vctrl.2"); // Layer 2 Control
map(0xc80000, 0xc80001).portr("IN0"); // Inputs
map(0xc80002, 0xc80003).portr("IN1"); // Inputs + EEPROM
map(0xd00000, 0xd00000).w(FUNC(cave_state::hotdogst_eeprom_w)); // EEPROM
map(0xd00002, 0xd00003).nopw(); // ???
map(0xf00000, 0xf0ffff).ram().share("spriteram.0"); // Sprites
}
/***************************************************************************
Koro Koro Quest
***************************************************************************/
void cave_state::show_leds()
{
#ifdef MAME_DEBUG
// popmessage("led %04X eep %02X", m_leds[0], (m_leds[1] >> 8) & ~0x70);
#endif
}
void cave_state::korokoro_leds_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_leds[0]);
m_led_outputs[0] = BIT(data, 15);
m_led_outputs[1] = BIT(data, 14);
m_led_outputs[2] = BIT(data, 12); // square button
m_led_outputs[3] = BIT(data, 11); // round button
// machine().bookkeeping().coin_lockout_w(1, ~data & 0x0200); // coin lockouts?
// machine().bookkeeping().coin_lockout_w(0, ~data & 0x0100);
// machine().bookkeeping().coin_counter_w(2, data & 0x0080);
// machine().bookkeeping().coin_counter_w(1, data & 0x0020);
machine().bookkeeping().coin_counter_w(0, data & 0x0010);
m_led_outputs[5] = BIT(data, 3);
m_led_outputs[6] = BIT(data, 2);
m_led_outputs[7] = BIT(data, 1);
m_led_outputs[8] = BIT(data, 0);
show_leds();
}
void cave_state::korokoro_eeprom_w(offs_t offset, u16 data, u16 mem_mask)
{
if (data & ~0x7000)
{
logerror("%s: Unknown EEPROM bit written %04X\n",machine().describe_context(),data);
COMBINE_DATA(&m_leds[1]);
show_leds();
}
if (ACCESSING_BITS_8_15) // even address
{
m_hopper = data & 0x0100; // ???
// latch the bit
m_eeprom->di_write((data & 0x4000) >> 14);
// reset line asserted: reset.
m_eeprom->cs_write((data & 0x1000) ? ASSERT_LINE : CLEAR_LINE);
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write((data & 0x2000) ? ASSERT_LINE : CLEAR_LINE);
}
}
READ_LINE_MEMBER(cave_state::korokoro_hopper_r)
{
return m_hopper ? 1 : 0;
}
void cave_state::korokoro_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x107fff).w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x140000, 0x140005).writeonly().share("vctrl.0"); // Layer 0 Control
map(0x180000, 0x187fff).writeonly().share("spriteram.0"); // Sprites
map(0x1c0000, 0x1c007f).writeonly().share("videoregs.0"); // Video Regs
map(0x1c0000, 0x1c0007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x200000, 0x207fff).writeonly().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
// map(0x240000, 0x240003).r("ymz", FUNC(ymz280b_device::read)).umask16(0x00ff); // YMZ280
map(0x240000, 0x240003).w("ymz", FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x280000, 0x280001).portr("IN0"); // Inputs + ???
map(0x280002, 0x280003).portr("IN1"); // Inputs + EEPROM
map(0x280008, 0x280009).w(FUNC(cave_state::korokoro_leds_w)); // Leds
map(0x28000a, 0x28000b).w(FUNC(cave_state::korokoro_eeprom_w)); // EEPROM
map(0x28000c, 0x28000d).nopw(); // 0 (watchdog?)
map(0x300000, 0x30ffff).ram(); // RAM
}
void cave_state::crusherm_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x107fff).w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x140000, 0x140005).writeonly().share("vctrl.0"); // Layer 0 Control
map(0x180000, 0x187fff).writeonly().share("spriteram.0"); // Sprites
map(0x200000, 0x207fff).writeonly().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x240000, 0x240003).w("ymz", FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x280000, 0x280001).portr("IN0"); // Inputs + ???
map(0x280002, 0x280003).portr("IN1"); // Inputs + EEPROM
map(0x280008, 0x280009).w(FUNC(cave_state::korokoro_leds_w)); // Leds
map(0x28000a, 0x28000b).w(FUNC(cave_state::korokoro_eeprom_w)); // EEPROM
map(0x28000c, 0x28000d).nopw(); // 0 (watchdog?)
map(0x300000, 0x30007f).writeonly().share("videoregs.0"); // Video Regs
map(0x300000, 0x300007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x340000, 0x34ffff).ram(); // RAM
}
/***************************************************************************
Mazinger Z
***************************************************************************/
void cave_state::mazinger_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites
map(0x300000, 0x30007f).writeonly().share("videoregs.0"); // Video Regs
map(0x300000, 0x300007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x300068, 0x300069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0x30006e, 0x30006f).rw(FUNC(cave_state::soundlatch_ack_r), FUNC(cave_state::sound_cmd_w)); // From Sound CPU
map(0x400000, 0x407fff).ram().w(FUNC(cave_state::vram_8x8_w<1>)).share("vram.1"); // Layer 1
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_8x8_w<0>)).share("vram.0"); // Layer 0
map(0x600000, 0x600005).ram().share("vctrl.1"); // Layer 1 Control
map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control
map(0x800000, 0x800001).portr("IN0"); // Inputs
map(0x800002, 0x800003).portr("IN1"); // Inputs + EEPROM
map(0x900000, 0x900000).w(FUNC(cave_state::eeprom_w)); // EEPROM
map(0xc08000, 0xc0ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0xd00000, 0xd7ffff).rom().region("user1", 0); // extra data ROM
}
/***************************************************************************
Metamoqester
***************************************************************************/
void cave_state::metmqstr_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x17ffff).rom(); // ROM
map(0x200000, 0x27ffff).rom(); // ROM
map(0x408000, 0x408fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x600000, 0x600001).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog?
map(0x880000, 0x887fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2
map(0x888000, 0x88ffff).ram(); //
map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x908000, 0x90ffff).ram(); //
map(0x980000, 0x987fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x988000, 0x98ffff).ram(); //
map(0xa80000, 0xa8007f).writeonly().share("videoregs.0"); // Video Regs
map(0xa80000, 0xa80007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0xa80068, 0xa80069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog?
map(0xa8006c, 0xa8006d).r(FUNC(cave_state::soundflags_ack_r)).nopw(); // Communication
map(0xa8006e, 0xa8006f).rw(FUNC(cave_state::soundlatch_ack_r), FUNC(cave_state::sound_cmd_w)); // From Sound CPU
map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control
map(0xb80000, 0xb80005).ram().share("vctrl.1"); // Layer 1 Control
map(0xc00000, 0xc00005).ram().share("vctrl.0"); // Layer 0 Control
map(0xc80000, 0xc80001).portr("IN0"); // Inputs
map(0xc80002, 0xc80003).portr("IN1"); // Inputs + EEPROM
map(0xd00000, 0xd00000).w(FUNC(cave_state::metmqstr_eeprom_w)); // EEPROM
map(0xf00000, 0xf0ffff).ram().share("spriteram.0"); // Sprites
}
/***************************************************************************
Poka Poka Satan
***************************************************************************/
void cave_state::ppsatan_io_mux_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_ppsatan_io_mux);
}
template<int Player>
u16 cave_state::ppsatan_touch_r()
{
u8 ret_x = 0, ret_y = 0;
u16 x = m_touch_x[Player]->read();
u16 y = m_touch_y[Player]->read();
if (x & 0x8000) // touching
{
x &= 0x7fff;
// x
int slot_x = floor( ((320.0f - 1 - x) - 12) / 20 );
if (slot_x < 0)
slot_x = 0;
else if (slot_x > 14)
slot_x = 14;
if ( (m_ppsatan_io_mux & (1 << slot_x)) || ((m_ppsatan_io_mux << 13) & (1 << slot_x)) )
ret_x |= 1 << (slot_x % 8);
// y
int slot_y = floor( ((224.0f - 1 - y) - 14) / 18 );
if (slot_y < 0)
slot_y = 0;
else if (slot_y > 10)
slot_y = 10;
if ( ((m_ppsatan_io_mux >> 2) & (1 << slot_y)) || ((m_ppsatan_io_mux << 6) & (1 << slot_y)) )
ret_y |= 1 << (slot_y % 6);
// if (!Player) popmessage("TOUCH %03x %03x -> %f -> %d", x, y, ((320.0f - 1 - x) - 12) / 20, slot_x);
}
return ret_x | (ret_y << 8);
}
void cave_state::ppsatan_out_w(offs_t offset, u16 data, u16 mem_mask)
{
if (ACCESSING_BITS_0_7)
{
machine().bookkeeping().coin_counter_w(0, data & 0x0001);
m_led_outputs[0] = BIT(data, 4);
m_led_outputs[1] = BIT(data, 5);
m_led_outputs[2] = BIT(data, 6);
m_led_outputs[3] = BIT(data, 7);
}
if (ACCESSING_BITS_8_15)
{
m_led_outputs[4] = BIT(data, 8);
m_led_outputs[5] = BIT(data, 9);
m_led_outputs[6] = BIT(data, 10); // not tested in service mode
m_led_outputs[7] = BIT(data, 11); // not tested in service mode
m_oki[0]->set_rom_bank((data & 0x8000) >> 15);
}
// popmessage("OUT %04x", data);
}
void cave_state::ppsatan_map(address_map &map)
{
map(0x000000, 0x03ffff).rom(); // ROM
map(0x040000, 0x04ffff).ram(); // RAM
// Left Screen (Player 2)
map(0x080000, 0x080005).ram().share("vctrl.1"); // Layer Control
map(0x100000, 0x107fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer
// map(0x180000, 0x1803ff).ram() // Palette (Tilemaps)
// map(0x187800, 0x188fff).ram().w(m_palette[1], FUNC(palette_device::write16)).share("palette.1"); // Palette (Sprites)
map(0x180000, 0x188fff).ram().w(m_palette[1], FUNC(palette_device::write16)).share("palette.1"); // Palette
map(0x1c0000, 0x1c7fff).ram().share("spriteram.1"); // Sprites
map(0x200000, 0x200001).portr("SYSTEM"); // DSW + (unused) EEPROM
map(0x200000, 0x200001).w(FUNC(cave_state::ppsatan_out_w)); // Outputs + OKI banking
map(0x200002, 0x200003).rw(FUNC(cave_state::ppsatan_touch_r<1>), FUNC(cave_state::ppsatan_eeprom_w)); // Touch Screen + (unused) EEPROM
map(0x200004, 0x200005).rw(FUNC(cave_state::ppsatan_touch_r<0>), FUNC(cave_state::ppsatan_io_mux_w)); // Touch Screen
map(0x200006, 0x200007).nopw(); // Lev. 2 IRQ Ack?
map(0x2c0000, 0x2c007f).writeonly().share("videoregs.1"); // Video Regs
map(0x2c0000, 0x2c0007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x2c0068, 0x2c0069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0x300001, 0x300001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
// Right Screen (Player 1)
map(0x480000, 0x480005).ram().share("vctrl.2"); // Layer Control
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer
// map(0x580000, 0x5803ff).ram() // Palette (Tilemaps)
// map(0x587800, 0x588fff).ram().w(m_palette[2], FUNC(palette_device::write16)).share("palette.2"); // Palette (Sprites)
map(0x580000, 0x588fff).ram().w(m_palette[2], FUNC(palette_device::write16)).share("palette.2"); // Palette
map(0x5c0000, 0x5c7fff).ram().share("spriteram.2"); // Sprites
map(0x6c0000, 0x6c007f).writeonly().share("videoregs.2"); // Video Regs
// Top Screen
map(0x880000, 0x880005).ram().share("vctrl.0"); // Layer Control
map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer
// map(0x980000, 0x9803ff).ram(); // Palette (Tilemaps)
// map(0x987800, 0x988fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette (Sprites)
map(0x980000, 0x988fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x9c0000, 0x9c7fff).ram().share("spriteram.0"); // Sprites
map(0xac0000, 0xac007f).writeonly().share("videoregs.0"); // Video Regs
}
/***************************************************************************
Power Instinct 2
***************************************************************************/
u16 cave_state::pwrinst2_eeprom_r()
{
return ~8 + ((m_eeprom->do_read() & 1) ? 8 : 0);
}
template<int Chip>
void cave_state::pwrinst2_vctrl_w(offs_t offset, u16 data, u16 mem_mask)
{
u16 *VCTRL = m_vctrl[Chip];
if (offset == 4 / 2)
{
switch (data & 0x000f)
{
case 1: data = (data & ~0x000f) | 0; break;
case 2: data = (data & ~0x000f) | 1; break;
case 4: data = (data & ~0x000f) | 2; break;
default:
case 8: data = (data & ~0x000f) | 3; break;
}
}
COMBINE_DATA(&VCTRL[offset]);
}
void cave_state::pwrinst2_map(address_map &map)
{
map(0x000000, 0x1fffff).rom(); // ROM
map(0x400000, 0x40ffff).ram(); // RAM
map(0x500000, 0x500001).portr("IN0"); // Inputs
map(0x500002, 0x500003).portr("IN1"); //
map(0x600000, 0x6fffff).rom().region("user1", 0); // extra data ROM space
map(0x700000, 0x700000).w(FUNC(cave_state::eeprom_w)); // EEPROM
map(0x800000, 0x807fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2
map(0x880000, 0x887fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x980000, 0x987fff).ram().w(FUNC(cave_state::vram_8x8_w<3>)).share("vram.3"); // Layer 3
map(0xa00000, 0xa0ffff).ram().share("spriteram.0"); // Sprites
map(0xa10000, 0xa1ffff).ram(); // Sprites?
map(0xa80000, 0xa8007f).ram().r(FUNC(cave_state::donpachi_videoregs_r)).share("videoregs.0"); // Video Regs
map(0xb00000, 0xb00005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<2>)).share("vctrl.2"); // Layer 2 Control
map(0xb80000, 0xb80005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<0>)).share("vctrl.0"); // Layer 0 Control
map(0xc00000, 0xc00005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<1>)).share("vctrl.1"); // Layer 1 Control
map(0xc80000, 0xc80005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<3>)).share("vctrl.3"); // Layer 3 Control
map(0xd80000, 0xd80001).r(FUNC(cave_state::soundlatch_ack_r)); // ? From Sound CPU
map(0xe00000, 0xe00001).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU
map(0xe80000, 0xe80001).r(FUNC(cave_state::pwrinst2_eeprom_r)); // EEPROM
map(0xf00000, 0xf04fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
}
/***************************************************************************
Sailor Moon
***************************************************************************/
u16 cave_state::sailormn_input0_r()
{
// watchdog_reset16_r(0, 0); // written too rarely for mame.
return m_io_in0->read();
}
void cave_state::sailormn_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x110000, 0x110001).ram(); // (agallet)
map(0x200000, 0x3fffff).rom(); // ROM
map(0x400000, 0x407fff).ram(); // (agallet)
map(0x408000, 0x40bfff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x40c000, 0x40ffff).ram(); // (agallet)
map(0x410000, 0x410001).ram(); // (agallet)
map(0x500000, 0x50ffff).ram().share("spriteram.0"); // Sprites
map(0x510000, 0x510001).ram(); // (agallet)
map(0x600000, 0x600001).r(FUNC(cave_state::sailormn_input0_r)); // Inputs + Watchdog!
map(0x600002, 0x600003).portr("IN1"); // Inputs + EEPROM
map(0x700000, 0x700000).w(FUNC(cave_state::sailormn_eeprom_w)); // EEPROM
map(0x800000, 0x807fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x880000, 0x887fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1
map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2
map(0x908000, 0x908001).ram(); // (agallet)
map(0xa00000, 0xa00005).ram().share("vctrl.0"); // Layer 0 Control
map(0xa80000, 0xa80005).ram().share("vctrl.1"); // Layer 1 Control
map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control
map(0xb80000, 0xb8007f).writeonly().share("videoregs.0"); // Video Regs
map(0xb80000, 0xb80007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause (bit 2 tested!)
map(0xb8006c, 0xb8006d).r(FUNC(cave_state::soundflags_ack_r)); // Communication
map(0xb8006e, 0xb8006f).r(FUNC(cave_state::soundlatch_ack_r)); // From Sound CPU
map(0xb8006e, 0xb8006f).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU
}
/***************************************************************************
Tekken Card World
***************************************************************************/
void cave_state::tekkencw_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery)
map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites
map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x400000, 0x400001).portr("IN0"); // Inputs + EEPROM + Hopper
map(0x400002, 0x400003).portr("IN1"); // Inputs
map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control
map(0x600000, 0x60ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs
map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
map(0xc00001, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper
map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM
}
/***************************************************************************
Tekken Battle Scratch
***************************************************************************/
void cave_state::tekkenbs_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery)
map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites
map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x400000, 0x40ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control
map(0x600000, 0x600001).portr("IN0"); // Inputs + EEPROM + Hopper
map(0x600002, 0x600003).portr("IN1"); // Inputs
map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs
map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
map(0xc00001, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper
map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM
}
/***************************************************************************
Tobikose! Jumpman
***************************************************************************/
void cave_state::tjumpman_eeprom_w(u8 data)
{
if (data & ~0x38)
logerror("%s: Unknown EEPROM bit written %04X\n",machine().describe_context(),data);
// latch the bit
m_eeprom->di_write(BIT(data, 5));
// reset line asserted: reset.
m_eeprom->cs_write(BIT(data, 3) ? ASSERT_LINE : CLEAR_LINE);
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write(BIT(data, 4) ? ASSERT_LINE : CLEAR_LINE);
}
void cave_state::tjumpman_leds_w(u8 data)
{
m_led_outputs[0] = BIT(data, 0); // suru
m_led_outputs[1] = BIT(data, 1); // shinai
m_led_outputs[2] = BIT(data, 2); // payout
m_led_outputs[3] = BIT(data, 3); // go
m_led_outputs[4] = BIT(data, 4); // 1 bet
m_led_outputs[5] = BIT(data, 5); // medal
m_hopper = BIT(data, 6); // hopper
m_led_outputs[6] = BIT(data, 7); // 3 bet
// popmessage("led %04X", data);
}
READ_LINE_MEMBER(cave_state::tjumpman_hopper_r)
{
return (m_hopper && !(m_screen[0]->frame_number() % 10)) ? 0 : 1;
}
void cave_state::tjumpman_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery)
map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites
map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x304000, 0x307fff).w(FUNC(cave_state::vram_w<0>)); // Layer 0 - 16x16 tiles mapped here
map(0x400000, 0x400005).writeonly().share("vctrl.0"); // Layer 0 Control
map(0x500000, 0x50ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x600000, 0x600001).portr("IN0"); // Inputs + EEPROM + Hopper
map(0x600002, 0x600003).portr("IN1"); // Inputs
map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs
map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
map(0xc00001, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper
map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM
}
/***************************************************************************
Pac-Slot
***************************************************************************/
void cave_state::pacslot_leds_w(u8 data)
{
m_led_outputs[0] = data & 0x0001; // pac-man
m_led_outputs[1] = data & 0x0002; // ms. pac-man
m_led_outputs[2] = data & 0x0004; // payout
m_led_outputs[3] = data & 0x0008; // start
m_led_outputs[4] = data & 0x0010; // bet
m_led_outputs[5] = data & 0x0020; // medal
m_hopper = data & 0x0040; // hopper
// popmessage("led %04X", data);
}
void cave_state::pacslot_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery)
map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites
map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x400000, 0x40007f).writeonly().share("videoregs.0"); // Video Regs
map(0x400000, 0x400007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x400068, 0x400069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control
map(0x600000, 0x60ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x700000, 0x700001).portr("IN0"); // Inputs + EEPROM + Hopper
map(0x700002, 0x700003).portr("IN1"); // Inputs
map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
map(0xc00001, 0xc00001).w(FUNC(cave_state::pacslot_leds_w)); // Leds + Hopper
map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM
}
/***************************************************************************
Pac-Eight
***************************************************************************/
//TODO: leds need verifying
void cave_state::paceight_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery)
map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites
map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x400000, 0x40ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x500000, 0x500001).portr("IN0"); // Inputs + EEPROM + Hopper
map(0x500002, 0x500003).portr("IN1"); // Inputs
map(0x600000, 0x600005).writeonly().share("vctrl.0"); // Layer 0 Control
map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs
map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
map(0xc00000, 0xc00001).w(FUNC(cave_state::pacslot_leds_w)); // Leds + Hopper
map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM
}
/***************************************************************************
Uo Poko
***************************************************************************/
void cave_state::uopoko_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // RAM
map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280
map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites
map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0
map(0x600000, 0x60007f).writeonly().share("videoregs.0"); // Video Regs
map(0x600000, 0x600007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause
map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control
map(0x800000, 0x80ffff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette.0"); // Palette
map(0x900000, 0x900001).portr("IN0"); // Inputs
map(0x900002, 0x900003).portr("IN1"); // Inputs + EEPROM
map(0xa00000, 0xa00000).w(FUNC(cave_state::eeprom_w)); // EEPROM
}
/***************************************************************************
Memory Maps - Sound CPU (Optional)
***************************************************************************/
template<int Mask>
void cave_state::z80_rombank_w(u8 data)
{
if (data & ~Mask)
logerror("CPU #1 - PC %04X: Bank %02X\n", m_audiocpu->pc(), data);
m_z80bank->set_entry(data & Mask);
}
template<int Mask>
void cave_state::oki1_bank_w(u8 data)
{
int bank1 = (data >> 0) & Mask;
int bank2 = (data >> 4) & Mask;
m_okibank_lo[0]->set_entry(bank1);
m_okibank_hi[0]->set_entry(bank2);
}
template<int Mask>
void cave_state::oki2_bank_w(u8 data)
{
int bank1 = (data >> 0) & Mask;
int bank2 = (data >> 4) & Mask;
m_okibank_lo[1]->set_entry(bank1);
m_okibank_hi[1]->set_entry(bank2);
}
void cave_state::oki_map(address_map &map)
{
map(0x00000, 0x1ffff).bankr("oki1_banklo");
map(0x20000, 0x3ffff).bankr("oki1_bankhi");
}
void cave_state::oki2_map(address_map &map)
{
map(0x00000, 0x1ffff).bankr("oki2_banklo");
map(0x20000, 0x3ffff).bankr("oki2_bankhi");
}
/***************************************************************************
Hotdog Storm
***************************************************************************/
void cave_state::hotdogst_sound_map(address_map &map)
{
map(0x0000, 0x3fff).rom(); // ROM
map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked)
map(0xe000, 0xffff).ram(); // RAM
}
void cave_state::hotdogst_sound_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x0f>)); // ROM bank
map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU
map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); //
map(0x50, 0x51).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); //
map(0x60, 0x60).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0x3>)); // Samples bank
}
/***************************************************************************
Mazinger Z
***************************************************************************/
void cave_state::mazinger_sound_map(address_map &map)
{
map(0x0000, 0x3fff).rom(); // ROM
map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked)
map(0xc000, 0xc7ff).ram(); // RAM
map(0xf800, 0xffff).ram(); // RAM
}
void cave_state::mazinger_sound_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x07>)); // ROM bank
map(0x10, 0x10).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU
map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU
map(0x50, 0x51).w("ymsnd", FUNC(ym2203_device::write)); // YM2203
map(0x52, 0x53).r("ymsnd", FUNC(ym2203_device::read)); // YM2203
map(0x70, 0x70).w("oki1", FUNC(okim6295_device::write)); // M6295
map(0x74, 0x74).w(FUNC(cave_state::oki1_bank_w<0x3>)); // Samples bank
}
/***************************************************************************
Metamoqester
***************************************************************************/
void cave_state::metmqstr_sound_map(address_map &map)
{
map(0x0000, 0x3fff).rom(); // ROM
map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked)
map(0xe000, 0xffff).ram(); // RAM
}
void cave_state::metmqstr_sound_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x0f>)); // Rom Bank
map(0x20, 0x20).r(FUNC(cave_state::soundflags_r)); // Communication
map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU
map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); //
map(0x50, 0x51).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); // YM2151
map(0x60, 0x60).w("oki1", FUNC(okim6295_device::write)); // M6295 #0
map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0x7>)); // Samples Bank #0
map(0x80, 0x80).w("oki2", FUNC(okim6295_device::write)); // M6295 #1
map(0x90, 0x90).w(FUNC(cave_state::oki2_bank_w<0x7>)); // Samples Bank #1
}
/***************************************************************************
Power Instinct 2
***************************************************************************/
void cave_state::pwrinst2_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom(); // ROM
map(0x8000, 0xbfff).bankr("z80bank"); // ROM (Banked)
map(0xe000, 0xffff).ram(); // RAM
}
void cave_state::pwrinst2_sound_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295
map(0x08, 0x08).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
map(0x10, 0x17).w("nmk112", FUNC(nmk112_device::okibank_w)); // Samples bank
map(0x40, 0x41).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); //
map(0x50, 0x50).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU
// map(0x51, 0x51).nopw(); // ?? volume
map(0x60, 0x60).r(FUNC(cave_state::soundlatch_hi_r)); // From Main CPU
map(0x70, 0x70).r(FUNC(cave_state::soundlatch_lo_r)); //
map(0x80, 0x80).w(FUNC(cave_state::z80_rombank_w<0x07>)); // ROM bank
}
/***************************************************************************
Sailor Moon
***************************************************************************/
void cave_state::sailormn_sound_map(address_map &map)
{
map(0x0000, 0x3fff).rom(); // ROM
map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked)
map(0xc000, 0xdfff).mirror(0x2000).ram(); // RAM (8KB, mirrored)
}
void cave_state::sailormn_sound_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x1f>)); // Rom Bank
map(0x10, 0x10).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU
map(0x20, 0x20).r(FUNC(cave_state::soundflags_r)); // Communication
map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU
map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); //
map(0x50, 0x51).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); // YM2151
map(0x60, 0x60).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 #0
map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0xf>)); // Samples Bank #0
map(0x80, 0x80).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 #1
map(0xc0, 0xc0).w(FUNC(cave_state::oki2_bank_w<0xf>)); // Samples Bank #1
}
/***************************************************************************
Input Ports
***************************************************************************/
/*
dfeveron config menu:
101624.w -> 8,a6 preferences
101626.w -> c,a6 (1:coin<<4|credit) <<8 | (2:coin<<4|credit)
*/
/* Most games use this */
static INPUT_PORTS_START( cave )
PORT_START("IN0") // Player 1
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(6)
PORT_SERVICE_NO_TOGGLE( 0x0200, IP_ACTIVE_LOW )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // sw? exit service mode
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) // sw? enter & exit service mode
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN1") // Player 2
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(6)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0xf400, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
/* Gaia Crusaders, no EEPROM. Has DIPS */
static INPUT_PORTS_START( gaia )
PORT_INCLUDE( cave )
PORT_MODIFY("IN0") // Player 1 + 2
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
PORT_MODIFY("IN1") // Coins
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(6)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(6)
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0fc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW")
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0002, DEF_STR( On ) )
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x0000, DEF_STR( English ) )
PORT_DIPSETTING( 0x0004, DEF_STR( Japanese ) )
PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:4,5,6")
PORT_DIPSETTING( 0x0008, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0000, "2 Coins/1 Credit (1 to continue)" )
PORT_DIPSETTING( 0x0038, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0018, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0028, DEF_STR( 1C_3C ) )
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0080, DEF_STR( On ) )
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0100, "1" )
PORT_DIPSETTING( 0x0000, "2" )
PORT_DIPSETTING( 0x0300, "3" )
PORT_DIPSETTING( 0x0200, "4" )
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xc000)
PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xa000)
PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xe000)
PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x6000)
PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x8000)
PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x2000)
PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x4000)
PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x0000)
PORT_DIPNAME( 0x1800, 0x1800, "Damage" ) PORT_DIPLOCATION("SW2:4,5")
PORT_DIPSETTING( 0x1800, "+0" )
PORT_DIPSETTING( 0x1000, "+1" )
PORT_DIPSETTING( 0x0800, "+2" )
PORT_DIPSETTING( 0x0000, "+3" )
PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7,8")
PORT_DIPSETTING( 0xc000, DEF_STR( Very_Easy ) )
PORT_DIPSETTING( 0xa000, DEF_STR( Easy ) )
PORT_DIPSETTING( 0xe000, DEF_STR( Medium ) )
PORT_DIPSETTING( 0x6000, DEF_STR( Medium_Hard ) )
PORT_DIPSETTING( 0x8000, "Hard 1" )
PORT_DIPSETTING( 0x2000, "Hard 2" )
PORT_DIPSETTING( 0x4000, DEF_STR( Very_Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
INPUT_PORTS_END
static INPUT_PORTS_START( theroes )
PORT_INCLUDE( gaia )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x0000, DEF_STR( English ) )
PORT_DIPSETTING( 0x0004, DEF_STR( Chinese ) )
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x0000)
PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW2:6" )
PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
PORT_DIPSETTING( 0x8000, DEF_STR( Very_Easy ) )
PORT_DIPSETTING( 0xc000, DEF_STR( Medium ) )
PORT_DIPSETTING( 0x4000, DEF_STR( Medium_Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
INPUT_PORTS_END
/* Normal layout but with 4 buttons */
static INPUT_PORTS_START( metmqstr )
PORT_INCLUDE( cave )
PORT_MODIFY("IN0") // Player 1
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
PORT_MODIFY("IN1") // Player 2
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
INPUT_PORTS_END
/* Different layout */
static INPUT_PORTS_START( guwange )
PORT_START("IN0") // Player 1 & 2
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_START("IN1") // Coins
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(6)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(6)
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0xff70, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( korokoro )
PORT_START("IN0")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // bit 0x0010 of leds (coin)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(10) // bit 0x0020 of leds (does coin sound)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(10) // bit 0x0080 of leds
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) // round button (choose)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) // square button (select in service mode / medal out in game)
PORT_BIT( 0x0fe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service medal out?
PORT_SERVICE( 0x2000, IP_ACTIVE_LOW )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, korokoro_hopper_r) // motor / hopper status ???
PORT_START("IN1")
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0xefff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( tekkencw )
PORT_START("IN0")
PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(10) // credits (impulse needed to coin up reliably)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
PORT_CONFSETTING( 0x08, DEF_STR( Off ) )
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME( DEF_STR( No ) ) PORT_CODE(KEYCODE_N) // shinai ("not")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Action" )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // medal (impulse needed to coin up reliably)
PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( tekkenbs )
PORT_START("IN0")
PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(10) // credits (impulse needed to coin up reliably)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
PORT_CONFSETTING( 0x08, DEF_STR( Off ) )
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Start" )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // medal (impulse needed to coin up reliably)
PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( tjumpman )
PORT_START("IN0")
PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "1 Bet" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
PORT_CONFSETTING( 0x08, DEF_STR( Off ) )
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( No ) ) PORT_CODE(KEYCODE_N) // shinai ("not")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Go" )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // medal (impulse needed to coin up reliably)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "3 Bet" )
INPUT_PORTS_END
static INPUT_PORTS_START( pacslot )
PORT_START("IN0")
PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) // must stay on during service mode
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(10) // credits (impulse needed to coin up reliably)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Pac-Man" ) PORT_CODE(KEYCODE_Y)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
PORT_CONFSETTING( 0x08, DEF_STR( Off ) )
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Ms. Pac-Man" ) PORT_CODE(KEYCODE_N)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // medal (impulse needed to coin up reliably)
PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( paceight )
PORT_INCLUDE( pacslot )
PORT_MODIFY("IN0")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Left" ) PORT_CODE(KEYCODE_Y)
PORT_MODIFY("IN1")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Right" ) PORT_CODE(KEYCODE_N)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Max Bet" )
INPUT_PORTS_END
static INPUT_PORTS_START( ppsatan )
PORT_START("SYSTEM") // $200000
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 ) // advance in service mode
PORT_BIT( 0x0072, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0300, "1 Coin/1 1P-Game (2 Coins/1 2P-Game)" )
PORT_DIPSETTING( 0x0100, "2 Coins/1 1P-Game (3 Coins/1 2P-Game)" )
PORT_DIPSETTING( 0x0200, "2 Coins/1 1P-Game (4 Coins/1 2P-Game)" )
PORT_DIPSETTING( 0x0000, "2 Coins/1 1P-Game (4 Coins/1 2P-Game) (duplicate)" )
PORT_DIPUNKNOWN(0x0400, 0x0400) PORT_DIPLOCATION("SW1:3")
PORT_DIPUNKNOWN(0x0800, 0x0800) PORT_DIPLOCATION("SW1:4")
PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6")
PORT_DIPSETTING( 0x1000, DEF_STR( Easy ) ) // 15 hits
PORT_DIPSETTING( 0x3000, DEF_STR( Normal ) ) // 20 hits
PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) // 25 hits
PORT_DIPSETTING( 0x2000, "Hard (duplicate)" )
PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") // Jingle after "warning" screen (every 3 demo loops)
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
PORT_SERVICE(0x8000, IP_ACTIVE_LOW) PORT_DIPLOCATION("SW1:8")
PORT_START("TOUCH1_X")
PORT_BIT( 0x7fff, 0x20, IPT_LIGHTGUN_X ) PORT_PLAYER(1) PORT_MINMAX(0x000, 0x140-1) PORT_CROSSHAIR(X, 284.0/320.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(8)
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_START("TOUCH1_Y")
PORT_BIT( 0xffff, 0x18, IPT_LIGHTGUN_Y ) PORT_PLAYER(1) PORT_MINMAX(0x000, 0xe0-1) PORT_CROSSHAIR(Y, 188.0/224.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(8)
PORT_START("TOUCH2_X")
PORT_BIT( 0x7fff, 0x20, IPT_LIGHTGUN_X ) PORT_PLAYER(2) PORT_MINMAX(0x000, 0x140-1) PORT_CROSSHAIR(X, 284.0/320.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(8)
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_START("TOUCH2_Y")
PORT_BIT( 0xffff, 0x18, IPT_LIGHTGUN_Y ) PORT_PLAYER(2) PORT_MINMAX(0x000, 0xe0-1) PORT_CROSSHAIR(Y, 188.0/224.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(8)
INPUT_PORTS_END
/***************************************************************************
Graphics Layouts
***************************************************************************/
// 6bpp tiles are accessible only 0x400 colors
/* 8x8x4 tiles */
static const gfx_layout layout_8x8x4 =
{
8,8,
RGN_FRAC(1,1),
4,
{STEP4(0,1)},
{STEP8(0,4)},
{STEP8(0,4*8)},
8*8*4
};
/* 8x8x6 tiles (in a 8x8x8 layout) */
static const gfx_layout layout_8x8x6 =
{
8,8,
RGN_FRAC(1,1),
6,
{STEP2(8,1),STEP4(0,1)},
{0*4,1*4,4*4,5*4,8*4,9*4,12*4,13*4},
{STEP8(0,8*8)},
8*8*8
};
/* 8x8x6 tiles (4 bits in one rom, 2 bits in the other,
unpacked in 2 pages of 4 bits) */
static const gfx_layout layout_8x8x6_2 =
{
8,8,
RGN_FRAC(1,2),
6,
{RGN_FRAC(1,2)+2,RGN_FRAC(1,2)+3, STEP4(0,1)},
{STEP8(0,4)},
{STEP8(0,4*8)},
8*8*4
};
/* 8x8x8 tiles */
static const gfx_layout layout_8x8x8 =
{
8,8,
RGN_FRAC(1,1),
8,
{STEP4(8,1),STEP4(0,1)},
{0*4,1*4,4*4,5*4,8*4,9*4,12*4,13*4},
{STEP8(0,8*8)},
8*8*8
};
#if 0
/* 16x16x8 Zooming Sprites - No need to decode them */
static const gfx_layout layout_sprites =
{
16,16,
RGN_FRAC(1,1),
8,
{STEP8(0,1)},
{STEP16(0,8)},
{STEP16(0,16*8)},
16*16*8
};
#endif
/***************************************************************************
Dangun Feveron
***************************************************************************/
static GFXDECODE_START( gfx_dfeveron )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0400, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x0400, 0x40 ) // [1] Layer 1
GFXDECODE_END
/***************************************************************************
Dodonpachi
***************************************************************************/
static GFXDECODE_START( gfx_ddonpach )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x4000, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x4000, 0x40 ) // [1] Layer 1
GFXDECODE_ENTRY( "layer2", 0, layout_8x8x8, 0x4000, 0x40 ) // [2] Layer 2
GFXDECODE_END
/***************************************************************************
Donpachi
***************************************************************************/
static GFXDECODE_START( gfx_donpachi )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0400, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x0400, 0x40 ) // [1] Layer 1
GFXDECODE_ENTRY( "layer2", 0, layout_8x8x4, 0x0400, 0x40 ) // [2] Layer 2
GFXDECODE_END
/***************************************************************************
Esprade
***************************************************************************/
static GFXDECODE_START( gfx_esprade )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x8, 0x4000, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x8, 0x4000, 0x40 ) // [1] Layer 1
GFXDECODE_ENTRY( "layer2", 0, layout_8x8x8, 0x4000, 0x40 ) // [2] Layer 2
GFXDECODE_END
/***************************************************************************
Hotdog Storm
***************************************************************************/
static GFXDECODE_START( gfx_hotdogst )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0000, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x0000, 0x40 ) // [1] Layer 1
GFXDECODE_ENTRY( "layer2", 0, layout_8x8x4, 0x0000, 0x40 ) // [2] Layer 2
GFXDECODE_END
/***************************************************************************
Koro Koro Quest
***************************************************************************/
static GFXDECODE_START( gfx_korokoro )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0400, 0x40 ) // [0] Layer 0
GFXDECODE_END
/***************************************************************************
Mazinger Z
***************************************************************************/
static GFXDECODE_START( gfx_mazinger )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0000, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x6, 0x0400, 0x10 ) // [1] Layer 1
GFXDECODE_END
/***************************************************************************
Poka Poka Satan
***************************************************************************/
static GFXDECODE_START( gfx_ppsatan_0 )
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0000, 0x40 ) // [0] Layer 0
GFXDECODE_END
static GFXDECODE_START( gfx_ppsatan_1 )
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x0000, 0x40 ) // [1] Layer 1
GFXDECODE_END
static GFXDECODE_START( gfx_ppsatan_2 )
GFXDECODE_ENTRY( "layer2", 0, layout_8x8x4, 0x0000, 0x40 ) // [2] Layer 2
GFXDECODE_END
/***************************************************************************
Power Instinct 2
***************************************************************************/
static GFXDECODE_START( gfx_pwrinst2 )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0800, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x1000, 0x40 ) // [1] Layer 1
GFXDECODE_ENTRY( "layer2", 0, layout_8x8x4, 0x1800, 0x40 ) // [2] Layer 2
GFXDECODE_ENTRY( "layer3", 0, layout_8x8x4, 0x2000, 0x40 ) // [3] Layer 3
GFXDECODE_END
/***************************************************************************
Sailor Moon
***************************************************************************/
static GFXDECODE_START( gfx_sailormn )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x0400, 0x40 ) // [0] Layer 0
GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x0800, 0x40 ) // [1] Layer 1
GFXDECODE_ENTRY( "layer2", 0, layout_8x8x6_2, 0x0c00, 0x10 ) // [2] Layer 2
GFXDECODE_END
/***************************************************************************
Uo Poko
***************************************************************************/
static GFXDECODE_START( gfx_uopoko )
// "sprites"
GFXDECODE_ENTRY( "layer0", 0, layout_8x8x8, 0x4000, 0x40 ) // [0] Layer 0
GFXDECODE_END
/***************************************************************************
Machine Drivers
***************************************************************************/
void cave_state::machine_start()
{
m_led_outputs.resolve();
m_vblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cave_state::vblank_end), this));
save_item(NAME(m_soundbuf_wptr));
save_item(NAME(m_soundbuf_rptr));
save_item(NAME(m_soundbuf_data));
save_item(NAME(m_soundbuf_empty));
save_item(NAME(m_vblank_irq));
save_item(NAME(m_sound_irq));
save_item(NAME(m_unknown_irq));
save_item(NAME(m_agallet_vblank_irq));
}
void cave_state::machine_reset()
{
std::fill(std::begin(m_soundbuf_data), std::end(m_soundbuf_data), 0);
m_soundbuf_wptr = 0;
m_soundbuf_rptr = 0;
m_soundbuf_empty = true;
m_vblank_irq = 0;
m_sound_irq = 0;
m_unknown_irq = 0;
m_agallet_vblank_irq = 0;
}
void cave_state::add_base_config(machine_config &config)
{
M68000(config, m_maincpu, 16_MHz_XTAL);
m_maincpu->set_vblank_int("screen.0", FUNC(cave_state::interrupt));
TIMER(config, m_int_timer).configure_generic(FUNC(cave_state::vblank_start));
SCREEN(config, m_screen[0], SCREEN_TYPE_RASTER);
m_screen[0]->set_refresh_hz(15625/271.5);
m_screen[0]->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen[0]->set_size(320, 240);
m_screen[0]->set_visarea(0, 320-1, 0, 240-1);
m_screen[0]->set_screen_update(FUNC(cave_state::screen_update));
PALETTE(config, m_palette[0], palette_device::BLACK).set_format(palette_device::xGRB_555, 0x8000);
}
void cave_state::add_ymz(machine_config &config)
{
SPEAKER(config, "mono").front_center();
ymz280b_device &ymz(YMZ280B(config, "ymz", 16.9344_MHz_XTAL));
ymz.irq_handler().set(FUNC(cave_state::sound_irq_gen));
ymz.add_route(ALL_OUTPUTS, "mono", 1.0);
}
/***************************************************************************
Dangun Feveron
***************************************************************************/
void cave_state::dfeveron(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::dfeveron_map);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_dfeveron);
m_palette[0]->set_entries(0x1000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,dfeveron)
/* sound hardware */
add_ymz(config);
}
/***************************************************************************
Dodonpachi
***************************************************************************/
void cave_state::ddonpach(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::ddonpach_map);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_ddonpach);
MCFG_VIDEO_START_OVERRIDE(cave_state,ddonpach)
/* sound hardware */
add_ymz(config);
}
/***************************************************************************
Donpachi
***************************************************************************/
void cave_state::donpachi(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::donpachi_map);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_donpachi);
m_palette[0]->set_entries(0x1000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,donpachi)
/* sound hardware */
SPEAKER(config, "mono").front_center();
OKIM6295(config, m_oki[0], 4.224_MHz_XTAL/4, okim6295_device::PIN7_HIGH); // pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.60);
OKIM6295(config, m_oki[1], 4.224_MHz_XTAL/2, okim6295_device::PIN7_HIGH); // pin 7 not verified
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.0);
nmk112_device &nmk112(NMK112(config, "nmk112", 0));
nmk112.set_rom0_tag("oki1");
nmk112.set_rom1_tag("oki2");
nmk112.set_page_mask(1 << 0); // chip #0 (music) is not paged
}
/***************************************************************************
Esprade
***************************************************************************/
void cave_state::esprade(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::esprade_map);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_esprade);
MCFG_VIDEO_START_OVERRIDE(cave_state,ddonpach)
/* sound hardware */
add_ymz(config);
}
/***************************************************************************
Gaia Crusaders
***************************************************************************/
void cave_state::gaia(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::gaia_map);
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
m_screen[0]->set_visarea(0, 320-1, 0, 224-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_esprade);
MCFG_VIDEO_START_OVERRIDE(cave_state,ddonpach)
/* sound hardware */
add_ymz(config);
}
/***************************************************************************
Guwange
***************************************************************************/
void cave_state::guwange(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::guwange_map);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_esprade);
MCFG_VIDEO_START_OVERRIDE(cave_state,ddonpach)
/* sound hardware */
add_ymz(config);
}
/***************************************************************************
Hotdog Storm
***************************************************************************/
void cave_state::hotdogst(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_clock(32_MHz_XTAL/2);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::hotdogst_map);
Z80(config, m_audiocpu, 32_MHz_XTAL/8);
m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::hotdogst_sound_map);
m_audiocpu->set_addrmap(AS_IO, &cave_state::hotdogst_sound_portmap);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
m_screen[0]->set_size(384, 240);
m_screen[0]->set_visarea(0, 384-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_hotdogst);
m_palette[0]->set_entries(0x1000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,donpachi)
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_16(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
ym2203_device &ymsnd(YM2203(config, "ymsnd", 32_MHz_XTAL/8));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "mono", 0.20);
ymsnd.add_route(1, "mono", 0.20);
ymsnd.add_route(2, "mono", 0.20);
ymsnd.add_route(3, "mono", 0.80);
OKIM6295(config, m_oki[0], 32_MHz_XTAL/16, okim6295_device::PIN7_HIGH); // pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0);
m_oki[0]->set_addrmap(0, &cave_state::oki_map);
}
/***************************************************************************
Koro Koro Quest
***************************************************************************/
void cave_state::korokoro(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::korokoro_map);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
m_screen[0]->set_visarea(0, 320-1-2, 0, 240-1-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_korokoro);
m_palette[0]->set_entries(0x8000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,korokoro)
/* sound hardware */
add_ymz(config);
}
void cave_state::crusherm(machine_config &config)
{
korokoro(config);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::crusherm_map);
}
/***************************************************************************
Mazinger Z
***************************************************************************/
void cave_state::mazinger(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::mazinger_map);
Z80(config, m_audiocpu, 4_MHz_XTAL); // Bidirectional communication
m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::mazinger_sound_map);
m_audiocpu->set_addrmap(AS_IO, &cave_state::mazinger_sound_portmap);
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
m_screen[0]->set_size(384, 240);
m_screen[0]->set_visarea(0, 384-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_mazinger);
m_palette[0]->set_entries(0x8000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,dfeveron)
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_16(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
ym2203_device &ymsnd(YM2203(config, "ymsnd", 4_MHz_XTAL));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "mono", 0.20);
ymsnd.add_route(1, "mono", 0.20);
ymsnd.add_route(2, "mono", 0.20);
ymsnd.add_route(3, "mono", 0.60);
OKIM6295(config, m_oki[0], 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 2.0);
m_oki[0]->set_addrmap(0, &cave_state::oki_map);
}
/***************************************************************************
Metamoqester
***************************************************************************/
void cave_state::metmqstr(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_clock(32_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::metmqstr_map);
Z80(config, m_audiocpu, 32_MHz_XTAL / 4);
m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::metmqstr_sound_map);
m_audiocpu->set_addrmap(AS_IO, &cave_state::metmqstr_sound_portmap);
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x7d, 0x7d + 0x180-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_donpachi);
m_palette[0]->set_entries(0x1000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,donpachi)
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_16(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
ym2151_device &ymsnd(YM2151(config, "ymsnd", 16_MHz_XTAL / 4));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.6);
OKIM6295(config, m_oki[0], 32_MHz_XTAL / 16, okim6295_device::PIN7_HIGH);
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5);
m_oki[0]->set_addrmap(0, &cave_state::oki_map);
OKIM6295(config, m_oki[1], 32_MHz_XTAL / 16, okim6295_device::PIN7_HIGH);
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.5);
m_oki[1]->set_addrmap(0, &cave_state::oki2_map);
}
/***************************************************************************
Pac-Slot
***************************************************************************/
void cave_state::pacslot(machine_config &config)
{
add_base_config(config);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* basic machine hardware */
m_maincpu->set_clock(28_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::pacslot_map);
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */
EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_uopoko);
MCFG_VIDEO_START_OVERRIDE(cave_state,uopoko)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
OKIM6295(config, m_oki[0], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
// oki2 chip is present but its rom socket is unpopulated
OKIM6295(config, m_oki[1], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
}
void cave_state::paceight(machine_config &config)
{
pacslot(config);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::paceight_map);
}
/***************************************************************************
Poka Poka Satan
***************************************************************************/
TIMER_DEVICE_CALLBACK_MEMBER( cave_state::timer_lev2_cb )
{
m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); // ppsatan: read touch screens
}
void cave_state::ppsatan(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_vblank_int("screen.0", FUNC(cave_state::interrupt_ppsatan));
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::ppsatan_map);
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(1)); /* a guess, and certainly wrong */
EEPROM_93C46_16BIT(config, m_eeprom);
TIMER(config, "timer_lev2").configure_periodic(FUNC(cave_state::timer_lev2_cb), attotime::from_hz(60));
/* video hardware */
m_screen[0]->set_visarea(0, 320-1, 0, 224-1);
m_screen[0]->set_screen_update(FUNC(cave_state::screen_update_ppsatan_top));
subdevice<timer_device>("int_timer")->configure_generic(FUNC(cave_state::vblank_start));
SCREEN(config, m_screen[1], SCREEN_TYPE_RASTER);
m_screen[1]->set_refresh_hz(15625/271.5);
m_screen[1]->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen[1]->set_size(320, 240);
m_screen[1]->set_visarea(0, 320-1, 0, 224-1);
m_screen[1]->set_screen_update(FUNC(cave_state::screen_update_ppsatan_left));
TIMER(config, "int_timer_left").configure_generic(FUNC(cave_state::vblank_start_left));
SCREEN(config, m_screen[2], SCREEN_TYPE_RASTER);
m_screen[2]->set_refresh_hz(15625/271.5);
m_screen[2]->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen[2]->set_size(320, 240);
m_screen[2]->set_visarea(0, 320-1, 0, 224-1);
m_screen[2]->set_screen_update(FUNC(cave_state::screen_update_ppsatan_right));
TIMER(config, "int_timer_right").configure_generic(FUNC(cave_state::vblank_start_right));
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_ppsatan_0);
GFXDECODE(config, m_gfxdecode[1], m_palette[1], gfx_ppsatan_1);
GFXDECODE(config, m_gfxdecode[2], m_palette[2], gfx_ppsatan_2);
m_palette[0]->set_entries(0x9000/2);
PALETTE(config, m_palette[1], palette_device::BLACK).set_format(palette_device::xGRB_555, 0x9000/2);
PALETTE(config, m_palette[2], palette_device::BLACK).set_format(palette_device::xGRB_555, 0x9000/2);
config.set_default_layout(layout_ppsatan);
MCFG_VIDEO_START_OVERRIDE(cave_state,ppsatan)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
OKIM6295(config, m_oki[0], 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 2.0);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 2.0);
}
/***************************************************************************
Power Instinct 2
***************************************************************************/
/* X1 = 12 MHz, X2 = 28 MHz, X3 = 16 MHz. OKI: / 165 mode A ; / 132 mode B */
void cave_state::pwrinst2(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::pwrinst2_map);
Z80(config, m_audiocpu, 16_MHz_XTAL / 2); /* 8 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::pwrinst2_sound_map);
m_audiocpu->set_addrmap(AS_IO, &cave_state::pwrinst2_sound_portmap);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x70, 0x70 + 0x140-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_pwrinst2);
m_palette[0]->set_entries(0x5000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,pwrinst2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_16(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
ym2203_device &ym2203(YM2203(config, "ymsnd", 16_MHz_XTAL / 4));
ym2203.irq_handler().set_inputline("audiocpu", 0);
ym2203.add_route(0, "mono", 0.40);
ym2203.add_route(1, "mono", 0.40);
ym2203.add_route(2, "mono", 0.40);
ym2203.add_route(3, "mono", 0.80);
OKIM6295(config, m_oki[0], 3_MHz_XTAL, okim6295_device::PIN7_LOW);
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.80);
OKIM6295(config, m_oki[1], 3_MHz_XTAL, okim6295_device::PIN7_LOW);
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.00);
nmk112_device &nmk112(NMK112(config, "nmk112", 0));
nmk112.set_rom0_tag("oki1");
nmk112.set_rom1_tag("oki2");
}
/***************************************************************************
Sailor Moon / Air Gallet
***************************************************************************/
TIMER_DEVICE_CALLBACK_MEMBER( cave_state::sailormn_startup )
{
m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
}
MACHINE_RESET_MEMBER(cave_state,sailormn)
{
machine_reset();
m_startup->adjust(attotime::from_usec(1000), 0, attotime::zero);
}
void cave_state::sailormn(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::sailormn_map);
// could be a wachdog, but if it is then our watchdog address is incorrect as there are periods where the game doesn't write it.
TIMER(config, m_startup).configure_generic(FUNC(cave_state::sailormn_startup));
Z80(config, m_audiocpu, 8_MHz_XTAL); // Bidirectional Communication
m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::sailormn_sound_map);
m_audiocpu->set_addrmap(AS_IO, &cave_state::sailormn_sound_portmap);
// config.m_minimum_quantum = attotime::from_hz(600);
MCFG_MACHINE_RESET_OVERRIDE(cave_state,sailormn)
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
m_screen[0]->set_size(320+1, 240);
m_screen[0]->set_visarea(0+1, 320+1-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_sailormn); // 4 bit sprites, 6 bit tiles
m_palette[0]->set_entries(0x4000/2);
MCFG_VIDEO_START_OVERRIDE(cave_state,sailormn) /* Layer 2 has 1 banked ROM */
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_16(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
ym2151_device &ymsnd(YM2151(config, "ymsnd", 16_MHz_XTAL / 4));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.30);
OKIM6295(config, m_oki[0], 2112000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0);
m_oki[0]->set_addrmap(0, &cave_state::oki_map);
OKIM6295(config, m_oki[1], 2112000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.0);
m_oki[1]->set_addrmap(0, &cave_state::oki2_map);
}
/***************************************************************************
Tekken Card World
***************************************************************************/
void cave_state::tekkencw(machine_config &config)
{
add_base_config(config);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* basic machine hardware */
m_maincpu->set_clock(28_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::tekkencw_map);
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */
EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_uopoko);
MCFG_VIDEO_START_OVERRIDE(cave_state,uopoko)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
OKIM6295(config, m_oki[0], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
// oki2 chip spot and rom socket are both unpopulated
}
void cave_state::tekkenbs(machine_config &config)
{
tekkencw(config);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::tekkenbs_map);
}
/***************************************************************************
Tobikose! Jumpman
***************************************************************************/
void cave_state::tjumpman(machine_config &config)
{
add_base_config(config);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* basic machine hardware */
m_maincpu->set_clock(28_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::tjumpman_map);
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */
EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1);
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_uopoko);
MCFG_VIDEO_START_OVERRIDE(cave_state,uopoko)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
OKIM6295(config, m_oki[0], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
// oki2 chip spot and rom socket are both unpopulated
}
/***************************************************************************
Uo Poko
***************************************************************************/
void cave_state::uopoko(machine_config &config)
{
add_base_config(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::uopoko_map);
EEPROM_93C46_16BIT(config, m_eeprom);
/* video hardware */
GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_uopoko);
MCFG_VIDEO_START_OVERRIDE(cave_state,uopoko)
/* sound hardware */
add_ymz(config);
}
/***************************************************************************
ROMs Loading
***************************************************************************/
/* 4 bits -> 8 bits. Even and odd pixels are swapped */
void cave_state::unpack_sprites(int chip)
{
const u32 len = m_spriteregion[chip]->bytes();
u8 *rgn = m_spriteregion[chip]->base();
u8 *src = rgn + len / 2 - 1;
u8 *dst = rgn + len - 1;
while (dst > src)
{
const u8 data = *src--;
/* swap even and odd pixels */
*dst-- = data >> 4; *dst-- = data & 0xF;
}
}
/* 4 bits -> 8 bits. Even and odd pixels are not swapped */
void cave_state::ddp_unpack_sprites(int chip)
{
const u32 len = m_spriteregion[chip]->bytes();
u8 *rgn = m_spriteregion[chip]->base();
u8 *src = rgn + len / 2 - 1;
u8 *dst = rgn + len - 1;
while (dst > src)
{
const u8 data = *src--;
*dst-- = data & 0xf; *dst-- = data >> 4;
}
}
/* 2 pages of 4 bits -> 8 bits */
void cave_state::esprade_unpack_sprites(int chip)
{
u8 *src = m_spriteregion[chip]->base();
u8 *dst = src + m_spriteregion[chip]->bytes();
while (src < dst)
{
const u8 data1 = src[0];
const u8 data2 = src[1];
src[0] = ((data1 & 0x0f) << 4) + (data2 & 0x0f);
src[1] = (data1 & 0xf0) + ((data2 & 0xf0) >> 4);
src += 2;
}
}
/***************************************************************************
Air Gallet
Banpresto
Runs on identical board to Sailor Moon (several sockets unpopulated)
PCB: BP945A (overstamped with BP962A)
CPU: TMP68HC000P16 (68000, 64 pin DIP)
SND: Z84C0008PEC (Z80, 40 pin DIP), OKI M6295 x 2, YM2151, YM3012
OSC: 28.000MHz, 16.000MHz
RAM: 62256 x 8, NEC 424260 x 2, 6264 x 5
Other Chips:
SGS Thomson ST93C46CB1 (EEPROM)
PALS (same as Sailor Moon, not dumped):
18CV8 label SMBG
18CV8 label SMZ80
18CV8 label SMCPU
GAL16V8 (located near BP962A.U47)
GFX: 038 9437WX711 (176 pin PQFP)
038 9437WX711 (176 pin PQFP)
038 9437WX711 (176 pin PQFP)
013 9346E7002 (240 pin PQFP)
On PCB near JAMMA connector is a small push button to access test mode.
ROMS:
BP962A.U9 27C040 Sound Program
BP962A.U45 27C240 Main Program
BP962A.U47 23C16000 Sound
BP962A.U48 23C16000 Sound
BP962A.U53 23C16000 GFX
BP962A.U54 23C16000 GFX
BP962A.U57 23C16000 GFX
BP962A.U65 23C16000 GFX
BP962A.U76 23C16000 GFX
BP962A.U77 23C16000 GFX
***************************************************************************/
#define ROMS_AGALLET_COMMON \
ROM_REGION( 0x80000, "audiocpu", 0 ) \
ROM_LOAD( "bp962a.u9", 0x00000, 0x80000, CRC(06caddbe) SHA1(6a3cc50558ba19a31b21b7f3ec6c6e2846244ff1) ) \
\
ROM_REGION( 0x400000 * 2, "sprites0", 0 ) \
ROM_LOAD( "bp962a.u76", 0x000000, 0x200000, CRC(858da439) SHA1(33a3d2a3ec3fa3364b00e1e43b405e5030a5b2a3) ) \
ROM_LOAD( "bp962a.u77", 0x200000, 0x200000, CRC(ea2ba35e) SHA1(72487f21d44fe7be9a98068ce7f57a43c132945f) ) \
\
ROM_REGION( 0x100000, "layer0", 0 ) \
ROM_LOAD( "bp962a.u53", 0x000000, 0x100000, CRC(fcd9a107) SHA1(169b94db8389e7d47d4d77f36907a62c30fea727) ) \
ROM_CONTINUE( 0x000000, 0x100000 ) \
\
ROM_REGION( 0x200000, "layer1", 0 ) \
ROM_LOAD( "bp962a.u54", 0x000000, 0x200000, CRC(0cfa3409) SHA1(17107e26762ef7e3b902fb29a6d7bc534a4d09aa) ) \
\
ROM_REGION( (1*0x200000)*2, "layer2", 0 ) \
\
ROM_LOAD( "bp962a.u57", 0x000000, 0x200000, CRC(6d608957) SHA1(15f6e8346f5f95eb229505b1b4666dabeb810ee8) ) \
\
ROM_LOAD( "bp962a.u65", 0x200000, 0x100000, CRC(135fcf9a) SHA1(2e8c89c2627bbdef160d96724d07883fb2fa1a57) ) \
ROM_CONTINUE( 0x200000, 0x100000 ) \
\
ROM_REGION( 0x200000, "oki1", 0 ) \
ROM_LOAD( "bp962a.u48", 0x000000, 0x200000, CRC(ae00a1ce) SHA1(5e8c74df0ac77efb3080406870856f958be14f79) ) \
\
ROM_REGION( 0x200000, "oki2", 0 ) \
ROM_LOAD( "bp962a.u47", 0x000000, 0x200000, CRC(6d4e9737) SHA1(81c7ecdfc2d38d0b35e26745866f6672f566f936) )
// these roms were dumped from a board set to Taiwanese region.
#define ROMS_AGALLET \
ROM_REGION( 0x400000, "maincpu", 0 ) \
ROM_LOAD16_WORD_SWAP( "bp962a.u45", 0x000000, 0x080000, CRC(24815046) SHA1(f5eeae60b923ae850b335e7898a2760407631d8b) ) \
ROMS_AGALLET_COMMON
/* the regions differ only in the EEPROM, hence the macro above - all EEPROMs are Factory Defaulted */
ROM_START( agallet )
ROMS_AGALLET
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_europe.nv", 0x0000, 0x0080, CRC(ec38bf65) SHA1(cb8d9eacc0cf55a0c6b187e6673e3354554314b5) )
ROM_END
ROM_START( agalletu )
ROMS_AGALLET
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_usa.nv", 0x0000, 0x0080, CRC(72e65056) SHA1(abf1a86df01064d9d5d8c418e8367817319ec335) )
ROM_END
ROM_START( agalletj )
ROMS_AGALLET
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_japan.nv", 0x0000, 0x0080, CRC(0753f547) SHA1(aabb987470406b8729894108bc4d050f7200917d) )
ROM_END
ROM_START( agalletk )
ROMS_AGALLET
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_korea.nv", 0x0000, 0x0080, CRC(7f41c253) SHA1(50793d4da0ad6eb590941d26a729a1cf4b3c25c2) )
ROM_END
ROM_START( agallett ) // the dumped board was this region
ROMS_AGALLET
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_taiwan.nv", 0x0000, 0x0080, CRC(0af46742) SHA1(37b704c4c573b2aabd6f016e9e8dd458f95148f7) )
ROM_END
ROM_START( agalleth )
ROMS_AGALLET
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_hongkong.nv", 0x0000, 0x0080, CRC(998d1a74) SHA1(13e7e27a18417949d49e97d521781fc0feeef792) )
ROM_END
// these roms were dumped from a board set to the Japanese region.
#define ROMS_AGALLETA \
ROM_REGION( 0x400000, "maincpu", 0 ) \
ROM_LOAD16_WORD_SWAP( "u45", 0x000000, 0x080000, CRC(2cab18b0) SHA1(5e779b74d8520cb482697b5efba4746854e7c9fe) ) \
ROMS_AGALLET_COMMON
/* the regions differ only in the EEPROM, hence the macro above - all EEPROMs are Factory Defaulted */
ROM_START( agalleta )
ROMS_AGALLETA
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_europe.nv", 0x0000, 0x0080, CRC(ec38bf65) SHA1(cb8d9eacc0cf55a0c6b187e6673e3354554314b5) )
ROM_END
ROM_START( agalletau )
ROMS_AGALLETA
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_usa.nv", 0x0000, 0x0080, CRC(72e65056) SHA1(abf1a86df01064d9d5d8c418e8367817319ec335) )
ROM_END
ROM_START( agalletaj ) // the dumped board was this region
ROMS_AGALLETA
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_japan.nv", 0x0000, 0x0080, CRC(0753f547) SHA1(aabb987470406b8729894108bc4d050f7200917d) )
ROM_END
ROM_START( agalletak )
ROMS_AGALLETA
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_korea.nv", 0x0000, 0x0080, CRC(7f41c253) SHA1(50793d4da0ad6eb590941d26a729a1cf4b3c25c2) )
ROM_END
ROM_START( agalletat )
ROMS_AGALLETA
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_taiwan.nv", 0x0000, 0x0080, CRC(0af46742) SHA1(37b704c4c573b2aabd6f016e9e8dd458f95148f7) )
ROM_END
ROM_START( agalletah )
ROMS_AGALLETA
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "agallet_hongkong.nv", 0x0000, 0x0080, CRC(998d1a74) SHA1(13e7e27a18417949d49e97d521781fc0feeef792) )
ROM_END
/***************************************************************************
Fever SOS (International) / Dangun Feveron (Japan)
Board: CV01
OSC: 28.0, 16.0, 16.9 MHz
***************************************************************************/
ROM_START( dfeveron )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "cv01-u34.bin", 0x000000, 0x080000, CRC(be87f19d) SHA1(595239245df3835cdf5a99a6c62480465558d8d3) )
ROM_LOAD16_BYTE( "cv01-u33.bin", 0x000001, 0x080000, CRC(e53a7db3) SHA1(ddced29f78dc3cc89038757b6577ba2ba0d8b041) )
ROM_REGION( 0x800000 * 2, "sprites0", 0 ) /* Sprites: * 2 */
ROM_LOAD( "cv01-u25.bin", 0x000000, 0x400000, CRC(a6f6a95d) SHA1(e1eb45cb5d0e6163edfd9d830633b913fb53c6ca) )
ROM_LOAD( "cv01-u26.bin", 0x400000, 0x400000, CRC(32edb62a) SHA1(3def74e1316b80cc25a8c3ac162cd7bcb8cc807c) )
ROM_REGION( 0x200000, "layer0", 0 ) /* Layer 0 */
ROM_LOAD( "cv01-u50.bin", 0x000000, 0x200000, CRC(7a344417) SHA1(828bd8f95d2fcc34407e17629ccafc904a4ea12d) )
ROM_REGION( 0x200000, "layer1", 0 ) /* Layer 1 */
ROM_LOAD( "cv01-u49.bin", 0x000000, 0x200000, CRC(d21cdda7) SHA1(cace4650de580c3c4a037f1f5c32bfc1846b383c) )
ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */
ROM_LOAD( "cv01-u19.bin", 0x000000, 0x400000, CRC(5f5514da) SHA1(53f27364aee544572a82649c9ff29bacc642b732) )
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-dfeveron.bin", 0x0000, 0x0080, CRC(c3174959) SHA1(29b5c94722756481e4f84bfd75dee15fdb5c8cf7) )
ROM_END
/*
Fever SOS
The program code checks for 0x05 & 0x19 at the 17th & 18th byte in the EEPROM. Therefore
you cannot convert a Dangun Feveron over to a Fever SOS by changing the 2 program roms
Jumper JP1:
INT Version - 2 & 3
JAP Version - 1 & 2
However there are more differences:
U4:
INT Version - 013 9838EX003
JAP Version - 013 9807EX004 (The second set of numbers are manufacture day codes)
UA2 & UB2:
INT Version - 038 9838WX001
JAP Version - 038 9808WX003 (The second set of numbers are manufacture day codes)
TA8030S (Beside SW1)
INT Version - NOT MOUNTED
JAP Version - TA8030S (WatchDog Timer, might be controlled by JP1)
U47 & U48 - Differ
U38 & U37 - Differ - These chips are Static RAM
It actually looks like the international version is older than
the Japanese version PCB wise, but the software date is 98/09/25
and mine is 98/09/17!
The famous full extent of the JAM is inside the image but so is
"full extent" of the LAW. There are also other version strings
inside the same image look here...
NOTICE
THIS GAME IS FOR USE IN
KOREA ONLY
HONG KONG ONLY
TAIWAN ONLY
SOUTHEAST ASIA ONLY
EUROPE ONLY
U.S.A ONLY
JAPAN ONLY
SALES, EXPORT OR OPERATION
OUTSIDE THIS COUNTRY MAY BE
CONSTRUED AS COPYRIGHT AND
TRADEMARK INFRINGEMENT AND
IS STRICTLY PROHIBITED.
VIOLATOR AND SUBJECT TO
SEVERE PENALTIES AND WILL
BE PROSECUTED TO THE FULL
EXTENT OF THE JAM.
98/09/10 VER.
Look at the version date!
NOTICE
THIS GAME MAY NOT BE SOLD,
EXPORTED OR OPERATED
WITHOUTPROOF OF LEGAL CONSENT
BY CAVE CO.,LTD.
VIOLATION OF THESE TERMS WILL
RESULT IN COPYRIGHT AND
TRADEMARK INFRINGEMENT,AND IS
STRICTLY PROHIBITED.
VIOLATORS ARE SUBJECT TO
SEVERE PENALTIES AND WILL BE
PROSECUTED TO THE FULL EXTENT
OF THE LAW GOVERNED BY THE
COUNTRY OF ORIGIN.
98/09/25 VER
This is from Fever SOS image! Both version strings are present!
The PCB is also different, UD's PCB does not have the Cave logo and
the CV01 marker in the lower left corner of the PCB.
There is some "engrish" story inside the UD image but this is NOT
present in the japanese images...
*/
ROM_START( feversos )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "cv01-u34.sos", 0x000000, 0x080000, CRC(24ef3ce6) SHA1(42799eebbb2686a837b8972aec684143deadca59) )
ROM_LOAD16_BYTE( "cv01-u33.sos", 0x000001, 0x080000, CRC(64ff73fd) SHA1(7fc3a8469cec2361d373a4dac4a547c13ca5f709) )
ROM_REGION( 0x800000 * 2, "sprites0", 0 ) /* Sprites: * 2 */
ROM_LOAD( "cv01-u25.bin", 0x000000, 0x400000, CRC(a6f6a95d) SHA1(e1eb45cb5d0e6163edfd9d830633b913fb53c6ca) )
ROM_LOAD( "cv01-u26.bin", 0x400000, 0x400000, CRC(32edb62a) SHA1(3def74e1316b80cc25a8c3ac162cd7bcb8cc807c) )
ROM_REGION( 0x200000, "layer0", 0 ) /* Layer 0 */
ROM_LOAD( "cv01-u50.bin", 0x000000, 0x200000, CRC(7a344417) SHA1(828bd8f95d2fcc34407e17629ccafc904a4ea12d) )
ROM_REGION( 0x200000, "layer1", 0 ) /* Layer 1 */
ROM_LOAD( "cv01-u49.bin", 0x000000, 0x200000, CRC(d21cdda7) SHA1(cace4650de580c3c4a037f1f5c32bfc1846b383c) )
ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */
ROM_LOAD( "cv01-u19.bin", 0x000000, 0x400000, CRC(5f5514da) SHA1(53f27364aee544572a82649c9ff29bacc642b732) )
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-feversos.bin", 0x0000, 0x0080, CRC(d80303aa) SHA1(8580f7c2223c72614516d800a98465e362c333ef) )
ROM_END
/***************************************************************************
Dodonpachi (Japan)
PCB: AT-C03 D2
CPU: MC68000-16
Sound: YMZ280B
OSC: 28.0000MHz
16.0000MHz
16.9MHz (16.9344MHz?)
***************************************************************************/
ROM_START( ddonpach )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "b1.u27", 0x000000, 0x080000, CRC(b5cdc8d3) SHA1(58757b50e21a27e500a82c03f62cf02a85389926) )
ROM_LOAD16_BYTE( "b2.u26", 0x000001, 0x080000, CRC(6bbb063a) SHA1(e5de64b9c3efc0a38a2e0e16b78ee393bff63558) )
ROM_REGION( 0x800000 * 2, "sprites0", 0 ) /* Sprites: * 2 */
ROM_LOAD16_WORD_SWAP( "u50.bin", 0x000000, 0x200000, CRC(14b260ec) SHA1(33bda210302428d5500115d0c7a839cdfcb67d17) )
ROM_LOAD16_WORD_SWAP( "u51.bin", 0x200000, 0x200000, CRC(e7ba8cce) SHA1(ad74a6b7d53760b19587c4a6dbea937daa7e87ce) )
ROM_LOAD16_WORD_SWAP( "u52.bin", 0x400000, 0x200000, CRC(02492ee0) SHA1(64d9cc64a4ad189a8b03cf6a749ddb732b4a0014) )
ROM_LOAD16_WORD_SWAP( "u53.bin", 0x600000, 0x200000, CRC(cb4c10f0) SHA1(a622e8bd0c938b5d38b392b247400b744d8be288) )
ROM_REGION( 0x200000, "layer0", 0 ) /* Layer 0 */
ROM_LOAD( "u60.bin", 0x000000, 0x200000, CRC(903096a7) SHA1(a243e903fef7c4a7b71383263e82e42acd869261) )
ROM_REGION( 0x200000, "layer1", 0 ) /* Layer 1 */
ROM_LOAD( "u61.bin", 0x000000, 0x200000, CRC(d89b7631) SHA1(a66bb4955ca58fab8973ca37a0f971e9a67ce017) )
ROM_REGION( 0x200000, "layer2", 0 ) /* Layer 2 */
ROM_LOAD( "u62.bin", 0x000000, 0x200000, CRC(292bfb6b) SHA1(11b385991ee990eb5ef36e136b988802b5f90fa4) )
ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */
ROM_LOAD( "u6.bin", 0x000000, 0x200000, CRC(9dfdafaf) SHA1(f5cb450cdc78a20c3a74c6dac05c9ac3cba08327) )
ROM_LOAD( "u7.bin", 0x200000, 0x200000, CRC(795b17d5) SHA1(cbfc29f1df9600c82e0fdae00edd00da5b73e14c) )
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-ddonpach.bin", 0x0000, 0x0080, CRC(315fb546) SHA1(7f597107d1610fc286413e0e93c794c80c0c554f) )
ROM_END
ROM_START( ddonpachj )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "u27.bin", 0x000000, 0x080000, CRC(2432ff9b) SHA1(fbc826c30553f6553ead40b312b73c049e8f4bf6) )
ROM_LOAD16_BYTE( "u26.bin", 0x000001, 0x080000, CRC(4f3a914a) SHA1(ae98eba049f1462aa1145f6959b9f9a32c97278f) )
ROM_REGION( 0x800000 * 2, "sprites0", 0 ) /* Sprites: * 2 */
ROM_LOAD16_WORD_SWAP( "u50.bin", 0x000000, 0x200000, CRC(14b260ec) SHA1(33bda210302428d5500115d0c7a839cdfcb67d17) )
ROM_LOAD16_WORD_SWAP( "u51.bin", 0x200000, 0x200000, CRC(e7ba8cce) SHA1(ad74a6b7d53760b19587c4a6dbea937daa7e87ce) )
ROM_LOAD16_WORD_SWAP( "u52.bin", 0x400000, 0x200000, CRC(02492ee0) SHA1(64d9cc64a4ad189a8b03cf6a749ddb732b4a0014) )
ROM_LOAD16_WORD_SWAP( "u53.bin", 0x600000, 0x200000, CRC(cb4c10f0) SHA1(a622e8bd0c938b5d38b392b247400b744d8be288) )
ROM_REGION( 0x200000, "layer0", 0 ) /* Layer 0 */
ROM_LOAD( "u60.bin", 0x000000, 0x200000, CRC(903096a7) SHA1(a243e903fef7c4a7b71383263e82e42acd869261) )
ROM_REGION( 0x200000, "layer1", 0 ) /* Layer 1 */
ROM_LOAD( "u61.bin", 0x000000, 0x200000, CRC(d89b7631) SHA1(a66bb4955ca58fab8973ca37a0f971e9a67ce017) )
ROM_REGION( 0x200000, "layer2", 0 ) /* Layer 2 */
ROM_LOAD( "u62.bin", 0x000000, 0x200000, CRC(292bfb6b) SHA1(11b385991ee990eb5ef36e136b988802b5f90fa4) )
ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */
ROM_LOAD( "u6.bin", 0x000000, 0x200000, CRC(9dfdafaf) SHA1(f5cb450cdc78a20c3a74c6dac05c9ac3cba08327) )
ROM_LOAD( "u7.bin", 0x200000, 0x200000, CRC(795b17d5) SHA1(cbfc29f1df9600c82e0fdae00edd00da5b73e14c) )
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-ddonpach.bin", 0x0000, 0x0080, CRC(315fb546) SHA1(7f597107d1610fc286413e0e93c794c80c0c554f) )
ROM_END
ROM_START( ddonpacha )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "arrange_u27.bin", 0x000000, 0x080000, CRC(44b899ae) SHA1(798ec437d861b94fcd90c99a7015dd420887c788) )
ROM_LOAD16_BYTE( "arrange_u26.bin", 0x000001, 0x080000, CRC(727a09a8) SHA1(91876386855f19e8a3d8d1df71dfe9b3d98e9ea9) )
ROM_REGION( 0x800000 * 2, "sprites0", 0 ) /* Sprites: * 2 */
ROM_LOAD16_WORD_SWAP( "u50.bin", 0x000000, 0x200000, CRC(14b260ec) SHA1(33bda210302428d5500115d0c7a839cdfcb67d17) )
ROM_LOAD16_WORD_SWAP( "arrange_u51.bin", 0x200000, 0x200000, CRC(0f3e5148) SHA1(3016f4d075940feae691389606cd2aa7ac53849e) )
ROM_LOAD16_WORD_SWAP( "u52.bin", 0x400000, 0x200000, CRC(02492ee0) SHA1(64d9cc64a4ad189a8b03cf6a749ddb732b4a0014) )
ROM_LOAD16_WORD_SWAP( "u53.bin", 0x600000, 0x200000, CRC(cb4c10f0) SHA1(a622e8bd0c938b5d38b392b247400b744d8be288) )
ROM_REGION( 0x200000, "layer0", 0 ) /* Layer 0 */
ROM_LOAD( "u60.bin", 0x000000, 0x200000, CRC(903096a7) SHA1(a243e903fef7c4a7b71383263e82e42acd869261) )
ROM_REGION( 0x200000, "layer1", 0 ) /* Layer 1 */
ROM_LOAD( "u61.bin", 0x000000, 0x200000, CRC(d89b7631) SHA1(a66bb4955ca58fab8973ca37a0f971e9a67ce017) )
ROM_REGION( 0x200000, "layer2", 0 ) /* Layer 2 */
ROM_LOAD( "arrange_u62.bin", 0x000000, 0x200000, CRC(42e4c6c5) SHA1(4d282f7592f5fc5e11839c57f39cae20b8422aa1) )
ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */
ROM_LOAD( "u6.bin", 0x000000, 0x200000, CRC(9dfdafaf) SHA1(f5cb450cdc78a20c3a74c6dac05c9ac3cba08327) )
ROM_LOAD( "u7.bin", 0x200000, 0x200000, CRC(795b17d5) SHA1(cbfc29f1df9600c82e0fdae00edd00da5b73e14c) )
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-ddonpach.bin", 0x0000, 0x0080, CRC(2df16438) SHA1(4881b70589a97e2420feb6d6e6737273beeff303) )
ROM_END
/***************************************************************************
Donpachi
Known versions:
USA Version 1.12 1995/05/2x
Korea Version 1.12 1995/05/2x
Hong Kong Version 1.10 1995/05/17
Japan Version 1.01 1995/05/11
BOARD #: AT-C01DP-2
CPU: TMP68HC000-16
VOICE: M6295 x2
OSC: 28.000/16.000/4.220MHz
EEPROM: ATMEL 93C46
CUSTOM: ATLUS 8647-01 013
038 9429WX727 x3
NMK 112 (M6295 sample ROM banking)
---------------------------------------------------
filenames devices kind
---------------------------------------------------
PRG.U29 27C4096 68000 main prg.
U58.BIN 27C020 gfx data
ATDP.U32 57C8200 M6295 data
ATDP.U33 57C16200 M6295 data
ATDP.U44 57C16200 gfx data
ATDP.U45 57C16200 gfx data
ATDP.U54 57C8200 gfx data
ATDP.U57 57C8200 gfx data
USA Version
----------------------------------------------------
prgu.U29 27C4002 68000 Main Program
text.u58 27C2001 Labeled as "TEXT"
***************************************************************************/
ROM_START( donpachi )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_WORD_SWAP( "prgu.u29", 0x00000, 0x80000, CRC(89c36802) SHA1(7857c726cecca5a4fce282e0d2b873774d2c1b1d) )
ROM_REGION( 0x400000 * 2, "sprites0", 0 ) /* Sprites: * 2 */
ROM_LOAD16_WORD_SWAP( "atdp.u44", 0x000000, 0x200000, CRC(7189e953) SHA1(53adbe6ea5e01ecb48575e9db82cc3d0dc8a3726) )
ROM_LOAD16_WORD_SWAP( "atdp.u45", 0x200000, 0x200000, CRC(6984173f) SHA1(625dd6674adeb206815855b8b6a1fba79ed5c4cd) )
ROM_REGION( 0x100000, "layer0", 0 ) /* Layer 0 */
ROM_LOAD( "atdp.u54", 0x000000, 0x100000, CRC(6bda6b66) SHA1(6472e6706505bac17484fb8bf4e8922ced4adf63) )
ROM_REGION( 0x100000, "layer1", 0 ) /* Layer 1 */
ROM_LOAD( "atdp.u57", 0x000000, 0x100000, CRC(0a0e72b9) SHA1(997e8253777e7acca5a1c0c4026e78eecc122d5d) )
ROM_REGION( 0x040000, "layer2", 0 ) /* Text / Character Layer */
ROM_LOAD( "text.u58", 0x000000, 0x040000, CRC(5dba06e7) SHA1(f9dab7f6c732a683fddb4cae090a875b3962332b) )
ROM_REGION( 0x240000, "oki1", 0 ) /* OKIM6295 #1 Samples */
/* Leave the 0x40000 bytes addressable by the chip empty */
ROM_LOAD( "atdp.u33", 0x040000, 0x200000, CRC(d749de00) SHA1(64a0acc23eb2515e7d0459f0289919e083c63afc) )
ROM_REGION( 0x340000, "oki2", 0 ) /* OKIM6295 #2 Samples */
/* Leave the 0x40000 bytes addressable by the chip empty */
ROM_LOAD( "atdp.u32", 0x040000, 0x100000, CRC(0d89fcca) SHA1(e16ed15fa5e72537822f7b37e83ccfed0fa87338) )
ROM_LOAD( "atdp.u33", 0x140000, 0x200000, CRC(d749de00) SHA1(64a0acc23eb2515e7d0459f0289919e083c63afc) )
ROM_REGION16_BE( 0x80, "eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-donpachi.u10", 0x0000, 0x0080, CRC(315fb546) SHA1(7f597107d1610fc286413e0e93c794c80c0c554f) ) /* ATMEL 93C46 */
ROM_REGION( 0x0155, "pal", 0 )
ROM_LOAD( "peel18cv8p-15.u18", 0x0000, 0x0155, CRC(3f4787e9) SHA1(fc7da25c9f36c9cbc6ba5a7314c4828d405d1261) ) /* PEEL18CV8P-15 */
ROM_END
ROM_START( donpachij )
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_WORD_SWAP( "prg.u29", 0x00000, 0x80000, CRC(6be14af6) SHA1(5b1158071f160efeded816ae4c4edca1d00d6e05) )
ROM_REGION( 0x400000 * 2, "sprites0", 0 ) /* Sprites: * 2 */
ROM_LOAD16_WORD_SWAP( "atdp.u44", 0x000000, 0x200000, CRC(7189e953) SHA1(53adbe6ea5e01ecb48575e9db82cc3d0dc8a3726) )
ROM_LOAD16_WORD_SWAP( "atdp.u45", 0x200000, 0x200000, CRC(6984173f) SHA1(625dd6674adeb206815855b8b6a1fba79ed5c4cd) )
ROM_REGION( 0x100000, "layer0", 0 ) /* Layer 0 */
ROM_LOAD( "atdp.u54", 0x000000, 0x100000, CRC(6bda6b66) SHA1(6472e6706505bac17484fb8bf4e8922ced4adf63) )
ROM_REGION( 0x100000, "layer1", 0 ) /* Layer 1 */
ROM_LOAD( "atdp.u57", 0x000000, 0x100000, CRC(0a0e72b9) SHA1(997e8253777e7acca5a1c0c4026e78eecc122d5d) )
ROM_REGION( 0x040000, "layer2", 0 ) /* Text / Character Layer */
ROM_LOAD( "u58.bin", 0x000000, 0x040000, CRC(285379ff) SHA1(b9552edcec29ddf4b552800b145c398b94117ab0) )
ROM_REGION( 0x240000, "oki1", 0 ) /* OKIM6295 #1 Samples */
/* Leave the 0x40000 bytes addressable by the chip empty */