summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2026-03-08 04:22:16 +0900
committer GitHub <noreply@github.com>2026-03-07 14:22:16 -0500
commit5a5fdc1e8cfa7272a251211d3b872db3b4162bad (patch)
tree294b82bc8619a2f774962d4f9d0d786bb9236861
parentaf450a181d0e897ebfca9603ad73abd8586f2c3e (diff)
kaneko/kan_pand.cpp and related drivers: Cleanups and Updates (#15002)
* kaneko/kan_pand.cpp and related drivers: Cleanups and Updates common: - Use shortened typename value for consistency - Use BIT macro for single bit flags - Fix loggings - Fix spacings - Fix namings - Make some variables constant - Reduce literal tag usages - Fill empty sprite gfx region to transparent kaneko/kan_pand.cpp: - Remove unnecessary checks - Fix comments (Original chip has 14 bit tile code, used at djboy.cpp and hvyunit.cpp) kaneko/airbustr.cpp: - Fix ROM set name in comments kaneko/djboy.cpp: - Fix initializer - Reduce duplicated comment block - Add notes for bankswitch entry kaneko/galpanic.cpp: - Restrict foreground bitmap draw routine to screen cliprect kaneko/hvyunit.cpp: - Remove empty override kaneko/sandscrp.cpp: - Fix CALC1 naming (CALC1 hasn't any mcu core) kaneko/snowbros.cpp - Fix comment order sort to MSB first and same byte - Split driver states per hardware configs - Simplified sound bankswitch method for snowbro3 and clones - Reduce duplicates - Fix toto dip switch config for describe broken title screen - Add korean titles when exists, Fix metadata due to title screen * kaneko/kan_pand.cpp: Add notes for sprite bitmap RAM * kaneko/kan_pand.cpp: Fix sprite trail, Fix notes Chip has double buffering, so this commit fixes sprite trail match to PCB. (ex: airbustr)
-rw-r--r--src/mame/kaneko/airbustr.cpp187
-rw-r--r--src/mame/kaneko/djboy.cpp238
-rw-r--r--src/mame/kaneko/galpanic.cpp73
-rw-r--r--src/mame/kaneko/hvyunit.cpp257
-rw-r--r--src/mame/kaneko/kan_pand.cpp160
-rw-r--r--src/mame/kaneko/kan_pand.h35
-rw-r--r--src/mame/kaneko/sandscrp.cpp47
-rw-r--r--src/mame/kaneko/snowbros.cpp889
-rw-r--r--src/mame/kaneko/snowbros.h219
-rw-r--r--src/mame/kaneko/snowbros_v.cpp218
10 files changed, 1157 insertions, 1166 deletions
diff --git a/src/mame/kaneko/airbustr.cpp b/src/mame/kaneko/airbustr.cpp
index 03ac24d96d1..d7386b777ff 100644
--- a/src/mame/kaneko/airbustr.cpp
+++ b/src/mame/kaneko/airbustr.cpp
@@ -244,11 +244,11 @@ public:
, m_devram(*this, "devram")
, m_videoram(*this, "videoram%u", 1)
, m_colorram(*this, "colorram%u", 1)
- , m_masterbank(*this, "masterbank")
- , m_slavebank(*this, "slavebank")
+ , m_mainbank(*this, "mainbank")
+ , m_subbank(*this, "subbank")
, m_audiobank(*this, "audiobank")
- , m_master(*this, "master")
- , m_slave(*this, "slave")
+ , m_maincpu(*this, "maincpu")
+ , m_subcpu(*this, "subcpu")
, m_audiocpu(*this, "audiocpu")
, m_pandora(*this, "pandora")
, m_calc1(*this, "calc1")
@@ -269,23 +269,23 @@ protected:
private:
// memory pointers
- required_shared_ptr<uint8_t> m_devram;
- required_shared_ptr_array<uint8_t, 2> m_videoram;
- required_shared_ptr_array<uint8_t, 2> m_colorram;
+ required_shared_ptr<u8> m_devram;
+ required_shared_ptr_array<u8, 2> m_videoram;
+ required_shared_ptr_array<u8, 2> m_colorram;
- required_memory_bank m_masterbank;
- required_memory_bank m_slavebank;
+ required_memory_bank m_mainbank;
+ required_memory_bank m_subbank;
required_memory_bank m_audiobank;
// video-related
tilemap_t *m_tilemap[2]{};
- uint8_t m_scrollx[2]{};
- uint8_t m_scrolly[2]{};
- uint8_t m_highbits = 0;
+ u8 m_scrollx[2]{};
+ u8 m_scrolly[2]{};
+ u8 m_highbits = 0;
// devices
- required_device<cpu_device> m_master;
- required_device<cpu_device> m_slave;
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
required_device<cpu_device> m_audiocpu;
required_device<kaneko_pandora_device> m_pandora;
optional_device<kaneko_hit_device> m_calc1;
@@ -294,28 +294,28 @@ private:
required_device<palette_device> m_palette;
required_device_array<generic_latch_8_device, 2> m_soundlatch;
- void calc1_w(offs_t offset, uint8_t data);
- uint8_t calc1_r(offs_t offset);
- void master_nmi_trigger_w(uint8_t data);
- void master_bankswitch_w(uint8_t data);
- void slave_bankswitch_w(uint8_t data);
- void sound_bankswitch_w(uint8_t data);
- uint8_t soundcommand_status_r();
- void coin_counter_w(uint8_t data);
- template<int Layer> void videoram_w(offs_t offset, uint8_t data);
- template<int Layer> void colorram_w(offs_t offset, uint8_t data);
- void scrollregs_w(offs_t offset, uint8_t data);
+ void calc1_w(offs_t offset, u8 data);
+ u8 calc1_r(offs_t offset);
+ void main_nmi_trigger_w(u8 data);
+ void main_bankswitch_w(u8 data);
+ void sub_bankswitch_w(u8 data);
+ void sound_bankswitch_w(u8 data);
+ u8 soundcommand_status_r();
+ void coin_counter_w(u8 data);
+ template<int Layer> void videoram_w(offs_t offset, u8 data);
+ template<int Layer> void colorram_w(offs_t offset, u8 data);
+ void scrollregs_w(offs_t offset, u8 data);
template<int Layer> TILE_GET_INFO_MEMBER(get_tile_info);
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_vblank(int state);
- INTERRUPT_GEN_MEMBER(slave_interrupt);
+ INTERRUPT_GEN_MEMBER(sub_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
- void master_map(address_map &map) ATTR_COLD;
- void master_prot_map(address_map &map) ATTR_COLD;
- void master_io_map(address_map &map) ATTR_COLD;
- void slave_map(address_map &map) ATTR_COLD;
- void slave_io_map(address_map &map) ATTR_COLD;
+ void main_map(address_map &map) ATTR_COLD;
+ void main_prot_map(address_map &map) ATTR_COLD;
+ void main_io_map(address_map &map) ATTR_COLD;
+ void sub_map(address_map &map) ATTR_COLD;
+ void sub_io_map(address_map &map) ATTR_COLD;
void sound_map(address_map &map) ATTR_COLD;
void sound_io_map(address_map &map) ATTR_COLD;
};
@@ -363,7 +363,7 @@ private:
Bg Y Bg X Fg Y Fg X <-Scroll High Bits (complemented!)
*/
-void airbustr_state::scrollregs_w(offs_t offset, uint8_t data)
+void airbustr_state::scrollregs_w(offs_t offset, u8 data)
{
switch (offset) // offset 0 <-> port 4
{
@@ -373,7 +373,7 @@ void airbustr_state::scrollregs_w(offs_t offset, uint8_t data)
case 0x06: m_scrollx[((offset & 4) >> 2) ^ 1] = data; break;
case 0x08: m_highbits = ~data; break; // complemented high bits
- default: LOGSCROLLREGS("CPU #2 - port %02X written with %02X - PC = %04X\n", offset, data, m_slave->pc());
+ default: LOGSCROLLREGS("%s: port %02X written with %02X\n", machine().describe_context(), offset, data);
}
for (int layer = 0; layer < 2; layer++)
@@ -408,7 +408,7 @@ void airbustr_state::video_start()
}
-uint32_t airbustr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 airbustr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0);
m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0);
@@ -434,36 +434,36 @@ void airbustr_state::screen_vblank(int state)
// Read / Write Handlers
-void airbustr_state::calc1_w(offs_t offset, uint8_t data)
+void airbustr_state::calc1_w(offs_t offset, u8 data)
{
offset += 0xfe0;
m_devram[offset] = data;
// CALC1 chip is 16-bit
- uint16_t data16 = m_devram[offset | 1] << 8 | m_devram[offset & ~1];
+ u16 const data16 = m_devram[offset | 1] << 8 | m_devram[offset & ~1];
m_calc1->kaneko_hit_w((offset & 0x1f) / 2, data16);
}
-uint8_t airbustr_state::calc1_r(offs_t offset)
+u8 airbustr_state::calc1_r(offs_t offset)
{
// CALC1 chip is 16-bit
- uint16_t ret = m_calc1->kaneko_hit_r(offset / 2);
+ u16 const ret = m_calc1->kaneko_hit_r(offset / 2);
return (offset & 1) ? (ret >> 8) : (ret & 0xff);
}
-void airbustr_state::master_nmi_trigger_w(uint8_t data)
+void airbustr_state::main_nmi_trigger_w(u8 data)
{
- m_slave->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
+ m_subcpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
-void airbustr_state::master_bankswitch_w(uint8_t data)
+void airbustr_state::main_bankswitch_w(u8 data)
{
- m_masterbank->set_entry(data & 0x07);
+ m_mainbank->set_entry(data & 0x07);
}
-void airbustr_state::slave_bankswitch_w(uint8_t data)
+void airbustr_state::sub_bankswitch_w(u8 data)
{
- m_slavebank->set_entry(data & 0x07);
+ m_subbank->set_entry(data & 0x07);
for (int layer = 0; layer < 2; layer++)
m_tilemap[layer]->set_flip(BIT(data, 4) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
@@ -474,12 +474,12 @@ void airbustr_state::slave_bankswitch_w(uint8_t data)
m_pandora->set_clear_bitmap(BIT(data, 5));
}
-void airbustr_state::sound_bankswitch_w(uint8_t data)
+void airbustr_state::sound_bankswitch_w(u8 data)
{
m_audiobank->set_entry(data & 0x07);
}
-uint8_t airbustr_state::soundcommand_status_r()
+u8 airbustr_state::soundcommand_status_r()
{
// bits: 2 <-> ? 1 <-> soundlatch full 0 <-> soundlatch2 empty
return 4 | (m_soundlatch[0]->pending_r() << 1) | !m_soundlatch[1]->pending_r();
@@ -487,58 +487,58 @@ uint8_t airbustr_state::soundcommand_status_r()
template<int Layer>
-void airbustr_state::videoram_w(offs_t offset, uint8_t data)
+void airbustr_state::videoram_w(offs_t offset, u8 data)
{
m_videoram[Layer][offset] = data;
m_tilemap[Layer]->mark_tile_dirty(offset);
}
template<int Layer>
-void airbustr_state::colorram_w(offs_t offset, uint8_t data)
+void airbustr_state::colorram_w(offs_t offset, u8 data)
{
m_colorram[Layer][offset] = data;
m_tilemap[Layer]->mark_tile_dirty(offset);
}
-void airbustr_state::coin_counter_w(uint8_t data)
+void airbustr_state::coin_counter_w(u8 data)
{
- machine().bookkeeping().coin_counter_w(0, data & 1);
- machine().bookkeeping().coin_counter_w(1, data & 2);
- machine().bookkeeping().coin_lockout_w(0, ~data & 4);
- machine().bookkeeping().coin_lockout_w(1, ~data & 8);
+ machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
+ machine().bookkeeping().coin_counter_w(1, BIT(data, 1));
+ machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2));
+ machine().bookkeeping().coin_lockout_w(1, BIT(~data, 3));
}
// Memory Maps
-void airbustr_state::master_map(address_map &map)
+void airbustr_state::main_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xbfff).bankr(m_masterbank);
+ map(0x8000, 0xbfff).bankr(m_mainbank);
map(0xc000, 0xcfff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_r), FUNC(kaneko_pandora_device::spriteram_w));
map(0xd000, 0xdfff).ram();
map(0xe000, 0xefff).ram().share(m_devram); // shared with protection device (see below)
- map(0xf000, 0xffff).ram().share("master_slave");
+ map(0xf000, 0xffff).ram().share("main_sub");
}
-void airbustr_state::master_prot_map(address_map &map)
+void airbustr_state::main_prot_map(address_map &map)
{
- master_map(map);
+ main_map(map);
map(0xefe0, 0xeff5).rw(FUNC(airbustr_state::calc1_r), FUNC(airbustr_state::calc1_w));
}
-void airbustr_state::master_io_map(address_map &map)
+void airbustr_state::main_io_map(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).w(FUNC(airbustr_state::master_bankswitch_w));
+ map(0x00, 0x00).w(FUNC(airbustr_state::main_bankswitch_w));
map(0x01, 0x01).nopw(); // ???
- map(0x02, 0x02).w(FUNC(airbustr_state::master_nmi_trigger_w));
+ map(0x02, 0x02).w(FUNC(airbustr_state::main_nmi_trigger_w));
}
-void airbustr_state::slave_map(address_map &map)
+void airbustr_state::sub_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xbfff).bankr(m_slavebank);
+ map(0x8000, 0xbfff).bankr(m_subbank);
map(0xc000, 0xc3ff).ram().w(FUNC(airbustr_state::videoram_w<1>)).share(m_videoram[1]);
map(0xc400, 0xc7ff).ram().w(FUNC(airbustr_state::colorram_w<1>)).share(m_colorram[1]);
map(0xc800, 0xcbff).ram().w(FUNC(airbustr_state::videoram_w<0>)).share(m_videoram[0]);
@@ -546,13 +546,13 @@ void airbustr_state::slave_map(address_map &map)
map(0xd000, 0xd5ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
map(0xd600, 0xdfff).ram();
map(0xe000, 0xefff).ram();
- map(0xf000, 0xffff).ram().share("master_slave");
+ map(0xf000, 0xffff).ram().share("main_sub");
}
-void airbustr_state::slave_io_map(address_map &map)
+void airbustr_state::sub_io_map(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).w(FUNC(airbustr_state::slave_bankswitch_w));
+ map(0x00, 0x00).w(FUNC(airbustr_state::sub_bankswitch_w));
map(0x02, 0x02).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
map(0x04, 0x0c).w(FUNC(airbustr_state::scrollregs_w));
map(0x0e, 0x0e).r(FUNC(airbustr_state::soundcommand_status_r));
@@ -696,18 +696,18 @@ GFXDECODE_END
// Main Z80 uses IM2
TIMER_DEVICE_CALLBACK_MEMBER(airbustr_state::scanline)
{
- int scanline = param;
+ int const scanline = param;
if (scanline == 240) // vblank-out irq
- m_master->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
// Pandora "sprite end dma" irq? TODO: timing is likely off
if (scanline == 64)
- m_master->set_input_line_and_vector(0, HOLD_LINE, 0xfd); // Z80
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xfd); // Z80
}
// Sub Z80 uses IM2 too, but 0xff irq routine just contains an irq ack in it
-INTERRUPT_GEN_MEMBER(airbustr_state::slave_interrupt)
+INTERRUPT_GEN_MEMBER(airbustr_state::sub_interrupt)
{
device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd); // Z80
}
@@ -717,8 +717,8 @@ INTERRUPT_GEN_MEMBER(airbustr_state::slave_interrupt)
void airbustr_state::machine_start()
{
- m_masterbank->configure_entries(0, 8, memregion("master")->base(), 0x4000);
- m_slavebank->configure_entries(0, 8, memregion("slave")->base(), 0x4000);
+ m_mainbank->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000);
+ m_subbank->configure_entries(0, 8, memregion("subcpu")->base(), 0x4000);
m_audiobank->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000);
save_item(NAME(m_scrollx));
@@ -741,15 +741,15 @@ void airbustr_state::machine_reset()
void airbustr_state::airbustrb(machine_config &config)
{
// basic machine hardware
- Z80(config, m_master, XTAL(12'000'000) / 2); // verified on PCB
- m_master->set_addrmap(AS_PROGRAM, &airbustr_state::master_map);
- m_master->set_addrmap(AS_IO, &airbustr_state::master_io_map);
+ Z80(config, m_maincpu, XTAL(12'000'000) / 2); // verified on PCB
+ m_maincpu->set_addrmap(AS_PROGRAM, &airbustr_state::main_map);
+ m_maincpu->set_addrmap(AS_IO, &airbustr_state::main_io_map);
TIMER(config, "scantimer").configure_scanline(FUNC(airbustr_state::scanline), "screen", 0, 1);
- Z80(config, m_slave, XTAL(12'000'000) / 2); // verified on PCB
- m_slave->set_addrmap(AS_PROGRAM, &airbustr_state::slave_map);
- m_slave->set_addrmap(AS_IO, &airbustr_state::slave_io_map);
- m_slave->set_vblank_int("screen", FUNC(airbustr_state::slave_interrupt)); // nmi signal from master CPU
+ Z80(config, m_subcpu, XTAL(12'000'000) / 2); // verified on PCB
+ m_subcpu->set_addrmap(AS_PROGRAM, &airbustr_state::sub_map);
+ m_subcpu->set_addrmap(AS_IO, &airbustr_state::sub_io_map);
+ m_subcpu->set_vblank_int("screen", FUNC(airbustr_state::sub_interrupt)); // nmi signal from main CPU
Z80(config, m_audiocpu, XTAL(12'000'000) / 2); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &airbustr_state::sound_map);
@@ -797,7 +797,7 @@ void airbustr_state::airbustr(machine_config &config)
{
airbustrb(config);
- m_master->set_addrmap(AS_PROGRAM, &airbustr_state::master_prot_map);
+ m_maincpu->set_addrmap(AS_PROGRAM, &airbustr_state::main_prot_map);
KANEKO_HIT(config, m_calc1).set_type(0);
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); // a guess, and certainly wrong
@@ -807,10 +807,10 @@ void airbustr_state::airbustr(machine_config &config)
// ROMs
ROM_START( airbustr )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "pr12.h19", 0x00000, 0x20000, CRC(91362eb2) SHA1(cd85acfa6542af68dd1cad46f9426a95cfc9432e) )
- ROM_REGION( 0x20000, "slave", 0 )
+ ROM_REGION( 0x20000, "subcpu", 0 )
ROM_LOAD( "pr13.l15", 0x00000, 0x20000, CRC(13b2257b) SHA1(325efa54e757a1f08caf81801930d61ea4e7b6d4) )
ROM_REGION( 0x20000, "audiocpu", 0 )
@@ -819,7 +819,7 @@ ROM_START( airbustr )
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "pr-000.bin", 0x00000, 0x80000, CRC(8ca68f0d) SHA1(d60389e7e63e9850bcddecb486558de1414f1276) )
- ROM_REGION( 0x100000, "sprites", 0 )
+ ROM_REGION( 0x100000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD( "pr-001.bin", 0x00000, 0x80000, CRC(7e6cb377) SHA1(005290f9f53a0c3a6a9d04486b16b7fd52cc94b6) )
ROM_LOAD( "pr-02.bin", 0x80000, 0x10000, CRC(6bbd5e46) SHA1(26563737f3f91ee0a056d35ce42217bb57d8a081) )
@@ -829,14 +829,13 @@ ROM_START( airbustr )
ROM_REGION( 0x400, "plds", ROMREGION_ERASE00 )
ROM_LOAD( "pal16l8-pr-500.16f", 0x000, 0x104, CRC(e0f901e1) SHA1(f436f5357408ad7056c950018c0e94681b34fd11) )
ROM_LOAD( "gal16v8a-pr-501.13j", 0x200, 0x117, CRC(d8bf8cb5) SHA1(2ccd4b35f97a4fdaf13f3eccb741a0ff54fc7115) )
-
ROM_END
ROM_START( airbustrj )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "pr-14j.bin", 0x00000, 0x20000, CRC(6b9805bd) SHA1(db6df33cf17316a4b81d7731dca9fe8bbf81f014) )
- ROM_REGION( 0x20000, "slave", 0 )
+ ROM_REGION( 0x20000, "subcpu", 0 )
ROM_LOAD( "pr-11j.bin", 0x00000, 0x20000, CRC(85464124) SHA1(8cce8dfdede48032c40d5f155fd58061866668de) )
ROM_REGION( 0x20000, "audiocpu", 0 )
@@ -845,7 +844,7 @@ ROM_START( airbustrj )
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "pr-000.bin", 0x00000, 0x80000, CRC(8ca68f0d) SHA1(d60389e7e63e9850bcddecb486558de1414f1276) )
- ROM_REGION( 0x100000, "sprites", 0 )
+ ROM_REGION( 0x100000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD( "pr-001.bin", 0x000000, 0x80000, CRC(7e6cb377) SHA1(005290f9f53a0c3a6a9d04486b16b7fd52cc94b6) )
ROM_LOAD( "pr-02.bin", 0x080000, 0x10000, CRC(6bbd5e46) SHA1(26563737f3f91ee0a056d35ce42217bb57d8a081) )
@@ -871,24 +870,24 @@ ROM 5 is on a piggyback daughterboard with a z80 and a PAL
*/
ROM_START( airbustrb )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "5.bin", 0x00000, 0x20000, CRC(9e4216a2) SHA1(46572da4df5a67b10cc3ee21bdc0ec4bcecaaf93) )
- ROM_REGION( 0x20000, "slave", 0 )
+ ROM_REGION( 0x20000, "subcpu", 0 )
ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(85464124) SHA1(8cce8dfdede48032c40d5f155fd58061866668de) )
ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "2.bin", 0x00000, 0x20000, CRC(6e0a5df0) SHA1(616b7c7aaf52a9a55b63c60717c1866940635cd4) )
ROM_REGION( 0x80000, "tiles", 0 )
- // Same content as airbusj, pr-001.bin, different sized ROMs / interleave
+ // Same content as airbustrj, pr-001.bin, different sized ROMs / interleave
ROM_LOAD16_BYTE( "7.bin", 0x00000, 0x20000, CRC(2e3bf0a2) SHA1(84cabc753e5fd1164f0a8a9a9dee7d339a5607c5) )
ROM_LOAD16_BYTE( "9.bin", 0x00001, 0x20000, CRC(2c23c646) SHA1(41c0f8788c9715918b4138f076415f8640adc483) )
ROM_LOAD16_BYTE( "6.bin", 0x40000, 0x20000, CRC(0d6cd470) SHA1(329286bc6c9d1eccc74735d1c155a0f5f98f1444) )
ROM_LOAD16_BYTE( "8.bin", 0x40001, 0x20000, CRC(b3372e51) SHA1(aa8dcbb84c829994ae04ceecbef795ac53e72493) )
- ROM_REGION( 0x100000, "sprites", 0 )
- // Same content as airbusj, pr-001.bin, different sized ROMs
+ ROM_REGION( 0x100000, "sprites", ROMREGION_ERASE00 )
+ // Same content as airbustrj, pr-001.bin, different sized ROMs
ROM_LOAD( "13.bin", 0x00000, 0x20000, CRC(75dee86d) SHA1(fe342fed5bb84ee6f35d3f91987141c559e94d5a) )
ROM_LOAD( "12.bin", 0x20000, 0x20000, CRC(c98a8333) SHA1(3a990460e232ee07a9297fcffdb02451406f5bf1) )
ROM_LOAD( "11.bin", 0x40000, 0x20000, CRC(4e9baebd) SHA1(6cf878a3fb3d344e3f5f4d031fbde6f14b653636) )
@@ -897,7 +896,7 @@ ROM_START( airbustrb )
ROM_LOAD( "14.bin", 0x80000, 0x10000, CRC(6bbd5e46) SHA1(26563737f3f91ee0a056d35ce42217bb57d8a081) )
ROM_REGION( 0x40000, "oki", 0 )
- // Same content as airbusj, pr-200.bin, different sized ROMs
+ // Same content as airbustrj, pr-200.bin, different sized ROMs
ROM_LOAD( "4.bin", 0x00000, 0x20000, CRC(21d9bfe3) SHA1(4a69458cd2a6309e389c9e7593ae29d3ef0f8daf) )
ROM_LOAD( "3.bin", 0x20000, 0x20000, CRC(58cd19e2) SHA1(479f22241bf29f7af67d9679fc6c20f10004fdd8) )
ROM_END
diff --git a/src/mame/kaneko/djboy.cpp b/src/mame/kaneko/djboy.cpp
index 9cb4a52eebb..d149c4f18cd 100644
--- a/src/mame/kaneko/djboy.cpp
+++ b/src/mame/kaneko/djboy.cpp
@@ -163,19 +163,19 @@ class djboy_state : public driver_device
public:
djboy_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
- , m_mastercpu(*this, "mastercpu")
- , m_slavecpu(*this, "slavecpu")
+ , m_maincpu(*this, "maincpu")
+ , m_subcpu(*this, "subcpu")
, m_soundcpu(*this, "soundcpu")
, m_beast(*this, "beast")
, m_pandora(*this, "pandora")
, m_gfxdecode(*this, "gfxdecode")
, m_palette(*this, "palette")
, m_soundlatch(*this, "soundlatch")
- , m_slavelatch(*this, "slavelatch")
+ , m_sublatch(*this, "sublatch")
, m_beastlatch(*this, "beastlatch")
, m_videoram(*this, "videoram")
- , m_masterbank(*this, "master_bank%u", 0U)
- , m_slavebank(*this, "slave_bank")
+ , m_mainbank(*this, "main_bank%u", 0U)
+ , m_subbank(*this, "sub_bank")
, m_soundbank(*this, "sound_bank")
, m_port_in(*this, "IN%u", 0)
, m_port_dsw(*this, "DSW%u", 1)
@@ -195,93 +195,96 @@ protected:
private:
//static constexpr unsigned PROT_OUTPUT_BUFFER_SIZE = 8;
- uint8_t beast_status_r();
- void trigger_nmi_on_mastercpu(uint8_t data);
- void mastercpu_bankswitch_w(uint8_t data);
- void slavecpu_bankswitch_w(uint8_t data);
- void coin_count_w(uint8_t data);
- void soundcpu_bankswitch_w(uint8_t data);
- uint8_t beast_p0_r();
- void beast_p0_w(uint8_t data);
- uint8_t beast_p1_r();
- void beast_p1_w(uint8_t data);
- uint8_t beast_p2_r();
- void beast_p2_w(uint8_t data);
- uint8_t beast_p3_r();
- void beast_p3_w(uint8_t data);
- void scrollx_w(uint8_t data);
- void scrolly_w(uint8_t data);
- void videoram_w(offs_t offset, uint8_t data);
+ u8 beast_status_r();
+ void trigger_nmi_on_maincpu(u8 data);
+ void maincpu_bankswitch_w(u8 data);
+ void subcpu_bankswitch_w(u8 data);
+ void coin_count_w(u8 data);
+ void soundcpu_bankswitch_w(u8 data);
+ u8 beast_p0_r();
+ void beast_p0_w(u8 data);
+ u8 beast_p1_r();
+ void beast_p1_w(u8 data);
+ u8 beast_p2_r();
+ void beast_p2_w(u8 data);
+ u8 beast_p3_r();
+ void beast_p3_w(u8 data);
+ void scrollx_w(u8 data);
+ void scrolly_w(u8 data);
+ void videoram_w(offs_t offset, u8 data);
+
TILE_GET_INFO_MEMBER(get_bg_tile_info);
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_vblank(int state);
+
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
- void mastercpu_am(address_map &map) ATTR_COLD;
- void mastercpu_port_am(address_map &map) ATTR_COLD;
- void slavecpu_am(address_map &map) ATTR_COLD;
- void slavecpu_port_am(address_map &map) ATTR_COLD;
+
+ void maincpu_am(address_map &map) ATTR_COLD;
+ void maincpu_port_am(address_map &map) ATTR_COLD;
+ void subcpu_am(address_map &map) ATTR_COLD;
+ void subcpu_port_am(address_map &map) ATTR_COLD;
void soundcpu_am(address_map &map) ATTR_COLD;
void soundcpu_port_am(address_map &map) ATTR_COLD;
// devices
- required_device<cpu_device> m_mastercpu;
- required_device<cpu_device> m_slavecpu;
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
required_device<cpu_device> m_soundcpu;
required_device<i80c51_device> m_beast;
required_device<kaneko_pandora_device> m_pandora;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
- required_device<generic_latch_8_device> m_slavelatch;
+ required_device<generic_latch_8_device> m_sublatch;
required_device<generic_latch_8_device> m_beastlatch;
// memory pointers
- required_shared_ptr<uint8_t> m_videoram;
+ required_shared_ptr<u8> m_videoram;
// ROM banking
- required_memory_bank_array<2> m_masterbank;
- required_memory_bank m_slavebank;
+ required_memory_bank_array<2> m_mainbank;
+ required_memory_bank m_subbank;
required_memory_bank m_soundbank;
required_ioport_array<3> m_port_in;
required_ioport_array<2> m_port_dsw;
- uint8_t m_bankxor;
+ u8 m_bankxor = 0;
// video-related
tilemap_t *m_background = nullptr;
- uint8_t m_videoreg = 0;
- uint8_t m_scrollx = 0;
- uint8_t m_scrolly = 0;
+ u8 m_videoreg = 0;
+ u8 m_scrollx = 0;
+ u8 m_scrolly = 0;
// Kaneko BEAST state
- uint8_t m_beast_p[4]{};
+ u8 m_beast_p[4]{};
};
-void djboy_state::scrollx_w(uint8_t data)
+void djboy_state::scrollx_w(u8 data)
{
m_scrollx = data;
}
-void djboy_state::scrolly_w(uint8_t data)
+void djboy_state::scrolly_w(u8 data)
{
m_scrolly = data;
}
TILE_GET_INFO_MEMBER(djboy_state::get_bg_tile_info)
{
- uint8_t const attr = m_videoram[tile_index + 0x800];
- int code = m_videoram[tile_index] + (attr & 0xf) * 256;
- int const color = attr >> 4;
+ u8 const attr = m_videoram[tile_index + 0x800];
+ u32 code = m_videoram[tile_index] + ((attr & 0xf) << 8);
+ u32 const color = attr >> 4;
- if (color & 8)
+ if (BIT(color, 3))
code |= 0x1000;
tileinfo.set(0, code, color, 0); // no flip
}
-void djboy_state::videoram_w(offs_t offset, uint8_t data)
+void djboy_state::videoram_w(offs_t offset, u8 data)
{
m_videoram[offset] = data;
m_background->mark_tile_dirty(offset & 0x7ff);
@@ -292,15 +295,8 @@ void djboy_state::video_start()
m_background = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(djboy_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
}
-uint32_t djboy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 djboy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- /**
- * xx------ msb x
- * --x----- msb y
- * ---x---- flipscreen?
- * ----xxxx ROM bank
- */
-
int const scrollx = m_scrollx | ((m_videoreg & 0xc0) << 2);
m_background->set_scrollx(0, scrollx - 0x391);
@@ -325,23 +321,23 @@ void djboy_state::screen_vblank(int state)
// KANEKO BEAST state
-uint8_t djboy_state::beast_status_r()
+u8 djboy_state::beast_status_r()
{
- return (m_slavelatch->pending_r() ? 0x0 : 0x4) | (m_beastlatch->pending_r() ? 0x8 : 0x0);
+ return (m_sublatch->pending_r() ? 0x0 : 0x4) | (m_beastlatch->pending_r() ? 0x8 : 0x0);
}
/******************************************************************************/
-void djboy_state::trigger_nmi_on_mastercpu(uint8_t data)
+void djboy_state::trigger_nmi_on_maincpu(u8 data)
{
- m_mastercpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
+ m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
-void djboy_state::mastercpu_bankswitch_w(uint8_t data)
+void djboy_state::maincpu_bankswitch_w(u8 data)
{
data ^= m_bankxor;
- m_masterbank[0]->set_entry(data);
- m_masterbank[1]->set_entry(0); // unsure if / how this area is banked
+ m_mainbank[0]->set_entry(data);
+ m_mainbank[1]->set_entry(0); // unsure if / how this area is banked
}
/******************************************************************************/
@@ -352,65 +348,65 @@ void djboy_state::mastercpu_bankswitch_w(uint8_t data)
* ---x---- screen flip
* ----xxxx bank
*/
-void djboy_state::slavecpu_bankswitch_w(uint8_t data)
+void djboy_state::subcpu_bankswitch_w(u8 data)
{
m_videoreg = data;
if ((data & 0xc) != 4)
- m_slavebank->set_entry((data & 0xf));
+ m_subbank->set_entry((data & 0xf));
}
-void djboy_state::coin_count_w(uint8_t data)
+void djboy_state::coin_count_w(u8 data)
{
- machine().bookkeeping().coin_counter_w(0, data & 1);
- machine().bookkeeping().coin_counter_w(1, data & 2);
+ machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
+ machine().bookkeeping().coin_counter_w(1, BIT(data, 1));
}
/******************************************************************************/
-void djboy_state::soundcpu_bankswitch_w(uint8_t data)
+void djboy_state::soundcpu_bankswitch_w(u8 data)
{
m_soundbank->set_entry(data); // shall we check data<0x07?
}
/******************************************************************************/
-void djboy_state::mastercpu_am(address_map &map)
+void djboy_state::maincpu_am(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xafff).bankr(m_masterbank[1]);
+ map(0x8000, 0xafff).bankr(m_mainbank[1]);
map(0xb000, 0xbfff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_r), FUNC(kaneko_pandora_device::spriteram_w));
- map(0xc000, 0xdfff).bankr(m_masterbank[0]);
- map(0xe000, 0xffff).ram().share("master_slave");
+ map(0xc000, 0xdfff).bankr(m_mainbank[0]);
+ map(0xe000, 0xffff).ram().share("main_sub");
}
-void djboy_state::mastercpu_port_am(address_map &map)
+void djboy_state::maincpu_port_am(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).w(FUNC(djboy_state::mastercpu_bankswitch_w));
+ map(0x00, 0x00).w(FUNC(djboy_state::maincpu_bankswitch_w));
}
/******************************************************************************/
-void djboy_state::slavecpu_am(address_map &map)
+void djboy_state::subcpu_am(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xbfff).bankr(m_slavebank);
+ map(0x8000, 0xbfff).bankr(m_subbank);
map(0xc000, 0xcfff).ram().w(FUNC(djboy_state::videoram_w)).share(m_videoram);
map(0xd000, 0xd3ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
map(0xd400, 0xd8ff).ram();
- map(0xe000, 0xffff).ram().share("master_slave");
+ map(0xe000, 0xffff).ram().share("main_sub");
}
-void djboy_state::slavecpu_port_am(address_map &map)
+void djboy_state::subcpu_port_am(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).w(FUNC(djboy_state::slavecpu_bankswitch_w));
+ map(0x00, 0x00).w(FUNC(djboy_state::subcpu_bankswitch_w));
map(0x02, 0x02).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x04, 0x04).r(m_slavelatch, FUNC(generic_latch_8_device::read)).w(m_beastlatch, FUNC(generic_latch_8_device::write));
+ map(0x04, 0x04).r(m_sublatch, FUNC(generic_latch_8_device::read)).w(m_beastlatch, FUNC(generic_latch_8_device::write));
map(0x06, 0x06).w(FUNC(djboy_state::scrolly_w));
map(0x08, 0x08).w(FUNC(djboy_state::scrollx_w));
- map(0x0a, 0x0a).w(FUNC(djboy_state::trigger_nmi_on_mastercpu));
+ map(0x0a, 0x0a).w(FUNC(djboy_state::trigger_nmi_on_maincpu));
map(0x0c, 0x0c).r(FUNC(djboy_state::beast_status_r));
map(0x0e, 0x0e).w(FUNC(djboy_state::coin_count_w));
}
@@ -436,17 +432,17 @@ void djboy_state::soundcpu_port_am(address_map &map)
/******************************************************************************/
-uint8_t djboy_state::beast_p0_r()
+u8 djboy_state::beast_p0_r()
{
// ?
return 0;
}
-void djboy_state::beast_p0_w(uint8_t data)
+void djboy_state::beast_p0_w(u8 data)
{
if (!BIT(m_beast_p[0], 1) && BIT(data, 1))
{
- m_slavelatch->write(m_beast_p[1]);
+ m_sublatch->write(m_beast_p[1]);
}
if (BIT(~data, 0))
@@ -455,7 +451,7 @@ void djboy_state::beast_p0_w(uint8_t data)
m_beast_p[0] = data;
}
-uint8_t djboy_state::beast_p1_r()
+u8 djboy_state::beast_p1_r()
{
if (BIT(~m_beast_p[0], 0))
return m_beastlatch->read();
@@ -463,12 +459,12 @@ uint8_t djboy_state::beast_p1_r()
return 0; // ?
}
-void djboy_state::beast_p1_w(uint8_t data)
+void djboy_state::beast_p1_w(u8 data)
{
m_beast_p[1] = data;
}
-uint8_t djboy_state::beast_p2_r()
+u8 djboy_state::beast_p2_r()
{
switch ((m_beast_p[0] >> 2) & 3)
{
@@ -479,16 +475,16 @@ uint8_t djboy_state::beast_p2_r()
}
}
-void djboy_state::beast_p2_w(uint8_t data)
+void djboy_state::beast_p2_w(u8 data)
{
m_beast_p[2] = data;
}
-uint8_t djboy_state::beast_p3_r()
+u8 djboy_state::beast_p3_r()
{
- uint8_t dsw = 0;
- uint8_t const dsw1 = ~m_port_dsw[0]->read();
- uint8_t const dsw2 = ~m_port_dsw[1]->read();
+ u8 dsw = 0;
+ u8 const dsw1 = ~m_port_dsw[0]->read();
+ u8 const dsw2 = ~m_port_dsw[1]->read();
switch ((m_beast_p[0] >> 5) & 3)
{
@@ -497,13 +493,13 @@ uint8_t djboy_state::beast_p3_r()
case 2: dsw = (BIT(dsw2, 6) << 3) | (BIT(dsw2, 2) << 2) | (BIT(dsw1, 6) << 1) | BIT(dsw1, 2); break;
case 3: dsw = (BIT(dsw2, 7) << 3) | (BIT(dsw2, 3) << 2) | (BIT(dsw1, 7) << 1) | BIT(dsw1, 3); break;
}
- return (dsw << 4) | (m_beastlatch->pending_r() ? 0x0 : 0x4) | (m_slavelatch->pending_r() ? 0x8 : 0x0);
+ return (dsw << 4) | (m_beastlatch->pending_r() ? 0x0 : 0x4) | (m_sublatch->pending_r() ? 0x8 : 0x0);
}
-void djboy_state::beast_p3_w(uint8_t data)
+void djboy_state::beast_p3_w(u8 data)
{
m_beast_p[3] = data;
- m_slavecpu->set_input_line(INPUT_LINE_RESET, BIT(data, 1) ? CLEAR_LINE : ASSERT_LINE);
+ m_subcpu->set_input_line(INPUT_LINE_RESET, BIT(data, 1) ? CLEAR_LINE : ASSERT_LINE);
}
// Program / data maps are defined in the 8051 core
@@ -603,27 +599,27 @@ GFXDECODE_END
// Main Z80 uses IM2
TIMER_DEVICE_CALLBACK_MEMBER(djboy_state::scanline)
{
- int scanline = param;
+ int const scanline = param;
if (scanline == 240) // vblank-out irq
- m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xfd); // Z80
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xfd); // Z80
// Pandora "sprite end dma" irq? TODO: timing is clearly off, attract mode relies on this
if (scanline == 64)
- m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
}
void djboy_state::machine_start()
{
- uint8_t *master = memregion("mastercpu")->base();
- uint8_t *slave = memregion("slavecpu")->base();
- uint8_t *sound = memregion("soundcpu")->base();
+ u8 *main = memregion("maincpu")->base();
+ u8 *sub = memregion("subcpu")->base();
+ u8 *sound = memregion("soundcpu")->base();
- m_masterbank[0]->configure_entries(0, 32, &master[0x00000], 0x2000);
- m_slavebank->configure_entries(0, 4, &slave[0x00000], 0x4000);
- m_slavebank->configure_entries(8, 8, &slave[0x10000], 0x4000);
+ m_mainbank[0]->configure_entries(0, 32, &main[0x00000], 0x2000);
+ m_subbank->configure_entries(0, 4, &sub[0x00000], 0x4000); // TODO: Mirrored?
+ m_subbank->configure_entries(8, 8, &sub[0x10000], 0x4000);
m_soundbank->configure_entries(0, 8, &sound[0x00000], 0x4000);
- m_masterbank[1]->configure_entry(0, &master[0x08000]); // unsure if / how this area is banked
+ m_mainbank[1]->configure_entry(0, &main[0x08000]); // unsure if / how this area is banked
save_item(NAME(m_videoreg));
save_item(NAME(m_scrollx));
@@ -642,15 +638,15 @@ void djboy_state::machine_reset()
void djboy_state::djboy(machine_config &config)
{
- Z80(config, m_mastercpu, 12_MHz_XTAL / 2); // 6.000MHz, verified
- m_mastercpu->set_addrmap(AS_PROGRAM, &djboy_state::mastercpu_am);
- m_mastercpu->set_addrmap(AS_IO, &djboy_state::mastercpu_port_am);
+ Z80(config, m_maincpu, 12_MHz_XTAL / 2); // 6.000MHz, verified
+ m_maincpu->set_addrmap(AS_PROGRAM, &djboy_state::maincpu_am);
+ m_maincpu->set_addrmap(AS_IO, &djboy_state::maincpu_port_am);
TIMER(config, "scantimer").configure_scanline(FUNC(djboy_state::scanline), "screen", 0, 1);
- Z80(config, m_slavecpu, 12_MHz_XTAL / 2); // 6.000MHz, verified
- m_slavecpu->set_addrmap(AS_PROGRAM, &djboy_state::slavecpu_am);
- m_slavecpu->set_addrmap(AS_IO, &djboy_state::slavecpu_port_am);
- m_slavecpu->set_vblank_int("screen", FUNC(djboy_state::irq0_line_hold));
+ Z80(config, m_subcpu, 12_MHz_XTAL / 2); // 6.000MHz, verified
+ m_subcpu->set_addrmap(AS_PROGRAM, &djboy_state::subcpu_am);
+ m_subcpu->set_addrmap(AS_IO, &djboy_state::subcpu_port_am);
+ m_subcpu->set_vblank_int("screen", FUNC(djboy_state::irq0_line_hold));
Z80(config, m_soundcpu, 12_MHz_XTAL / 2); // 6.000MHz, verified
m_soundcpu->set_addrmap(AS_PROGRAM, &djboy_state::soundcpu_am);
@@ -668,7 +664,7 @@ void djboy_state::djboy(machine_config &config)
config.set_maximum_quantum(attotime::from_hz(6000));
- GENERIC_LATCH_8(config, m_slavelatch);
+ GENERIC_LATCH_8(config, m_sublatch);
GENERIC_LATCH_8(config, m_beastlatch);
m_beastlatch->data_pending_callback().set_inputline(m_beast, INPUT_LINE_IRQ0);
@@ -710,11 +706,11 @@ void djboy_state::djboy(machine_config &config)
ROM_START( djboy )
- ROM_REGION( 0x40000, "mastercpu", 0 )
+ ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD( "djboy.4b", 0x00000, 0x20000, CRC(354531ec) SHA1(4722376601ca2d8fb79622fef35ab5b5b084555d) ) // verified on 2 PCBs, neither PCB had a label on the ROM
ROM_LOAD( "bs100.4d", 0x20000, 0x20000, CRC(081e8af8) SHA1(3589dab1cf31b109a40370b4db1f31785023e2ed) )
- ROM_REGION( 0x30000, "slavecpu", 0 )
+ ROM_REGION( 0x30000, "subcpu", 0 )
ROM_LOAD( "djboy.5y", 0x00000, 0x10000, CRC(91eb189a) SHA1(a6a2662369cd6c851ae45a49654f6150fa8cf42e) ) // mask ROM without label
ROM_LOAD( "bs101.6w", 0x10000, 0x20000, CRC(a7c85577) SHA1(8296b96d5f69f6c730b7ed77fa8c93496b33529c) )
@@ -740,11 +736,11 @@ ROM_START( djboy )
ROM_END
ROM_START( djboyu )
- ROM_REGION( 0x40000, "mastercpu", 0 )
+ ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD( "bs64.4b", 0x00000, 0x20000, CRC(b77aacc7) SHA1(78100d4695738a702f13807526eb1bcac759cce3) )
ROM_LOAD( "bs100.4d", 0x20000, 0x20000, CRC(081e8af8) SHA1(3589dab1cf31b109a40370b4db1f31785023e2ed) )
- ROM_REGION( 0x30000, "slavecpu", 0 )
+ ROM_REGION( 0x30000, "subcpu", 0 )
ROM_LOAD( "bs65.5y", 0x00000, 0x10000, CRC(0f1456eb) SHA1(62ed48c0d71c1fabbb3f6ada60381f57f692cef8) )
ROM_LOAD( "bs101.6w", 0x10000, 0x20000, CRC(a7c85577) SHA1(8296b96d5f69f6c730b7ed77fa8c93496b33529c) )
@@ -770,11 +766,11 @@ ROM_START( djboyu )
ROM_END
ROM_START( djboyua )
- ROM_REGION( 0x40000, "mastercpu", 0 )
+ ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD( "bs19s.4b", 0x00000, 0x20000, CRC(17ce9f6c) SHA1(a0c1832b05dc46991e8949067ca0278f5498835f) ) // found labeled as both BS19 and BS19S, same data - verified
ROM_LOAD( "bs100.4d", 0x20000, 0x20000, CRC(081e8af8) SHA1(3589dab1cf31b109a40370b4db1f31785023e2ed) )
- ROM_REGION( 0x30000, "slavecpu", 0 )
+ ROM_REGION( 0x30000, "subcpu", 0 )
ROM_LOAD( "bs15s.5y", 0x00000, 0x10000, CRC(e6f966b2) SHA1(f9df16035a8b09d87eb70315b216892e25d99b03) ) // found labeled as both BS15 and BS15S, same data - verified
ROM_LOAD( "bs101.6w", 0x10000, 0x20000, CRC(a7c85577) SHA1(8296b96d5f69f6c730b7ed77fa8c93496b33529c) )
@@ -800,11 +796,11 @@ ROM_START( djboyua )
ROM_END
ROM_START( djboyj )
- ROM_REGION( 0x40000, "mastercpu", 0 )
+ ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD( "bs12.4b", 0x00000, 0x20000, CRC(0971523e) SHA1(f90cd02cedf8632f4b651de7ea75dc8c0e682f6e) )
ROM_LOAD( "bs100.4d", 0x20000, 0x20000, CRC(081e8af8) SHA1(3589dab1cf31b109a40370b4db1f31785023e2ed) )
- ROM_REGION( 0x30000, "slavecpu", 0 )
+ ROM_REGION( 0x30000, "subcpu", 0 )
ROM_LOAD( "bs13.5y", 0x00000, 0x10000, CRC(5c3f2f96) SHA1(bb7ee028a2d8d3c76a78a29fba60bcc36e9399f5) )
ROM_LOAD( "bs101.6w", 0x10000, 0x20000, CRC(a7c85577) SHA1(8296b96d5f69f6c730b7ed77fa8c93496b33529c) )
@@ -830,11 +826,11 @@ ROM_START( djboyj )
ROM_END
ROM_START( djboyja )
- ROM_REGION( 0x40000, "mastercpu", 0 )
+ ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD( "djboyja.4b", 0x00000, 0x20000, CRC(f7ac20ca) SHA1(1bf66bfaa6d98f4cff50bc4d15cebfb7f4b09ae5) ) // mask ROM without label
ROM_LOAD( "bs100.4d", 0x20000, 0x20000, CRC(081e8af8) SHA1(3589dab1cf31b109a40370b4db1f31785023e2ed) )
- ROM_REGION( 0x30000, "slavecpu", 0 )
+ ROM_REGION( 0x30000, "subcpu", 0 )
ROM_LOAD( "bs13.5y", 0x00000, 0x10000, CRC(5c3f2f96) SHA1(bb7ee028a2d8d3c76a78a29fba60bcc36e9399f5) )
ROM_LOAD( "bs101.6w", 0x10000, 0x20000, CRC(a7c85577) SHA1(8296b96d5f69f6c730b7ed77fa8c93496b33529c) )
diff --git a/src/mame/kaneko/galpanic.cpp b/src/mame/kaneko/galpanic.cpp
index 1090fbcba68..8c7a7148a0a 100644
--- a/src/mame/kaneko/galpanic.cpp
+++ b/src/mame/kaneko/galpanic.cpp
@@ -110,19 +110,19 @@ private:
required_device<palette_device> m_palette;
required_device<kaneko_pandora_device> m_pandora;
- required_shared_ptr<uint16_t> m_bgvideoram;
- required_shared_ptr<uint16_t> m_fgvideoram;
+ required_shared_ptr<u16> m_bgvideoram;
+ required_shared_ptr<u16> m_fgvideoram;
required_memory_bank m_okibank;
bitmap_ind16 m_bitmap;
- void m6295_bankswitch_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
- void coin_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
- void bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
+ void m6295_bankswitch_w(offs_t offset, u16 data, u16 mem_mask = ~0);
+ void coin_w(offs_t offset, u16 data, u16 mem_mask = ~0);
+ void bgvideoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void palette(palette_device &palette) const;
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_vblank(int state);
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
void draw_fgbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -149,29 +149,32 @@ void galpanic_state::palette(palette_device &palette) const
palette.set_pen_color(i + 1024, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0));
}
-void galpanic_state::bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
+void galpanic_state::bgvideoram_w(offs_t offset, u16 data, u16 mem_mask)
{
data = COMBINE_DATA(&m_bgvideoram[offset]);
- int sy = offset / 256;
- int sx = offset % 256;
+ int const sy = offset >> 8;
+ int const sx = offset & 0xff;
m_bitmap.pix(sy, sx) = 1024 + (data >> 1);
}
void galpanic_state::draw_fgbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- for (int offs = 0; offs < m_fgvideoram.bytes() / 2; offs++)
+ for (int sy = cliprect.min_y; sy <= cliprect.max_y; sy++)
{
- int const sx = offs % 256;
- int const sy = offs / 256;
- int const color = m_fgvideoram[offs];
- if (color)
- bitmap.pix(sy, sx) = color;
+ u16 const *const src = &m_fgvideoram[(sy << 8) & 0xff00];
+ u16 *const dst = &bitmap.pix(sy);
+ for (int sx = cliprect.min_x; sx <= cliprect.max_x; sx++)
+ {
+ u16 const color = src[sx & 0xff];
+ if (color)
+ dst[sx] = color;
+ }
}
}
-uint32_t galpanic_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 galpanic_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// copy the temporary bitmap to the screen
copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
@@ -183,12 +186,6 @@ uint32_t galpanic_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
return 0;
}
-
-void galpanic_state::machine_start()
-{
- m_okibank->configure_entries(0, 16, memregion("oki")->base(), 0x10000);
-}
-
void galpanic_state::screen_vblank(int state)
{
// rising edge
@@ -198,48 +195,50 @@ void galpanic_state::screen_vblank(int state)
}
}
+void galpanic_state::machine_start()
+{
+ m_okibank->configure_entries(0, 16, memregion("oki")->base(), 0x10000);
+}
+
+
TIMER_DEVICE_CALLBACK_MEMBER(galpanic_state::scanline)
{
- int scanline = param;
+ int const scanline = param;
- if(scanline == 224) // vblank-out irq
+ if (scanline == 224) // vblank-out irq
m_maincpu->set_input_line(3, HOLD_LINE);
// Pandora "sprite end dma" irq?
- if(scanline == 32)
+ if (scanline == 32)
m_maincpu->set_input_line(5, HOLD_LINE);
}
-
-
-void galpanic_state::m6295_bankswitch_w(offs_t offset, uint16_t data, uint16_t mem_mask)
+void galpanic_state::m6295_bankswitch_w(offs_t offset, u16 data, u16 mem_mask)
{
if (ACCESSING_BITS_8_15)
{
m_okibank->set_entry((data >> 8) & 0x0f);
// used before title screen
- m_pandora->set_clear_bitmap((data & 0x8000) >> 15);
+ m_pandora->set_clear_bitmap(BIT(data, 15));
}
}
-
-void galpanic_state::coin_w(offs_t offset, uint16_t data, uint16_t mem_mask)
+void galpanic_state::coin_w(offs_t offset, u16 data, u16 mem_mask)
{
if (ACCESSING_BITS_8_15)
{
- machine().bookkeeping().coin_counter_w(0, data & 0x100);
- machine().bookkeeping().coin_counter_w(1, data & 0x200);
+ machine().bookkeeping().coin_counter_w(0, BIT(data, 8));
+ machine().bookkeeping().coin_counter_w(1, BIT(data, 9));
- machine().bookkeeping().coin_lockout_w(0, ~data & 0x400);
- machine().bookkeeping().coin_lockout_w(1, ~data & 0x800);
+ machine().bookkeeping().coin_lockout_w(0, BIT(~data, 10));
+ machine().bookkeeping().coin_lockout_w(1, BIT(~data, 11));
}
}
-
void galpanic_state::galpanic_map(address_map &map)
{
map(0x000000, 0x3fffff).rom();
@@ -247,7 +246,7 @@ void galpanic_state::galpanic_map(address_map &map)
map(0x500000, 0x51ffff).ram().share(m_fgvideoram);
map(0x520000, 0x53ffff).ram().w(FUNC(galpanic_state::bgvideoram_w)).share(m_bgvideoram); // + work RAM
map(0x600000, 0x6007ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // 1024 colors, but only 512 seem to be used
- map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_LSB_r), FUNC(kaneko_pandora_device::spriteram_LSB_w));
+ map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_lsb_r), FUNC(kaneko_pandora_device::spriteram_lsb_w));
map(0x702000, 0x704fff).ram();
map(0x800000, 0x800001).portr("DSW1");
map(0x800002, 0x800003).portr("DSW2");
diff --git a/src/mame/kaneko/hvyunit.cpp b/src/mame/kaneko/hvyunit.cpp
index 8b05812796e..e9e28309011 100644
--- a/src/mame/kaneko/hvyunit.cpp
+++ b/src/mame/kaneko/hvyunit.cpp
@@ -88,8 +88,8 @@ class hvyunit_state : public driver_device
public:
hvyunit_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
- , m_mastercpu(*this, "master")
- , m_slavecpu(*this, "slave")
+ , m_maincpu(*this, "maincpu")
+ , m_subcpu(*this, "subcpu")
, m_mermaid(*this, "mermaid")
, m_soundcpu(*this, "soundcpu")
, m_pandora(*this, "pandora")
@@ -97,11 +97,11 @@ public:
, m_palette(*this, "palette")
, m_soundlatch(*this, "soundlatch")
, m_mermaidlatch(*this, "mermaidlatch")
- , m_slavelatch(*this, "slavelatch")
+ , m_sublatch(*this, "sublatch")
, m_videoram(*this, "videoram")
, m_colorram(*this, "colorram")
- , m_masterbank(*this, "master_bank")
- , m_slavebank(*this, "slave_bank")
+ , m_mainbank(*this, "main_bank")
+ , m_subbank(*this, "sub_bank")
, m_soundbank(*this, "sound_bank")
, m_port_in(*this, "IN%u", 0U)
, m_port_dsw(*this, "DSW%u", 1U)
@@ -110,45 +110,45 @@ public:
void hvyunit(machine_config &config);
+protected:
+ virtual void machine_start() override ATTR_COLD;
+ virtual void video_start() override ATTR_COLD;
+
private:
- void trigger_nmi_on_slave_cpu(uint8_t data);
- void master_bankswitch_w(uint8_t data);
- uint8_t mermaid_status_r();
- void videoram_w(offs_t offset, uint8_t data);
- void colorram_w(offs_t offset, uint8_t data);
- void slave_bankswitch_w(uint8_t data);
- void scrollx_w(uint8_t data);
- void scrolly_w(uint8_t data);
- void slave_ack_w(uint8_t data);
- void sound_bankswitch_w(uint8_t data);
- void mermaid_p0_w(uint8_t data);
- uint8_t mermaid_p1_r();
- void mermaid_p1_w(uint8_t data);
- uint8_t mermaid_p2_r();
- void mermaid_p2_w(uint8_t data);
- uint8_t mermaid_p3_r();
- void mermaid_p3_w(uint8_t data);
+ void trigger_nmi_on_sub_cpu(u8 data);
+ void main_bankswitch_w(u8 data);
+ u8 mermaid_status_r();
+ void videoram_w(offs_t offset, u8 data);
+ void colorram_w(offs_t offset, u8 data);
+ void sub_bankswitch_w(u8 data);
+ void scrollx_w(u8 data);
+ void scrolly_w(u8 data);
+ void sub_ack_w(u8 data);
+ void sound_bankswitch_w(u8 data);
+ void mermaid_p0_w(u8 data);
+ u8 mermaid_p1_r();
+ void mermaid_p1_w(u8 data);
+ u8 mermaid_p2_r();
+ void mermaid_p2_w(u8 data);
+ u8 mermaid_p3_r();
+ void mermaid_p3_w(u8 data);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
- virtual void machine_start() override ATTR_COLD;
- virtual void machine_reset() override ATTR_COLD;
- virtual void video_start() override ATTR_COLD;
-
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_vblank(int state);
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
- void master_io(address_map &map) ATTR_COLD;
- void master_memory(address_map &map) ATTR_COLD;
- void slave_io(address_map &map) ATTR_COLD;
- void slave_memory(address_map &map) ATTR_COLD;
+ void main_io(address_map &map) ATTR_COLD;
+ void main_memory(address_map &map) ATTR_COLD;
+ void sub_io(address_map &map) ATTR_COLD;
+ void sub_memory(address_map &map) ATTR_COLD;
void sound_io(address_map &map) ATTR_COLD;
void sound_memory(address_map &map) ATTR_COLD;
// Devices
- required_device<cpu_device> m_mastercpu;
- required_device<cpu_device> m_slavecpu;
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
required_device<i80c51_device> m_mermaid;
required_device<cpu_device> m_soundcpu;
required_device<kaneko_pandora_device> m_pandora;
@@ -156,14 +156,14 @@ private:
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
required_device<generic_latch_8_device> m_mermaidlatch;
- required_device<generic_latch_8_device> m_slavelatch;
+ required_device<generic_latch_8_device> m_sublatch;
// Memory pointers
- required_shared_ptr<uint8_t> m_videoram;
- required_shared_ptr<uint8_t> m_colorram;
+ required_shared_ptr<u8> m_videoram;
+ required_shared_ptr<u8> m_colorram;
- required_memory_bank m_masterbank;
- required_memory_bank m_slavebank;
+ required_memory_bank m_mainbank;
+ required_memory_bank m_subbank;
required_memory_bank m_soundbank;
// Ports
@@ -171,13 +171,13 @@ private:
required_ioport_array<2> m_port_dsw;
// Video
- tilemap_t *m_bg_tilemap = nullptr;
- uint16_t m_scrollx = 0;
- uint16_t m_scrolly = 0;
- uint16_t m_port0_data = 0;
+ tilemap_t *m_bg_tilemap = nullptr;
+ u16 m_scrollx = 0;
+ u16 m_scrolly = 0;
+ u16 m_port0_data = 0;
// Mermaid
- uint8_t m_mermaid_p[4]{};
+ u8 m_mermaid_p[4]{};
};
@@ -190,18 +190,14 @@ private:
void hvyunit_state::machine_start()
{
- m_masterbank->configure_entries(0, 8, memregion("master")->base(), 0x4000);
- m_slavebank->configure_entries(0, 4, memregion("slave")->base(), 0x4000);
+ m_mainbank->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000);
+ m_subbank->configure_entries(0, 4, memregion("subcpu")->base(), 0x4000);
m_soundbank->configure_entries(0, 4, memregion("soundcpu")->base(), 0x4000);
std::fill_n(&m_mermaid_p[0], 4, 0xff);
save_item(NAME(m_mermaid_p));
}
-void hvyunit_state::machine_reset()
-{
-}
-
/*************************************
*
@@ -211,9 +207,9 @@ void hvyunit_state::machine_reset()
TILE_GET_INFO_MEMBER(hvyunit_state::get_bg_tile_info)
{
- uint32_t const attr = m_colorram[tile_index];
- uint32_t const code = m_videoram[tile_index] + ((attr & 0x0f) << 8);
- uint32_t const color = (attr >> 4);
+ u32 const attr = m_colorram[tile_index];
+ u32 const code = m_videoram[tile_index] + ((attr & 0x0f) << 8);
+ u32 const color = (attr >> 4);
tileinfo.set(0, code, color, 0);
}
@@ -227,7 +223,7 @@ void hvyunit_state::video_start()
save_item(NAME(m_port0_data));
}
-uint32_t hvyunit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 hvyunit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
constexpr int SX_POS = 96;
constexpr int SY_POS = 0;
@@ -253,63 +249,63 @@ void hvyunit_state::screen_vblank(int state)
/*************************************
*
- * Master CPU handlers
+ * Main CPU handlers
*
*************************************/
-void hvyunit_state::trigger_nmi_on_slave_cpu(uint8_t data)
+void hvyunit_state::trigger_nmi_on_sub_cpu(u8 data)
{
- m_slavecpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
+ m_subcpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
-void hvyunit_state::master_bankswitch_w(uint8_t data)
+void hvyunit_state::main_bankswitch_w(u8 data)
{
- m_masterbank->set_entry(data & 7);
+ m_mainbank->set_entry(data & 7);
}
-uint8_t hvyunit_state::mermaid_status_r()
+u8 hvyunit_state::mermaid_status_r()
{
- return (!m_slavelatch->pending_r() << 2) | (m_mermaidlatch->pending_r() << 3);
+ return (!m_sublatch->pending_r() << 2) | (m_mermaidlatch->pending_r() << 3);
}
/*************************************
*
- * Slave CPU handlers
+ * Sub CPU handlers
*
*************************************/
-void hvyunit_state::videoram_w(offs_t offset, uint8_t data)
+void hvyunit_state::videoram_w(offs_t offset, u8 data)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
}
-void hvyunit_state::colorram_w(offs_t offset, uint8_t data)
+void hvyunit_state::colorram_w(offs_t offset, u8 data)
{
m_colorram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
}
-void hvyunit_state::slave_bankswitch_w(uint8_t data)
+void hvyunit_state::sub_bankswitch_w(u8 data)
{
m_port0_data = data;
- m_slavebank->set_entry(data & 3);
+ m_subbank->set_entry(data & 3);
}
-void hvyunit_state::scrollx_w(uint8_t data)
+void hvyunit_state::scrollx_w(u8 data)
{
m_scrollx = data;
}
-void hvyunit_state::scrolly_w(uint8_t data)
+void hvyunit_state::scrolly_w(u8 data)
{
m_scrolly = data;
}
-void hvyunit_state::slave_ack_w(uint8_t data)
+void hvyunit_state::sub_ack_w(u8 data)
{
- m_slavecpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
+ m_subcpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
}
@@ -319,7 +315,7 @@ void hvyunit_state::slave_ack_w(uint8_t data)
*
*************************************/
-void hvyunit_state::sound_bankswitch_w(uint8_t data)
+void hvyunit_state::sound_bankswitch_w(u8 data)
{
m_soundbank->set_entry(data & 3);
}
@@ -331,10 +327,10 @@ void hvyunit_state::sound_bankswitch_w(uint8_t data)
*
*************************************/
-void hvyunit_state::mermaid_p0_w(uint8_t data)
+void hvyunit_state::mermaid_p0_w(u8 data)
{
if (!BIT(m_mermaid_p[0], 1) && BIT(data, 1))
- m_slavelatch->write(m_mermaid_p[1]);
+ m_sublatch->write(m_mermaid_p[1]);
if (BIT(data, 0) == 0)
m_mermaid_p[1] = m_mermaidlatch->read();
@@ -350,17 +346,17 @@ void hvyunit_state::mermaid_p0_w(uint8_t data)
m_mermaid_p[0] = data;
}
-uint8_t hvyunit_state::mermaid_p1_r()
+u8 hvyunit_state::mermaid_p1_r()
{
return m_mermaid_p[1];
}
-void hvyunit_state::mermaid_p1_w(uint8_t data)
+void hvyunit_state::mermaid_p1_w(u8 data)
{
m_mermaid_p[1] = data;
}
-uint8_t hvyunit_state::mermaid_p2_r()
+u8 hvyunit_state::mermaid_p2_r()
{
switch ((m_mermaid_p[0] >> 2) & 3)
{
@@ -371,16 +367,16 @@ uint8_t hvyunit_state::mermaid_p2_r()
}
}
-void hvyunit_state::mermaid_p2_w(uint8_t data)
+void hvyunit_state::mermaid_p2_w(u8 data)
{
m_mermaid_p[2] = data;
}
-uint8_t hvyunit_state::mermaid_p3_r()
+u8 hvyunit_state::mermaid_p3_r()
{
- uint8_t dsw = 0;
- uint8_t const dsw1 = m_port_dsw[0]->read();
- uint8_t const dsw2 = m_port_dsw[1]->read();
+ u8 dsw = 0;
+ u8 const dsw1 = m_port_dsw[0]->read();
+ u8 const dsw2 = m_port_dsw[1]->read();
switch ((m_mermaid_p[0] >> 5) & 3)
{
@@ -390,13 +386,13 @@ uint8_t hvyunit_state::mermaid_p3_r()
case 3: dsw = (BIT(dsw2, 7) << 3) | (BIT(dsw2, 3) << 2) | (BIT(dsw1, 7) << 1) | BIT(dsw1, 3); break;
}
- return (dsw << 4) | (m_slavelatch->pending_r() << 3) | (!m_mermaidlatch->pending_r() << 2);
+ return (dsw << 4) | (m_sublatch->pending_r() << 3) | (!m_mermaidlatch->pending_r() << 2);
}
-void hvyunit_state::mermaid_p3_w(uint8_t data)
+void hvyunit_state::mermaid_p3_w(u8 data)
{
m_mermaid_p[3] = data;
- m_slavecpu->set_input_line(INPUT_LINE_RESET, BIT(data, 1) ? CLEAR_LINE : ASSERT_LINE);
+ m_subcpu->set_input_line(INPUT_LINE_RESET, BIT(data, 1) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -406,28 +402,28 @@ void hvyunit_state::mermaid_p3_w(uint8_t data)
*
*************************************/
-void hvyunit_state::master_memory(address_map &map)
+void hvyunit_state::main_memory(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xbfff).bankr(m_masterbank);
+ map(0x8000, 0xbfff).bankr(m_mainbank);
map(0xc000, 0xcfff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_r), FUNC(kaneko_pandora_device::spriteram_w));
map(0xd000, 0xdfff).ram();
map(0xe000, 0xffff).ram().share("sharedram");
}
-void hvyunit_state::master_io(address_map &map)
+void hvyunit_state::main_io(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).w(FUNC(hvyunit_state::master_bankswitch_w));
- map(0x01, 0x01).w(FUNC(hvyunit_state::master_bankswitch_w)); // correct?
- map(0x02, 0x02).w(FUNC(hvyunit_state::trigger_nmi_on_slave_cpu));
+ map(0x00, 0x00).w(FUNC(hvyunit_state::main_bankswitch_w));
+ map(0x01, 0x01).w(FUNC(hvyunit_state::main_bankswitch_w)); // correct?
+ map(0x02, 0x02).w(FUNC(hvyunit_state::trigger_nmi_on_sub_cpu));
}
-void hvyunit_state::slave_memory(address_map &map)
+void hvyunit_state::sub_memory(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xbfff).bankr(m_slavebank);
+ map(0x8000, 0xbfff).bankr(m_subbank);
map(0xc000, 0xc3ff).ram().w(FUNC(hvyunit_state::videoram_w)).share(m_videoram);
map(0xc400, 0xc7ff).ram().w(FUNC(hvyunit_state::colorram_w)).share(m_colorram);
map(0xd000, 0xd1ff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext");
@@ -437,20 +433,19 @@ void hvyunit_state::slave_memory(address_map &map)
map(0xe000, 0xffff).ram().share("sharedram");
}
-void hvyunit_state::slave_io(address_map &map)
+void hvyunit_state::sub_io(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).w(FUNC(hvyunit_state::slave_bankswitch_w));
+ map(0x00, 0x00).w(FUNC(hvyunit_state::sub_bankswitch_w));
map(0x02, 0x02).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x04, 0x04).r(m_slavelatch, FUNC(generic_latch_8_device::read));
- map(0x04, 0x04).w(m_mermaidlatch, FUNC(generic_latch_8_device::write));
+ map(0x04, 0x04).r(m_sublatch, FUNC(generic_latch_8_device::read)).w(m_mermaidlatch, FUNC(generic_latch_8_device::write));
map(0x06, 0x06).w(FUNC(hvyunit_state::scrolly_w));
map(0x08, 0x08).w(FUNC(hvyunit_state::scrollx_w));
map(0x0c, 0x0c).r(FUNC(hvyunit_state::mermaid_status_r));
- map(0x0e, 0x0e).w(FUNC(hvyunit_state::slave_ack_w));
+ map(0x0e, 0x0e).w(FUNC(hvyunit_state::sub_ack_w));
-// map(0x22, 0x22).r(FUNC(hvyunit_state::hu_scrolly_hi_reset)); //22/a2 taken from ram $f065
-// map(0xa2, 0xa2).r(FUNC(hvyunit_state::hu_scrolly_hi_set));
+// map(0x22, 0x22).r(FUNC(hvyunit_state::scrolly_hi_reset)); //22/a2 taken from ram $f065
+// map(0xa2, 0xa2).r(FUNC(hvyunit_state::scrolly_hi_set));
}
@@ -604,14 +599,14 @@ GFXDECODE_END
// Main Z80 uses IM2
TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_state::scanline)
{
- int scanline = param;
+ int const scanline = param;
- if(scanline == 240) // vblank-out irq
- m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xfd); // Z80
+ if (scanline == 240) // vblank-out irq
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xfd); // Z80
// Pandora "sprite end dma" irq? TODO: timing is likely off
- if(scanline == 64)
- m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
+ if (scanline == 64)
+ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
}
/*************************************
@@ -622,15 +617,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_state::scanline)
void hvyunit_state::hvyunit(machine_config &config)
{
- Z80(config, m_mastercpu, XTAL(12'000'000)/2); // 6MHz verified on PCB
- m_mastercpu->set_addrmap(AS_PROGRAM, &hvyunit_state::master_memory);
- m_mastercpu->set_addrmap(AS_IO, &hvyunit_state::master_io);
+ Z80(config, m_maincpu, XTAL(12'000'000)/2); // 6MHz verified on PCB
+ m_maincpu->set_addrmap(AS_PROGRAM, &hvyunit_state::main_memory);
+ m_maincpu->set_addrmap(AS_IO, &hvyunit_state::main_io);
TIMER(config, "scantimer").configure_scanline(FUNC(hvyunit_state::scanline), "screen", 0, 1);
- Z80(config, m_slavecpu, XTAL(12'000'000)/2); // 6MHz verified on PCB
- m_slavecpu->set_addrmap(AS_PROGRAM, &hvyunit_state::slave_memory);
- m_slavecpu->set_addrmap(AS_IO, &hvyunit_state::slave_io);
- m_slavecpu->set_vblank_int("screen", FUNC(hvyunit_state::irq0_line_assert));
+ Z80(config, m_subcpu, XTAL(12'000'000)/2); // 6MHz verified on PCB
+ m_subcpu->set_addrmap(AS_PROGRAM, &hvyunit_state::sub_memory);
+ m_subcpu->set_addrmap(AS_IO, &hvyunit_state::sub_io);
+ m_subcpu->set_vblank_int("screen", FUNC(hvyunit_state::irq0_line_assert));
Z80(config, m_soundcpu, XTAL(12'000'000)/2); // 6MHz verified on PCB
m_soundcpu->set_addrmap(AS_PROGRAM, &hvyunit_state::sound_memory);
@@ -648,7 +643,7 @@ void hvyunit_state::hvyunit(machine_config &config)
GENERIC_LATCH_8(config, m_mermaidlatch);
m_mermaidlatch->data_pending_callback().set_inputline(m_mermaid, INPUT_LINE_IRQ0);
- GENERIC_LATCH_8(config, m_slavelatch);
+ GENERIC_LATCH_8(config, m_sublatch);
config.set_maximum_quantum(attotime::from_hz(6000));
@@ -688,19 +683,19 @@ void hvyunit_state::hvyunit(machine_config &config)
// There is likely a World version using the newer (B73_25 - B73_28) graphics ROMs with a program ROM labeled B73_29
ROM_START( hvyunit )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "b73_10.5c", 0x00000, 0x20000, CRC(ca52210f) SHA1(346951962aa5bbad641117dbd66f035dddc7c0bf) )
- ROM_REGION( 0x10000, "slave", 0 )
+ ROM_REGION( 0x10000, "subcpu", 0 )
ROM_LOAD( "b73_11.5p", 0x00000, 0x10000, CRC(cb451695) SHA1(116fd59f96a54c22fae65eea9ee5e58cb9ce5074) )
ROM_REGION( 0x10000, "soundcpu", 0 )
- ROM_LOAD( "b73_12.7e", 0x000000, 0x010000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
+ ROM_LOAD( "b73_12.7e", 0x00000, 0x10000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
ROM_REGION( 0x1000, "mermaid", 0 )
ROM_LOAD( "mermaid.bin", 0x0000, 0x0e00, CRC(88c5dd27) SHA1(5043fed7fd192891be7e4096f2c5daaae1538bc4) )
- ROM_REGION( 0x200000, "sprites", 0 )
+ ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD( "b73_08.2f", 0x000000, 0x080000, CRC(f83dd808) SHA1(09d5f1e86fad3a0d2d3ac1845103d3f2833c6793) )
ROM_LOAD( "b73_07.2c", 0x100000, 0x010000, CRC(5cffa42c) SHA1(687e047345039479b35d5099e56dbc1d57284ed9) )
ROM_LOAD( "b73_06.2b", 0x120000, 0x010000, CRC(a98e4aea) SHA1(560fef03ad818894c9c7578c6282d55b646e8129) )
@@ -717,19 +712,19 @@ ROM_START( hvyunit )
ROM_END
ROM_START( hvyunitj )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "b73_30.5c", 0x00000, 0x20000, CRC(600af545) SHA1(c52b9be2bae28848ad0818c296f000a1bda4fa4f) )
- ROM_REGION( 0x10000, "slave", 0 )
+ ROM_REGION( 0x10000, "subcpu", 0 )
ROM_LOAD( "b73_14.5p", 0x00000, 0x10000, CRC(0dfb51d4) SHA1(0e6f3b3d4558f12fe1b1620f57a0f4ac2065fd1a) )
ROM_REGION( 0x10000, "soundcpu", 0 )
- ROM_LOAD( "b73_12.7e", 0x000000, 0x010000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
+ ROM_LOAD( "b73_12.7e", 0x00000, 0x10000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
ROM_REGION( 0x1000, "mermaid", 0 )
ROM_LOAD( "mermaid.bin", 0x0000, 0x0e00, CRC(88c5dd27) SHA1(5043fed7fd192891be7e4096f2c5daaae1538bc4) )
- ROM_REGION( 0x200000, "sprites", 0 )
+ ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD( "b73_08.2f", 0x000000, 0x080000, CRC(f83dd808) SHA1(09d5f1e86fad3a0d2d3ac1845103d3f2833c6793) )
ROM_LOAD( "b73_28.2c", 0x100000, 0x020000, CRC(a02e08d6) SHA1(72764d4e8474aaac0674fd1c20278a706da7ade2) ) // == b73_22.2c, despite the different label
ROM_LOAD( "b73_27.2b", 0x120000, 0x020000, CRC(8708f97c) SHA1(ccddc7f2fa53c5e35345c2db0520f515c512b723) ) // == b73_21.2b, despite the different label
@@ -741,19 +736,19 @@ ROM_START( hvyunitj )
ROM_END
ROM_START( hvyunitja )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "b73_24.5c", 0x00000, 0x20000, CRC(60122f5a) SHA1(f9abccc8c4f65c613f901c7baebe02881ea8bf60) )
- ROM_REGION( 0x10000, "slave", 0 )
+ ROM_REGION( 0x10000, "subcpu", 0 )
ROM_LOAD( "b73_14.5p", 0x00000, 0x10000, CRC(0dfb51d4) SHA1(0e6f3b3d4558f12fe1b1620f57a0f4ac2065fd1a) )
ROM_REGION( 0x10000, "soundcpu", 0 )
- ROM_LOAD( "b73_12.7e", 0x000000, 0x010000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
+ ROM_LOAD( "b73_12.7e", 0x00000, 0x10000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
ROM_REGION( 0x1000, "mermaid", 0 )
ROM_LOAD( "mermaid.bin", 0x0000, 0x0e00, CRC(88c5dd27) SHA1(5043fed7fd192891be7e4096f2c5daaae1538bc4) )
- ROM_REGION( 0x200000, "sprites", 0 ) // The data in first half of b73_15.0b actually differs slightly to the other sets, a 0x22 fill is replaced by 0xff on empty tiles
+ ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) // The data in first half of b73_15.0b actually differs slightly to the other sets, a 0x22 fill is replaced by 0xff on empty tiles
ROM_LOAD( "b73_22.2c", 0x100000, 0x020000, CRC(a02e08d6) SHA1(72764d4e8474aaac0674fd1c20278a706da7ade2) ) // == b73_28.2c, despite the different label - M5M27C101P mask ROM
ROM_LOAD( "b73_21.2b", 0x120000, 0x020000, CRC(8708f97c) SHA1(ccddc7f2fa53c5e35345c2db0520f515c512b723) ) // == b73_27.2b, despite the different label - M5M27C101P mask ROM
ROM_LOAD( "b73_15.0b", 0x140000, 0x020000, CRC(2f13f81e) SHA1(9d9c1869bf582a0bc0581cdf5b65237124b9e456) ) // == b73_25.0b, despite the different label - M5M27C101P mask ROM
@@ -773,19 +768,19 @@ ROM_START( hvyunitja )
ROM_END
ROM_START( hvyunitjo )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "b73_13.5c", 0x00000, 0x20000, CRC(e2874601) SHA1(7f7f3287113b8622eb365d04135d2d9c35d70554) )
- ROM_REGION( 0x10000, "slave", 0 )
+ ROM_REGION( 0x10000, "subcpu", 0 )
ROM_LOAD( "b73_14.5p", 0x00000, 0x10000, CRC(0dfb51d4) SHA1(0e6f3b3d4558f12fe1b1620f57a0f4ac2065fd1a) )
ROM_REGION( 0x10000, "soundcpu", 0 )
- ROM_LOAD( "b73_12.7e", 0x000000, 0x010000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
+ ROM_LOAD( "b73_12.7e", 0x00000, 0x10000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
ROM_REGION( 0x1000, "mermaid", 0 )
ROM_LOAD( "mermaid.bin", 0x0000, 0x0e00, CRC(88c5dd27) SHA1(5043fed7fd192891be7e4096f2c5daaae1538bc4) )
- ROM_REGION( 0x200000, "sprites", 0 )
+ ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD( "b73_08.2f", 0x000000, 0x080000, CRC(f83dd808) SHA1(09d5f1e86fad3a0d2d3ac1845103d3f2833c6793) )
ROM_LOAD( "b73_07.2c", 0x100000, 0x010000, CRC(5cffa42c) SHA1(687e047345039479b35d5099e56dbc1d57284ed9) )
ROM_LOAD( "b73_06.2b", 0x120000, 0x010000, CRC(a98e4aea) SHA1(560fef03ad818894c9c7578c6282d55b646e8129) )
@@ -802,19 +797,19 @@ ROM_START( hvyunitjo )
ROM_END
ROM_START( hvyunitu )
- ROM_REGION( 0x20000, "master", 0 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "b73_34.5c", 0x00000, 0x20000, CRC(05c30a90) SHA1(97cc0ded2896e0945d790247c284e5058c28c735) )
- ROM_REGION( 0x10000, "slave", 0 )
+ ROM_REGION( 0x10000, "subcpu", 0 )
ROM_LOAD( "b73_35.6p", 0x00000, 0x10000, CRC(aed1669d) SHA1(d0539261d6128fa2d58b529e8383b6d1f3ccac77) )
ROM_REGION( 0x10000, "soundcpu", 0 )
- ROM_LOAD( "b73_12.7e", 0x000000, 0x010000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
+ ROM_LOAD( "b73_12.7e", 0x00000, 0x10000, CRC(d1d24fab) SHA1(ed0312535d0b136d79aa885b9e6eea19ebde6409) )
ROM_REGION( 0x1000, "mermaid", 0 )
ROM_LOAD( "mermaid.bin", 0x0000, 0x0e00, CRC(88c5dd27) SHA1(5043fed7fd192891be7e4096f2c5daaae1538bc4) )
- ROM_REGION( 0x200000, "sprites", 0 )
+ ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD( "b73_08.2f", 0x000000, 0x080000, CRC(f83dd808) SHA1(09d5f1e86fad3a0d2d3ac1845103d3f2833c6793) )
ROM_LOAD( "b73_28.2c", 0x100000, 0x020000, CRC(a02e08d6) SHA1(72764d4e8474aaac0674fd1c20278a706da7ade2) ) // == b73_22.2c, despite the different label
ROM_LOAD( "b73_27.2b", 0x120000, 0x020000, CRC(8708f97c) SHA1(ccddc7f2fa53c5e35345c2db0520f515c512b723) ) // == b73_21.2b, despite the different label
diff --git a/src/mame/kaneko/kan_pand.cpp b/src/mame/kaneko/kan_pand.cpp
index 53d1181d49a..d4239b96c8d 100644
--- a/src/mame/kaneko/kan_pand.cpp
+++ b/src/mame/kaneko/kan_pand.cpp
@@ -9,16 +9,16 @@
which is found on several Kaneko boards.
there several bootleg variants of this chip,
- these are emulated in kan_panb.c instead.
+ these are emulated in kaneko/snowbros_v.cpp instead.
Original Games using this Chip
- Snow Bros
- Air Buster
- DJ Boy
- Heavy Unit
- Sand Scorpion
- Gals Panic (1st release)
+ Snow Bros (kaneko/snowbros.cpp)
+ Air Buster (kaneko/airbustr.cpp)
+ DJ Boy (kaneko/djboy.cpp)
+ Heavy Unit (kaneko/hvyunit.cpp)
+ Sand Scorpion (kaneko/sandscrp.cpp)
+ Gals Panic (1st release) (kaneko/galpanic.cpp)
The SemiCom games are also using this because
their bootleg chip appears to function in an
@@ -36,15 +36,15 @@
hookups.
to use this in a driver you must hook functions to
- VIDEO_UPDATE (copies framebuffer to screen)
+ screen_update (copies framebuffer to screen)
and
- VIDEO_EOF (renders the sprites to the framebuffer)
+ screen_vblank (renders the sprites to the framebuffer)
- also, you have to add the correspondent device in MACHINE_DRIVER
+ also, you have to add the correspondent device in machine_config
spriteram should be accessed only with the
- pandora_spriteram_r / pandora_spriteram_w or
- pandora_spriteram_LSB_r / pandora_spriteram_LSB_w
+ spriteram_r / spriteram_w or
+ spriteram_lsb_r / spriteram_lsb_w
handlers, depending on the CPU being used with it.
***********************************************************************/
@@ -53,12 +53,13 @@
#include "kan_pand.h"
#include "screen.h"
-DEFINE_DEVICE_TYPE(KANEKO_PANDORA, kaneko_pandora_device, "kaneko_pandora", "Kaneko PANDORA GFX")
+DEFINE_DEVICE_TYPE(KANEKO_PANDORA, kaneko_pandora_device, "kaneko_pandora", "Kaneko PANDORA Sprite Generator")
-kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, KANEKO_PANDORA, tag, owner, clock)
, device_video_interface(mconfig, *this)
, device_gfx_interface(mconfig, *this)
+ , m_buffer(0)
, m_clear_bitmap(false)
, m_bg_pen(0)
, m_xoffset(0)
@@ -76,15 +77,22 @@ void kaneko_pandora_device::device_start()
m_bg_pen = 0;
m_flip_screen = false;
- m_spriteram = std::make_unique<uint8_t[]>(0x1000);
+ m_spriteram = std::make_unique<u8[]>(0x1000);
- m_sprites_bitmap = std::make_unique<bitmap_ind16>(screen().width(), screen().height());
+ // 4 64x4 DRAMs - 256x256 8 bit, double buffered
+ for (auto &elem : m_sprites_bitmap)
+ {
+ elem.allocate(256, 256);
+ elem.fill(m_bg_pen);
+ }
+ save_item(NAME(m_buffer));
save_item(NAME(m_clear_bitmap));
save_item(NAME(m_bg_pen));
save_item(NAME(m_flip_screen));
save_pointer(NAME(m_spriteram), 0x1000);
- save_item(NAME(*m_sprites_bitmap));
+ save_item(NAME(m_sprites_bitmap[0]));
+ save_item(NAME(m_sprites_bitmap[1]));
}
//-------------------------------------------------
@@ -103,7 +111,7 @@ void kaneko_pandora_device::device_reset()
IMPLEMENTATION
*****************************************************************************/
-void kaneko_pandora_device::set_bg_pen(uint16_t pen)
+void kaneko_pandora_device::set_bg_pen(u16 pen)
{
m_bg_pen = pen;
}
@@ -113,22 +121,15 @@ void kaneko_pandora_device::set_clear_bitmap(int clear)
m_clear_bitmap = clear != 0;
}
-void kaneko_pandora_device::update( bitmap_ind16 &bitmap, const rectangle &cliprect )
+void kaneko_pandora_device::update(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- if (!m_sprites_bitmap)
- {
- printf("ERROR: pandora_update with no pandora_sprites_bitmap\n");
- return;
- }
-
- copybitmap_trans(bitmap, *m_sprites_bitmap, 0, 0, 0, 0, cliprect, 0);
+ copybitmap_trans(bitmap, m_sprites_bitmap[m_buffer], 0, 0, 0, 0, cliprect, 0);
}
-void kaneko_pandora_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprect )
+void kaneko_pandora_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int sx = 0, sy = 0, x = 0, y = 0, offs;
-
+ int x = 0, y = 0;
/*
* Sprite Tile Format
@@ -138,33 +139,33 @@ void kaneko_pandora_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprec
* -----+-76543210-+----------------
* 0-2 | -------- | unused
* 3 | xxxx.... | Palette Bank
- * 3 | .......x | XPos - Sign Bit
- * 3 | ......x. | YPos - Sign Bit
* 3 | .....x.. | Use Relative offsets
+ * 3 | ......x. | YPos - Sign Bit
+ * 3 | .......x | XPos - Sign Bit
* 4 | xxxxxxxx | XPos
* 5 | xxxxxxxx | YPos
* 6 | xxxxxxxx | Sprite Number (low 8 bits)
- * 7 | ....xxxx | Sprite Number (high 4 bits)
* 7 | x....... | Flip Sprite Y-Axis
* 7 | .x...... | Flip Sprite X-Axis
+ * 7 | ..xxxxxx | Sprite Number (high 6 bits)
*/
- for (offs = 0; offs < 0x1000; offs += 8)
+ for (int offs = 0; offs < 0x1000; offs += 8)
{
- int dx = m_spriteram[offs + 4];
- int dy = m_spriteram[offs + 5];
- int tilecolour = m_spriteram[offs + 3];
- int attr = m_spriteram[offs + 7];
- int flipx = attr & 0x80;
- int flipy = (attr & 0x40) << 1;
- int tile = ((attr & 0x3f) << 8) + (m_spriteram[offs + 6] & 0xff);
-
- if (tilecolour & 1)
+ int dx = m_spriteram[offs + 4];
+ int dy = m_spriteram[offs + 5];
+ const u8 tilecolour = m_spriteram[offs + 3];
+ const u8 attr = m_spriteram[offs + 7];
+ bool flipx = BIT(attr, 7);
+ bool flipy = BIT(attr, 6);
+ const u32 tile = ((attr & 0x3f) << 8) + (m_spriteram[offs + 6] & 0xff);
+
+ if (BIT(tilecolour, 0))
dx |= 0x100;
- if (tilecolour & 2)
+ if (BIT(tilecolour, 1))
dy |= 0x100;
- if (tilecolour & 4)
+ if (BIT(tilecolour, 2))
{
x += dx;
y += dy;
@@ -175,104 +176,77 @@ void kaneko_pandora_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprec
y = dy;
}
+ int sx = x, sy = y;
if (m_flip_screen)
{
- sx = 240 - x;
- sy = 240 - y;
+ sx = 240 - sx;
+ sy = 240 - sy;
flipx = !flipx;
flipy = !flipy;
}
- else
- {
- sx = x;
- sy = y;
- }
/* global offset */
sx += m_xoffset;
sy += m_yoffset;
- sx &= 0x1ff;
- sy &= 0x1ff;
-
- if (sx & 0x100)
- sx -= 0x200;
- if (sy & 0x100)
- sy -= 0x200;
+ sx = util::sext(sx & 0x1ff, 9);
+ sy = util::sext(sy & 0x1ff, 9);
gfx(0)->transpen(bitmap,cliprect,
tile,
(tilecolour & 0xf0) >> 4,
flipx, flipy,
- sx,sy,0);
+ sx, sy, 0);
}
}
-void kaneko_pandora_device::eof( )
+void kaneko_pandora_device::eof()
{
- assert(m_spriteram != nullptr);
-
+ m_buffer ^= 1;
// the games can disable the clearing of the sprite bitmap, to leave sprite trails
if (m_clear_bitmap)
- m_sprites_bitmap->fill(m_bg_pen, screen().visible_area());
+ m_sprites_bitmap[m_buffer].fill(m_bg_pen);
- kaneko_pandora_device::draw(*m_sprites_bitmap, screen().visible_area());
+ draw(m_sprites_bitmap[m_buffer], m_sprites_bitmap[m_buffer].cliprect());
}
/*****************************************************************************
DEVICE HANDLERS
*****************************************************************************/
-void kaneko_pandora_device::spriteram_w(offs_t offset, uint8_t data)
+void kaneko_pandora_device::spriteram_w(offs_t offset, u8 data)
{
// it's either hooked up oddly on this, or on the 16-bit games
// either way, we swap the address lines so that the spriteram is in the same format
- offset = bitswap<16>(offset, 15,14,13,12, 11, 7,6,5,4,3,2,1,0, 10,9,8 );
-
- if (!m_spriteram)
- {
- printf("ERROR: spriteram_w with no m__spriteram\n");
- return;
- }
+ offset = bitswap<16>(offset, 15,14,13,12, 11, 7,6,5,4,3,2,1,0, 10,9,8);
if (offset >= 0x1000)
{
- logerror("spriteram_w write past spriteram, offset %04x %02x\n", offset, data);
+ logerror("%s: spriteram_w write past spriteram, offset %04x %02x\n", machine().describe_context(), offset, data);
return;
}
m_spriteram[offset] = data;
}
-uint8_t kaneko_pandora_device::spriteram_r(offs_t offset)
+u8 kaneko_pandora_device::spriteram_r(offs_t offset)
{
// it's either hooked up oddly on this, or on the 16-bit games
// either way, we swap the address lines so that the spriteram is in the same format
- offset = bitswap<16>(offset, 15,14,13,12, 11, 7,6,5,4,3,2,1,0, 10,9,8 );
-
- if (!m_spriteram)
- {
- printf("ERROR: spriteram_r with no m_spriteram\n");
- return 0x00;
- }
+ offset = bitswap<16>(offset, 15,14,13,12, 11, 7,6,5,4,3,2,1,0, 10,9,8);
if (offset >= 0x1000)
{
- logerror("spriteram_r read past spriteram, offset %04x\n", offset);
+ if (!machine().side_effects_disabled())
+ logerror("%s: spriteram_r read past spriteram, offset %04x\n", machine().describe_context(), offset);
return 0x00;
}
return m_spriteram[offset];
}
/* I don't know if this MSB/LSB mirroring is correct, or if there is twice as much ram, with half of it unused */
-void kaneko_pandora_device::spriteram_LSB_w(offs_t offset, uint16_t data, uint16_t mem_mask)
+void kaneko_pandora_device::spriteram_lsb_w(offs_t offset, u16 data, u16 mem_mask)
{
- if (!m_spriteram)
- {
- printf("ERROR: m_spriteram_LSB_w with no m_spriteram\n");
- return;
- }
-
if (ACCESSING_BITS_8_15)
{
m_spriteram[offset] = (data >> 8) & 0xff;
@@ -284,13 +258,7 @@ void kaneko_pandora_device::spriteram_LSB_w(offs_t offset, uint16_t data, uint16
}
}
-uint16_t kaneko_pandora_device::spriteram_LSB_r(offs_t offset)
+u16 kaneko_pandora_device::spriteram_lsb_r(offs_t offset)
{
- if (!m_spriteram)
- {
- printf("ERROR: spriteram_LSB_r with no m_spriteram\n");
- return 0x0000;
- }
-
return m_spriteram[offset] | (m_spriteram[offset] << 8);
}
diff --git a/src/mame/kaneko/kan_pand.h b/src/mame/kaneko/kan_pand.h
index 866aea2f5fc..c3d80449bbc 100644
--- a/src/mame/kaneko/kan_pand.h
+++ b/src/mame/kaneko/kan_pand.h
@@ -22,8 +22,8 @@ class kaneko_pandora_device : public device_t,
{
public:
// constructor/destructor
- kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <typename T> kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&palette_tag, const gfx_decode_entry *gfxinfo)
+ kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ template <typename T> kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, T &&palette_tag, const gfx_decode_entry *gfxinfo)
: kaneko_pandora_device(mconfig, tag, owner, clock)
{
set_info(gfxinfo);
@@ -32,20 +32,20 @@ public:
// configuration
void set_gfxinfo(const gfx_decode_entry *gfxinfo) { set_info(gfxinfo); }
- void set_offsets(int32_t x_offset, int32_t y_offset)
+ void set_offsets(s32 x_offset, s32 y_offset)
{
m_xoffset = x_offset;
m_yoffset = y_offset;
}
- void spriteram_w(offs_t offset, uint8_t data);
- uint8_t spriteram_r(offs_t offset);
- void spriteram_LSB_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
- uint16_t spriteram_LSB_r(offs_t offset);
- void update( bitmap_ind16 &bitmap, const rectangle &cliprect );
+ void spriteram_w(offs_t offset, u8 data);
+ u8 spriteram_r(offs_t offset);
+ void spriteram_lsb_w(offs_t offset, u16 data, u16 mem_mask = ~0);
+ u16 spriteram_lsb_r(offs_t offset);
+ void update(bitmap_ind16 &bitmap, const rectangle &cliprect);
void set_clear_bitmap(int clear);
void eof();
- void set_bg_pen(uint16_t pen);
+ void set_bg_pen(u16 pen);
void flip_screen_set(bool flip) { m_flip_screen = flip; }
protected:
@@ -53,17 +53,18 @@ protected:
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
- void draw( bitmap_ind16 &bitmap, const rectangle &cliprect );
+ void draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
// internal state
- std::unique_ptr<uint8_t[]> m_spriteram;
- std::unique_ptr<bitmap_ind16> m_sprites_bitmap; // bitmap to render sprites to, Pandora seems to be frame'buffered'
- bool m_clear_bitmap;
- uint16_t m_bg_pen; // might work some other way..
- int32_t m_xoffset;
- int32_t m_yoffset;
- bool m_flip_screen;
+ std::unique_ptr<u8[]> m_spriteram;
+ bitmap_ind16 m_sprites_bitmap[2]; // bitmap to render sprites to, Pandora seems to be frame'buffered'
+ u8 m_buffer;
+ bool m_clear_bitmap;
+ u16 m_bg_pen; // might work some other way..
+ s32 m_xoffset;
+ s32 m_yoffset;
+ bool m_flip_screen;
};
DECLARE_DEVICE_TYPE(KANEKO_PANDORA, kaneko_pandora_device)
diff --git a/src/mame/kaneko/sandscrp.cpp b/src/mame/kaneko/sandscrp.cpp
index 235eb2ecba8..c6d8079ddb7 100644
--- a/src/mame/kaneko/sandscrp.cpp
+++ b/src/mame/kaneko/sandscrp.cpp
@@ -116,10 +116,10 @@ private:
required_memory_bank m_audiobank;
- u8 m_sprite_irq;
- u8 m_unknown_irq;
- u8 m_vblank_irq;
- bool m_latch_full[2];
+ u8 m_sprite_irq = 0;
+ u8 m_unknown_irq = 0;
+ u8 m_vblank_irq = 0;
+ bool m_latch_full[2]{};
u8 irq_cause_r();
void irq_cause_w(u8 data);
@@ -152,17 +152,17 @@ u32 sandscrp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
m_view2->prepare(bitmap, cliprect);
- for ( int l = 0; l < 4; l++ )
+ for (int l = 0; l < 4; l++)
{
- m_view2->render_tilemap(screen,bitmap,cliprect,l);
+ m_view2->render_tilemap(screen, bitmap, cliprect, l);
}
// copy sprite bitmap to screen
m_pandora->update(bitmap, cliprect);
- for ( int h = 4; h < 8; h++ ) // high bit of tile priority : above sprites
+ for (int h = 4; h < 8; h++) // high bit of tile priority : above sprites
{
- m_view2->render_tilemap(screen,bitmap,cliprect,h);
+ m_view2->render_tilemap(screen, bitmap, cliprect, h);
}
return 0;
@@ -212,21 +212,24 @@ void sandscrp_state::screen_vblank(int state)
/* Reads the cause of the interrupt */
u8 sandscrp_state::irq_cause_r()
{
- return ( m_sprite_irq ? 0x08 : 0 ) |
- ( m_unknown_irq ? 0x10 : 0 ) |
- ( m_vblank_irq ? 0x20 : 0 ) ;
+ return (m_sprite_irq ? 0x08 : 0) |
+ (m_unknown_irq ? 0x10 : 0) |
+ (m_vblank_irq ? 0x20 : 0);
}
/* Clear the cause of the interrupt */
void sandscrp_state::irq_cause_w(u8 data)
{
-// m_sprite_flipx = data & 1;
-// m_sprite_flipy = data & 1;
+// m_sprite_flipx = BIT(data, 0);
+// m_sprite_flipy = BIT(data, 0);
- if (BIT(data, 3)) m_sprite_irq = 0;
- if (BIT(data, 4)) m_unknown_irq = 0;
- if (BIT(data, 5)) m_vblank_irq = 0;
+ if (BIT(data, 3))
+ m_sprite_irq = 0;
+ if (BIT(data, 4))
+ m_unknown_irq = 0;
+ if (BIT(data, 5))
+ m_vblank_irq = 0;
update_irq_state();
}
@@ -246,7 +249,7 @@ void sandscrp_state::coincounter_w(u8 data)
u8 sandscrp_state::latchstatus_68k_r()
{
return (m_latch_full[0] ? 0x80 : 0) |
- (m_latch_full[1] ? 0x40 : 0) ;
+ (m_latch_full[1] ? 0x40 : 0);
}
void sandscrp_state::latchstatus_68k_w(u8 data)
@@ -275,10 +278,10 @@ void sandscrp_state::sandscrp_mem(address_map &map)
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100001, 0x100001).w(FUNC(sandscrp_state::irq_cause_w)); // IRQ Ack
- map(0x200000, 0x20001f).rw("calc1_mcu", FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w));
+ map(0x200000, 0x20001f).rw("calc1", FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w));
map(0x300000, 0x30001f).rw(m_view2, FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x400000, 0x403fff).m(m_view2, FUNC(kaneko_view2_tilemap_device::vram_map));
- map(0x500000, 0x501fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_LSB_r), FUNC(kaneko_pandora_device::spriteram_LSB_w)); // sprites
+ map(0x500000, 0x501fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_lsb_r), FUNC(kaneko_pandora_device::spriteram_lsb_w)); // sprites
map(0x600000, 0x600fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); // Palette
map(0x700000, 0x70ffff).ram(); // RAM
map(0x800001, 0x800001).r(FUNC(sandscrp_state::irq_cause_r)); // IRQ Cause
@@ -305,13 +308,13 @@ void sandscrp_state::bankswitch_w(u8 data)
u8 sandscrp_state::latchstatus_r()
{
return (m_latch_full[1] ? 0x80 : 0) | // swapped!?
- (m_latch_full[0] ? 0x40 : 0) ;
+ (m_latch_full[0] ? 0x40 : 0);
}
void sandscrp_state::sandscrp_soundmem(address_map &map)
{
map(0x0000, 0x7fff).rom(); // ROM
- map(0x8000, 0xbfff).bankr("audiobank"); // Banked ROM
+ map(0x8000, 0xbfff).bankr(m_audiobank); // Banked ROM
map(0xc000, 0xdfff).ram(); // RAM
}
@@ -461,7 +464,7 @@ void sandscrp_state::sandscrp(machine_config &config)
m_view2->set_offset(0x5b, 0, 256, 224);
m_view2->set_palette("palette");
- KANEKO_HIT(config, "calc1_mcu").set_type(0);
+ KANEKO_HIT(config, "calc1").set_type(0);
KANEKO_PANDORA(config, m_pandora, 0, "palette", gfx_sandscrp_spr);
diff --git a/src/mame/kaneko/snowbros.cpp b/src/mame/kaneko/snowbros.cpp
index 8a193300973..d98a0ad0be3 100644
--- a/src/mame/kaneko/snowbros.cpp
+++ b/src/mame/kaneko/snowbros.cpp
@@ -87,19 +87,19 @@ a joystick. This is not an emulation bug.
#include "speaker.h"
-void snowbros_state::snowbros_flipscreen_w(uint8_t data)
+void snowbros_pandora_state::snowbros_flipscreen_w(u8 data)
{
m_pandora->flip_screen_set(!BIT(data, 7));
}
-void snowbros_state::bootleg_flipscreen_w(uint8_t data)
+void snowbros_state::bootleg_flipscreen_w(u8 data)
{
- flip_screen_set(~data & 0x80);
+ flip_screen_set(BIT(~data, 7));
}
-uint32_t snowbros_state::screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 snowbros_pandora_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* This clears & redraws the entire screen each pass */
bitmap.fill(0xf0, cliprect);
@@ -108,7 +108,7 @@ uint32_t snowbros_state::screen_update_snowbros(screen_device &screen, bitmap_in
}
-void snowbros_state::screen_vblank_snowbros(int state)
+void snowbros_pandora_state::screen_vblank(int state)
{
// rising edge
if (state)
@@ -118,94 +118,83 @@ void snowbros_state::screen_vblank_snowbros(int state)
}
-
-void snowbros_state::snowbros_irq4_ack_w(uint16_t data)
+template <unsigned Line>
+void snowbros_state::irq_ack_w(u16 data)
{
- m_maincpu->set_input_line(4, CLEAR_LINE);
+ m_maincpu->set_input_line(Line, CLEAR_LINE);
}
-void snowbros_state::snowbros_irq3_ack_w(uint16_t data)
+TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::scanline)
{
- m_maincpu->set_input_line(3, CLEAR_LINE);
-}
-
-void snowbros_state::snowbros_irq2_ack_w(uint16_t data)
-{
- m_maincpu->set_input_line(2, CLEAR_LINE);
-}
+ const int scanline = param;
-TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros_irq)
-{
- int scanline = param;
-
- if(scanline == 240)
+ if (scanline == 240)
m_maincpu->set_input_line(2, ASSERT_LINE);
- if(scanline == 128)
+ if (scanline == 128)
m_maincpu->set_input_line(3, ASSERT_LINE);
- if(scanline == 32)
+ if (scanline == 32)
m_maincpu->set_input_line(4, ASSERT_LINE);
}
-TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
+TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_state::snowbros3_scanline)
{
- int status = m_oki->read();
- int scanline = param;
+ const u8 status = m_oki[0]->read();
+ const int scanline = param;
- if(scanline == 240)
+ if (scanline == 240)
m_maincpu->set_input_line(2, ASSERT_LINE);
- if(scanline == 128)
+ if (scanline == 128)
m_maincpu->set_input_line(3, ASSERT_LINE);
- if(scanline == 32)
+ if (scanline == 32)
m_maincpu->set_input_line(4, ASSERT_LINE);
if (m_sb3_music_is_playing)
{
- if ((status&0x08)==0x00)
+ if (BIT(~status, 3))
{
- m_oki->write(0x80|m_sb3_music);
- m_oki->write(0x00|0x82);
+ m_oki[0]->write(0x80 | m_sb3_music);
+ m_oki[0]->write(0x00 | 0x82);
}
-
}
else
{
- if ((status&0x08)==0x08)
+ if (BIT(status, 3))
{
- m_oki->write(0x40); /* Stop playing music */
+ m_oki[0]->write(0x40); /* Stop playing music */
}
}
-
}
-uint16_t snowbros_state::toto_read(offs_t offset, uint16_t mem_mask)
+u16 snowbros_pandora_state::toto_read(offs_t offset, u16 mem_mask)
{
- int pc = m_maincpu->pc();
- if ((pc!= 0x3f010) && (pc!= 0x38008)) printf("toto prot %08x %04x\n", pc, mem_mask);
+ const offs_t pc = m_maincpu->pc();
+ if ((pc!= 0x3f010) && (pc!= 0x38008) && (!machine().side_effects_disabled()))
+ logerror("%s: toto prot %08x %04x\n", machine().describe_context(), pc, mem_mask);
return 0x0700;
}
/* Snow Bros Memory Map */
-void snowbros_state::snowbros_map(address_map &map)
+void snowbros_pandora_state::snowbros_map(address_map &map)
{
map(0x000000, 0x03ffff).rom();
map(0x100000, 0x103fff).ram();
map(0x200000, 0x200001).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
- map(0x300001, 0x300001).r("soundlatch2", FUNC(generic_latch_8_device::read));
- map(0x300001, 0x300001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x400000, 0x400000).w(FUNC(snowbros_state::snowbros_flipscreen_w));
+ map(0x300001, 0x300001).r(m_soundlatch[1], FUNC(generic_latch_8_device::read));
+ map(0x300001, 0x300001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
+ map(0x400000, 0x400000).w(FUNC(snowbros_pandora_state::snowbros_flipscreen_w));
map(0x500000, 0x500001).portr("DSW1");
map(0x500002, 0x500003).portr("DSW2");
map(0x500004, 0x500005).portr("SYSTEM");
map(0x600000, 0x6001ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_LSB_r), FUNC(kaneko_pandora_device::spriteram_LSB_w));
- map(0x800000, 0x800001).w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x900000, 0x900001).w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0xa00000, 0xa00001).w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_lsb_r), FUNC(kaneko_pandora_device::spriteram_lsb_w));
+ map(0x800000, 0x800001).w(FUNC(snowbros_pandora_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x900000, 0x900001).w(FUNC(snowbros_pandora_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0xa00000, 0xa00001).w(FUNC(snowbros_pandora_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
}
void snowbros_state::sound_map(address_map &map)
@@ -218,30 +207,30 @@ void snowbros_state::sound_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x02, 0x03).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write));
- map(0x04, 0x04).r(m_soundlatch, FUNC(generic_latch_8_device::read));
- map(0x04, 0x04).w("soundlatch2", FUNC(generic_latch_8_device::write)); // goes back to the main CPU, checked during boot
+ // goes back to the main CPU, checked during boot
+ map(0x04, 0x04).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)).w(m_soundlatch[1], FUNC(generic_latch_8_device::write));
}
/* Semicom AT89C52 MCU */
// probably not endian safe
-void snowbros_state::prot_p0_w(uint8_t data)
+void semicom_state::prot_p0_w(u8 data)
{
- uint16_t word = m_hyperpac_ram[m_semicom_prot_base + m_semicom_prot_offset];
+ u16 word = m_hyperpac_ram[m_semicom_prot_base + m_semicom_prot_offset];
word = (word & 0xff00) | (data << 0);
m_hyperpac_ram[m_semicom_prot_base + m_semicom_prot_offset] = word;
}
// probably not endian safe
-void snowbros_state::prot_p1_w(uint8_t data)
+void semicom_state::prot_p1_w(u8 data)
{
- uint16_t word = m_hyperpac_ram[m_semicom_prot_base + m_semicom_prot_offset];
+ u16 word = m_hyperpac_ram[m_semicom_prot_base + m_semicom_prot_offset];
word = (word & 0x00ff) | (data << 8);
m_hyperpac_ram[m_semicom_prot_base + m_semicom_prot_offset] = word;
}
-void snowbros_state::prot_p2_w(uint8_t data)
+void semicom_state::prot_p2_w(u8 data)
{
// offset
m_semicom_prot_offset = data;
@@ -254,17 +243,17 @@ void snowbros_state::wintbob_map(address_map &map)
map(0x000000, 0x03ffff).rom();
map(0x100000, 0x103fff).ram();
map(0x200000, 0x200001).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
- map(0x300001, 0x300001).r("soundlatch2", FUNC(generic_latch_8_device::read));
- map(0x300001, 0x300001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
+ map(0x300001, 0x300001).r(m_soundlatch[1], FUNC(generic_latch_8_device::read));
+ map(0x300001, 0x300001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
map(0x400000, 0x400000).w(FUNC(snowbros_state::bootleg_flipscreen_w));
map(0x500000, 0x500001).portr("DSW1");
map(0x500002, 0x500003).portr("DSW2");
map(0x500004, 0x500005).portr("SYSTEM");
map(0x600000, 0x6001ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x700000, 0x701fff).ram().share("spriteram16b");
- map(0x800000, 0x800001).w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x900000, 0x900001).w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0xa00000, 0xa00001).w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x700000, 0x701fff).ram().share(m_bootleg_spriteram);
+ map(0x800000, 0x800001).w(FUNC(snowbros_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x900000, 0x900001).w(FUNC(snowbros_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0xa00000, 0xa00001).w(FUNC(snowbros_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
}
/* Honey Doll */
@@ -272,32 +261,32 @@ void snowbros_state::wintbob_map(address_map &map)
void snowbros_state::honeydol_map(address_map &map)
{
map(0x000000, 0x03ffff).rom();
- map(0x100000, 0x10ffff).ram().share("hyperpac_ram");
+ map(0x100000, 0x10ffff).ram();
map(0x200000, 0x200001).nopw(); /* ? */
- map(0x300001, 0x300001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x400000, 0x400001).w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x500000, 0x500001).w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0x600000, 0x600001).w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x300001, 0x300001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
+ map(0x400000, 0x400001).w(FUNC(snowbros_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x500000, 0x500001).w(FUNC(snowbros_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0x600000, 0x600001).w(FUNC(snowbros_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
map(0x800000, 0x800001).nopw(); /* ? */
map(0x900000, 0x900001).portr("DSW1");
map(0x900002, 0x900003).portr("DSW2");
map(0x900004, 0x900005).portr("SYSTEM");
map(0xa00000, 0xa007ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0xb00000, 0xb01fff).ram().share("spriteram16b");
+ map(0xb00000, 0xb01fff).ram().share(m_bootleg_spriteram);
}
void snowbros_state::honeydol_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0x87ff).ram();
- map(0xe010, 0xe010).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
+ map(0xe010, 0xe010).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
}
void snowbros_state::honeydol_sound_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x02, 0x03).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); // not connected?
- map(0x04, 0x04).r(m_soundlatch, FUNC(generic_latch_8_device::read));
+ map(0x04, 0x04).r(m_soundlatch[0], FUNC(generic_latch_8_device::read));
map(0x04, 0x04).nopw(); // still written but never actually read by the main CPU
}
@@ -308,36 +297,37 @@ void snowbros_state::twinadv_map(address_map &map)
map(0x000000, 0x03ffff).rom();
map(0x100000, 0x10ffff).ram();
map(0x200000, 0x200001).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
- map(0x300001, 0x300001).r("soundlatch2", FUNC(generic_latch_8_device::read));
- map(0x300001, 0x300001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
+ map(0x300001, 0x300001).r(m_soundlatch[1], FUNC(generic_latch_8_device::read));
+ map(0x300001, 0x300001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
map(0x400000, 0x400000).w(FUNC(snowbros_state::bootleg_flipscreen_w));
map(0x500000, 0x500001).portr("DSW1");
map(0x500002, 0x500003).portr("DSW2");
map(0x500004, 0x500005).portr("SYSTEM");
map(0x600000, 0x6001ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x700000, 0x701fff).ram().share("spriteram16b");
- map(0x800000, 0x800001).w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x900000, 0x900001).w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0xa00000, 0xa00001).w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x700000, 0x701fff).ram().share(m_bootleg_spriteram);
+ map(0x800000, 0x800001).w(FUNC(snowbros_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x900000, 0x900001).w(FUNC(snowbros_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0xa00000, 0xa00001).w(FUNC(snowbros_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
}
-void snowbros_state::twinadv_oki_bank_w(uint8_t data)
+void snowbros_state::twinadv_oki_bank_w(u8 data)
{
- int bank = (data &0x02)>>1;
+ const u8 bank = BIT(data, 1);
- if (data&0xfd) logerror ("Unused bank bits! %02x\n",data);
+ if (data & 0xfd)
+ logerror("%s: Unused bank bits! %02x\n", machine().describe_context(), data);
- m_oki->set_rom_bank(bank);
+ m_oki[0]->set_rom_bank(bank);
}
void snowbros_state::twinadv_sound_io_map(address_map &map)
{
map.global_mask(0xff);
- map(0x02, 0x02).r(m_soundlatch, FUNC(generic_latch_8_device::read));
- map(0x02, 0x02).w("soundlatch2", FUNC(generic_latch_8_device::write)); // back to 68k?
+ map(0x02, 0x02).r(m_soundlatch[0], FUNC(generic_latch_8_device::read));
+ map(0x02, 0x02).w(m_soundlatch[1], FUNC(generic_latch_8_device::write)); // back to 68k?
map(0x04, 0x04).w(FUNC(snowbros_state::twinadv_oki_bank_w)); // oki bank?
- map(0x06, 0x06).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
+ map(0x06, 0x06).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
}
@@ -348,43 +338,41 @@ sound hardware is also different
*/
-void snowbros_state::hyperpac_map(address_map &map)
+void semicom_state::hyperpac_map(address_map &map)
{
map(0x000000, 0x0fffff).rom();
- map(0x100000, 0x10ffff).ram().share("hyperpac_ram");
- map(0x300001, 0x300001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
+ map(0x100000, 0x10ffff).ram().share(m_hyperpac_ram);
+ map(0x300001, 0x300001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
// map(0x400000, 0x400001) ???
map(0x500000, 0x500001).portr("DSW1");
map(0x500002, 0x500003).portr("DSW2");
map(0x500004, 0x500005).portr("SYSTEM");
map(0x600000, 0x6001ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_LSB_r), FUNC(kaneko_pandora_device::spriteram_LSB_w));
- map(0x800000, 0x800001).w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x900000, 0x900001).w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0xa00000, 0xa00001).w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_lsb_r), FUNC(kaneko_pandora_device::spriteram_lsb_w));
+ map(0x800000, 0x800001).w(FUNC(semicom_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x900000, 0x900001).w(FUNC(semicom_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0xa00000, 0xa00001).w(FUNC(semicom_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
}
-void snowbros_state::hyperpac_sound_map(address_map &map)
+void semicom_state::hyperpac_sound_map(address_map &map)
{
map(0x0000, 0xcfff).rom();
map(0xd000, 0xd7ff).ram();
map(0xf000, 0xf001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
- map(0xf002, 0xf002).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
- map(0xf008, 0xf008).r(m_soundlatch, FUNC(generic_latch_8_device::read));
+ map(0xf002, 0xf002).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
+ map(0xf008, 0xf008).r(m_soundlatch[0], FUNC(generic_latch_8_device::read));
}
/* Same volume used for all samples at the Moment, could be right, we have no
way of knowing .. */
-uint16_t snowbros_state::sb3_sound_r()
+u16 snowbros3_state::sb3_sound_r()
{
return 0x0003;
}
-void snowbros_state::sb3_play_music(int data)
+void snowbros3_state::sb3_play_music(u16 data)
{
- uint8_t *snd;
-
/* sample is actually played in interrupt function so it loops */
m_sb3_music = data;
@@ -392,16 +380,14 @@ void snowbros_state::sb3_play_music(int data)
{
case 0x23:
case 0x26:
- snd = memregion("oki")->base();
- memcpy(snd+0x20000, snd+0x80000+0x00000, 0x20000);
- m_sb3_music_is_playing = 1;
- break;
+ m_okibank->set_entry(0);
+ m_sb3_music_is_playing = 1;
+ break;
case 0x24:
- snd = memregion("oki")->base();
- memcpy(snd+0x20000, snd+0x80000+0x20000, 0x20000);
- m_sb3_music_is_playing = 1;
- break;
+ m_okibank->set_entry(1);
+ m_sb3_music_is_playing = 1;
+ break;
case 0x25:
case 0x27:
@@ -411,101 +397,102 @@ void snowbros_state::sb3_play_music(int data)
case 0x2b:
case 0x2c:
case 0x2d:
- snd = memregion("oki")->base();
- memcpy(snd+0x20000, snd+0x80000+0x40000, 0x20000);
- m_sb3_music_is_playing = 1;
- break;
+ m_okibank->set_entry(2);
+ m_sb3_music_is_playing = 1;
+ break;
case 0x2e:
- m_sb3_music_is_playing = 0;
- break;
+ m_sb3_music_is_playing = 0;
+ break;
}
}
-void snowbros_state::sb3_play_sound (int data)
+void snowbros3_state::sb3_play_sound(u16 data)
{
- int status = m_oki->read();
+ const u8 status = m_oki[0]->read();
- if ((status&0x01)==0x00)
+ if (BIT(~status, 0))
{
- m_oki->write(0x80|data);
- m_oki->write(0x00|0x12);
+ m_oki[0]->write(0x80 | data);
+ m_oki[0]->write(0x00 | 0x12);
}
- else if ((status&0x02)==0x00)
+ else if (BIT(~status, 1))
{
- m_oki->write(0x80|data);
- m_oki->write(0x00|0x22);
+ m_oki[0]->write(0x80 | data);
+ m_oki[0]->write(0x00 | 0x22);
}
- else if ((status&0x04)==0x00)
+ else if (BIT(~status, 2))
{
- m_oki->write(0x80|data);
- m_oki->write(0x00|0x42);
+ m_oki[0]->write(0x80 | data);
+ m_oki[0]->write(0x00 | 0x42);
}
-
-
}
-void snowbros_state::sb3_sound_w(uint16_t data)
+void snowbros3_state::sb3_sound_w(u16 data)
{
if (data == 0x00fe)
{
m_sb3_music_is_playing = 0;
- m_oki->write(0x78); /* Stop sounds */
+ m_oki[0]->write(0x78); /* Stop sounds */
}
else /* the alternating 0x00-0x2f or 0x30-0x5f might be something to do with the channels */
{
- data = data>>8;
+ data = data >> 8;
if (data <= 0x21)
{
sb3_play_sound(data);
}
- if (data>=0x22 && data<=0x31)
+ if ((data >= 0x22) && (data <= 0x31))
{
sb3_play_music(data);
}
- if ((data>=0x30) && (data<=0x51))
+ if ((data >= 0x30) && (data <= 0x51))
{
- sb3_play_sound(data-0x30);
+ sb3_play_sound(data - 0x30);
}
- if (data>=0x52 && data<=0x5f)
+ if ((data >= 0x52) && (data <= 0x5f))
{
- sb3_play_music(data-0x30);
+ sb3_play_music(data - 0x30);
}
-
}
}
-
-void snowbros_state::snowbros3_map(address_map &map)
+void snowbros3_state::snowbros3_map(address_map &map)
{
map(0x000000, 0x03ffff).rom();
map(0x100000, 0x103fff).ram();
map(0x200000, 0x200001).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
- map(0x300000, 0x300001).r(FUNC(snowbros_state::sb3_sound_r)); // ?
- map(0x300000, 0x300001).w(FUNC(snowbros_state::sb3_sound_w)); // ?
- map(0x400000, 0x400000).w(FUNC(snowbros_state::bootleg_flipscreen_w));
+ map(0x300000, 0x300001).r(FUNC(snowbros3_state::sb3_sound_r)); // ?
+ map(0x300000, 0x300001).w(FUNC(snowbros3_state::sb3_sound_w)); // ?
+ map(0x400000, 0x400000).w(FUNC(snowbros3_state::bootleg_flipscreen_w));
map(0x500000, 0x500001).portr("DSW1");
map(0x500002, 0x500003).portr("DSW2");
map(0x500004, 0x500005).portr("SYSTEM");
map(0x600000, 0x6003ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x700000, 0x7021ff).ram().share("spriteram16b");
- map(0x800000, 0x800001).w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x900000, 0x900001).w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0xa00000, 0xa00001).w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x700000, 0x7021ff).ram().share(m_bootleg_spriteram);
+ map(0x800000, 0x800001).w(FUNC(snowbros3_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x900000, 0x900001).w(FUNC(snowbros3_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0xa00000, 0xa00001).w(FUNC(snowbros3_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
+}
+
+void snowbros3_state::snowbros3_oki_map(address_map &map)
+{
+ map(0x00000, 0x1ffff).rom().region("oki1", 0);
+ map(0x20000, 0x3ffff).bankr(m_okibank);
}
/* Final Tetris */
-void snowbros_state::finalttr_map(address_map &map)
+void semicom_state::finalttr_map(address_map &map)
{
map(0x000000, 0x0fffff).rom();
- map(0x100000, 0x103fff).ram().share("hyperpac_ram");
- map(0x300001, 0x300001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
+ map(0x100000, 0x103fff).ram().share(m_hyperpac_ram);
+ map(0x300001, 0x300001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
// map(0x400000, 0x400001) ???
map(0x500000, 0x500001).portr("DSW1");
@@ -513,10 +500,10 @@ void snowbros_state::finalttr_map(address_map &map)
map(0x500004, 0x500005).portr("SYSTEM");
map(0x600000, 0x6001ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_LSB_r), FUNC(kaneko_pandora_device::spriteram_LSB_w));
- map(0x800000, 0x800001).w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x900000, 0x900001).w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0xa00000, 0xa00001).w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x700000, 0x701fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_lsb_r), FUNC(kaneko_pandora_device::spriteram_lsb_w));
+ map(0x800000, 0x800001).w(FUNC(semicom_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x900000, 0x900001).w(FUNC(semicom_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0xa00000, 0xa00001).w(FUNC(semicom_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
}
@@ -524,9 +511,9 @@ void snowbros_state::finalttr_map(address_map &map)
// The sequence MEN is sent to the protection device, followed by the code request (4 bytes in all).
// After each byte, a number of NOPs are executed to give the device time to catch up.
// After the 4th byte, the code reads the device to get its response.
-uint16_t snowbros_state::yutnori_prot_r()
+u16 snowbros_pandora_state::yutnori_prot_r()
{
- switch(m_yutnori_prot_val) // the 4th byte
+ switch (m_yutnori_prot_val) // the 4th byte
{
case 0x33: // C3B6
return 0xcc;
@@ -535,22 +522,23 @@ uint16_t snowbros_state::yutnori_prot_r()
case 0xb8: // D820
return 0x74;
}
- logerror("%s: Unhandled protection sequence found: %02X\n", machine().describe_context(), m_yutnori_prot_val);
+ if (!machine().side_effects_disabled())
+ logerror("%s: Unhandled protection sequence found: %02X\n", machine().describe_context(), m_yutnori_prot_val);
return 0;
}
-void snowbros_state::yutnori_prot_w(uint16_t data)
+void snowbros_pandora_state::yutnori_prot_w(u16 data)
{
m_yutnori_prot_val = data;
}
-void snowbros_state::yutnori_map(address_map &map)
+void snowbros_pandora_state::yutnori_map(address_map &map)
{
map(0x000000, 0x03ffff).rom();
// 0x100000 clr.w on startup
- map(0x200000, 0x200001).rw(FUNC(snowbros_state::yutnori_prot_r),FUNC(snowbros_state::yutnori_prot_w)); // protection
+ map(0x200000, 0x200001).rw(FUNC(snowbros_pandora_state::yutnori_prot_r),FUNC(snowbros_pandora_state::yutnori_prot_w)); // protection
map(0x300000, 0x300001).portr("DSW1");
map(0x300002, 0x300003).portr("DSW2");
@@ -558,20 +546,20 @@ void snowbros_state::yutnori_map(address_map &map)
// could be one of the OKIs? but gets value to write from RAM, always seems to be 0?
map(0x30000c, 0x30000d).nopw();
- map(0x30000e, 0x30000f).nopr(); //.r(FUNC(snowbros_state::yutnori_unk_r)); // ??
+ map(0x30000e, 0x30000f).nopr(); //.r(FUNC(snowbros_pandora_state::yutnori_unk_r)); // ??
// map(0x400000, 0x400001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // maybe?
map(0x400000, 0x400001).noprw();
map(0x500000, 0x5001ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x600000, 0x601fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_LSB_r), FUNC(kaneko_pandora_device::spriteram_LSB_w));
+ map(0x600000, 0x601fff).rw(m_pandora, FUNC(kaneko_pandora_device::spriteram_lsb_r), FUNC(kaneko_pandora_device::spriteram_lsb_w));
map(0x700000, 0x70ffff).ram();
- map(0x800000, 0x800001).nopr().w(FUNC(snowbros_state::snowbros_irq4_ack_w)); /* IRQ 4 acknowledge */
- map(0x900000, 0x900001).nopr().w(FUNC(snowbros_state::snowbros_irq3_ack_w)); /* IRQ 3 acknowledge */
- map(0xa00000, 0xa00001).nopr().w(FUNC(snowbros_state::snowbros_irq2_ack_w)); /* IRQ 2 acknowledge */
+ map(0x800000, 0x800001).nopr().w(FUNC(snowbros_pandora_state::irq_ack_w<4>)); /* IRQ 4 acknowledge */
+ map(0x900000, 0x900001).nopr().w(FUNC(snowbros_pandora_state::irq_ack_w<3>)); /* IRQ 3 acknowledge */
+ map(0xa00000, 0xa00001).nopr().w(FUNC(snowbros_pandora_state::irq_ack_w<2>)); /* IRQ 2 acknowledge */
}
static INPUT_PORTS_START( snowbros )
@@ -664,6 +652,15 @@ static INPUT_PORTS_START( snowbroj )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
INPUT_PORTS_END
+static INPUT_PORTS_START( toto )
+ PORT_INCLUDE(snowbros)
+
+ PORT_MODIFY("DSW1")
+ PORT_DIPNAME( 0x01, 0x00, "Show All Rights Reserved (Broken)" ) PORT_DIPLOCATION("SW1:1") // Copyright screen is broken if set
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( No ) )
+INPUT_PORTS_END
+
static INPUT_PORTS_START( ballboy3p )
PORT_INCLUDE(snowbros)
@@ -1906,35 +1903,42 @@ static GFXDECODE_START( gfx_hyperpac_spr )
GFXDECODE_ENTRY( "gfx1", 0, hyperpac_tilelayout, 0, 16 )
GFXDECODE_END
-MACHINE_RESET_MEMBER(snowbros_state,semiprot)
+void snowbros3_state::machine_start()
+{
+ m_okibank->configure_entries(0, 3, memregion("oki1")->base() + 0x20000, 0x20000);
+ m_okibank->set_entry(0);
+
+ save_item(NAME(m_sb3_music_is_playing));
+ save_item(NAME(m_sb3_music));
+}
+
+MACHINE_RESET_MEMBER(semicom_state,semiprot)
{
- uint16_t *PROTDATA = (uint16_t*)memregion("user1")->base();
- int i;
+ u16 const *const PROTDATA = (u16*)memregion("protdata")->base();
- for (i = 0;i < 0x200/2;i++)
- m_hyperpac_ram[0xf000/2 + i] = PROTDATA[i];
+ for (int i = 0; i < 0x200 / 2; i++)
+ m_hyperpac_ram[0xf000 / 2 + i] = PROTDATA[i];
}
-MACHINE_RESET_MEMBER(snowbros_state,finalttr)
+MACHINE_RESET_MEMBER(semicom_state,finalttr)
{
- uint16_t *PROTDATA = (uint16_t*)memregion("user1")->base();
- int i;
+ u16 const *const PROTDATA = (u16*)memregion("protdata")->base();
- for (i = 0;i < 0x200/2;i++)
- m_hyperpac_ram[0x2000/2 + i] = PROTDATA[i];
+ for (int i = 0; i < 0x200 / 2; i++)
+ m_hyperpac_ram[0x2000 / 2 + i] = PROTDATA[i];
}
-void snowbros_state::snowbros(machine_config &config)
+void snowbros_state::snowbros_base(machine_config &config)
{
- /* basic machine hardware */
M68000(config, m_maincpu, XTAL(16'000'000)/2); /* 8 Mhz - confirmed */
- m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::snowbros_map);
- TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
+
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_pandora_state::scanline), "screen", 0, 1);
+
WATCHDOG_TIMER(config, "watchdog");
Z80(config, m_soundcpu, XTAL(12'000'000)/2); /* 6 MHz - confirmed */
- m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_state::sound_map);
- m_soundcpu->set_addrmap(AS_IO, &snowbros_state::sound_io_map);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_pandora_state::sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &snowbros_pandora_state::sound_io_map);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -1942,59 +1946,65 @@ void snowbros_state::snowbros(machine_config &config)
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(32*8, 262);
m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
- m_screen->set_screen_update(FUNC(snowbros_state::screen_update_snowbros));
- m_screen->screen_vblank().set(FUNC(snowbros_state::screen_vblank_snowbros));
m_screen->set_palette(m_palette);
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 256);
- KANEKO_PANDORA(config, m_pandora, 0, m_palette, gfx_snowbros_spr);
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
- GENERIC_LATCH_8(config, m_soundlatch);
- m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
- GENERIC_LATCH_8(config, "soundlatch2");
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(12'000'000)/4)); /* 3 MHz - confirmed */
ymsnd.irq_handler().set_inputline("soundcpu", 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
}
+void snowbros_pandora_state::snowbros(machine_config &config)
+{
+ snowbros_base(config);
+
+ /* basic machine hardware */
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_pandora_state::snowbros_map);
+
+ m_screen->set_screen_update(FUNC(snowbros_pandora_state::screen_update));
+ m_screen->screen_vblank().set(FUNC(snowbros_pandora_state::screen_vblank));
+
+ KANEKO_PANDORA(config, m_pandora, 0, m_palette, gfx_snowbros_spr);
+}
+
void snowbros_state::wintbob(machine_config &config)
{
- snowbros(config);
+ snowbros_base(config);
/* basic machine hardware */
- m_maincpu->set_clock(10000000); /* 10mhz - Confirmed */
+ m_maincpu->set_clock(10000000); /* 10 MHz - Confirmed */
m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::wintbob_map);
- config.device_remove("pandora");
-
/* video hardware */
- GFXDECODE(config, m_gfxdecode, m_palette, gfx_wb);
-
m_screen->set_screen_update(FUNC(snowbros_state::screen_update_wintbob));
- m_screen->screen_vblank().set_nop();
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_wb);
}
-void snowbros_state::semicom(machine_config &config)
+void semicom_state::semicom(machine_config &config)
{
snowbros(config);
/* basic machine hardware */
m_maincpu->set_clock(XTAL(12'000'000)); /* 12MHz - Confirmed */
- m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::hyperpac_map);
+ m_maincpu->set_addrmap(AS_PROGRAM, &semicom_state::hyperpac_map);
m_soundcpu->set_clock(XTAL(16'000'000)/4); /* 4MHz - Confirmed */
- m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_state::hyperpac_sound_map);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &semicom_state::hyperpac_sound_map);
m_soundcpu->set_addrmap(AS_IO, address_map_constructor());
m_pandora->set_gfxinfo(gfx_hyperpac_spr);
- m_soundlatch->data_pending_callback().set_nop();
+ m_soundlatch[0]->data_pending_callback().set_nop();
config.device_remove("soundlatch2");
@@ -2004,26 +2014,26 @@ void snowbros_state::semicom(machine_config &config)
ymsnd.add_route(0, "mono", 0.10);
ymsnd.add_route(1, "mono", 0.10);
- OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* 1MHz & pin 7 High - Confirmed */
- m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* 1MHz & pin 7 High - Confirmed */
+ m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0);
}
-void snowbros_state::semicom_mcu(machine_config &config)
+void semicom_state::semicom_mcu(machine_config &config)
{
semicom(config);
/* basic machine hardware */
at89c52_device &prot(AT89C52(config, "protection", XTAL(16'000'000)));
- prot.port_out_cb<0>().set(FUNC(snowbros_state::prot_p0_w));
- prot.port_out_cb<1>().set(FUNC(snowbros_state::prot_p1_w));
- prot.port_out_cb<2>().set(FUNC(snowbros_state::prot_p2_w));
+ prot.port_out_cb<0>().set(FUNC(semicom_state::prot_p0_w));
+ prot.port_out_cb<1>().set(FUNC(semicom_state::prot_p1_w));
+ prot.port_out_cb<2>().set(FUNC(semicom_state::prot_p2_w));
}
-void snowbros_state::semiprot(machine_config &config)
+void semicom_state::semiprot(machine_config &config)
{
semicom(config);
- MCFG_MACHINE_RESET_OVERRIDE(snowbros_state, semiprot)
+ MCFG_MACHINE_RESET_OVERRIDE(semicom_state, semiprot)
}
@@ -2032,7 +2042,7 @@ void snowbros_state::honeydol(machine_config &config)
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(12'000'000)); /* MC68000P12 @ 12MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::honeydol_map);
- TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::scanline), "screen", 0, 1);
Z80(config, m_soundcpu, XTAL(16'000'000)/4); /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_state::honeydol_sound_map);
@@ -2053,15 +2063,15 @@ void snowbros_state::honeydol(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- GENERIC_LATCH_8(config, m_soundlatch);
- m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(12'000'000)/4)); /* 3Mhz */
ymsnd.irq_handler().set_inputline("soundcpu", 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
- OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* freq? */
- m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* freq? */
+ m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0);
}
void snowbros_state::twinadv(machine_config &config)
@@ -2069,7 +2079,7 @@ void snowbros_state::twinadv(machine_config &config)
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(12'000'000)); /* 12MHz like Honey Doll ? */
m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::twinadv_map);
- TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::scanline), "screen", 0, 1);
WATCHDOG_TIMER(config, "watchdog");
Z80(config, m_soundcpu, XTAL(16'000'000)/4); /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
@@ -2092,14 +2102,14 @@ void snowbros_state::twinadv(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- GENERIC_LATCH_8(config, m_soundlatch);
- m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
- GENERIC_LATCH_8(config, "soundlatch2");
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
/* sound hardware */
- OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* freq? */
- m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* freq? */
+ m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0);
}
@@ -2121,28 +2131,28 @@ Intel P8752 (mcu)
*/
-void snowbros_state::finalttr(machine_config &config)
+void semicom_state::finalttr(machine_config &config)
{
semicom(config);
m_maincpu->set_clock(XTAL(12'000'000));
- m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::finalttr_map);
+ m_maincpu->set_addrmap(AS_PROGRAM, &semicom_state::finalttr_map);
m_soundcpu->set_clock(XTAL(3'579'545));
- MCFG_MACHINE_RESET_OVERRIDE(snowbros_state, finalttr)
+ MCFG_MACHINE_RESET_OVERRIDE(semicom_state, finalttr)
ym2151_device &ymsnd(YM2151(config.replace(), "ymsnd", XTAL(3'579'545))); /* possible but less likely 4MHz (12MHz/3) */
ymsnd.irq_handler().set_inputline(m_soundcpu, 0);
ymsnd.add_route(0, "mono", 0.08);
ymsnd.add_route(1, "mono", 0.08);
- m_oki->set_clock(999900);
- m_oki->reset_routes().add_route(ALL_OUTPUTS, "mono", 0.4);
+ m_oki[0]->set_clock(999900);
+ m_oki[0]->reset_routes().add_route(ALL_OUTPUTS, "mono", 0.4);
}
-void snowbros_state::_4in1(machine_config &config)
+void semicom_state::_4in1(machine_config &config)
{
semicom(config);
@@ -2150,12 +2160,12 @@ void snowbros_state::_4in1(machine_config &config)
m_pandora->set_gfxinfo(gfx_snowbros_spr);
}
-void snowbros_state::snowbro3(machine_config &config) /* PCB has 16MHz & 12MHz OSCs */
+void snowbros3_state::snowbro3(machine_config &config) /* PCB has 16MHz & 12MHz OSCs */
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(12'000'000)); /* MC68000P10 CPU @ 12mhz or 8MHz (16MHz/2) ? */
- m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::snowbros3_map);
- TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros3_irq), "screen", 0, 1);
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros3_state::snowbros3_map);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros3_state::snowbros3_scanline), "screen", 0, 1);
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
@@ -2164,7 +2174,7 @@ void snowbros_state::snowbro3(machine_config &config) /* PCB has 16MHz & 12MHz O
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(32*8, 32*8);
m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
- m_screen->set_screen_update(FUNC(snowbros_state::screen_update_snowbro3));
+ m_screen->set_screen_update(FUNC(snowbros3_state::screen_update_snowbro3));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_sb3);
@@ -2173,16 +2183,17 @@ void snowbros_state::snowbro3(machine_config &config) /* PCB has 16MHz & 12MHz O
/* sound hardware */
SPEAKER(config, "mono").front_center();
- OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
- m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki[0]->set_addrmap(0, &snowbros3_state::snowbros3_oki_map);
+ m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0);
}
-void snowbros_state::yutnori(machine_config &config)
+void snowbros_pandora_state::yutnori(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(16'000'000)/2);
- m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::yutnori_map);
- TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_pandora_state::yutnori_map);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_pandora_state::scanline), "screen", 0, 1);
// WATCHDOG_TIMER(config, "watchdog"); // maybe
@@ -2192,8 +2203,8 @@ void snowbros_state::yutnori(machine_config &config)
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(32*8, 262);
m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
- m_screen->set_screen_update(FUNC(snowbros_state::screen_update_snowbros));
- m_screen->screen_vblank().set(FUNC(snowbros_state::screen_vblank_snowbros));
+ m_screen->set_screen_update(FUNC(snowbros_pandora_state::screen_update));
+ m_screen->screen_vblank().set(FUNC(snowbros_pandora_state::screen_vblank));
m_screen->set_palette(m_palette);
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 256);
@@ -2203,11 +2214,11 @@ void snowbros_state::yutnori(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- okim6295_device &oki1(OKIM6295(config, "oki1", XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
- oki1.add_route(ALL_OUTPUTS, "mono", 1.0);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0);
- okim6295_device &oki2(OKIM6295(config, "oki2", XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
- oki2.add_route(ALL_OUTPUTS, "mono", 1.0);
+ OKIM6295(config, m_oki[1], XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.0);
}
/***************************************************************************
@@ -2221,7 +2232,7 @@ ROM_START( snowbros )
ROM_LOAD16_BYTE( "sn6.bin", 0x00000, 0x20000, CRC(4899ddcf) SHA1(47d750d3022a80e47ffabe47566bb2556cc8d477) )
ROM_LOAD16_BYTE( "sn5.bin", 0x00001, 0x20000, CRC(ad310d3f) SHA1(f39295b38d99087dbb9c5b00bf9cb963337a50e2) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "sbros-4.29", 0x0000, 0x8000, CRC(e6eab4e4) SHA1(d08187d03b21192e188784cb840a37a7bdb5ad32) )
ROM_REGION( 0x80000, "gfx1", 0 )
@@ -2238,7 +2249,7 @@ ROM_START( snowbrosa )
ROM_LOAD16_BYTE( "sbros-3a.5", 0x00000, 0x20000, CRC(10cb37e1) SHA1(786be4640f8df2c81a32decc189ea7657ace00c6) )
ROM_LOAD16_BYTE( "sbros-2a.6", 0x00001, 0x20000, CRC(ab91cc1e) SHA1(8cff61539dc7d35fcbf110d3e54fc1883e7b8509) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "sbros-4.29", 0x0000, 0x8000, CRC(e6eab4e4) SHA1(d08187d03b21192e188784cb840a37a7bdb5ad32) )
ROM_REGION( 0x80000, "gfx1", 0 )
@@ -2250,7 +2261,7 @@ ROM_START( snowbrosb )
ROM_LOAD16_BYTE( "sbros3-a", 0x00000, 0x20000, CRC(301627d6) SHA1(0d1dc70091c87e9c27916d4232ff31b7381a64e1) )
ROM_LOAD16_BYTE( "sbros2-a", 0x00001, 0x20000, CRC(f6689f41) SHA1(e4fd27b930a31479c0d99e0ddd23d5db34044666) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "sbros-4.29", 0x0000, 0x8000, CRC(e6eab4e4) SHA1(d08187d03b21192e188784cb840a37a7bdb5ad32) )
ROM_REGION( 0x80000, "gfx1", 0 )
@@ -2262,7 +2273,7 @@ ROM_START( snowbrosc )
ROM_LOAD16_BYTE( "3-a.ic5", 0x00000, 0x20000, CRC(e1bc346b) SHA1(a20c343d9ed2ad4f785d21076499008edad251f9) )
ROM_LOAD16_BYTE( "2-a.ic6", 0x00001, 0x20000, CRC(1be27f9d) SHA1(76dd14480b9274831e51016f7bb57459d7b15cf9) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "sbros-4.29", 0x0000, 0x8000, CRC(e6eab4e4) SHA1(d08187d03b21192e188784cb840a37a7bdb5ad32) )
ROM_REGION( 0x80000, "gfx1", 0 )
@@ -2274,7 +2285,7 @@ ROM_START( snowbrosd ) /* Korean release, but no specific "For use in Korea only
ROM_LOAD16_BYTE( "sbk_3-a.bin", 0x00000, 0x20000, CRC(97174d40) SHA1(481e8c680af8b03d4bcf97b87ca0ba5a3ffca0d7) )
ROM_LOAD16_BYTE( "sbk_2-a.bin", 0x00001, 0x20000, CRC(80cc80e5) SHA1(1eeca0924c93e9f0536683160e80c59871569088) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "sbros-4.29", 0x0000, 0x8000, CRC(e6eab4e4) SHA1(d08187d03b21192e188784cb840a37a7bdb5ad32) )
ROM_REGION( 0x80000, "gfx1", 0 )
@@ -2286,7 +2297,7 @@ ROM_START( snowbrosj )/* "For use in Japan only..." notice screen */
ROM_LOAD16_BYTE( "snowbros.3", 0x00000, 0x20000, CRC(3f504f9e) SHA1(700758b114c3fde6ea8f84222af0850dba13cd3b) )
ROM_LOAD16_BYTE( "snowbros.2", 0x00001, 0x20000, CRC(854b02bc) SHA1(4ad1548eef94dcb95119cb4a7dcdefa037591b5b) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "sbros-4.29", 0x0000, 0x8000, CRC(e6eab4e4) SHA1(d08187d03b21192e188784cb840a37a7bdb5ad32) )
ROM_REGION( 0x80000, "gfx1", 0 )
@@ -2313,7 +2324,7 @@ ROM_START( wintbob )
ROM_LOAD16_BYTE( "wb02.bin", 0x20001, 0x10000, CRC(fc8e292e) SHA1(857cfeb0be121e64e6117120514ae1f2ffeae4d6) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
- ROM_LOAD( "wb05.bin", 0x0000, 0x10000, CRC(53fe59df) SHA1(a99053e82b9fed76f744fa9f67078294641c6317) )
+ ROM_LOAD( "wb05.bin", 0x00000, 0x10000, CRC(53fe59df) SHA1(a99053e82b9fed76f744fa9f67078294641c6317) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "wb13.bin", 0x00000, 0x10000, CRC(426921de) SHA1(5107c58e7e08d71895baa67fe260b17ebd61389c) )
@@ -2335,7 +2346,7 @@ ROM_START( snowbroswb )
ROM_LOAD16_BYTE( "wb02.bin", 0x20001, 0x10000, CRC(fc8e292e) SHA1(857cfeb0be121e64e6117120514ae1f2ffeae4d6) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
- ROM_LOAD( "wb05.bin", 0x0000, 0x10000, CRC(53fe59df) SHA1(a99053e82b9fed76f744fa9f67078294641c6317) )
+ ROM_LOAD( "wb05.bin", 0x00000, 0x10000, CRC(53fe59df) SHA1(a99053e82b9fed76f744fa9f67078294641c6317) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD16_BYTE( "wb13.bin", 0x00000, 0x10000, CRC(426921de) SHA1(5107c58e7e08d71895baa67fe260b17ebd61389c) )
@@ -2353,8 +2364,8 @@ ROM_START( toto )
ROM_LOAD16_BYTE( "u60.5j", 0x00000, 0x20000, CRC(39203792) SHA1(4c8d560be02a514cbf91774c7a0b4a95cf573356) )
ROM_LOAD16_BYTE( "u51.4j", 0x00001, 0x20000, CRC(7b846cd4) SHA1(04aa0bbaab4303fb08dff52d5515f7e764f1be6d))
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
- ROM_LOAD( "u46.4c", 0x0000, 0x8000, CRC(77b1ef42) SHA1(75e3c8c2b687669cc56f972dd7375dab5185859c) )
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_LOAD( "u46.4c", 0x00000, 0x8000, CRC(77b1ef42) SHA1(75e3c8c2b687669cc56f972dd7375dab5185859c) )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD( "u107.8k", 0x00000, 0x20000, CRC(4486153b) SHA1(a6dc0c17bf2328ab725bce4aaa0a413a42129fb0) )
@@ -2388,7 +2399,7 @@ ROM_START( honeydol )
ROM_LOAD16_BYTE( "d-16.uh12", 0x00001, 0x20000, CRC(cee1a2e3) SHA1(6d1ff5358ec704616b724eea2ab9b60b84709eb1) )
ROM_LOAD16_BYTE( "d-17.ui12", 0x00000, 0x20000, CRC(cac44154) SHA1(2c30dc033001fc9303da7e117e3401bc7af16607) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "d-12.uh15", 0x0000, 0x8000, CRC(386f1b63) SHA1(d719875226cd3d380e2ebec49209590d91b6f07b) )
ROM_REGION( 0x80000, "gfx1", 0 ) // 4 bpp gfx
@@ -2400,7 +2411,7 @@ ROM_START( honeydol )
ROM_LOAD( "d-18.9", 0x100000, 0x80000, CRC(0210507a) SHA1(5b7348bf253b1ae8bfa86cdee2ff80aa2b3faa79) )
ROM_LOAD( "d-19.10", 0x180000, 0x80000, CRC(d27375d5) SHA1(2a39ce9b985e00a290c3ea75be3b1edbc00d39ec) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "d-11.u14", 0x00000, 0x40000, CRC(f3ee4861) SHA1(f24f1f855ae6c96a6d84a4b5e5c196df8f922d0a) )
ROM_END
@@ -2450,7 +2461,7 @@ ROM_START( twinadv )
ROM_LOAD16_BYTE( "13.uh12", 0x00001, 0x20000, CRC(9f70a39b) SHA1(d49823be58b00c4c5a4f6cc4e4371531492aff1e) )
ROM_LOAD16_BYTE( "12.ui12", 0x00000, 0x20000, CRC(d8776495) SHA1(15b93ded80bf9f240faef2d89b6076f33f1f4ece) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "uh15.bin", 0x0000, 0x8000, CRC(3d5acd08) SHA1(c19f686862dfc12d2fa91c2dd3d3b75d9cb410c3) )
ROM_REGION( 0x180000, "gfx1", 0 ) /* 4bpp gfx */
@@ -2458,7 +2469,7 @@ ROM_START( twinadv )
ROM_LOAD( "15.ua5", 0x080000, 0x80000, CRC(79a08b8d) SHA1(034c0a3b9e27ac174092d265b32fb82d6ee45d47) )
ROM_LOAD( "14.ua6", 0x100000, 0x80000, CRC(79faee0b) SHA1(7421a5fa038d01658ba5ac1f65ea87b97ac25c36) )
- ROM_REGION( 0x080000, "oki", 0 ) /* Samples - both banks are almost the same */
+ ROM_REGION( 0x080000, "oki1", 0 ) /* Samples - both banks are almost the same */
/* todo, check bank ordering .. */
ROM_LOAD( "sra.bin", 0x00000, 0x40000, CRC(82f452c4) SHA1(95ad6ede87ceafb045ed7df40496baf96190b97f) ) // bank 1
ROM_LOAD( "srb.bin", 0x40000, 0x40000, CRC(109e51e6) SHA1(3344c68d63bbad4a02b47143b2d2f72ce9bcb4bb) ) // bank 2
@@ -2469,7 +2480,7 @@ ROM_START( twinadvk )
ROM_LOAD16_BYTE( "uh12", 0x00001, 0x20000, CRC(e0bcc738) SHA1(7fc6a793fcdd80122c0ac6409ae4cac5597b7b5a) )
ROM_LOAD16_BYTE( "ui12", 0x00000, 0x20000, CRC(a3ee6451) SHA1(9c0b415a2f325513739f2047780c2a56df350aa5) )
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "uh15.bin", 0x0000, 0x8000, CRC(3d5acd08) SHA1(c19f686862dfc12d2fa91c2dd3d3b75d9cb410c3) )
ROM_REGION( 0x180000, "gfx1", 0 ) /* 4bpp gfx */
@@ -2477,7 +2488,7 @@ ROM_START( twinadvk )
ROM_LOAD( "ua5", 0x080000, 0x80000, CRC(f83b3b97) SHA1(2e967d49ef411d164a0b6cf32444f60fcd8068a9) )
ROM_LOAD( "ua6", 0x100000, 0x80000, CRC(4dfcffb9) SHA1(c157e031acbb321b9435389f9fc4e1ffebca106d) )
- ROM_REGION( 0x080000, "oki", 0 ) /* Samples - both banks are almost the same */
+ ROM_REGION( 0x080000, "oki1", 0 ) /* Samples - both banks are almost the same */
/* todo, check bank ordering .. */
ROM_LOAD( "sra.bin", 0x00000, 0x40000, CRC(82f452c4) SHA1(95ad6ede87ceafb045ed7df40496baf96190b97f) ) // bank 1
ROM_LOAD( "srb.bin", 0x40000, 0x40000, CRC(109e51e6) SHA1(3344c68d63bbad4a02b47143b2d2f72ce9bcb4bb) ) // bank 2
@@ -2488,7 +2499,7 @@ ROM_START( multi96 )
ROM_LOAD16_BYTE( "uh12", 0x00001, 0x20000, CRC(e912ea4e) SHA1(cf0b37d6b6fbdd311ef7b404c4ba2c6a7e1f8486) ) // sldh
ROM_LOAD16_BYTE( "ui12", 0x00000, 0x20000, CRC(ac99e837) SHA1(20bc1599f78a4eac65cae54350872fa292daa807) ) // sldh
- ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */
+ ROM_REGION( 0x8000, "soundcpu", 0 ) /* 64k for z80 sound code */
ROM_LOAD( "uh15.bin", 0x0000, 0x8000, CRC(3d5acd08) SHA1(c19f686862dfc12d2fa91c2dd3d3b75d9cb410c3) )
ROM_REGION( 0x180000, "gfx1", 0 ) /* 4bpp gfx */
@@ -2496,7 +2507,7 @@ ROM_START( multi96 )
ROM_LOAD( "ua5", 0x080000, 0x80000, CRC(0bd9f6bb) SHA1(400ddff7a76860caacfe8bfd803f9ccd2dba3356) ) // sldh
ROM_LOAD( "ua6", 0x100000, 0x80000, CRC(0e90b26c) SHA1(fd9b40988d03db8ed797abf859a8828bb65db8d5) ) // sldh
- ROM_REGION( 0x080000, "oki", 0 ) /* Samples - both banks are almost the same */
+ ROM_REGION( 0x080000, "oki1", 0 ) /* Samples - both banks are almost the same */
/* todo, check bank ordering .. */
ROM_LOAD( "sra.bin", 0x00000, 0x40000, CRC(82f452c4) SHA1(95ad6ede87ceafb045ed7df40496baf96190b97f) ) // bank 1
ROM_LOAD( "srb.bin", 0x40000, 0x40000, CRC(109e51e6) SHA1(3344c68d63bbad4a02b47143b2d2f72ce9bcb4bb) ) // bank 2
@@ -2510,12 +2521,12 @@ ROM_START( hyperpac )
ROM_LOAD16_BYTE( "hyperpac.i12", 0x00000, 0x20000, CRC(9c7d85b8) SHA1(432d5fbe8bef875ce4a9aeb74a7b57dc79c709fd) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "hyperpac.u1", 0x00000, 0x10000 , CRC(03faf88e) SHA1(a8da883d4b765b809452bbffca37ff224edbe86d) )
+ ROM_LOAD( "hyperpac.u1", 0x00000, 0x10000, CRC(03faf88e) SHA1(a8da883d4b765b809452bbffca37ff224edbe86d) )
ROM_REGION( 0x2000, "protection", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "at89c52.bin", 0x0000, 0x2000 , CRC(291f9326) SHA1(e440ce7d92188faa86e02e7f9db4ec6bce21efd3) ) /* decapped */
+ ROM_LOAD( "at89c52.bin", 0x0000, 0x2000, CRC(291f9326) SHA1(e440ce7d92188faa86e02e7f9db4ec6bce21efd3) ) /* decapped */
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "hyperpac.j15", 0x00000, 0x40000, CRC(fb9f468d) SHA1(52857b1a04c64ac853340ebb8e92d98eabea8bc1) )
ROM_REGION( 0x0c0000, "gfx1", 0 ) /* Sprites */
@@ -2530,9 +2541,9 @@ ROM_START( hyperpacb )
ROM_LOAD16_BYTE( "hpacui12.bin", 0x00000, 0x20000, CRC(23dc00d1) SHA1(8d4d00f450b94912adcbb24073f9b3b01eab0450) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "hyperpac.u1", 0x00000, 0x10000 , CRC(03faf88e) SHA1(a8da883d4b765b809452bbffca37ff224edbe86d) ) // was missing from this set, using the one from the original
+ ROM_LOAD( "hyperpac.u1", 0x00000, 0x10000, CRC(03faf88e) SHA1(a8da883d4b765b809452bbffca37ff224edbe86d) ) // was missing from this set, using the one from the original
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "hyperpac.j15", 0x00000, 0x40000, CRC(fb9f468d) SHA1(52857b1a04c64ac853340ebb8e92d98eabea8bc1) )
ROM_REGION( 0x0c0000, "gfx1", 0 ) /* Sprites */
@@ -2547,17 +2558,17 @@ ROM_START( twinkle )
ROM_LOAD16_BYTE( "ui12.bin", 0x00000, 0x20000, CRC(5af73684) SHA1(9be43e5c71152d515366e422eb077a41dbb3fe62) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u1.bin", 0x00000, 0x10000 , CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
+ ROM_LOAD( "u1.bin", 0x00000, 0x10000, CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(00d3e4b4) SHA1(afa359a8b48605ff034133bad2a0a182429dec71) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "uj15.bin", 0x00000, 0x40000, CRC(0a534b37) SHA1(b7d780eb4668f1f757a60884c022f5bbc424dc97) )
ROM_REGION( 0x080000, "gfx1", 0 ) /* Sprites */
@@ -2570,16 +2581,16 @@ ROM_START( twinklea )
ROM_LOAD16_BYTE( "ui12.bin", 0x00000, 0x20000, CRC(79420382) SHA1(13183d819f5b7699e8e0974c193796151a0a9617) ) // sldh
ROM_REGION( 0x10000, "soundcpu", 0 )
- ROM_LOAD( "u1.bin", 0x00000, 0x10000 , CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
+ ROM_LOAD( "u1.bin", 0x00000, 0x10000, CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
- ROM_REGION( 0x10000, "cpu2", 0 ) // Intel 87C52 MCU Code
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP ) // needs decapping
+ ROM_REGION( 0x10000, "mcu", 0 ) // Intel 87C52 MCU Code
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP ) // needs decapping
- ROM_REGION16_BE( 0x200, "user1", 0 ) // Data from Shared RAM
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) // Data from Shared RAM
// this is not a real rom but instead the data extracted from shared ram, the MCU puts it there
ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, BAD_DUMP CRC(00d3e4b4) SHA1(afa359a8b48605ff034133bad2a0a182429dec71) ) // this has been extracted for the parent set, seems to work for this set, too
- ROM_REGION( 0x040000, "oki", 0 )
+ ROM_REGION( 0x040000, "oki1", 0 )
ROM_LOAD( "uj15.bin", 0x00000, 0x40000, CRC(0a534b37) SHA1(b7d780eb4668f1f757a60884c022f5bbc424dc97) )
ROM_REGION( 0x080000, "gfx1", 0 ) // Sprites
@@ -2592,17 +2603,17 @@ ROM_START( pzlbreak )
ROM_LOAD16_BYTE( "5.ui12", 0x00000, 0x20000, CRC(13c298a0) SHA1(9455de7ea45c9a61ed6105023eb909c086c44007) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "0.u1", 0x00000, 0x10000 , CRC(1ad646b7) SHA1(0132baa097e48df2450afdcd316375dc546ea4d0) )
+ ROM_LOAD( "0.u1", 0x00000, 0x10000, CRC(1ad646b7) SHA1(0132baa097e48df2450afdcd316375dc546ea4d0) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", ROMREGION_ERASEFF ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", ROMREGION_ERASEFF ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(092cb794) SHA1(eb2b336d97b440453ca37ee7605654b35dfb6bad) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "1.uj15", 0x00000, 0x40000, CRC(dbfae77c) SHA1(cc509d52cd9c608fc80df799890e62e7b4c143c6) )
ROM_REGION( 0x100000, "gfx1", 0 ) /* Sprites */
@@ -2616,16 +2627,16 @@ ROM_START( pzlbreaka )
ROM_LOAD16_BYTE( "ui12", 0x00000, 0x20000, CRC(2f66c4ce) SHA1(4349f093ce1267c2ebcbf1233082661604f10851) )
ROM_REGION( 0x10000, "soundcpu", 0 )
- ROM_LOAD( "u1", 0x00000, 0x10000 , CRC(1ad646b7) SHA1(0132baa097e48df2450afdcd316375dc546ea4d0) )
+ ROM_LOAD( "u1", 0x00000, 0x10000, CRC(1ad646b7) SHA1(0132baa097e48df2450afdcd316375dc546ea4d0) )
- ROM_REGION( 0x10000, "cpu2", 0 ) // Intel 87C52 MCU Code
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) // Intel 87C52 MCU Code
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", ROMREGION_ERASEFF ) // Data from Shared RAM
+ ROM_REGION16_BE( 0x200, "protdata", ROMREGION_ERASEFF ) // Data from Shared RAM
// this is not a real rom but instead the data extracted from shared ram, the MCU puts it there
ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, BAD_DUMP CRC(092cb794) SHA1(eb2b336d97b440453ca37ee7605654b35dfb6bad) ) // extracted from the parent set, so marked as bad
- ROM_REGION( 0x040000, "oki", 0 )
+ ROM_REGION( 0x040000, "oki1", 0 )
ROM_LOAD( "uj15", 0x00000, 0x20000, CRC(5cdffcc5) SHA1(793a20bd0480cfea0dbf9397797428f6d105f724) ) // 1xxxxxxxxxxxxxxxx = 0xFF and half sized compared to the parent
ROM_REGION( 0x100000, "gfx1", 0 )
@@ -2640,18 +2651,18 @@ ROM_START( toppyrap )
ROM_LOAD16_BYTE( "ui12.bin", 0x00000, 0x40000, CRC(caf5a7e1) SHA1(b521b2f06a804a52dad1b07657db2a29e1411844) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u1.bin", 0x00000, 0x10000 , CRC(07f50947) SHA1(83740655ab5f677bd009191bb0de60e237aaa11c) )
+ ROM_LOAD( "u1.bin", 0x00000, 0x10000, CRC(07f50947) SHA1(83740655ab5f677bd009191bb0de60e237aaa11c) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this contains the code for 2 of the IRQ functions, but the game only uses one of them, the other is
executed from ROM. The version in ROM is slightly patched version so maybe there is an earlier revision
which uses the code provided by the MCU instead */
ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(0704e6c7) SHA1(22387257db569990378c304af9677e6dc1436207) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "uj15.bin", 0x00000, 0x20000, CRC(a3bacfd7) SHA1(d015d8bd26d0189fc13d09fefcb9b8baaaacec8a) )
ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */
@@ -2661,23 +2672,24 @@ ROM_START( toppyrap )
ROM_LOAD( "ua7.bin", 0x180000, 0x80000, CRC(663dd099) SHA1(84b52af54ac49e8b4bae23995e3cf94494be2bb3) )
ROM_END
+// 퍼즐 특급 모아모아/Puzzle Express More More
ROM_START( moremore )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "u52.bin", 0x00001, 0x40000, CRC(cea4b246) SHA1(5febcb5dda6581caccfe9079b28c2366dfc1db2b) )
ROM_LOAD16_BYTE( "u74.bin", 0x00000, 0x40000, CRC(2acdcb88) SHA1(74d661d07752bbccab7eab151209a414e9bf7675) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u35.bin", 0x00000, 0x10000 , CRC(92dc95fc) SHA1(f04e63cc680835458246989532faf5657e28db13) )
+ ROM_LOAD( "u35.bin", 0x00000, 0x10000, CRC(92dc95fc) SHA1(f04e63cc680835458246989532faf5657e28db13) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
- ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(782dd2aa) SHA1(2587734271e0c85cb76bcdee171366c4e6fc9f81) )
+ ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(782dd2aa) SHA1(2587734271e0c85cb76bcdee171366c4e6fc9f81) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "u14.bin", 0x00000, 0x40000, CRC(90580088) SHA1(c64de2c0db95ab4ce06fc0a29c0cc8b7f3deeb28) )
ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */
@@ -2693,17 +2705,17 @@ ROM_START( moremorp )
ROM_LOAD16_BYTE( "mmp_u74.bin", 0x00000, 0x40000, CRC(7c6fede5) SHA1(41bc539a6efe9eb2304243701857b972d2170bcf) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "mmp_u35.bin", 0x00000, 0x10000 , CRC(4d098cad) SHA1(a79d417e7525a25dd6697da9f3d1de269e759d2e) )
+ ROM_LOAD( "mmp_u35.bin", 0x00000, 0x10000, CRC(4d098cad) SHA1(a79d417e7525a25dd6697da9f3d1de269e759d2e) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
- ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(782dd2aa) SHA1(2587734271e0c85cb76bcdee171366c4e6fc9f81) )
+ ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(782dd2aa) SHA1(2587734271e0c85cb76bcdee171366c4e6fc9f81) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "mmp_u14.bin", 0x00000, 0x40000, CRC(211a2566) SHA1(48138547822a8e76c101dd4189d581f80eee1e24) )
ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */
@@ -2719,17 +2731,17 @@ ROM_START( 3in1semi ) /* SemiCom Ser-4331-4 PCB */
ROM_LOAD16_BYTE( "u74", 0x00000, 0x40000, CRC(266862c4) SHA1(2c5c513fee99bdb6e0ae3e0e644e516bdaddd629) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u35", 0x00000, 0x10000 , CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
+ ROM_LOAD( "u35", 0x00000, 0x10000, CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
- ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(85deba7c) SHA1(44c6d9306b4f8e47182f4740a18971c49a8df8db) )
+ ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(85deba7c) SHA1(44c6d9306b4f8e47182f4740a18971c49a8df8db) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "u14", 0x00000, 0x40000, CRC(c83c11be) SHA1(c05d96d61e5b8245232c85cbbcb7cc1e4e066492) )
ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */
@@ -2745,17 +2757,17 @@ ROM_START( 3in1semia ) // SemiCom Ser-4331-4 PCB
ROM_LOAD16_BYTE( "u74.bin", 0x00000, 0x40000, CRC(555ae716) SHA1(9a3d7d81d7c6fb8443d263087bb7dca7bc3918b6) )
ROM_REGION( 0x10000, "soundcpu", 0 ) // Z80 Code
- ROM_LOAD( "u35.bin", 0x00000, 0x10000 , CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
+ ROM_LOAD( "u35.bin", 0x00000, 0x10000, CRC(e40481da) SHA1(1c1fabcb67693235eaa6ff59ae12a35854b5564a) )
- ROM_REGION( 0x10000, "cpu2", 0 ) // Intel 87C52 MCU Code
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) // Intel 87C52 MCU Code
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) // Data from Shared RAM
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) // Data from Shared RAM
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
- ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(85deba7c) SHA1(44c6d9306b4f8e47182f4740a18971c49a8df8db) )
+ ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(85deba7c) SHA1(44c6d9306b4f8e47182f4740a18971c49a8df8db) )
- ROM_REGION( 0x040000, "oki", 0 ) // Samples
+ ROM_REGION( 0x040000, "oki1", 0 ) // Samples
ROM_LOAD( "u14.bin", 0x00000, 0x40000, CRC(c83c11be) SHA1(c05d96d61e5b8245232c85cbbcb7cc1e4e066492) )
ROM_REGION( 0x200000, "gfx1", 0 ) // Sprites
@@ -2767,7 +2779,7 @@ ROM_END
/*
-Ma Cheon Ru
+마천루/Ma Cheon Ru
SemiCom (c) 1999
PCB: Ser-4331-4
@@ -2790,17 +2802,17 @@ ROM_START( mcheonru ) /* SemiCom Ser-4331-4 PCB */
ROM_LOAD16_BYTE( "u74", 0x00000, 0x40000, CRC(3edb17ce) SHA1(0c6ea239f57eca114d75c173b77b2c8ef43d63a2) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u35", 0x00000, 0x10000 , CRC(79e965b4) SHA1(268df67ec6ea828ae01a6e4d2da9ad2a08a837f1) )
+ ROM_LOAD( "u35", 0x00000, 0x10000, CRC(79e965b4) SHA1(268df67ec6ea828ae01a6e4d2da9ad2a08a837f1) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
- ROM_LOAD( "protdata.bin", 0x00000, 0x200 , CRC(d61f4f07) SHA1(29485bce6e3a7ed2ace540bb81fe028456ae1ae9) )
+ ROM_LOAD( "protdata.bin", 0x00000, 0x200, CRC(d61f4f07) SHA1(29485bce6e3a7ed2ace540bb81fe028456ae1ae9) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "u14", 0x00000, 0x40000, CRC(28a62d23) SHA1(24dbe6229647032599e02225de57650205dce5c3) )
ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */
@@ -2827,12 +2839,12 @@ ROM_START( cookbib2 )
ROM_LOAD16_BYTE( "unico_01.ui12", 0x00000, 0x40000, CRC(65aafde2) SHA1(01f9f261527c35182f0445d641d987aa86ad750f) ) // 27C020
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "unico_07.u1", 0x00000, 0x10000 , CRC(f59f1c9a) SHA1(2830261fd55249e015514fcb4cf8392e83b7fd0d) ) // 27C512
+ ROM_LOAD( "unico_07.u1", 0x00000, 0x10000, CRC(f59f1c9a) SHA1(2830261fd55249e015514fcb4cf8392e83b7fd0d) ) // 27C512
ROM_REGION( 0x2000, "protection", 0 ) /* P87C52EBPN (XSC6407A) Code (8052) */
- ROM_LOAD( "p87c52ebpn.bin", 0x0000, 0x2000 , CRC(ef042cef) SHA1(3089d5a3cb5ed663a8d89d59e427a06cffcd6219) ) /* dumped via laser glitching */
+ ROM_LOAD( "p87c52ebpn.bin", 0x0000, 0x2000, CRC(ef042cef) SHA1(3089d5a3cb5ed663a8d89d59e427a06cffcd6219) ) /* dumped via laser glitching */
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "unico_06.uj15", 0x00000, 0x20000, CRC(5e6f76b8) SHA1(725800143dfeaa6093ed5fcc5b9f15678ae9e547) ) // 27C010
ROM_REGION( 0x140000, "gfx1", 0 ) /* Sprites */
@@ -2848,12 +2860,12 @@ ROM_START( cookbib2a )
ROM_LOAD16_BYTE( "unico.ui12", 0x00000, 0x40000, CRC(0d09ecf5) SHA1(16f787638041d38ee2567ca958ca4405324cf5fa) ) // both program ROMs are 27C020
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "unico_07.u1", 0x00000, 0x10000 , CRC(f59f1c9a) SHA1(2830261fd55249e015514fcb4cf8392e83b7fd0d) ) // 27C512
+ ROM_LOAD( "unico_07.u1", 0x00000, 0x10000, CRC(f59f1c9a) SHA1(2830261fd55249e015514fcb4cf8392e83b7fd0d) ) // 27C512
ROM_REGION( 0x2000, "protection", 0 ) /* P87C52EBPN (XSC6407A) Code (8052) */
- ROM_LOAD( "p87c52ebpn.bin", 0x0000, 0x2000 , CRC(ef042cef) SHA1(3089d5a3cb5ed663a8d89d59e427a06cffcd6219) ) /* dumped via laser glitching */
+ ROM_LOAD( "p87c52ebpn.bin", 0x0000, 0x2000, CRC(ef042cef) SHA1(3089d5a3cb5ed663a8d89d59e427a06cffcd6219) ) /* dumped via laser glitching */
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "unico_06.uj15", 0x00000, 0x20000, CRC(5e6f76b8) SHA1(725800143dfeaa6093ed5fcc5b9f15678ae9e547) ) // 27C010
ROM_REGION( 0x140000, "gfx1", 0 ) /* Sprites */
@@ -2869,19 +2881,19 @@ ROM_START( cookbib2b )
ROM_LOAD16_BYTE( "ui12.020", 0x00000, 0x40000, CRC(bdbcd0d1) SHA1(9a6a85a492c21f6dd5daef964071a8a1c62f73c8) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u1.512", 0x00000, 0x10000 , CRC(f59f1c9a) SHA1(2830261fd55249e015514fcb4cf8392e83b7fd0d) )
+ ROM_LOAD( "u1.512", 0x00000, 0x10000, CRC(f59f1c9a) SHA1(2830261fd55249e015514fcb4cf8392e83b7fd0d) )
ROM_REGION( 0x2000, "protection", 0 ) /* P87C52EBPN (XSC6407A) Code (8052) */
- ROM_LOAD( "87c52.mcu", 0x0000, 0x2000 , NO_DUMP ) /* not dumped yet */
+ ROM_LOAD( "87c52.mcu", 0x0000, 0x2000, NO_DUMP ) /* not dumped yet */
- ROM_REGION( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there
this one is hacked from the cookbib2 one, absolute code jump needed to be changed at least */
ROM_LOAD16_WORD_SWAP( "protdata_alt.bin", 0x000, 0x200, BAD_DUMP CRC(bc136ead) SHA1(96459c2ccf7f95880421ba082c2414fa1040f3ed) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "uj15.010", 0x00000, 0x20000, CRC(5e6f76b8) SHA1(725800143dfeaa6093ed5fcc5b9f15678ae9e547) )
ROM_REGION( 0x180000, "gfx1", 0 ) /* Sprites */
@@ -2898,19 +2910,19 @@ ROM_START( cookbib2c ) // no ROM matches any of the other sets
ROM_LOAD16_BYTE( "unico.ui12", 0x00000, 0x40000, CRC(ed49a0e5) SHA1(fbb6c45559d82ec84253aac5e4e6ff0a8c4d04e0) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "unico.u1", 0x00000, 0x10000 , CRC(f1100b20) SHA1(92c78e028e9020743b68744a759a11638cf2c971) )
+ ROM_LOAD( "unico.u1", 0x00000, 0x10000, CRC(f1100b20) SHA1(92c78e028e9020743b68744a759a11638cf2c971) )
ROM_REGION( 0x2000, "protection", 0 ) /* P87C52EBPN (XSC6407A) Code (8052) */
- ROM_LOAD( "87c52.mcu", 0x0000, 0x2000 , NO_DUMP ) /* not dumped yet */
+ ROM_LOAD( "87c52.mcu", 0x0000, 0x2000, NO_DUMP ) /* not dumped yet */
- ROM_REGION( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there
this one is hacked from the old cookbib2 one, absolute code jump needed to be changed at least */
ROM_LOAD16_WORD_SWAP( "protdata.bin", 0x000, 0x200, BAD_DUMP CRC(b956f056) SHA1(aa9a73e8546b027ae8ef30b03524d302d07cae92) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "unico.uj15", 0x00000, 0x20000, CRC(ae5cc9e5) SHA1(f001c00fea76795ad2d7f4f0e436abecbc7ff00d) )
ROM_REGION( 0x140000, "gfx1", 0 ) /* Sprites */
@@ -2925,21 +2937,21 @@ ROM_START( cookbib3 )
ROM_LOAD16_BYTE( "u74.bin", 0x00000, 0x40000, CRC(c4ab8435) SHA1(7f97d3deafb3eb5412a44308ef20d3317405e94c) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u35.bin", 0x0c000, 0x4000 , CRC(5dfd2a98) SHA1(193c0cd9272144c25cbc3660967424d34d0da185) ) /* bit strange but verified, not the first time SemiCom have done this, see bcstory.. */
+ ROM_LOAD( "u35.bin", 0x0c000, 0x4000, CRC(5dfd2a98) SHA1(193c0cd9272144c25cbc3660967424d34d0da185) ) /* bit strange but verified, not the first time SemiCom have done this, see bcstory.. */
ROM_CONTINUE(0x8000,0x4000)
ROM_CONTINUE(0x4000,0x4000)
ROM_CONTINUE(0x0000,0x4000)
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
- ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200 , CRC(c819b9a8) SHA1(1d425e8c9940c0e691149e5406dd71808bd73832) )
+ ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(c819b9a8) SHA1(1d425e8c9940c0e691149e5406dd71808bd73832) )
/* the 'empty' pattern continued after 0x200 but the game doesn't use it or attempt to decrypt it */
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "u14.bin", 0x00000, 0x20000, CRC(e5bf9288) SHA1(12fb9542f9105fe1a21a74a08cda4d6372b984ee) )
ROM_REGION( 0x180000, "gfx1", 0 ) /* Sprites */
@@ -2954,9 +2966,9 @@ ROM_START( 4in1boot ) /* snow bros, tetris, hyperman 1, pacman 2 */
ROM_LOAD16_BYTE( "u74", 0x00000, 0x80000, CRC(e22d3fa2) SHA1(020ab92d8cbf37a9f8186a81934abb97088c16f9) )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "u35", 0x00000, 0x10000 , CRC(c894ac80) SHA1(ee896675b5205ab2dbd0cbb13db16aa145391d06) )
+ ROM_LOAD( "u35", 0x00000, 0x10000, CRC(c894ac80) SHA1(ee896675b5205ab2dbd0cbb13db16aa145391d06) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "u14", 0x00000, 0x40000, CRC(94b09b0e) SHA1(414de3e36eff85126038e8ff74145b35076e0a43) )
ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */
@@ -2969,8 +2981,8 @@ ROM_START( snowbro3 )
ROM_LOAD16_BYTE( "ur3", 0x00001, 0x20000, CRC(3f32fa15) SHA1(1402c173c1df142ff9dd7b859689c075813a50e5) )
/* the sound is driven by an MCU */
- ROM_REGION( 0x10000, "cpu2", 0 )
- ROM_LOAD( "sound.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 )
+ ROM_LOAD( "sound.mcu", 0x00000, 0x10000, NO_DUMP )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD( "ua5", 0x000000, 0x80000, CRC(0604e385) SHA1(96acbc65a8db89a7be100f852dc07ba9a0313167) ) /* 16x16 tiles */
@@ -2979,9 +2991,8 @@ ROM_START( snowbro3 )
ROM_LOAD( "un7", 0x000000, 0x200000, CRC(4a79da4c) SHA1(59207d116d39b9ee25c51affe520f5fdff34e536) )
ROM_LOAD( "un8", 0x200000, 0x200000, CRC(7a4561a4) SHA1(1dd823369c09368d1f0ec8e1cb85d700f10ff448) )
- ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */
- ROM_LOAD( "us5", 0x00000, 0x20000, CRC(7c6368ef) SHA1(53393c570c605f7582b61c630980041e2ed32e2d) )
- ROM_CONTINUE(0x80000,0x60000)
+ ROM_REGION( 0x80000, "oki1", 0 ) /* OKIM6295 samples */
+ ROM_LOAD( "us5", 0x00000, 0x80000, CRC(7c6368ef) SHA1(53393c570c605f7582b61c630980041e2ed32e2d) )
ROM_END
ROM_START( ballboy )
@@ -2990,8 +3001,8 @@ ROM_START( ballboy )
ROM_LOAD16_BYTE( "27c010.ur3", 0x00001, 0x20000, CRC(a9c1fdda) SHA1(efb7eaab993f99d89d3b9c159c3b8eb18ace9c2c) )
/* the sound is driven by an MCU */
- ROM_REGION( 0x10000, "cpu2", 0 )
- ROM_LOAD( "sound.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 )
+ ROM_LOAD( "sound.mcu", 0x00000, 0x10000, NO_DUMP )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD( "27c040.ua5", 0x000000, 0x80000, CRC(0604e385) SHA1(96acbc65a8db89a7be100f852dc07ba9a0313167) ) /* 16x16 tiles */
@@ -3000,9 +3011,8 @@ ROM_START( ballboy )
ROM_LOAD( "27c160.un7", 0x000000, 0x200000, CRC(4a79da4c) SHA1(59207d116d39b9ee25c51affe520f5fdff34e536) )
ROM_LOAD( "27c160.un8", 0x200000, 0x200000, CRC(bfef8c44) SHA1(86930cfcaedbd111d5b985e87a76d2211d2ce2ec) )
- ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */
- ROM_LOAD( "27c040.us5", 0x00000, 0x20000, CRC(7c6368ef) SHA1(53393c570c605f7582b61c630980041e2ed32e2d) )
- ROM_CONTINUE(0x80000,0x60000)
+ ROM_REGION( 0x80000, "oki1", 0 ) /* OKIM6295 samples */
+ ROM_LOAD( "27c040.us5", 0x00000, 0x80000, CRC(7c6368ef) SHA1(53393c570c605f7582b61c630980041e2ed32e2d) )
ROM_END
@@ -3012,8 +3022,8 @@ ROM_START( ballboy3p ) //PCB etched JOYCUS1B and 2001927
ROM_LOAD16_BYTE( "ur3", 0x00001, 0x20000, CRC(4d462a75) SHA1(30a84a618bea5c64201329d02847382c2d0c84ba) )
// the sound is driven by an MCU
- ROM_REGION( 0x10000, "cpu2", 0 )
- ROM_LOAD( "sound.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 )
+ ROM_LOAD( "sound.mcu", 0x00000, 0x10000, NO_DUMP )
ROM_REGION( 0x80000, "gfx1", 0 )
ROM_LOAD( "ua5", 0x000000, 0x80000, CRC(fc72011f) SHA1(f1f10b34fd3365c6542299bd0224dad926d650b4) ) // 16x16 tiles
@@ -3021,9 +3031,8 @@ ROM_START( ballboy3p ) //PCB etched JOYCUS1B and 2001927
ROM_REGION( 0x400000, "gfx2", 0 ) // 16x16 BG Tiles
ROM_LOAD( "un7", 0x000000, 0x400000, CRC(fe427e9d) SHA1(6932ad18b6807af860f8430e2a00e959d6c36a23) )
- ROM_REGION( 0x100000, "oki", 0 ) // OKIM6295 samples
- ROM_LOAD( "us5", 0x00000, 0x20000, CRC(7c6368ef) SHA1(53393c570c605f7582b61c630980041e2ed32e2d) ) // only ROM identical to the 2 player version
- ROM_CONTINUE(0x80000,0x60000)
+ ROM_REGION( 0x80000, "oki1", 0 ) // OKIM6295 samples
+ ROM_LOAD( "us5", 0x00000, 0x80000, CRC(7c6368ef) SHA1(53393c570c605f7582b61c630980041e2ed32e2d) ) // only ROM identical to the 2 player version
ROM_END
@@ -3045,18 +3054,18 @@ ROM_START( finalttr ) // also seen on a PCB with half sized GFX ROMs
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
ROM_LOAD( "12.5r", 0x00000, 0x10000, CRC(4bc21361) SHA1(dab9bea665c0f2fd7cee8ab7f3762e427911bcca) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real rom but instead the data extracted from
shared ram, the MCU puts it there */
- ROM_LOAD16_WORD_SWAP( "protdata.bin", 0x00000, 0x200 , CRC(d5bbb006) SHA1(2f9ce6c4f4f5a304a807134da9c85c68a7b49200) )
+ ROM_LOAD16_WORD_SWAP( "protdata.bin", 0x00000, 0x200, CRC(d5bbb006) SHA1(2f9ce6c4f4f5a304a807134da9c85c68a7b49200) )
/* after 0xc7 the data read seems meaningless garbage, it doesn't appear to
stop at 0x102200, might be worth going back and checking if its simply random
values due to ram not being cleared, or actual data */
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "11.7p", 0x00000, 0x20000, CRC(2e331022) SHA1(1e74c66d16eb9c8ae04acecbb4040dea037492cc) )
ROM_REGION( 0x100000, "gfx1", 0 ) /* Sprites */
@@ -3067,23 +3076,22 @@ ROM_START( finalttr ) // also seen on a PCB with half sized GFX ROMs
ROM_END
-
+// 수호성
ROM_START( suhosong )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "su_ho_sung.uh12", 0x00001, 0x20000, CRC(6bd8bd08) SHA1(668398c9c77cc4cc52858daefd3cb13fbaf29a37) )
ROM_LOAD16_BYTE( "su_ho_sung.ui12", 0x00000, 0x20000, CRC(79a4806e) SHA1(a4080ea70fa588ada384ffa9877f5cf965fb68df) )
-
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
- ROM_LOAD( "su_ho_sung.u1", 0x00000, 0x10000 , CRC(509ce74e) SHA1(a93add5ab674671078b55128281dcf9b0db46617) )
+ ROM_LOAD( "su_ho_sung.u1", 0x00000, 0x10000, CRC(509ce74e) SHA1(a93add5ab674671078b55128281dcf9b0db46617) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", ROMREGION_ERASE00 ) /* Data from Shared RAM */
- ROM_LOAD16_WORD( "protdata.bin", 0x000, 0x200 , CRC(4478e251) SHA1(08489d6bfe5503c8eb62909e56a07193a922b4c1) )
+ ROM_REGION16_BE( 0x200, "protdata", ROMREGION_ERASE00 ) /* Data from Shared RAM */
+ ROM_LOAD16_WORD( "protdata.bin", 0x000, 0x200, CRC(4478e251) SHA1(08489d6bfe5503c8eb62909e56a07193a922b4c1) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "su_ho_sung.uj15", 0x00000, 0x40000, CRC(266fcae8) SHA1(0f15f880bde0c12b5c663ed387f9353c13b731b6) )
ROM_REGION( 0x180000, "gfx1", 0 ) /* Sprites */
@@ -3092,7 +3100,7 @@ ROM_START( suhosong )
ROM_LOAD( "su_ho_sung.ua6", 0x100000, 0x80000, CRC(92fea02c) SHA1(946c7bf55354875a1581ce484cb185b640f74166) )
ROM_END
-
+// Puzzle 윷놀이
ROM_START( yutnori )
ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_BYTE( "sys_d0-d7", 0x000001, 0x20000, CRC(d5c853da) SHA1(578f29c3a307f82fcaa23a7fe2931c0a673e777e) )
@@ -3113,8 +3121,8 @@ ROM_START( yutnori )
ROM_LOAD("voice_rom", 0x000000, 0x040000, CRC(25e85201) SHA1(6c0001e2942f49b62e1bbf3a68c59abad1e2f94c) )
ROM_END
-
-ROM_START( sutjarod ) // 숫자로 해요 Deluxe
+// 숫자로 해요 Deluxe
+ROM_START( sutjarod )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "ul12_am27c512.bin", 0x00000, 0x10000, CRC(50e2563c) SHA1(d02e0805ae5aa5058e8c096f4265603006de2a6d) )
ROM_LOAD16_BYTE( "uh12_am27c512.bin", 0x00001, 0x10000, CRC(dc7e036c) SHA1(90a9b29b3f776e26303ccfa74800501152e05ceb) )
@@ -3122,10 +3130,10 @@ ROM_START( sutjarod ) // 숫자로 해요 Deluxe
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
ROM_LOAD( "u1_am27c512.bin", 0x00000, 0x10000, CRC(c6e31c4a) SHA1(178e10432d9d1096ac0d11b0da9e5441279f5ffe) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
/* this is not a real ROM but instead the data extracted from
shared RAM - the MCU puts it there
@@ -3135,7 +3143,7 @@ ROM_START( sutjarod ) // 숫자로 해요 Deluxe
*/
ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, BAD_DUMP CRC(c819b9a8) SHA1(1d425e8c9940c0e691149e5406dd71808bd73832) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "uj15_tms27c010a.bin", 0x00000, 0x20000, CRC(da9dea73) SHA1(b72da82686054dbbe423724fecf0e58966b0ea45) )
ROM_REGION( 0x100000, "gfx1", 0 ) /* Sprites */
@@ -3143,7 +3151,7 @@ ROM_START( sutjarod ) // 숫자로 해요 Deluxe
ROM_LOAD( "ua5_am27c040.bin", 0x80000, 0x80000, CRC(b286427d) SHA1(ee7f98a9d451b901c211326bff6b3ed4e2c1b76f) )
ROM_END
-
+// 과수원
ROM_START( gwasu )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "ul12_tms27c010a.bin", 0x00000, 0x20000, CRC(af76012a) SHA1(05177440db95d15ade683d13a255043a2bfb6a5c) )
@@ -3152,14 +3160,14 @@ ROM_START( gwasu )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* Z80 Code */
ROM_LOAD( "u1_am27c512.bin", 0x00000, 0x10000, CRC(91127141) SHA1(03b6f55fa6ce4fee4cfb350768d0f0b1f0049944) )
- ROM_REGION( 0x10000, "cpu2", 0 ) /* Intel 87C52 MCU Code */
- ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP )
+ ROM_REGION( 0x10000, "mcu", 0 ) /* Intel 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000, NO_DUMP )
- ROM_REGION16_BE( 0x200, "user1", 0 ) /* Data from Shared RAM */
+ ROM_REGION16_BE( 0x200, "protdata", 0 ) /* Data from Shared RAM */
// see note in sutjarod, same workaround is being used
ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, BAD_DUMP CRC(c819b9a8) SHA1(1d425e8c9940c0e691149e5406dd71808bd73832) )
- ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
ROM_LOAD( "uj15_tms27c010a.bin", 0x00000, 0x20000, CRC(a3c3fe53) SHA1(318e017b86e96f3adda830216fe6da3680a7cfab) )
ROM_REGION( 0x100000, "gfx1", 0 ) /* Sprites */
@@ -3168,7 +3176,7 @@ ROM_START( gwasu )
ROM_END
-void snowbros_state::init_cookbib2()
+void semicom_state::init_cookbib2()
{
save_item(NAME(m_semicom_prot_offset));
@@ -3176,19 +3184,19 @@ void snowbros_state::init_cookbib2()
}
-uint16_t snowbros_state::_4in1_02_read()
+u16 semicom_state::_4in1_02_read()
{
return 0x0202;
}
-void snowbros_state::init_4in1boot()
+void semicom_state::init_4in1boot()
{
- uint8_t *src = memregion("maincpu")->base();
+ u8 *src = memregion("maincpu")->base();
int len = memregion("maincpu")->bytes();
/* strange order */
{
- std::vector<uint8_t> buffer(len);
+ std::vector<u8> buffer(len);
for (int i = 0;i < len; i++)
if (i & 1) buffer[i] = bitswap<8>(src[i],6,7,5,4,3,2,1,0);
else buffer[i] = src[i];
@@ -3201,62 +3209,59 @@ void snowbros_state::init_4in1boot()
/* strange order */
{
- std::vector<uint8_t> buffer(len);
+ std::vector<u8> buffer(len);
for (int i = 0;i < len; i++)
buffer[i] = src[i^0x4000];
memcpy(src,&buffer[0],len);
}
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16smo_delegate(*this, FUNC(snowbros_state::_4in1_02_read)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16smo_delegate(*this, FUNC(semicom_state::_4in1_02_read)));
}
-void snowbros_state::init_snowbro3()
+void snowbros3_state::init_snowbro3()
{
- uint8_t *src = memregion("maincpu")->base();
+ u8 *src = memregion("maincpu")->base();
int len = memregion("maincpu")->bytes();
/* strange order */
{
- std::vector<uint8_t> buffer(len);
+ std::vector<u8> buffer(len);
for (int i = 0;i < len; i++)
buffer[i] = src[bitswap<24>(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,3,4,1,2,0)];
memcpy(src,&buffer[0],len);
}
-
- save_item(NAME(m_sb3_music_is_playing));
- save_item(NAME(m_sb3_music));
}
-void snowbros_state::init_ballboy3p()
+void snowbros3_state::init_ballboy3p()
{
init_snowbro3();
m_maincpu->space(AS_PROGRAM).unmap_write(0x400000, 0x400001); // unmap flipscreen as the DSW has been removed in favor of the controls for the 3rd player
}
-uint16_t snowbros_state::_3in1_read()
+u16 semicom_state::_3in1_read()
{
return 0x000a;
}
-void snowbros_state::init_3in1semi()
+void semicom_state::init_3in1semi()
{
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16smo_delegate(*this, FUNC(snowbros_state::_3in1_read)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16smo_delegate(*this, FUNC(semicom_state::_3in1_read)));
}
-uint16_t snowbros_state::cookbib3_read()
+u16 semicom_state::cookbib3_read()
{
return 0x2a2a;
}
-void snowbros_state::init_cookbib3()
+void semicom_state::init_cookbib3()
{
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16smo_delegate(*this, FUNC(snowbros_state::cookbib3_read)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16smo_delegate(*this, FUNC(semicom_state::cookbib3_read)));
}
-void snowbros_state::init_sutjarod()
+void semicom_state::init_sutjarod()
{
- uint16_t *rom = (uint16_t*)memregion("maincpu")->base();
+ u16 *rom = (u16*)memregion("maincpu")->base();
// patch RAM decrypt key in ROM to be the same as cookbib3
rom[0xb994 / 2] = 0x434b;
rom[0xb996 / 2] = 0x3345;
@@ -3266,10 +3271,10 @@ void snowbros_state::init_sutjarod()
rom[0x54 / 2] = 0x2508;
}
-void snowbros_state::init_gwasu()
+void semicom_state::init_gwasu()
{
// same reason for patch as init_sutjarod
- uint16_t *rom = (uint16_t*)memregion("maincpu")->base();
+ u16 *rom = (u16*)memregion("maincpu")->base();
rom[0xfda8 / 2] = 0x434b;
rom[0xfdaa / 2] = 0x3345;
@@ -3279,17 +3284,17 @@ void snowbros_state::init_gwasu()
-void snowbros_state::init_pzlbreak()
+void semicom_state::init_pzlbreak()
{
m_pandora->set_bg_pen(0xc0);
}
-void snowbros_state::init_toto()
+void snowbros_pandora_state::init_toto()
{
// every single rom has bits 0x10 and 0x08 swapped
- uint8_t *src = memregion("maincpu")->base();
+ u8 *src = memregion("maincpu")->base();
int len = memregion("maincpu")->bytes();
for (int i = 0; i < len; i++)
@@ -3314,17 +3319,17 @@ void snowbros_state::init_toto()
}
// protection? (just return 0x07)
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x500006, 0x500007, read16s_delegate(*this, FUNC(snowbros_state::toto_read)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x500006, 0x500007, read16s_delegate(*this, FUNC(snowbros_pandora_state::toto_read)));
}
-void snowbros_state::init_hyperpac()
+void semicom_state::init_hyperpac()
{
save_item(NAME(m_semicom_prot_offset));
m_semicom_prot_base = 0xe000 / 2;
}
-void snowbros_state::init_yutnori()
+void snowbros_pandora_state::init_yutnori()
{
m_yutnori_prot_val = 0;
m_pandora->set_bg_pen(0xf0);
@@ -3332,56 +3337,56 @@ void snowbros_state::init_yutnori()
}
-GAME( 1990, snowbros, 0, snowbros, snowbros, snowbros_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, snowbros_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, snowbrosb, snowbros, snowbros, snowbros, snowbros_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 3)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, snowbrosc, snowbros, snowbros, snowbros, snowbros_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 4)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, snowbrosj, snowbros, snowbros, snowbroj, snowbros_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, snowbrosd, snowbros, snowbros, snowbroj, snowbros_state, empty_init, ROT0, "Toaplan (Dooyong license)", "Snow Bros. - Nick & Tom (Dooyong license)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, wintbob, snowbros, wintbob, snowbros, snowbros_state, empty_init, ROT0, "bootleg (Sakowa Project Korea)", "The Winter Bobble (bootleg of Snow Bros.)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, snowbroswb, snowbros, wintbob, snowbros, snowbros_state, empty_init, ROT0, "bootleg", "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)", MACHINE_SUPPORTS_SAVE ) // this was probably unhacked back from the more common Winter Bobble to make it look more original
+GAME( 1990, snowbros, 0, snowbros, snowbros, snowbros_pandora_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, snowbros_pandora_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, snowbrosb, snowbros, snowbros, snowbros, snowbros_pandora_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 3)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, snowbrosc, snowbros, snowbros, snowbros, snowbros_pandora_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 4)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, snowbrosj, snowbros, snowbros, snowbroj, snowbros_pandora_state, empty_init, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, snowbrosd, snowbros, snowbros, snowbroj, snowbros_pandora_state, empty_init, ROT0, "Toaplan (Dooyong license)", "Snow Bros. - Nick & Tom (Dooyong license)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, wintbob, snowbros, wintbob, snowbros, snowbros_state, empty_init, ROT0, "bootleg (Sakowa Project Korea)", "The Winter Bobble (bootleg of Snow Bros.)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, snowbroswb, snowbros, wintbob, snowbros, snowbros_state, empty_init, ROT0, "bootleg", "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)", MACHINE_SUPPORTS_SAVE ) // this was probably unhacked back from the more common Winter Bobble to make it look more original
-GAME( 1996, toto, 0, snowbros, snowbros, snowbros_state, init_toto, ROT0, "SoftClub", "Come Back Toto", MACHINE_SUPPORTS_SAVE ) // modified from 'snowbros' code
+GAME( 1996, toto, 0, snowbros, toto, snowbros_pandora_state, init_toto, ROT0, "SoftClub", "Come Back Toto", MACHINE_SUPPORTS_SAVE ) // modified from 'snowbros' code
// none of the games below are on genuine SnowBros hardware, but they clone the functionality of it.
// SemiCom / Jeil titles are protected, a dumb MCU copies code into RAM at startup, some also check for a specific return value from an address on startup.
-GAME( 1993, finalttr, 0, finalttr, finalttr, snowbros_state, empty_init, ROT0, "Jeil Computer System", "Final Tetris", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, hyperpac, 0, semicom_mcu, hyperpac, snowbros_state, init_hyperpac, ROT0, "SemiCom", "Hyper Pacman", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, hyperpacb, hyperpac, semicom, hyperpac, snowbros_state, empty_init, ROT0, "bootleg", "Hyper Pacman (bootleg)", MACHINE_SUPPORTS_SAVE )
-GAME( 1996, cookbib2, 0, semicom_mcu, cookbib2, snowbros_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English, set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1996, cookbib2a, cookbib2, semicom_mcu, cookbib2, snowbros_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English, set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1996, cookbib2b, cookbib2, semiprot, cookbib2, snowbros_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English, set 3)", MACHINE_SUPPORTS_SAVE ) // older? test mode looks even worse on this, but neither shows the correct dip info anyway
-GAME( 1996, cookbib2c, cookbib2, semiprot, cookbib2c,snowbros_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English / Korean)", MACHINE_SUPPORTS_SAVE ) // in this set the language switch actually works but its effects are inverted to what test mode shows. Sticker on PCB shows 95 so maybe earliest set?
-GAME( 1996, toppyrap, 0, semiprot, toppyrap, snowbros_state, empty_init, ROT0, "SemiCom", "Toppy & Rappy", MACHINE_SUPPORTS_SAVE )
-GAME( 1996, sutjarod, 0, semiprot, sutjarod, snowbros_state, init_sutjarod, ROT0, "SemiCom", "Sutjaro Haeyo Deluxe (Korea)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // playable, but left as not working until protection data is extracted
-GAME( 1997, gwasu, 0, semiprot, gwasu, snowbros_state, init_gwasu, ROT0, "SemiCom / DMD", "Gwasuwon (Korea)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // playable, but left as not working until protection data is extracted
-GAME( 1997, cookbib3, 0, semiprot, cookbib3, snowbros_state, init_cookbib3, ROT0, "SemiCom", "Cookie & Bibi 3", MACHINE_SUPPORTS_SAVE )
-GAME( 1997, pzlbreak, 0, semiprot, pzlbreak, snowbros_state, init_pzlbreak, ROT0, "SemiCom / Tirano", "Puzzle Break (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1997, pzlbreaka, pzlbreak, semiprot, pzlbreak, snowbros_state, init_pzlbreak, ROT0, "SemiCom / Tirano", "Puzzle Break (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1997, suhosong, 0, semiprot, suhosong, snowbros_state, empty_init, ROT0, "SemiCom", "Su Ho Seong (Korea)", MACHINE_SUPPORTS_SAVE )
-GAME( 1997, twinkle, 0, semiprot, twinkle, snowbros_state, empty_init, ROT0, "SemiCom / Tirano", "Twinkle (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1997, twinklea, twinkle, semiprot, twinkle, snowbros_state, empty_init, ROT0, "SemiCom / Tirano", "Twinkle (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1998, 3in1semi, 0, semiprot, moremore, snowbros_state, init_3in1semi, ROT0, "SemiCom / XESS", "New HyperMan (3-in-1 with Cookie & Bibi & HyperMan) (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1998, 3in1semia, 3in1semi, semiprot, moremore, snowbros_state, init_3in1semi, ROT0, "SemiCom / XESS", "New HyperMan (3-in-1 with Cookie & Bibi & HyperMan) (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1999, mcheonru, 0, semiprot, mcheonru, snowbros_state, init_3in1semi, ROT0, "SemiCom / AceVer", "Ma Cheon Ru (Korea)", MACHINE_SUPPORTS_SAVE ) // a flyer exists for an English version called Arirang, AceVer team logo is displayed on it
-GAME( 1999, moremore, 0, semiprot, moremore, snowbros_state, init_3in1semi, ROT0, "SemiCom / Exit", "More More", MACHINE_SUPPORTS_SAVE )
-GAME( 1999, moremorp, 0, semiprot, moremore, snowbros_state, init_3in1semi, ROT0, "SemiCom / Exit", "More More Plus", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, finalttr, 0, finalttr, finalttr, semicom_state, empty_init, ROT0, "Jeil Computer System", "Final Tetris", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, hyperpac, 0, semicom_mcu, hyperpac, semicom_state, init_hyperpac, ROT0, "SemiCom", "Hyper Pacman", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, hyperpacb, hyperpac, semicom, hyperpac, semicom_state, empty_init, ROT0, "bootleg", "Hyper Pacman (bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1996, cookbib2, 0, semicom_mcu, cookbib2, semicom_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English, set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1996, cookbib2a, cookbib2, semicom_mcu, cookbib2, semicom_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English, set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1996, cookbib2b, cookbib2, semiprot, cookbib2, semicom_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English, set 3)", MACHINE_SUPPORTS_SAVE ) // older? test mode looks even worse on this, but neither shows the correct dip info anyway
+GAME( 1996, cookbib2c, cookbib2, semiprot, cookbib2c, semicom_state, init_cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2 (English / Korean)", MACHINE_SUPPORTS_SAVE ) // in this set the language switch actually works but its effects are inverted to what test mode shows. Sticker on PCB shows 95 so maybe earliest set?
+GAME( 1996, toppyrap, 0, semiprot, toppyrap, semicom_state, empty_init, ROT0, "SemiCom", "Toppy & Rappy", MACHINE_SUPPORTS_SAVE )
+GAME( 1996, sutjarod, 0, semiprot, sutjarod, semicom_state, init_sutjarod, ROT0, "SemiCom", "Sutjaro Haeyo Deluxe (Korea)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // playable, but left as not working until protection data is extracted
+GAME( 1997, gwasu, 0, semiprot, gwasu, semicom_state, init_gwasu, ROT0, "SemiCom / DMD", "Gwasuwon (Korea)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // playable, but left as not working until protection data is extracted
+GAME( 1997, cookbib3, 0, semiprot, cookbib3, semicom_state, init_cookbib3, ROT0, "SemiCom", "Cookie & Bibi 3", MACHINE_SUPPORTS_SAVE )
+GAME( 1997, pzlbreak, 0, semiprot, pzlbreak, semicom_state, init_pzlbreak, ROT0, "SemiCom / Tirano", "Puzzle Break (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1997, pzlbreaka, pzlbreak, semiprot, pzlbreak, semicom_state, init_pzlbreak, ROT0, "SemiCom / Tirano", "Puzzle Break (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1997, suhosong, 0, semiprot, suhosong, semicom_state, empty_init, ROT0, "SemiCom", "Suhoseong (Korea)", MACHINE_SUPPORTS_SAVE )
+GAME( 1997, twinkle, 0, semiprot, twinkle, semicom_state, empty_init, ROT0, "SemiCom / Tirano", "Twinkle (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1997, twinklea, twinkle, semiprot, twinkle, semicom_state, empty_init, ROT0, "SemiCom / Tirano", "Twinkle (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1998, 3in1semi, 0, semiprot, moremore, semicom_state, init_3in1semi, ROT0, "SemiCom / XESS", "New HyperMan (3-in-1 with Cookie & Bibi & HyperMan) (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1998, 3in1semia, 3in1semi, semiprot, moremore, semicom_state, init_3in1semi, ROT0, "SemiCom / XESS", "New HyperMan (3-in-1 with Cookie & Bibi & HyperMan) (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1999, mcheonru, 0, semiprot, mcheonru, semicom_state, init_3in1semi, ROT0, "SemiCom / AceVer", "Macheonlu (Korea)", MACHINE_SUPPORTS_SAVE ) // a flyer exists for an English version called Arirang, AceVer team logo is displayed on it
+GAME( 1999, moremore, 0, semiprot, moremore, semicom_state, init_3in1semi, ROT0, "SemiCom / Exit", "Puzzle Express More More (Korea)", MACHINE_SUPPORTS_SAVE ) // korean title screen, english title call
+GAME( 1999, moremorp, 0, semiprot, moremore, semicom_state, init_3in1semi, ROT0, "SemiCom / Exit", "Puzzle Express More More Plus", MACHINE_SUPPORTS_SAVE ) // vice versa of above
// This is very similar to the SemiCom titles, but unprotected.
-GAME( 2002, 4in1boot, 0, _4in1, 4in1boot, snowbros_state, init_4in1boot, ROT0, "K1 Soft", "Puzzle King (PacMan 2, Tetris, HyperMan 2, Snow Bros.)" , MACHINE_SUPPORTS_SAVE )
+GAME( 2002, 4in1boot, 0, _4in1, 4in1boot, semicom_state, init_4in1boot, ROT0, "K1 Soft", "Puzzle King (PacMan 2, Tetris, HyperMan 2, Snow Bros.)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, honeydol, 0, honeydol, honeydol, snowbros_state, empty_init, ROT0, "Barko Corp.", "Honey Doll", MACHINE_SUPPORTS_SAVE ) // based on snowbros code..
+GAME( 1995, honeydol, 0, honeydol, honeydol, snowbros_state, empty_init, ROT0, "Barko Corp.", "Honey Doll", MACHINE_SUPPORTS_SAVE ) // based on snowbros code..
-GAME( 1995, twinadv, 0, twinadv, twinadv, snowbros_state, empty_init, ROT0, "Barko Corp.", "Twin Adventure (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, twinadvk, twinadv, twinadv, twinadv, snowbros_state, empty_init, ROT0, "Barko Corp.", "Twin Adventure (Korea)", MACHINE_SUPPORTS_SAVE )
-GAME( 1996, multi96, twinadv, twinadv, twinadv, snowbros_state, empty_init, ROT0, "Barko Corp.", "Multi Game '96 (Italy)", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, twinadv, 0, twinadv, twinadv, snowbros_state, empty_init, ROT0, "Barko Corp.", "Twin Adventure (World)", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, twinadvk, twinadv, twinadv, twinadv, snowbros_state, empty_init, ROT0, "Barko Corp.", "Twin Adventure (Korea)", MACHINE_SUPPORTS_SAVE )
+GAME( 1996, multi96, twinadv, twinadv, twinadv, snowbros_state, empty_init, ROT0, "Barko Corp.", "Multi Game '96 (Italy)", MACHINE_SUPPORTS_SAVE )
// The Korean games database shows an earlier version of this called Ball Boy with a different title screen to the version of Ball Boy we have
// http://mamedev.emulab.it/undumped/images/Ballboy.jpg
// it is possible this 'ball boy' is the original bootleg, with snwobro3 being a hack of that, and the ballboy set we have a further hack of that
// these use an MCU to drive the sound
-GAME( 2002, snowbro3, 0, snowbro3, snowbroj, snowbros_state, init_snowbro3, ROT0, "Syrmex", "Snow Brothers 3 - Magical Adventure", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // hacked from SnowBros code but released as an original game
-GAME( 2003, ballboy, snowbro3, snowbro3, snowbroj, snowbros_state, init_snowbro3, ROT0, "bootleg", "Ball Boy (2 players)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 2004, ballboy3p, snowbro3, snowbro3, ballboy3p, snowbros_state, init_ballboy3p, ROT0, "bootleg", "Ball Boy (3 players)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 2002, snowbro3, 0, snowbro3, snowbroj, snowbros3_state, init_snowbro3, ROT0, "Syrmex", "Snow Brothers 3 - Magical Adventure", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // hacked from SnowBros code but released as an original game
+GAME( 2003, ballboy, snowbro3, snowbro3, snowbroj, snowbros3_state, init_snowbro3, ROT0, "bootleg", "Ball Boy (2 players)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 2004, ballboy3p, snowbro3, snowbro3, ballboy3p, snowbros3_state, init_ballboy3p, ROT0, "bootleg", "Ball Boy (3 players)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
// protection appears to handle the sound, should check if it's just a block of code that is conditionally executed like some of the Semicom titles.
-GAME( 1999, yutnori, 0, yutnori, yutnori, snowbros_state, init_yutnori, ROT0, "Nunal", "Puzzle Yutnori (Korea)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // Nunal is apparently Korean slang for Eyeball, hence the logo. Some places report 'JCC Soft' as the manufacturer
+GAME( 1999, yutnori, 0, yutnori, yutnori, snowbros_pandora_state, init_yutnori, ROT0, "Nunal", "Puzzle Yutnori (Korea)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // Nunal is apparently Korean slang for Eyeball, hence the logo. Some places report 'JCC Soft' as the manufacturer
diff --git a/src/mame/kaneko/snowbros.h b/src/mame/kaneko/snowbros.h
index 41ec4c02cc9..680afc9a7ee 100644
--- a/src/mame/kaneko/snowbros.h
+++ b/src/mame/kaneko/snowbros.h
@@ -14,117 +14,172 @@
#include "emupal.h"
#include "screen.h"
-
+// base class, no pandora chip
class snowbros_state : public driver_device
{
public:
snowbros_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this,"maincpu"),
- m_soundcpu(*this, "soundcpu"),
- m_oki(*this, "oki"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
- m_screen(*this, "screen"),
- m_soundlatch(*this, "soundlatch"),
- m_pandora(*this, "pandora"),
- m_hyperpac_ram(*this, "hyperpac_ram"),
- m_bootleg_spriteram16(*this, "spriteram16b"),
- m_semicom_prot_base(0)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this,"maincpu")
+ , m_soundcpu(*this, "soundcpu")
+ , m_oki(*this, "oki%u", 1U)
+ , m_gfxdecode(*this, "gfxdecode")
+ , m_palette(*this, "palette")
+ , m_screen(*this, "screen")
+ , m_soundlatch(*this, "soundlatch%u", 1U)
+ , m_bootleg_spriteram(*this, "spriteram")
{ }
- void _4in1(machine_config &config);
- void semiprot(machine_config &config);
- void semicom_mcu(machine_config &config);
- void yutnori(machine_config &config);
- void snowbros(machine_config &config);
- void semicom(machine_config &config);
void twinadv(machine_config &config);
void wintbob(machine_config &config);
void honeydol(machine_config &config);
- void snowbro3(machine_config &config);
- void finalttr(machine_config &config);
- void init_pzlbreak();
- void init_snowbro3();
- void init_ballboy3p();
- void init_cookbib3();
- void init_4in1boot();
- void init_3in1semi();
- void init_cookbib2();
- void init_toto();
- void init_hyperpac();
- void init_yutnori();
- void init_sutjarod();
- void init_gwasu();
-
-private:
+protected:
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_soundcpu;
- optional_device<okim6295_device> m_oki;
+ optional_device_array<okim6295_device, 2> m_oki;
optional_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
- optional_device<generic_latch_8_device> m_soundlatch; // not snowbro3
-
- optional_device<kaneko_pandora_device> m_pandora;
- optional_shared_ptr<uint16_t> m_hyperpac_ram;
- optional_shared_ptr<uint16_t> m_bootleg_spriteram16;
-
- int m_sb3_music_is_playing = 0;
- int m_sb3_music = 0;
- uint8_t m_semicom_prot_offset = 0;
- uint16_t m_semicom_prot_base;
- uint16_t m_yutnori_prot_val = 0;
-
- void snowbros_flipscreen_w(uint8_t data);
- void bootleg_flipscreen_w(uint8_t data);
- void snowbros_irq4_ack_w(uint16_t data);
- void snowbros_irq3_ack_w(uint16_t data);
- void snowbros_irq2_ack_w(uint16_t data);
- void prot_p0_w(uint8_t data);
- void prot_p1_w(uint8_t data);
- void prot_p2_w(uint8_t data);
- uint16_t sb3_sound_r();
- uint16_t _4in1_02_read();
- uint16_t _3in1_read();
- uint16_t cookbib3_read();
- void twinadv_oki_bank_w(uint8_t data);
- void sb3_sound_w(uint16_t data);
- uint16_t toto_read(offs_t offset, uint16_t mem_mask = ~0);
- void yutnori_prot_w(uint16_t data);
- uint16_t yutnori_prot_r();
+ optional_device_array<generic_latch_8_device, 2> m_soundlatch; // not snowbro3
- DECLARE_MACHINE_RESET(semiprot);
- DECLARE_MACHINE_RESET(finalttr);
+ optional_shared_ptr<u16> m_bootleg_spriteram;
- uint32_t screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_honeydol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_twinadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void screen_vblank_snowbros(int state);
+ void bootleg_flipscreen_w(u8 data);
+ template <unsigned Line> void irq_ack_w(u16 data);
+ void twinadv_oki_bank_w(u8 data);
- TIMER_DEVICE_CALLBACK_MEMBER(snowbros_irq);
- TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_irq);
+ u32 screen_update_honeydol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update_twinadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void sb3_play_music(int data);
- void sb3_play_sound(int data);
+ TIMER_DEVICE_CALLBACK_MEMBER(scanline);
+
+ void snowbros_base(machine_config &config) ATTR_COLD;
- void finalttr_map(address_map &map) ATTR_COLD;
void honeydol_map(address_map &map) ATTR_COLD;
void honeydol_sound_io_map(address_map &map) ATTR_COLD;
void honeydol_sound_map(address_map &map) ATTR_COLD;
- void hyperpac_map(address_map &map) ATTR_COLD;
- void hyperpac_sound_map(address_map &map) ATTR_COLD;
- void snowbros3_map(address_map &map) ATTR_COLD;
- void snowbros_map(address_map &map) ATTR_COLD;
void sound_io_map(address_map &map) ATTR_COLD;
void sound_map(address_map &map) ATTR_COLD;
void twinadv_map(address_map &map) ATTR_COLD;
void twinadv_sound_io_map(address_map &map) ATTR_COLD;
void wintbob_map(address_map &map) ATTR_COLD;
+};
+
+// with original pandora hardware
+class snowbros_pandora_state : public snowbros_state
+{
+public:
+ snowbros_pandora_state(const machine_config &mconfig, device_type type, const char *tag)
+ : snowbros_state(mconfig, type, tag)
+ , m_pandora(*this, "pandora")
+ { }
+
+ void snowbros(machine_config &config);
+ void yutnori(machine_config &config);
+
+ void init_toto();
+ void init_yutnori();
+
+protected:
+ required_device<kaneko_pandora_device> m_pandora;
+
+ u16 m_yutnori_prot_val = 0;
+
+ void snowbros_flipscreen_w(u8 data);
+ u16 toto_read(offs_t offset, u16 mem_mask = ~0);
+ void yutnori_prot_w(u16 data);
+ u16 yutnori_prot_r();
+
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void screen_vblank(int state);
+
+ void snowbros_map(address_map &map) ATTR_COLD;
void yutnori_map(address_map &map) ATTR_COLD;
};
+// with sound MCU (HLE until hooked up MCU) and bankswitched OKI
+class snowbros3_state : public snowbros_state
+{
+public:
+ snowbros3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : snowbros_state(mconfig, type, tag)
+ , m_okibank(*this, "okibank")
+ { }
+
+ void snowbro3(machine_config &config);
+
+ void init_snowbro3();
+ void init_ballboy3p();
+
+protected:
+ virtual void machine_start() override ATTR_COLD;
+
+private:
+ required_memory_bank m_okibank;
+
+ s32 m_sb3_music_is_playing = 0;
+ s32 m_sb3_music = 0;
+
+ u16 sb3_sound_r();
+ void sb3_sound_w(u16 data);
+
+ u32 screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_scanline);
+
+ void sb3_play_music(u16 data);
+ void sb3_play_sound(u16 data);
+
+ void snowbros3_map(address_map &map) ATTR_COLD;
+ void snowbros3_oki_map(address_map &map) ATTR_COLD;
+};
+
+// with protection MCU
+class semicom_state : public snowbros_pandora_state
+{
+public:
+ semicom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : snowbros_pandora_state(mconfig, type, tag)
+ , m_hyperpac_ram(*this, "hyperpac_ram")
+ , m_semicom_prot_base(0)
+ { }
+
+ void _4in1(machine_config &config);
+ void semiprot(machine_config &config);
+ void semicom_mcu(machine_config &config);
+ void semicom(machine_config &config);
+ void finalttr(machine_config &config);
+
+ void init_pzlbreak();
+ void init_cookbib3();
+ void init_4in1boot();
+ void init_3in1semi();
+ void init_cookbib2();
+ void init_hyperpac();
+ void init_sutjarod();
+ void init_gwasu();
+
+protected:
+ optional_shared_ptr<u16> m_hyperpac_ram;
+
+ u8 m_semicom_prot_offset = 0;
+ u16 m_semicom_prot_base;
+
+ void prot_p0_w(u8 data);
+ void prot_p1_w(u8 data);
+ void prot_p2_w(u8 data);
+ u16 _4in1_02_read();
+ u16 _3in1_read();
+ u16 cookbib3_read();
+
+ DECLARE_MACHINE_RESET(semiprot);
+ DECLARE_MACHINE_RESET(finalttr);
+
+ void finalttr_map(address_map &map) ATTR_COLD;
+ void hyperpac_map(address_map &map) ATTR_COLD;
+ void hyperpac_sound_map(address_map &map) ATTR_COLD;
+};
+
#endif // MAME_KANEKO_SNOWBROS_H
diff --git a/src/mame/kaneko/snowbros_v.cpp b/src/mame/kaneko/snowbros_v.cpp
index 6910e5b468f..ad6fd8de9cc 100644
--- a/src/mame/kaneko/snowbros_v.cpp
+++ b/src/mame/kaneko/snowbros_v.cpp
@@ -5,10 +5,8 @@
#include "emu.h"
#include "snowbros.h"
-uint32_t snowbros_state::screen_update_honeydol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 snowbros_state::screen_update_honeydol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- uint16_t *spriteram16 = m_bootleg_spriteram16;
- int sx=0, sy=0, x=0, y=0, offs;
/* sprites clip on left / right edges when scrolling, but it seems correct,
no extra sprite attribute bits are set during this time, the sprite co-ordinates
are simply set to 0 */
@@ -17,83 +15,65 @@ uint32_t snowbros_state::screen_update_honeydol(screen_device &screen, bitmap_in
bitmap.fill(0xf0, cliprect);
- for (offs = 0x0000/2;offs < 0x2000/2;offs += 8)
+ for (int offs = 0x0000 / 2; offs < 0x2000 / 2; offs += 8)
{
- int dx,dy,tilecolour,attr,flipx,flipy,tile;
+ int dx, dy, tilecolour, attr, flipx, flipy, tile;
/* 8bpp gfx */
- dx = (spriteram16[offs+4]>>8) & 0xff;
- dy = (spriteram16[offs+5]>>8) & 0xff;
- tilecolour = (spriteram16[offs+3]>>8)&3;
- attr = spriteram16[offs+7]>>8;
- flipx = attr & 0x80;
- flipy = (attr & 0x40) << 1;
- tile = ((attr & 0x3f)<<8) + ((spriteram16[offs+6]>>8) & 0xff);
-
- x = dx;
- y = dy;
+ dx = (m_bootleg_spriteram[offs + 4] >> 8) & 0xff;
+ dy = (m_bootleg_spriteram[offs + 5] >> 8) & 0xff;
+ tilecolour = (m_bootleg_spriteram[offs + 3] >> 8) & 3;
+ attr = m_bootleg_spriteram[offs + 7] >> 8;
+ flipx = BIT(attr, 7);
+ flipy = BIT(attr, 6);
+ tile = ((attr & 0x3f) << 8) + ((m_bootleg_spriteram[offs + 6] >> 8) & 0xff);
if (flip_screen())
{
- sx = 240 - x;
- sy = 240 - y;
+ dx = 240 - dx;
+ dy = 240 - dy;
flipx = !flipx;
flipy = !flipy;
}
- else
- {
- sx = x;
- sy = y;
- }
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(1)->transpen(bitmap, cliprect,
tile,
tilecolour,
flipx, flipy,
- sx,sy,0);
+ dx, dy, 0);
/* second list interleaved with first (4bpp) ??? */
- dx = spriteram16[offs+4] & 0xff;
- dy = spriteram16[offs+5] & 0xff;
- tilecolour = spriteram16[offs+3];
- attr = spriteram16[offs+7];
- flipx = attr & 0x80;
- flipy = (attr & 0x40) << 1;
- tile = ((attr & 0x3f) << 8) + (spriteram16[offs+6] & 0xff);
-
- x = dx;
- y = dy;
+ dx = m_bootleg_spriteram[offs + 4] & 0xff;
+ dy = m_bootleg_spriteram[offs + 5] & 0xff;
+ tilecolour = m_bootleg_spriteram[offs + 3];
+ attr = m_bootleg_spriteram[offs + 7];
+ flipx = BIT(attr, 7);
+ flipy = BIT(attr, 6);
+ tile = ((attr & 0x3f) << 8) + (m_bootleg_spriteram[offs + 6] & 0xff);
if (flip_screen())
{
- sx = 240 - x;
- sy = 240 - y;
+ dx = 240 - dx;
+ dy = 240 - dy;
flipx = !flipx;
flipy = !flipy;
}
- else
- {
- sx = x;
- sy = y;
- }
- tilecolour = (tilecolour&0x03f0) >> 4;
- tilecolour ^=0x3f; // unusual, but correct..
+ tilecolour = (tilecolour & 0x03f0) >> 4;
+ tilecolour ^= 0x3f; // unusual, but correct..
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
tile,
tilecolour,
flipx, flipy,
- sx,sy,0);
+ dx, dy, 0);
}
return 0;
}
-uint32_t snowbros_state::screen_update_twinadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 snowbros_state::screen_update_twinadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- uint16_t *spriteram16 = m_bootleg_spriteram16;
- int sx=0, sy=0, x=0, y=0, offs;
/* sprites clip on left / right edges when scrolling, but it seems correct,
no extra sprite attribute bits are set during this time, the sprite co-ordinates
are simply set to 0 */
@@ -102,70 +82,62 @@ uint32_t snowbros_state::screen_update_twinadv(screen_device &screen, bitmap_ind
bitmap.fill(0xf0, cliprect);
- for (offs = 0x0000/2;offs < 0x2000/2;offs += 8)
+ for (int offs = 0x0000 / 2; offs < 0x2000 / 2; offs += 8)
{
- int dx,dy,tilecolour,attr,flipx,flipy,tile;
-
/* Similar to Honey Doll, but no 8bpp list / gfx */
- dx = spriteram16[offs+4] & 0xff;
- dy = spriteram16[offs+5] & 0xff;
- tilecolour = spriteram16[offs+3];
- attr = spriteram16[offs+7];
- flipx = attr & 0x80;
- flipy = (attr & 0x40) << 1;
- tile = ((attr & 0x3f) << 8) + (spriteram16[offs+6] & 0xff);
-
- x = dx;
- y = dy;
+ int dx = m_bootleg_spriteram[offs + 4] & 0xff;
+ int dy = m_bootleg_spriteram[offs + 5] & 0xff;
+ int tilecolour = m_bootleg_spriteram[offs + 3];
+ const u8 attr = m_bootleg_spriteram[offs + 7] & 0xff;
+ bool flipx = BIT(attr, 7);
+ bool flipy = BIT(attr, 6);
+ const u32 tile = ((attr & 0x3f) << 8) + (m_bootleg_spriteram[offs + 6] & 0xff);
if (flip_screen())
{
- sx = 240 - x;
- sy = 240 - y;
+ dx = 240 - dx;
+ dy = 240 - dy;
flipx = !flipx;
flipy = !flipy;
}
- else
- {
- sx = x;
- sy = y;
- }
- tilecolour = (tilecolour&0x00f0) >> 4;
- tilecolour ^=0xf; // unusual, but correct..
+ tilecolour = (tilecolour & 0x00f0) >> 4;
+ tilecolour ^= 0xf; // unusual, but correct..
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
tile,
tilecolour,
flipx, flipy,
- sx,sy,0);
+ dx, dy, 0);
}
return 0;
}
-uint32_t snowbros_state::screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 snowbros_state::screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- uint16_t *spriteram16 = m_bootleg_spriteram16;
- int offs;
-
bitmap.fill(m_palette->black_pen(), cliprect);
- for (offs = 0;offs < m_bootleg_spriteram16.bytes()/2;offs += 8)
+ for (int offs = 0; offs < m_bootleg_spriteram.bytes() / 2; offs += 8)
{
- int xpos = spriteram16[offs] & 0xff;
- int ypos = spriteram16[offs+4] & 0xff;
-/* int unk1 = spriteram16[offs+1] & 0x01;*/ /* Unknown .. Set for the Bottom Left part of Sprites */
- int disbl = spriteram16[offs+1] & 0x02;
-/* int unk2 = spriteram16[offs+1] & 0x04;*/ /* Unknown .. Set for most things */
- int wrapr = spriteram16[offs+1] & 0x08;
- int colr = (spriteram16[offs+1] & 0xf0) >> 4;
- int tilen = (spriteram16[offs+2] << 8) + (spriteram16[offs+3] & 0xff);
- int flipx = spriteram16[offs+2] & 0x80;
- int flipy = (spriteram16[offs+2] & 0x40) << 1;
-
- if (wrapr == 8) xpos -= 256;
+ const u8 attr = m_bootleg_spriteram[offs + 1] & 0xff;
+ if (BIT(attr, 1))
+ continue;
+
+ int xpos = m_bootleg_spriteram[offs] & 0xff;
+ int ypos = m_bootleg_spriteram[offs + 4] & 0xff;
+/* const bool unk1 = BIT(attr, 0);*/ /* Unknown .. Set for the Bottom Left part of Sprites */
+/* const bool unk2 = BIT(attr, 2);*/ /* Unknown .. Set for most things */
+ const bool wrapr = BIT(attr, 3);
+ const u32 colr = (attr & 0xf0) >> 4;
+ const u8 tile_flip = m_bootleg_spriteram[offs + 2] & 0xff;
+ const u32 tile = (tile_flip << 8) + (m_bootleg_spriteram[offs + 3] & 0xff);
+ bool flipx = BIT(tile_flip, 7);
+ bool flipy = BIT(tile_flip, 6);
+
+ if (wrapr)
+ xpos -= 256;
if (flip_screen())
{
@@ -175,26 +147,25 @@ uint32_t snowbros_state::screen_update_wintbob(screen_device &screen, bitmap_ind
flipy = !flipy;
}
- if ((xpos > -16) && (ypos > 0) && (xpos < 256) && (ypos < 240) && (disbl !=2))
+ if ((xpos > -16) && (ypos > 0) && (xpos < 256) && (ypos < 240))
{
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
- tilen,
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
+ tile,
colr,
flipx, flipy,
- xpos,ypos,0);
+ xpos, ypos, 0);
}
}
return 0;
}
-uint32_t snowbros_state::screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 snowbros3_state::screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- uint16_t *spriteram16 = m_bootleg_spriteram16;
- int sx=0, sy=0, x=0, y=0, offs;
+ int x = 0, y = 0;
/*
- * Sprite Tile Format
+ * Sprite Tile Format (Only low bytes are used?)
* ------------------
*
* Byte | Bit(s) | Use
@@ -202,37 +173,40 @@ uint32_t snowbros_state::screen_update_snowbro3(screen_device &screen, bitmap_in
* 0-5 | -------- | ?
* 6 | -------- | ?
* 7 | xxxx.... | Palette Bank
+ * 7 | .....x.. | Use Relative offsets
+ * 7 | ......x. | YPos - Sign Bit
* 7 | .......x | XPos - Sign Bit
* 9 | xxxxxxxx | XPos
- * 7 | ......x. | YPos - Sign Bit
* B | xxxxxxxx | YPos
- * 7 | .....x.. | Use Relative offsets
* C | -------- | ?
* D | xxxxxxxx | Sprite Number (low 8 bits)
* E | -------- | ?
- * F | ....xxxx | Sprite Number (high 4 bits)
* F | x....... | Flip Sprite Y-Axis
* F | .x...... | Flip Sprite X-Axis
+ * F | ....xxxx | Sprite Number (high 4 bits)
*/
/* This clears & redraws the entire screen each pass */
bitmap.fill(m_palette->black_pen(), cliprect);
- for (offs = 0;offs < m_bootleg_spriteram16.bytes()/2;offs += 8)
+ for (int offs = 0; offs < m_bootleg_spriteram.bytes() / 2; offs += 8)
{
- gfx_element *gfx = m_gfxdecode->gfx(0);
- int dx = spriteram16[offs+4] & 0xff;
- int dy = spriteram16[offs+5] & 0xff;
- int tilecolour = spriteram16[offs+3];
- int attr = spriteram16[offs+7];
- int flipx = attr & 0x80;
- int flipy = (attr & 0x40) << 1;
- int tile = ((attr & 0xff) << 8) + (spriteram16[offs+6] & 0xff);
-
- if (tilecolour & 1) dx = -1 - (dx ^ 0xff);
- if (tilecolour & 2) dy = -1 - (dy ^ 0xff);
- if (tilecolour & 4)
+ u8 gfx = 0;
+ int dx = m_bootleg_spriteram[offs + 4] & 0xff;
+ int dy = m_bootleg_spriteram[offs + 5] & 0xff;
+ u8 tilecolour = m_bootleg_spriteram[offs + 3] & 0xff;
+ const u8 attr = m_bootleg_spriteram[offs + 7] & 0xff;
+ bool flipx = BIT(attr, 7);
+ bool flipy = BIT(attr, 6);
+ const u32 tile = ((attr & 0xff) << 8) + (m_bootleg_spriteram[offs + 6] & 0xff);
+
+ if (BIT(tilecolour, 0))
+ dx = -1 - (dx ^ 0xff);
+ if (BIT(tilecolour, 1))
+ dy = -1 - (dy ^ 0xff);
+
+ if (BIT(tilecolour, 2))
{
x += dx;
y += dy;
@@ -246,6 +220,7 @@ uint32_t snowbros_state::screen_update_snowbro3(screen_device &screen, bitmap_in
if (x > 511) x &= 0x1ff;
if (y > 511) y &= 0x1ff;
+ int sx = x, sy = y;
if (flip_screen())
{
sx = 240 - x;
@@ -253,23 +228,18 @@ uint32_t snowbros_state::screen_update_snowbro3(screen_device &screen, bitmap_in
flipx = !flipx;
flipy = !flipy;
}
- else
- {
- sx = x;
- sy = y;
- }
if (offs < 0x800) /* i guess this is the right way */
{
- gfx = m_gfxdecode->gfx(1);
+ gfx = 1;
tilecolour = 0x10;
}
- gfx->transpen(bitmap,cliprect,
- tile,
- (tilecolour & 0xf0) >> 4,
- flipx, flipy,
- sx,sy,0);
+ m_gfxdecode->gfx(gfx)->transpen(bitmap, cliprect,
+ tile,
+ (tilecolour & 0xf0) >> 4,
+ flipx, flipy,
+ sx, sy, 0);
}
return 0;
}