From 074d55b4034c8a3f847df657cae3871f2349587a Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 8 Mar 2022 18:18:41 +0100 Subject: - megazone.cpp: added PCB infos and some notes about the megazonea set [Guru] - snesb.cpp, snesb51.cpp: moved fatfurspb from the former to the latter. Also patched out protection for ffight3b for now [hammy] --- scripts/target/mame/arcade.lua | 2 - src/mame/drivers/megazone.cpp | 643 +++++++++++++++++++++++++++++++++-------- src/mame/drivers/snesb.cpp | 34 +-- src/mame/drivers/snesb51.cpp | 146 +++++++++- src/mame/includes/megazone.h | 88 ------ src/mame/mame.lst | 2 +- src/mame/video/megazone.cpp | 222 -------------- 7 files changed, 666 insertions(+), 471 deletions(-) delete mode 100644 src/mame/includes/megazone.h delete mode 100644 src/mame/video/megazone.cpp diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index cd31c3f9740..bde9b58eeb1 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -2569,8 +2569,6 @@ files { MAME_DIR .. "src/mame/includes/mainevt.h", MAME_DIR .. "src/mame/video/mainevt.cpp", MAME_DIR .. "src/mame/drivers/megazone.cpp", - MAME_DIR .. "src/mame/includes/megazone.h", - MAME_DIR .. "src/mame/video/megazone.cpp", MAME_DIR .. "src/mame/drivers/mikie.cpp", MAME_DIR .. "src/mame/includes/mikie.h", MAME_DIR .. "src/mame/video/mikie.cpp", diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp index 4dd88e3a5a6..8572ea434b4 100644 --- a/src/mame/drivers/megazone.cpp +++ b/src/mame/drivers/megazone.cpp @@ -57,59 +57,450 @@ CONN BOARD IC3 TMP8039P-6 REAR BOARD 1C026 N/U (CUSTOM ON ORIGINAL) +************************************************************************** + +Mega Zone, Konami 1983 +Hardware info by Guru +Note: Revision documented here is the Konami/Interlogic/Kosuka +version with hand-written labels and Program Code H software. + + +Bottom Board +------------ +KONAMI GX319 +PWB(A)2000079B + |--------------| |--------------| +|---|--------------|----------------|--------------|---| +| | +| | +|319B18.IC091 | +| 18.432kHz | +| | +| 2114 2114 | +| | +| 2114 2114 | +| | +| | +| | +|319B17.IC063 | +| | +| 319G13.IC058 | +| | +| 319G12.IC046 319B15.IC048 8128 | +| | +| 319B14.IC042 8128 | +| 319B16.IC033 | +| 2148 2148 |-------| | +| | 083 | | +| |-------| | +| | +| | +| 319E11.IC015 | +| 319E10.IC014 | +| 319E09.IC005 | +| 319E08.IC004 CN001 | +|------------------------------------------------------| +Notes: + 2148 - Fujitsu MBM2148 1kBx4-bit SRAM + 2114 - Toshiba TMM2114 1kBx4-bit SRAM + 8128 - Fujitsu MB8128 2kBx8-bit SRAM (compatible with 6116) + CN001 - 2 pin connector for 5V/GND coming from top board + 083 - Konami custom chip 083 (contains only logic). Can be replaced with Konami daughterboard 'PWB 400322' +319G13.IC058 \ 2764 8kBx8-bit EPROM (background tiles) +319G12.IC046 / +319E08.IC004 \ +319E09.IC005 \ 2764 8kBx8-bit EPROM (sprites) +319E10.IC014 / +319E11.IC015 / +319B18.IC091 - Texas Instruments TBP18S030 32x8-bit bipolar PROM (palette) +319B17.IC063 - MMI 6301 256x4-bit bipolar PROM (character lookup table) +319B16.IC033 - MMI 6301 256x4-bit bipolar PROM (sprite lookup table) +319B15.IC048 - Texas Instruments TBP18S030 32x8-bit bipolar PROM (timing) +319B14.IC042 - Texas Instruments TBP18S030 32x8-bit bipolar PROM (timing) + + +Top Board +--------- +KONAMI GX319 +PWB(B)2000082A + |--------------| |--------------| +|---|--------------|----------------|--------------|---| +| MC1455 | +| | +| | +| | +| |--------------| | +| | KONAMI-1 | | +| |--------------| | +| 14.31818MHz DIP28 | +| | +| |--------------| |-------| 319H07.IC59| +| | AY-3-8910 | | 501 | | +| |--------------| |-------| 319H06.IC58| +| MB8128 | +| |--------------| 319H05.IC57| +| M5224 | Z80 | | +| |--------------| 319H04.IC56| +| 319E02.IC25 | +| 319H03.IC55| +| |--------------| | +| | 8039 | | +| |--------------| | +| DSW2 | +| VOL | +| 319E01.IC2 | +| LA4460 DSW1 | +| | +| | +| 18-WAY CN5 | +|------------------------------------------------------| +Notes: + 8128 - Fujitsu MB8128 2kBx8-bit SRAM (compatible with 6116) + CN5 - 2 pin connector for 5V/GND tied to bottom board + 501 - Konami custom chip 501 (contains only logic). Can be replaced with Konami daughterboard 'PWB 402034' + 319E01.IC2 - 2732 4kBx8-bit EPROM (8039 program) + 319E02.IC25 - 2764 8kBx8-bit EPROM (Z80 sound program) + 319H03.IC55 \ + 319H04.IC56 \ + 319H05.IC57 \ 2764 8kBx8-bit EPROM (main program for custom KONAMI-1 CPU) + 319H06.IC58 / + 319H07.IC59 / + DIP28 - Empty DIP28 socket + LA4460 - Sanyo LA4460 12W Audio Power Amplifier + MC1455 - Motorola MC1455 Timer (compatible with NE555) + M5224 - Mitsubishi M5224 Quad Operational Amplifier (compatible with LM324) + Z80 - Z80 CPU. Clock input 3.072MHz [18.432/6] + 8039 - Intel 8039 ROM-less microcontroller with 128 bytes internal RAM. Clock input 7.15909MHz [14.31818/2] + AY-3-8910 - General Instrument AY-3-8910 Programmable Sound Generator (PSG). Clock input 1.7897725MHz [14.31818/8] + KONAMI-1 - Konami custom encrypted 6809 CPU. Clock input 1.536MHz on pins 15 & 17 [18.432/12] + HSync - 15.4566kHz \ + VSync - 60.606059Hz / Actual PCB measurements + ***************************************************************************/ + #include "emu.h" -#include "includes/megazone.h" + #include "includes/konamipt.h" +#include "machine/konami1.h" #include "cpu/m6809/m6809.h" +#include "cpu/mcs48/mcs48.h" #include "cpu/z80/z80.h" #include "machine/74259.h" #include "machine/gen_latch.h" -#include "machine/konami1.h" #include "machine/watchdog.h" #include "sound/ay8910.h" #include "sound/dac.h" +#include "sound/flt_rc.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "video/resnet.h" + + +namespace { + +class megazone_state : public driver_device +{ +public: + megazone_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_scrolly(*this, "scrolly"), + m_scrollx(*this, "scrollx"), + m_videoram(*this, "videoram%u", 1U), + m_colorram(*this, "colorram%u", 1U), + m_spriteram(*this, "spriteram"), + m_share1(*this, "share1"), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_daccpu(*this, "daccpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_filter(*this, "filter.0.%u", 0U) + { } + + void megazone(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr m_scrolly; + required_shared_ptr m_scrollx; + required_shared_ptr_array m_videoram; + required_shared_ptr_array m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_share1; + + // video-related + std::unique_ptr m_tmpbitmap; + bool m_flipscreen; + + // misc + uint8_t m_i8039_status; + bool m_irq_mask; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_daccpu; + required_device m_gfxdecode; + required_device m_palette; + required_device_array m_filter; + + void i8039_irq_w(uint8_t data); + void i8039_irqen_and_status_w(uint8_t data); + DECLARE_WRITE_LINE_MEMBER(coin_counter_1_w); + DECLARE_WRITE_LINE_MEMBER(coin_counter_2_w); + DECLARE_WRITE_LINE_MEMBER(irq_mask_w); + DECLARE_WRITE_LINE_MEMBER(flipscreen_w); + uint8_t port_a_r(); + void port_b_w(uint8_t data); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(vblank_irq); + void i8039_io_map(address_map &map); + void i8039_map(address_map &map); + void main_map(address_map &map); + void sound_io_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** +Based on driver from MAME 0.55 +Changes by Martin M. (pfloyd@gmx.net) 14.10.2001: + + - Added support for screen flip in cocktail mode (tricky!) */ + + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Megazone has one 32x8 palette PROM and two 256x4 lookup table PROMs + (one for characters, one for sprites). + The palette PROM is connected to the RGB output this way: + + bit 7 -- 220 ohm resistor -- BLUE + -- 470 ohm resistor -- BLUE + -- 220 ohm resistor -- GREEN + -- 470 ohm resistor -- GREEN + -- 1 kohm resistor -- GREEN + -- 220 ohm resistor -- RED + -- 470 ohm resistor -- RED + bit 0 -- 1 kohm resistor -- RED + +***************************************************************************/ + +void megazone_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + static constexpr int resistances_rg[3] = { 1000, 470, 220 }; + static constexpr int resistances_b [2] = { 470, 220 }; + + // compute the color output resistor weights + double rweights[3], gweights[3], bweights[2]; + compute_resistor_weights(0, 255, -1.0, + 3, &resistances_rg[0], rweights, 1000, 0, + 3, &resistances_rg[0], gweights, 1000, 0, + 2, &resistances_b[0], bweights, 1000, 0); + + // create a lookup table for the palette + for (int i = 0; i < 0x20; i++) + { + // red component + int bit0 = BIT(color_prom[i], 0); + int bit1 = BIT(color_prom[i], 1); + int bit2 = BIT(color_prom[i], 2); + int const r = combine_weights(rweights, bit0, bit1, bit2); + + // green component + bit0 = BIT(color_prom[i], 3); + bit1 = BIT(color_prom[i], 4); + bit2 = BIT(color_prom[i], 5); + int const g = combine_weights(gweights, bit0, bit1, bit2); + + // blue component + bit0 = BIT(color_prom[i], 6); + bit1 = BIT(color_prom[i], 7); + int const b = combine_weights(bweights, bit0, bit1); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x20; + + // sprites + for (int i = 0; i < 0x100; i++) + { + uint8_t const ctabentry = color_prom[i] & 0x0f; + palette.set_pen_indirect(i, ctabentry); + } + + // characters + for (int i = 0x100; i < 0x200; i++) + { + uint8_t const ctabentry = (color_prom[i] & 0x0f) | 0x10; + palette.set_pen_indirect(i, ctabentry); + } +} +WRITE_LINE_MEMBER(megazone_state::flipscreen_w) +{ + m_flipscreen = state; +} -uint8_t megazone_state::megazone_port_a_r() +void megazone_state::video_start() { - int clock, timer; + m_tmpbitmap = std::make_unique(256, 256); + save_item(NAME(*m_tmpbitmap)); +} - /* main xtal 14.318MHz, divided by 8 to get the AY-3-8910 clock, further */ - /* divided by 1024 to get this timer */ - /* The base clock for the CPU and 8910 is NOT the same, so we have to */ - /* compensate. */ - /* (divide by (1024/2), and not 1024, because the CPU cycle counter is */ - /* incremented every other state change of the clock) */ - clock = m_audiocpu->total_cycles() * 7159/12288; /* = (14318/8)/(18432/6) */ - timer = (clock / (1024/2)) & 0x0f; +uint32_t megazone_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // for every character in the Video RAM + for (int offs = m_videoram[0].bytes() - 1; offs >= 0; offs--) + { + int sx = offs % 32; + int sy = offs / 32; + int flipx = m_colorram[0][offs] & (1 << 6); + int flipy = m_colorram[0][offs] & (1 << 5); + + if (m_flipscreen) + { + sx = 31 - sx; + sy = 31 - sy; + flipx = !flipx; + flipy = !flipy; + } + + m_gfxdecode->gfx(1)->opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), + ((int)m_videoram[0][offs]) + ((m_colorram[0][offs] & (1 << 7) ? 256 : 0) ), + (m_colorram[0][offs] & 0x0f) + 0x10, + flipx, flipy, + 8 * sx, 8 * sy); + } - /* low three bits come from the 8039 */ + // copy the temporary bitmap to the screen + { + int scrollx; + int scrolly; + + if (m_flipscreen) + { + scrollx = *m_scrolly; + scrolly = *m_scrollx; + } + else + { + scrollx = - *m_scrolly + 4 * 8; // leave space for credit&score overlay + scrolly = - *m_scrollx; + } + + copyscrollbitmap(bitmap, *m_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); + } + + + // Draw the sprites. + { + for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) + { + int sx = m_spriteram[offs + 3]; + int sy = 255 - ((m_spriteram[offs + 1] + 16) & 0xff); + int color = m_spriteram[offs + 0] & 0x0f; + int flipx = ~m_spriteram[offs + 0] & 0x40; + int flipy = m_spriteram[offs + 0] & 0x80; + + if (m_flipscreen) + { + sx = sx - 11; + sy = sy + 2; + } + else + sx = sx + 32; + + m_gfxdecode->gfx(0)->transmask(bitmap, cliprect, + m_spriteram[offs + 2], + color, + flipx, flipy, + sx, sy, + m_palette->transpen_mask(*m_gfxdecode->gfx(0), color, 0)); + } + } + + for (int y = 0; y < 32;y++) + { + int offs = y * 32; + for (int x = 0; x < 6; x++) + { + int sx = x; + int sy = y; + + int flipx = m_colorram[1][offs] & (1 << 6); + int flipy = m_colorram[1][offs] & (1 << 5); + + if (m_flipscreen) + { + sx = 35 - sx; + sy = 31 - sy; + flipx = !flipx; + flipy = !flipy; + } + + m_gfxdecode->gfx(1)->opaque(bitmap, cliprect, + ((int)m_videoram[1][offs]) + ((m_colorram[1][offs] & (1 << 7) ? 256 : 0) ), + (m_colorram[1][offs] & 0x0f) + 0x10, + flipx, flipy, + 8 * sx, 8 * sy); + offs++; + } + } + return 0; +} + + +// machine + +uint8_t megazone_state::port_a_r() +{ + // main xtal 14.318MHz, divided by 8 to get the AY-3-8910 clock, further divided by 1024 to get this timer + // The base clock for the CPU and 8910 is NOT the same, so we have to compensate. + // (divide by (1024/2), and not 1024, because the CPU cycle counter is incremented every other state change of the clock) + + int clock = m_audiocpu->total_cycles() * 7159 / 12288; // = (14318 / 8) / (18432 / 6) + int timer = (clock / (1024 / 2)) & 0x0f; + + // low three bits come from the 8039 return (timer << 4) | m_i8039_status; } -void megazone_state::megazone_port_b_w(uint8_t data) +void megazone_state::port_b_w(uint8_t data) { for (int i = 0; i < 3; i++) { int C = 0; if (data & 1) - C += 10000; /* 10000pF = 0.01uF */ + C += 10000; // 10000pF = 0.01uF if (data & 2) - C += 220000; /* 220000pF = 0.22uF */ + C += 220000; // 220000pF = 0.22uF data >>= 2; m_filter[i]->filter_rc_set_RC(filter_rc_device::LOWPASS_3R, 1000, 2200, 200, CAP_P(C)); } } -void megazone_state::megazone_i8039_irq_w(uint8_t data) +void megazone_state::i8039_irq_w(uint8_t data) { m_daccpu->set_input_line(0, ASSERT_LINE); } @@ -137,38 +528,38 @@ WRITE_LINE_MEMBER(megazone_state::irq_mask_w) } -void megazone_state::megazone_map(address_map &map) +void megazone_state::main_map(address_map &map) { map(0x0000, 0x0007).w("mainlatch", FUNC(ls259_device::write_d0)); map(0x0800, 0x0800).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0x1000, 0x1000).writeonly().share("scrolly"); - map(0x1800, 0x1800).writeonly().share("scrollx"); - map(0x2000, 0x23ff).ram().share("videoram"); - map(0x2400, 0x27ff).ram().share("videoram2"); - map(0x2800, 0x2bff).ram().share("colorram"); - map(0x2c00, 0x2fff).ram().share("colorram2"); - map(0x3000, 0x33ff).ram().share("spriteram"); + map(0x1000, 0x1000).writeonly().share(m_scrolly); + map(0x1800, 0x1800).writeonly().share(m_scrollx); + map(0x2000, 0x23ff).ram().share(m_videoram[0]); + map(0x2400, 0x27ff).ram().share(m_videoram[1]); + map(0x2800, 0x2bff).ram().share(m_colorram[0]); + map(0x2c00, 0x2fff).ram().share(m_colorram[1]); + map(0x3000, 0x33ff).ram().share(m_spriteram); map(0x3800, 0x3fff).lrw8([this](offs_t off) { return m_share1[off]; }, "share_r", [this](offs_t off, u8 data) { m_share1[off] = data; }, "share_w"); - map(0x4000, 0xffff).rom(); /* 4000->5FFF is a debug rom */ + map(0x4000, 0xffff).rom(); // 4000->5FFF is a debug ROM } -void megazone_state::megazone_sound_map(address_map &map) +void megazone_state::sound_map(address_map &map) { map(0x0000, 0x1fff).rom(); - map(0x2000, 0x2000).w(FUNC(megazone_state::megazone_i8039_irq_w)); /* START line. Interrupts 8039 */ - map(0x4000, 0x4000).w("soundlatch", FUNC(generic_latch_8_device::write)); /* CODE line. Command Interrupts 8039 */ - map(0x6000, 0x6000).portr("IN0"); /* IO Coin */ - map(0x6001, 0x6001).portr("IN1"); /* P1 IO */ - map(0x6002, 0x6002).portr("IN2"); /* P2 IO */ + map(0x2000, 0x2000).w(FUNC(megazone_state::i8039_irq_w)); // START line. Interrupts 8039 + map(0x4000, 0x4000).w("soundlatch", FUNC(generic_latch_8_device::write)); // CODE line. Command Interrupts 8039 + map(0x6000, 0x6000).portr("IN0"); // IO Coin + map(0x6001, 0x6001).portr("IN1"); // P1 IO + map(0x6002, 0x6002).portr("IN2"); // P2 IO map(0x8000, 0x8000).portr("DSW2"); map(0x8001, 0x8001).portr("DSW1"); - map(0xa000, 0xa000).nopw(); /* INTMAIN - Interrupts main CPU (unused) */ - map(0xc000, 0xc000).nopw(); /* INT (Actually is NMI) enable/disable (unused)*/ + map(0xa000, 0xa000).nopw(); // INTMAIN - Interrupts main CPU (unused) + map(0xc000, 0xc000).nopw(); // INT (Actually is NMI) enable/disable (unused) map(0xc001, 0xc001).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0xe000, 0xe7ff).ram().share("share1"); + map(0xe000, 0xe7ff).ram().share(m_share1); } -void megazone_state::megazone_sound_io_map(address_map &map) +void megazone_state::sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).w("aysnd", FUNC(ay8910_device::address_w)); @@ -176,35 +567,35 @@ void megazone_state::megazone_sound_io_map(address_map &map) map(0x02, 0x02).w("aysnd", FUNC(ay8910_device::data_w)); } -void megazone_state::megazone_i8039_map(address_map &map) +void megazone_state::i8039_map(address_map &map) { map(0x0000, 0x0fff).rom(); } -void megazone_state::megazone_i8039_io_map(address_map &map) +void megazone_state::i8039_io_map(address_map &map) { map(0x00, 0xff).r("soundlatch", FUNC(generic_latch_8_device::read)); } static INPUT_PORTS_START( megazone ) - /* 0x6000 -> 0xe320 (CPU1) = 0x3b20 (CPU0) */ + // 0x6000 -> 0xe320 (CPU1) = 0x3b20 (CPU0) PORT_START("IN0") KONAMI8_SYSTEM_UNK - /* 0x6001 -> 0xe31e (CPU1) = 0x3b1e (CPU0) */ + // 0x6001 -> 0xe31e (CPU1) = 0x3b1e (CPU0) PORT_START("IN1") KONAMI8_MONO_B1_UNK - /* 0x6002 -> 0xe31e (CPU1) = 0x3b1e (CPU0) or 0xe31f (CPU1) = 0x3b1f (CPU0) in "test mode" */ + // 0x6002 -> 0xe31e (CPU1) = 0x3b1e (CPU0) or 0xe31f (CPU1) = 0x3b1f (CPU0) in "test mode" PORT_START("IN2") KONAMI8_COCKTAIL_B1_UNK - /* 0x8001 -> 0xe021 (CPU1) = 0x3821 (CPU0) */ + // 0x8001 -> 0xe021 (CPU1) = 0x3821 (CPU0) PORT_START("DSW1") KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), "No Coin B", SW1) - /* "No Coin B" = coins produce sound, but no effect on coin counter */ + // "No Coin B" = coins produce sound, but no effect on coin counter - /* 0x8000 -> 0xe020 (CPU1) = 0x3820 (CPU0) */ + // 0x8000 -> 0xe020 (CPU1) = 0x3820 (CPU0) PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "3" ) @@ -243,26 +634,26 @@ INPUT_PORTS_END static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ - 512, /* 512 characters */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, /* the four bitplanes are packed in one nibble */ + 8,8, // 8*8 characters + 512, // 512 characters + 4, // 4 bits per pixel + { 0, 1, 2, 3 }, // the four bitplanes are packed in one nibble { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 /* every char takes 8 consecutive bytes */ + 32*8 // every char takes 8 consecutive bytes }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 256, /* 256 sprites */ - 4, /* 4 bits per pixel */ + 16,16, // 16*16 sprites + 256, // 256 sprites + 4, // 4 bits per pixel { 0x4000*8+4, 0x4000*8+0, 4, 0 }, { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 , 32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 }, - 64*8 /* every sprite takes 64 consecutive bytes */ + 64*8 // every sprite takes 64 consecutive bytes }; static GFXDECODE_START( gfx_megazone ) @@ -294,17 +685,17 @@ WRITE_LINE_MEMBER(megazone_state::vblank_irq) void megazone_state::megazone(machine_config &config) { - /* basic machine hardware */ - KONAMI1(config, m_maincpu, XTAL(18'432'000)/9); /* 2.048 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &megazone_state::megazone_map); + // basic machine hardware + KONAMI1(config, m_maincpu, XTAL(18'432'000) / 12); // 1.536 MHz + m_maincpu->set_addrmap(AS_PROGRAM, &megazone_state::main_map); - Z80(config, m_audiocpu, XTAL(18'432'000)/6); /* Z80 Clock is derived from the H1 signal */ - m_audiocpu->set_addrmap(AS_PROGRAM, &megazone_state::megazone_sound_map); - m_audiocpu->set_addrmap(AS_IO, &megazone_state::megazone_sound_io_map); + Z80(config, m_audiocpu, XTAL(18'432'000) / 6); // Z80 Clock is derived from the H1 signal + m_audiocpu->set_addrmap(AS_PROGRAM, &megazone_state::sound_map); + m_audiocpu->set_addrmap(AS_IO, &megazone_state::sound_io_map); - I8039(config, m_daccpu, XTAL(14'318'181)/2); /* 7.15909MHz */ - m_daccpu->set_addrmap(AS_PROGRAM, &megazone_state::megazone_i8039_map); - m_daccpu->set_addrmap(AS_IO, &megazone_state::megazone_i8039_io_map); + I8039(config, m_daccpu, XTAL(14'318'181) / 2); // 7.15909 MHz + m_daccpu->set_addrmap(AS_PROGRAM, &megazone_state::i8039_map); + m_daccpu->set_addrmap(AS_IO, &megazone_state::i8039_io_map); m_daccpu->p1_out_cb().set("dac", FUNC(dac_byte_interface::data_w)); m_daccpu->p2_out_cb().set(FUNC(megazone_state::i8039_irqen_and_status_w)); @@ -318,32 +709,32 @@ void megazone_state::megazone(machine_config &config) WATCHDOG_TIMER(config, "watchdog"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); + screen.set_refresh_hz(60.606060); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(36*8, 32*8); screen.set_visarea(0*8, 36*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(megazone_state::screen_update_megazone)); + screen.set_screen_update(FUNC(megazone_state::screen_update)); screen.set_palette(m_palette); screen.screen_vblank().set(FUNC(megazone_state::vblank_irq)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_megazone); - PALETTE(config, m_palette, FUNC(megazone_state::megazone_palette), 16*16+16*16, 32); + PALETTE(config, m_palette, FUNC(megazone_state::palette), 16*16+16*16, 32); - /* sound hardware */ + // sound hardware SPEAKER(config, "speaker").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(14'318'181)/8)); - aysnd.port_a_read_callback().set(FUNC(megazone_state::megazone_port_a_r)); - aysnd.port_b_write_callback().set(FUNC(megazone_state::megazone_port_b_w)); + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(14'318'181) / 8)); + aysnd.port_a_read_callback().set(FUNC(megazone_state::port_a_r)); + aysnd.port_b_write_callback().set(FUNC(megazone_state::port_b_w)); aysnd.add_route(0, "filter.0.0", 0.30); aysnd.add_route(1, "filter.0.1", 0.30); aysnd.add_route(2, "filter.0.2", 0.30); - DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // R-2R ladder network FILTER_RC(config, m_filter[0]).add_route(ALL_OUTPUTS, "speaker", 1.0); FILTER_RC(config, m_filter[1]).add_route(ALL_OUTPUTS, "speaker", 1.0); @@ -369,7 +760,7 @@ ROM_START( megazone ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "319e02.6d", 0x0000, 0x2000, CRC(d5d45edb) SHA1(3808d1b58fe152f8f5b49bf0aa40c53e9c9dd4bd) ) - ROM_REGION( 0x1000, "daccpu", 0 ) /* 4k for the 8039 DAC CPU */ + ROM_REGION( 0x1000, "daccpu", 0 ) // 4k for the 8039 DAC CPU ROM_LOAD( "319e01.3a", 0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) ROM_REGION( 0x08000, "gfx1", 0 ) @@ -383,11 +774,11 @@ ROM_START( megazone ) ROM_LOAD( "319_g13.10c", 0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13 ROM_REGION( 0x0260, "proms", 0 ) - ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */ - ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */ - ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) /* character lookup table */ - ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) /* timing (not used) */ - ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) /* timing (not used) */ + ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) // palette + ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) // sprite lookup table + ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) // character lookup table + ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) // timing (not used) + ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) // timing (not used) ROM_END ROM_START( megazonej ) // Interlogic + Kosuka license set @@ -401,7 +792,7 @@ ROM_START( megazonej ) // Interlogic + Kosuka license set ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "319e02.6d", 0x0000, 0x2000, CRC(d5d45edb) SHA1(3808d1b58fe152f8f5b49bf0aa40c53e9c9dd4bd) ) - ROM_REGION( 0x1000, "daccpu", 0 ) /* 4k for the 8039 DAC CPU */ + ROM_REGION( 0x1000, "daccpu", 0 ) // 4k for the 8039 DAC CPU ROM_LOAD( "319e01.3a", 0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) ROM_REGION( 0x08000, "gfx1", 0 ) @@ -415,11 +806,11 @@ ROM_START( megazonej ) // Interlogic + Kosuka license set ROM_LOAD( "319_g13.10c", 0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13 ROM_REGION( 0x0260, "proms", 0 ) - ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */ - ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */ - ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) /* character lookup table */ - ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) /* timing (not used) */ - ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) /* timing (not used) */ + ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) // palette + ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) // sprite lookup table + ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) // character lookup table + ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) // timing (not used) + ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) // timing (not used) ROM_END ROM_START( megazonei ) @@ -433,7 +824,7 @@ ROM_START( megazonei ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "319e02.6d", 0x0000, 0x2000, CRC(d5d45edb) SHA1(3808d1b58fe152f8f5b49bf0aa40c53e9c9dd4bd) ) - ROM_REGION( 0x1000, "daccpu", 0 ) /* 4k for the 8039 DAC CPU */ + ROM_REGION( 0x1000, "daccpu", 0 ) // 4k for the 8039 DAC CPU ROM_LOAD( "319e01.3a", 0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) ROM_REGION( 0x08000, "gfx1", 0 ) @@ -447,11 +838,11 @@ ROM_START( megazonei ) ROM_LOAD( "319_e13.10c", 0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) ROM_REGION( 0x0260, "proms", 0 ) - ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */ - ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */ - ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) /* character lookup table */ - ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) /* timing (not used) */ - ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) /* timing (not used) */ + ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) // palette + ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) // sprite lookup table + ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) // character lookup table + ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) // timing (not used) + ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) // timing (not used) ROM_END ROM_START( megazoneh ) // Kosuka license set @@ -465,7 +856,7 @@ ROM_START( megazoneh ) // Kosuka license set ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "319e02.6d", 0x0000, 0x2000, CRC(d5d45edb) SHA1(3808d1b58fe152f8f5b49bf0aa40c53e9c9dd4bd) ) - ROM_REGION( 0x1000, "daccpu", 0 ) /* 4k for the 8039 DAC CPU */ + ROM_REGION( 0x1000, "daccpu", 0 ) // 4k for the 8039 DAC CPU ROM_LOAD( "319h01.3a", 0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) // same as e01 ROM_REGION( 0x08000, "gfx1", 0 ) @@ -479,43 +870,44 @@ ROM_START( megazoneh ) // Kosuka license set ROM_LOAD( "319_g13.10c", 0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13 ROM_REGION( 0x0260, "proms", 0 ) - ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */ - ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */ - ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) /* character lookup table */ - ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) /* timing (not used) */ - ROM_LOAD( "prom.48", 0x0240, 0x020, CRC(796dea94) SHA1(bab3c2a5466e1c07ec27cccf7b1a21e9de4ed982) ) /* timing (not used) */ + ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) // palette + ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) // sprite lookup table + ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) // character lookup table + ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) // timing (not used) + ROM_LOAD( "prom.48", 0x0240, 0x020, CRC(796dea94) SHA1(bab3c2a5466e1c07ec27cccf7b1a21e9de4ed982) ) // timing (not used) ROM_END -ROM_START( megazonea ) // Interlogic + Kosuka license set +ROM_START( megazonea ) // Interlogic + Kosuka license set. +// A second dump was made from a PCB with all hand written labels on both top and bottom boards. The labels for the second PCB are noted in the comments. Curiously, they seem to point at this being version H, but they differ from megazoneh ROM_REGION( 2*0x10000, "maincpu", 0 ) - ROM_LOAD( "ic59_cpu.bin", 0x6000, 0x2000, CRC(f41922a0) SHA1(9f54509da18721a76593921c6e52085e62e6ea6b) ) // need to correct program / region code ID - ROM_LOAD( "ic58_cpu.bin", 0x8000, 0x2000, CRC(7fd7277b) SHA1(e773247e0c9419cae49e04962ea362a2976c2db2) ) - ROM_LOAD( "ic57_cpu.bin", 0xa000, 0x2000, CRC(a4b33b51) SHA1(12bb4da0319a7fe355e5ea4945759c8709aed5fe) ) - ROM_LOAD( "ic56_cpu.bin", 0xc000, 0x2000, CRC(2aabcfbf) SHA1(f0054af98bd68158eab3328f8cf2a04b35e812c7) ) - ROM_LOAD( "ic55_cpu.bin", 0xe000, 0x2000, CRC(b33a3c37) SHA1(2f1fdf1b9f18fcc9bd97cc9adeecc4ce77dd30c9) ) + ROM_LOAD( "ic59_cpu.bin", 0x6000, 0x2000, CRC(f41922a0) SHA1(9f54509da18721a76593921c6e52085e62e6ea6b) ) // need to correct program / region code ID // 2nd PCB: 319h07.ic59 + ROM_LOAD( "ic58_cpu.bin", 0x8000, 0x2000, CRC(7fd7277b) SHA1(e773247e0c9419cae49e04962ea362a2976c2db2) ) // 2nd PCB: 319h06.ic58 + ROM_LOAD( "ic57_cpu.bin", 0xa000, 0x2000, CRC(a4b33b51) SHA1(12bb4da0319a7fe355e5ea4945759c8709aed5fe) ) // 2nd PCB: 319h05.ic57 + ROM_LOAD( "ic56_cpu.bin", 0xc000, 0x2000, CRC(2aabcfbf) SHA1(f0054af98bd68158eab3328f8cf2a04b35e812c7) ) // 2nd PCB: 319h04.ic56 + ROM_LOAD( "ic55_cpu.bin", 0xe000, 0x2000, CRC(b33a3c37) SHA1(2f1fdf1b9f18fcc9bd97cc9adeecc4ce77dd30c9) ) // 2nd PCB: 319h03.ic55 ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "319e02.6d", 0x0000, 0x2000, CRC(d5d45edb) SHA1(3808d1b58fe152f8f5b49bf0aa40c53e9c9dd4bd) ) + ROM_LOAD( "319e02.6d", 0x0000, 0x2000, CRC(d5d45edb) SHA1(3808d1b58fe152f8f5b49bf0aa40c53e9c9dd4bd) ) // 2nd PCB: 319e02.ic25 - ROM_REGION( 0x1000, "daccpu", 0 ) /* 4k for the 8039 DAC CPU */ - ROM_LOAD( "319e01.3a", 0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) + ROM_REGION( 0x1000, "daccpu", 0 ) // 4k for the 8039 DAC CPU + ROM_LOAD( "319e01.3a", 0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) // 2nd PCB: 319e01.ic2 ROM_REGION( 0x08000, "gfx1", 0 ) - ROM_LOAD( "319e11.3e", 0x0000, 0x2000, CRC(965a7ff6) SHA1(210aae91a3838e5f7c78747d9b7419d266538ffc) ) - ROM_LOAD( "319e09.2e", 0x2000, 0x2000, CRC(5eaa7f3e) SHA1(4c038e80d575988407252897a1f1bc6b76af597c) ) - ROM_LOAD( "319e10.3d", 0x4000, 0x2000, CRC(7bb1aeee) SHA1(be2dd46cd0121cedad6dab90a22643798a3176ab) ) - ROM_LOAD( "319e08.2d", 0x6000, 0x2000, CRC(6add71b1) SHA1(fc8c0ecd3b7f03d63b6c3143143986883345fa38) ) + ROM_LOAD( "319e11.3e", 0x0000, 0x2000, CRC(965a7ff6) SHA1(210aae91a3838e5f7c78747d9b7419d266538ffc) ) // 2nd PCB: 319e11.ic015 + ROM_LOAD( "319e09.2e", 0x2000, 0x2000, CRC(5eaa7f3e) SHA1(4c038e80d575988407252897a1f1bc6b76af597c) ) // 2nd PCB: 319e09.ic005 + ROM_LOAD( "319e10.3d", 0x4000, 0x2000, CRC(7bb1aeee) SHA1(be2dd46cd0121cedad6dab90a22643798a3176ab) ) // 2nd PCB: 319e10.ic014 + ROM_LOAD( "319e08.2d", 0x6000, 0x2000, CRC(6add71b1) SHA1(fc8c0ecd3b7f03d63b6c3143143986883345fa38) ) // 2nd PCB: 319e08.ic004 ROM_REGION( 0x04000, "gfx2", 0 ) - ROM_LOAD( "319_g12.8c", 0x0000, 0x2000, CRC(07b8b24b) SHA1(faadcb20ee8b26b9ab0692df6a81e5423514863e) ) - ROM_LOAD( "319_g13.10c", 0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13 + ROM_LOAD( "319_g12.8c", 0x0000, 0x2000, CRC(07b8b24b) SHA1(faadcb20ee8b26b9ab0692df6a81e5423514863e) ) // 2nd PCB: 319g12.ic046 + ROM_LOAD( "319_g13.10c", 0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13 // 2nd PCB: 319g13.ic058 ROM_REGION( 0x0260, "proms", 0 ) - ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */ - ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */ - ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) /* character lookup table */ - ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) /* timing (not used) */ - ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) /* timing (not used) */ + ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) // palette + ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) // sprite lookup table + ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) // character lookup table + ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) // timing (not used) + ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) // timing (not used) ROM_END ROM_START( megazoneb ) @@ -529,7 +921,7 @@ ROM_START( megazoneb ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "319h02.6d", 0x0000, 0x2000, CRC(d5d45edb) SHA1(3808d1b58fe152f8f5b49bf0aa40c53e9c9dd4bd) ) // same as e02 - ROM_REGION( 0x1000, "daccpu", 0 ) /* 4k for the 8039 DAC CPU */ + ROM_REGION( 0x1000, "daccpu", 0 ) // 4k for the 8039 DAC CPU ROM_LOAD( "319h01.3a", 0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) // same as e01 ROM_REGION( 0x08000, "gfx1", 0 ) @@ -543,18 +935,19 @@ ROM_START( megazoneb ) ROM_LOAD( "319_g13.10c", 0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13 ROM_REGION( 0x0260, "proms", 0 ) - ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */ - ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */ - ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) /* character lookup table */ - ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) /* timing (not used) */ - ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) /* timing (not used) */ + ROM_LOAD( "319b18.a16", 0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) // palette + ROM_LOAD( "319b16.c6", 0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) // sprite lookup table + ROM_LOAD( "319b17.a11", 0x0120, 0x100, CRC(1fbfce73) SHA1(1c58eb91982d5f10511d54a83070e859ac57d2f1) ) // character lookup table + ROM_LOAD( "319b14.e7", 0x0220, 0x020, CRC(55044268) SHA1(29cf4158314ed897daf045a7f07be865dd977663) ) // timing (not used) + ROM_LOAD( "319b15.e8", 0x0240, 0x020, CRC(31fd7ab9) SHA1(04d6e51b4930619c8ee12fb0d7b5f981e4d6d8d3) ) // timing (not used) ROM_END +} // anonymous namespace -GAME( 1983, megazone, 0, megazone, megazone, megazone_state, empty_init, ROT90, "Konami", "Mega Zone (program code L)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, megazonej, megazone, megazone, megazone, megazone_state, empty_init, ROT90, "Konami (Interlogic / Kosuka license)", "Mega Zone (program code J)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, megazonei, megazone, megazone, megazone, megazone_state, empty_init, ROT90, "Konami", "Mega Zone (program code I)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, megazoneh, megazone, megazone, megazone, megazone_state, empty_init, ROT90, "Konami (Kosuka license)", "Mega Zone (program code H)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, megazone, 0, megazone, megazone, megazone_state, empty_init, ROT90, "Konami", "Mega Zone (program code L)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, megazonej, megazone, megazone, megazone, megazone_state, empty_init, ROT90, "Konami (Interlogic / Kosuka license)", "Mega Zone (program code J)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, megazonei, megazone, megazone, megazone, megazone_state, empty_init, ROT90, "Konami", "Mega Zone (program code I)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, megazoneh, megazone, megazone, megazone, megazone_state, empty_init, ROT90, "Konami (Kosuka license)", "Mega Zone (program code H)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, megazonea, megazone, megazone, megazone, megazone_state, empty_init, ROT90, "Konami (Interlogic / Kosuka license)", "Mega Zone (unknown program code 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, megazoneb, megazone, megazone, megazona, megazone_state, empty_init, ROT90, "Konami", "Mega Zone (unknown program code 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/snesb.cpp b/src/mame/drivers/snesb.cpp index b275ec930b7..46b64b7b837 100644 --- a/src/mame/drivers/snesb.cpp +++ b/src/mame/drivers/snesb.cpp @@ -35,7 +35,6 @@ TODO: - venom : gfx glitches on second level - wldgunsb : dipswitches - wldgunsb : sometimes continue counter doesn't start from '9', verify if protection is involved. - - fatfurspb: ROMs are identical to the SNES version. Mods provided by security chip? *************************************************************************** @@ -189,7 +188,6 @@ public: void init_rushbets(); void init_venom(); void init_wldgunsb(); - void init_fatfurspb(); private: optional_shared_ptr_array m_shared_ram; @@ -999,20 +997,6 @@ void snesb_state::init_kinstb() init_snes_hirom(); } -void snesb_state::init_fatfurspb() -{ - uint8_t *rom = memregion("user3")->base(); - - for (uint32_t i = 0; i < 0x400000; i++) - { - rom[i] = bitswap<8>(rom[i], 5, 0, 6, 1, 7, 4, 3, 2); // Same as kinstb - } - - // Data is 100% same as Fatal Fury Special (U). Patches applied by protection device for coinage, etc? - - init_snes_hirom(); -} - void snesb_state::init_ffight2b() { uint8_t *rom = memregion("user3")->base(); @@ -1058,6 +1042,13 @@ void snesb_state::init_ffight3b() rom[0xfffc] = 0x00; rom[0xfffd] = 0xfe; + // patch out protection + rom[0xfe33] = 0x5c; + rom[0xfe34] = 0x00; + rom[0xfe35] = 0x00; + rom[0xfe36] = 0xc0; + rom[0xfeab] = 0x60; + init_snes_hirom(); } @@ -1636,20 +1627,12 @@ ROM_START( wldgunsb ) ROM_LOAD( "c20.bin", 0x080000, 0x080000, CRC(62ae4acb) SHA1(62aa320bcc7eeedb00c70baa909ac0230256c9a4) ) ROM_END -ROM_START( fatfurspb ) - ROM_REGION( 0x400000, "user3", 0 ) - ROM_LOAD( "1.u14", 0x000000, 0x100000, CRC(7cb9192c) SHA1(0247e303902e86eaa9443f2a39d352430df5f46f) ) - ROM_LOAD( "2.u15", 0x100000, 0x100000, CRC(440e3017) SHA1(7d1a2077032c761676bff7f841ab1fc669d322fa) ) - ROM_LOAD( "3.u16", 0x200000, 0x100000, CRC(dbbe10de) SHA1(27c590bff5a762a2528d0819b7544914ab6cae7c) ) - ROM_LOAD( "4.u17", 0x300000, 0x100000, CRC(a356e60c) SHA1(c403eff4e7c7deefed68a34a0dbeefadac8c7a0e) ) -ROM_END - } // Anonymous namespace GAME( 199?, kinstb, 0, kinstb, kinstb, snesb_state, init_kinstb, ROT0, "bootleg", "Killer Instinct (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, ffight2b, 0, ffight2b, ffight2b, snesb_state, init_ffight2b, ROT0, "bootleg", "Final Fight 2 (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 199?, ffight3b, 0, extrainp, ffight2b, snesb_state, init_ffight3b, ROT0, "bootleg", "Final Fight 3 (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // based on beta version? protected? +GAME( 199?, ffight3b, 0, extrainp, ffight2b, snesb_state, init_ffight3b, ROT0, "bootleg", "Final Fight 3 (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // based on beta version? protection isn't figured out GAME( 1996, iron, 0, extrainp, iron, snesb_state, init_iron, ROT0, "bootleg", "Iron (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, denseib, 0, extrainp, denseib, snesb_state, init_denseib, ROT0, "bootleg", "Ghost Chaser Densei (SNES bootleg, set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, denseib2, denseib, extrainp, denseib, snesb_state, init_denseib2, ROT0, "bootleg", "Ghost Chaser Densei (SNES bootleg, set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) @@ -1661,4 +1644,3 @@ GAME( 1996, legendsb, 0, extrainp, kinstb, snesb_state, init_le GAME( 1997, rushbets, 0, rushbets, rushbets, snesb_state, init_rushbets, ROT0, "bootleg", "Rushing Beat Shura (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, venom, 0, venom, venom, snesb_state, init_venom, ROT0, "bootleg", "Venom & Spider-Man - Separation Anxiety (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, wldgunsb, 0, wldgunsb, wldgunsb, snesb_state, init_wldgunsb, ROT0, "bootleg", "Wild Guns (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // based off Japanese version -GAME( 199?, fatfurspb, 0, base, venom, snesb_state, init_fatfurspb, ROT0, "bootleg", "Fatal Fury Special (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // coinage, etc. handled by protection device diff --git a/src/mame/drivers/snesb51.cpp b/src/mame/drivers/snesb51.cpp index bbaf3278d97..1dcc6277883 100644 --- a/src/mame/drivers/snesb51.cpp +++ b/src/mame/drivers/snesb51.cpp @@ -7,6 +7,7 @@ Skeleton driver The following systems are dumped: + - Fatal Fury Special - Mortal Kombat 3 - 4 Slot board (two different BIOS versions) - 4 Slot board with built-in NBA Jam @@ -52,24 +53,37 @@ 6 - * Note - P5 ribbon to SNES controls 7 - GND + Dumper's notes for MK3: + "Ok can confirm with this style the MCU provides an overlay similar to the "NBA jam 4 slot" snes bootlegs. + I have an onscreen insert coin display from the MCU but the underlying snes hardware is dead so actual game is not running." + + TODO: complete MCU hookup ***************************************************************************/ #include "emu.h" +#include "includes/snes.h" #include "cpu/mcs51/mcs51.h" #include "emupal.h" +#include "speaker.h" + -class snesb51_state : public driver_device +namespace { + +class snesb51_state : public snes_state { public: snesb51_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), + snes_state(mconfig, type, tag), m_mcu(*this, "mcu") { } + void base(machine_config &config); void mk3snes(machine_config &config); void snes4sl(machine_config &config); void snes4sln(machine_config &config); + void init_fatfurspb(); + protected: void machine_start() override; @@ -78,6 +92,8 @@ private: void mem_map(address_map &map); void io_map(address_map &map); + void snes_map(address_map &map); + void spc_map(address_map &map); void mcu_p1_w(uint8_t data); uint8_t mcu_p3_r(); @@ -91,6 +107,18 @@ private: uint16_t m_ram_address; }; +void snesb51_state::snes_map(address_map &map) +{ + map(0x000000, 0x7dffff).rw(FUNC(snesb51_state::snes_r_bank1), FUNC(snesb51_state::snes_w_bank1)); + map(0x7e0000, 0x7fffff).ram().share(m_wram); // 8KB Low RAM, 24KB High RAM, 96KB Expanded RAM + map(0x800000, 0xffffff).rw(FUNC(snesb51_state::snes_r_bank2), FUNC(snesb51_state::snes_w_bank2)); // Mirror and ROM +} + +void snesb51_state::spc_map(address_map &map) +{ + map(0x0000, 0xffff).ram().share("aram"); +} + void snesb51_state::mem_map(address_map &map) { map(0x0000, 0x7fff).rom().region("mcu", 0); @@ -112,6 +140,41 @@ void snesb51_state::io_map(address_map &map) } static INPUT_PORTS_START( mk3snes ) + PORT_START("SERIAL1_DATA1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button A") PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button X") PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button L") PORT_PLAYER(1) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button R") PORT_PLAYER(1) + PORT_BIT( 0x000f, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("SERIAL2_DATA1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button A") PORT_PLAYER(2) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button X") PORT_PLAYER(2) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button L") PORT_PLAYER(2) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button R") PORT_PLAYER(2) + PORT_BIT( 0x000f, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("SERIAL1_DATA2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("SERIAL2_DATA2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END static INPUT_PORTS_START( snes4sl ) @@ -178,10 +241,47 @@ void snesb51_state::machine_start() { m_ram = std::make_unique(0x2000); save_pointer(NAME(m_ram), 0x2000); + + snes_state::machine_start(); +} + +void snesb51_state::base(machine_config &config) +{ + // basic machine hardware + _5A22(config, m_maincpu, 3580000 * 6); + m_maincpu->set_addrmap(AS_PROGRAM, &snesb51_state::snes_map); + + S_SMP(config, m_soundcpu, XTAL(24'576'000) / 12); + m_soundcpu->set_addrmap(AS_DATA, &snesb51_state::spc_map); + m_soundcpu->dsp_io_read_callback().set(m_s_dsp, FUNC(s_dsp_device::dsp_io_r)); + m_soundcpu->dsp_io_write_callback().set(m_s_dsp, FUNC(s_dsp_device::dsp_io_w)); + + config.set_perfect_quantum(m_maincpu); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(DOTCLK_NTSC * 2, SNES_HTOTAL * 2, 0, SNES_SCR_WIDTH * 2, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC); + m_screen->set_video_attributes(VIDEO_VARIABLE_WIDTH); + m_screen->set_screen_update(FUNC(snes_state::screen_update)); + + SNES_PPU(config, m_ppu, MCLK_NTSC); + m_ppu->open_bus_callback().set([this] { return snes_open_bus_r(); }); + m_ppu->set_screen("screen"); + + // sound hardware + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + S_DSP(config, m_s_dsp, XTAL(24'576'000) / 12); + m_s_dsp->set_addrmap(0, &snesb51_state::spc_map); + m_s_dsp->add_route(0, "lspeaker", 1.00); + m_s_dsp->add_route(1, "rspeaker", 1.00); } void snesb51_state::mk3snes(machine_config &config) { + base(config); + I8751(config, m_mcu, 12_MHz_XTAL); m_mcu->set_addrmap(AS_IO, &snesb51_state::io_map); m_mcu->port_out_cb<1>().set(FUNC(snesb51_state::mcu_p1_w)); @@ -191,6 +291,8 @@ void snesb51_state::mk3snes(machine_config &config) void snesb51_state::snes4sl(machine_config &config) { + base(config); + // exact type unknown I8031(config, m_mcu, 12_MHz_XTAL); m_mcu->set_addrmap(AS_PROGRAM, &snesb51_state::mem_map); @@ -206,6 +308,8 @@ void snesb51_state::snes4sl(machine_config &config) void snesb51_state::snes4sln(machine_config &config) { + base(config); + I8051(config, m_mcu, 12_MHz_XTAL); // SAB 8051A-P m_mcu->set_addrmap(AS_PROGRAM, &snesb51_state::mem_map); m_mcu->set_addrmap(AS_IO, &snesb51_state::io_map); @@ -216,7 +320,7 @@ void snesb51_state::snes4sln(machine_config &config) // This is identical to the SNES release apart from a single byte ROM_START( mk3snes ) - ROM_REGION(0x400000, "game", 0) + ROM_REGION(0x400000, "user3", 0) ROM_LOAD("5.u5", 0x000000, 0x080000, CRC(c21ee1ac) SHA1(12fc526e39b0b998b39d558fbe5660e72c7fad14)) ROM_LOAD("6.u6", 0x080000, 0x080000, CRC(0e064323) SHA1(a11175516892beb862c7cc1e186034ef1b55ee8f)) ROM_LOAD("7.u7", 0x100000, 0x080000, CRC(7db6b7be) SHA1(a7653c04f5321fd83062425a492c7ed0a4f1fdb0)) @@ -256,7 +360,35 @@ ROM_START( snes4sln ) ROM_LOAD("5.bin", 0x0000, 0x8000, CRC(af8a64e3) SHA1(f13187d213fe7c2a0edcb88d4e828bd24112e812)) ROM_END -// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS -GAME( 199?, mk3snes, 0, mk3snes, mk3snes, snesb51_state, empty_init, ROT0, "bootleg", "Mortal Kombat 3 (SNES bootleg)", MACHINE_IS_SKELETON ) -GAME( 1993, snes4sl, 0, snes4sl, snes4sl, snesb51_state, empty_init, ROT0, "bootleg", "SNES 4 Slot arcade switcher", MACHINE_IS_SKELETON ) -GAME( 1994, snes4sln, 0, snes4sln, snes4sl, snesb51_state, empty_init, ROT0, "bootleg", "SNES 4 Slot arcade switcher (NBA Jam)", MACHINE_IS_SKELETON ) +ROM_START( fatfurspb ) + ROM_REGION( 0x400000, "user3", 0 ) + ROM_LOAD("1.u14", 0x000000, 0x100000, CRC(7cb9192c) SHA1(0247e303902e86eaa9443f2a39d352430df5f46f)) + ROM_LOAD("2.u15", 0x100000, 0x100000, CRC(440e3017) SHA1(7d1a2077032c761676bff7f841ab1fc669d322fa)) + ROM_LOAD("3.u16", 0x200000, 0x100000, CRC(dbbe10de) SHA1(27c590bff5a762a2528d0819b7544914ab6cae7c)) + ROM_LOAD("4.u17", 0x300000, 0x100000, CRC(a356e60c) SHA1(c403eff4e7c7deefed68a34a0dbeefadac8c7a0e)) + + ROM_REGION(0x1000, "mcu", 0) + ROM_LOAD("d87c51.u9", 0x0000, 0x1000, NO_DUMP) +ROM_END + + +void snesb51_state::init_fatfurspb() +{ + uint8_t *rom = memregion("user3")->base(); + + for (uint32_t i = 0; i < 0x400000; i++) + { + rom[i] = bitswap<8>(rom[i], 5, 0, 6, 1, 7, 4, 3, 2); + } + + init_snes_hirom(); +} + +} // anonymous namespace + + +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS +GAME( 199?, mk3snes, 0, mk3snes, mk3snes, snesb51_state, init_snes_hirom, ROT0, "bootleg", "Mortal Kombat 3 (SNES bootleg)", MACHINE_IS_SKELETON ) +GAME( 1993, snes4sl, 0, snes4sl, snes4sl, snesb51_state, empty_init, ROT0, "bootleg", "SNES 4 Slot arcade switcher", MACHINE_IS_SKELETON ) +GAME( 1994, snes4sln, 0, snes4sln, snes4sl, snesb51_state, empty_init, ROT0, "bootleg", "SNES 4 Slot arcade switcher (NBA Jam)", MACHINE_IS_SKELETON ) +GAME( 199?, fatfurspb, 0, mk3snes, mk3snes, snesb51_state, init_fatfurspb, ROT0, "bootleg", "Fatal Fury Special (SNES bootleg)", MACHINE_IS_SKELETON ) diff --git a/src/mame/includes/megazone.h b/src/mame/includes/megazone.h deleted file mode 100644 index 7a1059bb45b..00000000000 --- a/src/mame/includes/megazone.h +++ /dev/null @@ -1,88 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Chris Hardy -/************************************************************************* - - Megazone - -*************************************************************************/ -#ifndef MAME_INCLUDES_MEGAZONE_H -#define MAME_INCLUDES_MEGAZONE_H - -#pragma once - -#include "cpu/mcs48/mcs48.h" -#include "sound/flt_rc.h" -#include "emupal.h" - -class megazone_state : public driver_device -{ -public: - megazone_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_scrolly(*this, "scrolly"), - m_scrollx(*this, "scrollx"), - m_videoram(*this, "videoram"), - m_videoram2(*this, "videoram2"), - m_colorram(*this, "colorram"), - m_colorram2(*this, "colorram2"), - m_spriteram(*this, "spriteram"), - m_share1(*this, "share1"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_daccpu(*this, "daccpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_filter(*this, "filter.0.%u", 0U) - { } - - void megazone(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_scrolly; - required_shared_ptr m_scrollx; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_spriteram; - required_shared_ptr m_share1; - - /* video-related */ - std::unique_ptr m_tmpbitmap; - int m_flipscreen; - - /* misc */ - int m_i8039_status; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_daccpu; - required_device m_gfxdecode; - required_device m_palette; - required_device_array m_filter; - - uint8_t m_irq_mask; - void megazone_i8039_irq_w(uint8_t data); - void i8039_irqen_and_status_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(coin_counter_1_w); - DECLARE_WRITE_LINE_MEMBER(coin_counter_2_w); - DECLARE_WRITE_LINE_MEMBER(irq_mask_w); - DECLARE_WRITE_LINE_MEMBER(flipscreen_w); - uint8_t megazone_port_a_r(); - void megazone_port_b_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void megazone_palette(palette_device &palette) const; - uint32_t screen_update_megazone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(vblank_irq); - void megazone_i8039_io_map(address_map &map); - void megazone_i8039_map(address_map &map); - void megazone_map(address_map &map); - void megazone_sound_io_map(address_map &map); - void megazone_sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_MEGAZONE_H diff --git a/src/mame/mame.lst b/src/mame/mame.lst index ddf5153f398..e79fa5b5e6e 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -39022,7 +39022,6 @@ denseib // bootleg denseib2 // bootleg endless // bootleg endlessa // bootleg -fatfurspb // bootleg ffight2b // bootleg ffight3b // bootleg iron // bootleg @@ -39035,6 +39034,7 @@ venom // bootleg wldgunsb // bootleg @source:snesb51.cpp +fatfurspb mk3snes snes4sl snes4sln diff --git a/src/mame/video/megazone.cpp b/src/mame/video/megazone.cpp deleted file mode 100644 index 908aef20564..00000000000 --- a/src/mame/video/megazone.cpp +++ /dev/null @@ -1,222 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Chris Hardy -/*************************************************************************** - - video.c - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "video/resnet.h" -#include "includes/megazone.h" - -/*************************************************************************** -Based on driver from MAME 0.55 -Changes by Martin M. (pfloyd@gmx.net) 14.10.2001: - - - Added support for screen flip in cocktail mode (tricky!) */ - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Megazone has one 32x8 palette PROM and two 256x4 lookup table PROMs - (one for characters, one for sprites). - The palette PROM is connected to the RGB output this way: - - bit 7 -- 220 ohm resistor -- BLUE - -- 470 ohm resistor -- BLUE - -- 220 ohm resistor -- GREEN - -- 470 ohm resistor -- GREEN - -- 1 kohm resistor -- GREEN - -- 220 ohm resistor -- RED - -- 470 ohm resistor -- RED - bit 0 -- 1 kohm resistor -- RED - -***************************************************************************/ - -void megazone_state::megazone_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - static constexpr int resistances_rg[3] = { 1000, 470, 220 }; - static constexpr int resistances_b [2] = { 470, 220 }; - - // compute the color output resistor weights - double rweights[3], gweights[3], bweights[2]; - compute_resistor_weights(0, 255, -1.0, - 3, &resistances_rg[0], rweights, 1000, 0, - 3, &resistances_rg[0], gweights, 1000, 0, - 2, &resistances_b[0], bweights, 1000, 0); - - // create a lookup table for the palette - for (int i = 0; i < 0x20; i++) - { - int bit0, bit1, bit2; - - // red component - bit0 = BIT(color_prom[i], 0); - bit1 = BIT(color_prom[i], 1); - bit2 = BIT(color_prom[i], 2); - int const r = combine_weights(rweights, bit0, bit1, bit2); - - // green component - bit0 = BIT(color_prom[i], 3); - bit1 = BIT(color_prom[i], 4); - bit2 = BIT(color_prom[i], 5); - int const g = combine_weights(gweights, bit0, bit1, bit2); - - // blue component - bit0 = BIT(color_prom[i], 6); - bit1 = BIT(color_prom[i], 7); - int const b = combine_weights(bweights, bit0, bit1); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x20; - - // sprites - for (int i = 0; i < 0x100; i++) - { - uint8_t const ctabentry = color_prom[i] & 0x0f; - palette.set_pen_indirect(i, ctabentry); - } - - // characters - for (int i = 0x100; i < 0x200; i++) - { - uint8_t const ctabentry = (color_prom[i] & 0x0f) | 0x10; - palette.set_pen_indirect(i, ctabentry); - } -} - -WRITE_LINE_MEMBER(megazone_state::flipscreen_w) -{ - m_flipscreen = state; -} - -void megazone_state::video_start() -{ - m_tmpbitmap = std::make_unique(256, 256); - - save_item(NAME(*m_tmpbitmap)); -} - - -uint32_t megazone_state::screen_update_megazone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int offs; - int x, y; - - /* for every character in the Video RAM */ - for (offs = m_videoram.bytes() - 1; offs >= 0; offs--) - { - int sx, sy, flipx, flipy; - - sx = offs % 32; - sy = offs / 32; - flipx = m_colorram[offs] & (1 << 6); - flipy = m_colorram[offs] & (1 << 5); - - if (m_flipscreen) - { - sx = 31 - sx; - sy = 31 - sy; - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(1)->opaque(*m_tmpbitmap,m_tmpbitmap->cliprect(), - ((int)m_videoram[offs]) + ((m_colorram[offs] & (1 << 7) ? 256 : 0) ), - (m_colorram[offs] & 0x0f) + 0x10, - flipx,flipy, - 8*sx,8*sy); - } - - /* copy the temporary bitmap to the screen */ - { - int scrollx; - int scrolly; - - if (m_flipscreen) - { - scrollx = *m_scrolly; - scrolly = *m_scrollx; - } - else - { - scrollx = - *m_scrolly + 4 * 8; // leave space for credit&score overlay - scrolly = - *m_scrollx; - } - - - copyscrollbitmap(bitmap, *m_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); - } - - - /* Draw the sprites. */ - { - uint8_t *spriteram = m_spriteram; - for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) - { - int sx = spriteram[offs + 3]; - int sy = 255 - ((spriteram[offs + 1] + 16) & 0xff); - int color = spriteram[offs + 0] & 0x0f; - int flipx = ~spriteram[offs + 0] & 0x40; - int flipy = spriteram[offs + 0] & 0x80; - - if (m_flipscreen) - { - sx = sx - 11; - sy = sy + 2; - } - else - sx = sx + 32; - - m_gfxdecode->gfx(0)->transmask(bitmap,cliprect, - spriteram[offs + 2], - color, - flipx,flipy, - sx,sy, - m_palette->transpen_mask(*m_gfxdecode->gfx(0), color, 0)); - } - } - - for (y = 0; y < 32;y++) - { - offs = y * 32; - for (x = 0; x < 6; x++) - { - int sx, sy, flipx, flipy; - - sx = x; - sy = y; - - flipx = m_colorram2[offs] & (1 << 6); - flipy = m_colorram2[offs] & (1 << 5); - - if (m_flipscreen) - { - sx = 35 - sx; - sy = 31 - sy; - flipx = !flipx; - flipy = !flipy; - } - - - - - m_gfxdecode->gfx(1)->opaque(bitmap,cliprect, - ((int)m_videoram2[offs]) + ((m_colorram2[offs] & (1 << 7) ? 256 : 0) ), - (m_colorram2[offs] & 0x0f) + 0x10, - flipx,flipy, - 8*sx,8*sy); - offs++; - } - } - return 0; -} -- cgit v1.2.3