From b5602cbe6fa570c79c23f0d5f55556d2a0e67d61 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 29 Nov 2024 15:24:44 +0100 Subject: source org: move galaxia driver to zaccaria folder --- src/mame/cvs/galaxia.cpp | 846 ----------------------------------------- src/mame/mame.lst | 14 +- src/mame/zaccaria/galaxia.cpp | 854 ++++++++++++++++++++++++++++++++++++++++++ src/mame/zaccaria/quasar.cpp | 12 +- 4 files changed, 871 insertions(+), 855 deletions(-) delete mode 100644 src/mame/cvs/galaxia.cpp create mode 100644 src/mame/zaccaria/galaxia.cpp diff --git a/src/mame/cvs/galaxia.cpp b/src/mame/cvs/galaxia.cpp deleted file mode 100644 index 2f66cbdda5c..00000000000 --- a/src/mame/cvs/galaxia.cpp +++ /dev/null @@ -1,846 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders: David Haywood, hap - -/* - -Galaxia by Zaccaria (1979) -Also released in several regions as "Super Galaxians". -Set regions are unknown, so all are currently named Galaxia. - -Taken from an untested board. - -1K byte files were 2708 or equivalent. -512 byte file is a 82S130 PROM. - -This is not a direct pirate of Galaxian as you might think from the name. -The game uses a Signetics 2650A CPU with three 40-pin 2636 chips, which are -responsible for basic sound and some video functions. - -Other than that, the video hardware looks like it's similar to Galaxian -(2 x 2114, 2 x 2101, 2 x EPROM) but there is no attack RAM and the graphics -EPROMS are 2708. The graphics EPROMS do contain Galaxian-like graphics... - -Quick PCB sketch: - ------------------------------------------------------------------------------ - | | - | 13l 13i 13h | - | | - | PROM 11l 11i 11h S2636 S2621 XTAL | -|6-| 14.31818 | - | 10i 10h S2636 | -|5-| | -|--| 8i 8h S2636 S2650A | -|--| | -|--| | - | | -|4-| | -|--| | -|--| | -|--| | - | | -|3-| | -|--| | -|--| | -|--| DSW | - | 3d | -|2-| DSW |-1| - | 1d |--| - | |--| - ------------------------------------------------------------------------------ - -Astro Wars (port of Astro Fighter) is on a stripped down board of Galaxia, -using only one 2636 chip, less RAM, and no PROM. - -HW has many similarities with quasar.cpp / cvs.cpp / zac1b1120.cpp -real hardware video of Astro Wars can be seen here: youtu.be/eSrQFBMeDlM - --------------------------------------------------------------------------------- - -About the 1-bit different 13H ROM in "galaxiab" compared to the one in "galaxia" -and "galaxiaa": The change is a RAM address from $1CD5(unknown) to $1CC5(player X -position). When an alien is diving down, it reads from there. Set "galaxiac" also -reads from $1CC5. - -Also note that "galaxiab" 13H was dumped from 2 boards, so that should take away -remaining suspicion that it might be a bad dump. - -TODO: -- astrowar resets at the boss fight, very likely a bad bit in one ROM (MT7016) -- Are there other versions of galaxia with different colors? The alternate sets - in MAME took the gfx roms from the parent, but there are references online - showing that not all versions look alike. -- support screen raw params, blanking is much like how laserbat hardware does it - and is needed to correct the speed in all machines -- provide accurate sprite/bg sync in astrowar -- improve starfield: density, blink rate, x repeat of 240, and the checkerboard - pattern (fast forward MAME to see) are all correct, the RNG is not right -- add sound board emulation (info is in the schematics) - -*/ - -#include "emu.h" - -#include "cpu/s2650/s2650.h" -#include "machine/s2636.h" -#include "sound/dac.h" - -#include "emupal.h" -#include "screen.h" -#include "speaker.h" -#include "tilemap.h" - - -namespace { - -class galaxia_state : public driver_device -{ -public: - galaxia_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_s2636(*this, "s2636_%u", 0U), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_video_ram(*this, "video_ram", 0x400, ENDIANNESS_BIG), - m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_BIG), - m_bullet_ram(*this, "bullet_ram"), - m_ram_view(*this, "video_color_ram_view") - { } - - void galaxia(machine_config &config) ATTR_COLD; - -protected: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - virtual void video_start() override ATTR_COLD; - - // max stars is more than it needs to be, to allow experimenting with the star generator - static constexpr u16 MAX_STARS = 0x800; - static constexpr u8 STAR_PEN = 0x18; - - // devices - required_device m_maincpu; - optional_device_array m_s2636; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - // memory - memory_share_creator m_video_ram; - memory_share_creator m_color_ram; - required_shared_ptr m_bullet_ram; - - memory_view m_ram_view; - - bitmap_ind16 m_temp_bitmap; - tilemap_t *m_bg_tilemap = nullptr; - - u8 m_collision = 0; - u16 m_stars_scroll = 0; - u16 m_total_stars = 0; - - struct star_t - { - u16 x = 0; - u16 y = 0; - u8 color = 0; - }; - star_t m_stars[MAX_STARS]; - - template void video_w(offs_t offset, u8 data); - void data_map(address_map &map) ATTR_COLD; - void io_map(address_map &map) ATTR_COLD; - - TILE_GET_INFO_MEMBER(get_bg_tile_info); - - void stars_palette(palette_device &palette) const ATTR_COLD; - virtual void palette(palette_device &palette) const ATTR_COLD; - void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - virtual u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - virtual void mem_map(address_map &map) ATTR_COLD; - - void scroll_stars(int state); - void init_stars() ATTR_COLD; - void update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect); - - void scroll_w(u8 data); - u8 collision_r(); - u8 collision_clear_r(); - void ctrlport_w(u8 data); - void dataport_w(u8 data); -}; - -class astrowar_state : public galaxia_state -{ -public: - astrowar_state(const machine_config &mconfig, device_type type, const char *tag) : - galaxia_state(mconfig, type, tag) - { } - - void astrowar(machine_config &config) ATTR_COLD; - -protected: - virtual void palette(palette_device &palette) const override ATTR_COLD; - virtual u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) override; - virtual void mem_map(address_map &map) override ATTR_COLD; -}; - - -void galaxia_state::machine_start() -{ - save_item(NAME(m_collision)); - save_item(NAME(m_stars_scroll)); -} - -void galaxia_state::machine_reset() -{ - m_collision = 0; - m_stars_scroll = 0; -} - - - -/******************************************************************************* - - Palette - -*******************************************************************************/ - -void galaxia_state::stars_palette(palette_device &palette) const -{ - // 6bpp pens for the stars - for (int i = 0; i < 0x40; i++) - { - int b = pal2bit(BIT(i, 1) << 1 | BIT(i, 0)); - int g = pal2bit(BIT(i, 3) << 1 | BIT(i, 2)); - int r = pal2bit(BIT(i, 5) << 1 | BIT(i, 4)); - - palette.set_pen_color(i + STAR_PEN, r, g, b); - } -} - -void galaxia_state::palette(palette_device &palette) const -{ - u8 const *const color_prom = memregion("proms")->base(); - - // background from A5-A8 - for (int i = 0; i < 0x10; i++) - { - int index = bitswap<4>(i, 0, 1, 2, 3) << 5; - u8 data = color_prom[index]; - - palette.set_pen_color(i, pal1bit(BIT(data, 0)), pal1bit(BIT(data, 1)), pal1bit(BIT(data, 2))); - } - - // sprites from A0-A3 - for (int i = 0; i < 8; i++) - { - u8 data = ~color_prom[i] & 7; - palette.set_pen_color(i | 0x10, pal1bit(BIT(data, 2)), pal1bit(BIT(data, 1)), pal1bit(BIT(data, 0))); - } - - stars_palette(palette); -} - -void astrowar_state::palette(palette_device &palette) const -{ - for (int i = 0; i < 8; i++) - { - // background - palette.set_pen_color(i * 2, 0, 0, 0); - palette.set_pen_color(i * 2 + 1, pal1bit(BIT(~i, 2)), pal1bit(BIT(~i, 1)), pal1bit(BIT(~i, 0))); - - // sprites - palette.set_pen_color(i | 0x10, pal1bit(BIT(i, 0)), pal1bit(BIT(i, 1)), pal1bit(BIT(i, 2))); - } - - stars_palette(palette); -} - - - -/******************************************************************************* - - Stars - -*******************************************************************************/ - -void galaxia_state::init_stars() -{ - u32 generator = 0; - m_total_stars = 0; - - // precalculate the star background - for (int y = 0; y < 272; y++) - { - for (int x = 0; x < 480; x++) - { - generator <<= 1; - generator |= BIT(~generator, 17) ^ BIT(generator, 5); - - // stars are enabled if the shift register output is 0, and bits 1-7 are set - if ((generator & 0x200fe) == 0xfe && m_total_stars != MAX_STARS) - { - m_stars[m_total_stars].x = x; - m_stars[m_total_stars].y = y; - m_stars[m_total_stars].color = generator >> 8 & 0x3f; - - m_total_stars++; - } - } - } -} - -void galaxia_state::update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - for (int offs = 0; offs < m_total_stars; offs++) - { - u8 x = ((m_stars[offs].x + m_stars_scroll) >> 1) % 240; - u16 y = m_stars[offs].y; - - if ((BIT(y, 4) ^ BIT(y, 8) ^ BIT(x, 5))) - { - if (cliprect.contains(x, y)) - bitmap.pix(y, x) = STAR_PEN + m_stars[offs].color; - } - } -} - -void galaxia_state::scroll_stars(int state) -{ - if (state) - m_stars_scroll++; - - m_stars_scroll %= 480; -} - - - -/******************************************************************************* - - Background - -*******************************************************************************/ - -TILE_GET_INFO_MEMBER(galaxia_state::get_bg_tile_info) -{ - u8 code = m_video_ram[tile_index]; // d7 unused for galaxia - u8 color = m_color_ram[tile_index]; // highest bits unused - - tileinfo.set(0, code, color, 0); -} - -void galaxia_state::video_start() -{ - init_stars(); - - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(galaxia_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bg_tilemap->set_transparent_pen(0); - m_bg_tilemap->set_scroll_cols(8); - - m_screen->register_screen_bitmap(m_temp_bitmap); -} - -static GFXDECODE_START( gfx_galaxia ) - GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x2_planar, 0, 4 ) -GFXDECODE_END - -static GFXDECODE_START( gfx_astrowar ) - GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x1, 0, 8 ) -GFXDECODE_END - - -void galaxia_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_palette->black_pen(), cliprect); - update_stars(bitmap, cliprect); - - // tilemap doesn't wrap - rectangle bg_clip = cliprect; - bg_clip.max_y = 32*8-1; - bg_clip &= cliprect; - - m_temp_bitmap.fill(0, cliprect); - m_bg_tilemap->draw(screen, m_temp_bitmap, bg_clip, 0); - copybitmap_trans(bitmap, m_temp_bitmap, 0, 0, 0, 0, cliprect, 0); -} - - - -/******************************************************************************* - - Screen Update - -*******************************************************************************/ - -u32 galaxia_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); - bitmap_ind16 const &s2636_1_bitmap = m_s2636[1]->update(cliprect); - bitmap_ind16 const &s2636_2_bitmap = m_s2636[2]->update(cliprect); - - draw_background(screen, bitmap, cliprect); - - for (int y = cliprect.top(); y <= cliprect.bottom(); y++) - { - for (int x = cliprect.left(); x <= cliprect.right(); x++) - { - int const bullet_pos = (((y < 0x100) ? m_bullet_ram[y] : 0) ^ 0xff) - 8; - bool const bullet = (bullet_pos != 0xff - 8) && (x <= bullet_pos && x > bullet_pos - 4); - bool const background = (m_temp_bitmap.pix(y, x) & 3) != 0; - - // draw bullets - if (bullet) - { - // background vs. bullet collision detection - if (background) m_collision |= 0x80; - - // draw white 1x4-size bullet - bitmap.pix(y, x) = m_palette->white_pen(); - } - - // copy the S2636 images into the main bitmap and check collision - int const pixel0 = s2636_0_bitmap.pix(y, x); - int const pixel1 = s2636_1_bitmap.pix(y, x); - int const pixel2 = s2636_2_bitmap.pix(y, x); - - int const pixel = pixel0 | pixel1 | pixel2; - - if (S2636_IS_PIXEL_DRAWN(pixel)) - { - // S2636 vs. S2636 collision detection - if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x01; - if (S2636_IS_PIXEL_DRAWN(pixel1) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x02; - if (S2636_IS_PIXEL_DRAWN(pixel2) && S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x04; - - // S2636 vs. bullet collision detection - if (bullet) m_collision |= 0x08; - - // S2636 vs. background collision detection - if (background) - { - /* bit4 causes problems on 2nd level - if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x10; */ - if (S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x20; - if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x40; - } - - bitmap.pix(y, x) = S2636_PIXEL_COLOR(pixel) | 0x10; - } - } - } - - return 0; -} - - -u32 astrowar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - // astrowar has only one S2636 - bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); - - draw_background(screen, bitmap, cliprect); - - for (int y = cliprect.top(); y <= cliprect.bottom(); y++) - { - for (int x = cliprect.left(); x <= cliprect.right(); x++) - { - int const bullet_pos = (((y < 0x100) ? m_bullet_ram[y] : 0) ^ 0xff) - 8; - bool const bullet = (bullet_pos != 0xff - 8) && (x <= bullet_pos && x > bullet_pos - 4); - - // draw bullets first - if (bullet) - { - // background vs. bullet collision detection - if (m_temp_bitmap.pix(y, x) & 1) - m_collision |= 0x02; - - // draw white 1x4-size bullet - bitmap.pix(y, x) = m_palette->white_pen(); - } - } - - for (int x = cliprect.left(); x <= cliprect.right(); x++) - { - // NOTE: similar to zac1b1120.cpp, the sprite chip runs at a different frequency than the background generator - // the exact timing ratio is unknown, so we'll have to do with guesswork - float const s_ratio = 256.0f / 196.0f; - - float const sx = x * s_ratio; - if (int(sx + 0.5f) > cliprect.right()) - break; - - // copy the S2636 bitmap into the main bitmap and check collision - int const pixel = s2636_0_bitmap.pix(y, x); - - if (S2636_IS_PIXEL_DRAWN(pixel)) - { - // S2636 vs. background collision detection - if ((m_temp_bitmap.pix(y, int(sx)) | m_temp_bitmap.pix(y, int(sx + 0.5f))) & 1) - m_collision |= 0x01; - - bitmap.pix(y, int(sx)) = S2636_PIXEL_COLOR(pixel) | 0x10; - bitmap.pix(y, int(sx + 0.5f)) = S2636_PIXEL_COLOR(pixel) | 0x10; - } - } - } - - return 0; -} - - - -/******************************************************************************* - - I/O - -*******************************************************************************/ - -template -void galaxia_state::video_w(offs_t offset, u8 data) -{ - m_bg_tilemap->mark_tile_dirty(offset); - Which ? m_video_ram[offset] = data : m_color_ram[offset] = data; -} - -void galaxia_state::scroll_w(u8 data) -{ - // fixed scrolling area - for (int i = 1; i < 6; i++) - m_bg_tilemap->set_scrolly(i, data); -} - -u8 galaxia_state::collision_r() -{ - return m_collision; -} - -u8 galaxia_state::collision_clear_r() -{ - if (!machine().side_effects_disabled()) - m_collision = 0; - - return 0; -} - -void galaxia_state::ctrlport_w(u8 data) -{ - // d0: triggers on every new credit - // d1: coin counter? if you put a coin in slot A, galaxia constantly - // strobes sets and clears the bit. if you put a coin in slot B - // however, the bit is set and cleared only once. - // d5: set as soon as the game completes selftest - // other bits: unknown -} - -void galaxia_state::dataport_w(u8 data) -{ - // seems to be related to sound board comms -} - -void galaxia_state::mem_map(address_map &map) -{ - map(0x0000, 0x13ff).rom(); - map(0x1400, 0x14ff).mirror(0x6000).ram().share(m_bullet_ram); - map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1600, 0x16ff).mirror(0x6000).rw(m_s2636[1], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1700, 0x17ff).mirror(0x6000).rw(m_s2636[2], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); - m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<0>)).share(m_color_ram); - m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<1>)).share(m_video_ram); - map(0x1c00, 0x1fff).mirror(0x6000).ram(); - map(0x2000, 0x33ff).rom(); - map(0x7214, 0x7214).portr("IN0"); -} - -void astrowar_state::mem_map(address_map &map) -{ - map(0x0000, 0x13ff).rom(); - map(0x1400, 0x14ff).mirror(0x6000).ram(); - map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); - m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<0>)).share(m_color_ram); - m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<1>)).share(m_video_ram); - map(0x1c00, 0x1cff).mirror(0x6000).ram().share(m_bullet_ram); - map(0x2000, 0x33ff).rom(); -} - -void galaxia_state::io_map(address_map &map) -{ - map.unmap_value_high(); - map(0x00, 0x00).w(FUNC(galaxia_state::scroll_w)).portr("IN0"); - map(0x02, 0x02).portr("IN1"); - map(0x05, 0x05).nopr(); - map(0x06, 0x06).portr("DSW0"); - map(0x07, 0x07).portr("DSW1"); - map(0xac, 0xac).nopr(); -} - -void galaxia_state::data_map(address_map &map) -{ - map(S2650_CTRL_PORT, S2650_CTRL_PORT).rw(FUNC(galaxia_state::collision_r), FUNC(galaxia_state::ctrlport_w)); - map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(galaxia_state::collision_clear_r), FUNC(galaxia_state::dataport_w)); -} - - - -/******************************************************************************* - - Inputs - -*******************************************************************************/ - -static INPUT_PORTS_START( galaxia ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("IN1") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY - PORT_BIT( 0xc3, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("DSW0") - PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, "A 1C_1C B 2C_1C" ) - PORT_DIPSETTING( 0x01, "A 1C_2C B 2C_1C" ) - PORT_DIPSETTING( 0x02, "A 1C_3C B 2C_1C" ) - PORT_DIPSETTING( 0x03, "A 1C_5C B 2C_1C" ) - PORT_DIPSETTING( 0x04, "A 1C_1C B 1C_1C" ) - PORT_DIPSETTING( 0x05, "A 1C_2C B 1C_1C" ) - PORT_DIPSETTING( 0x06, "A 1C_3C B 1C_1C" ) - PORT_DIPSETTING( 0x07, "A 1C_5C B 1C_1C" ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x08, "5" ) - - PORT_DIPNAME( 0x10, 0x00, "UNK04" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "UNK05" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "UNK06" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "UNK07" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, "UNK10" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "UNK11" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "UNK12" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "UNK13" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - - PORT_DIPNAME( 0x10, 0x00, "UNK14" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "UNK15" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "UNK16" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "UNK17" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) -INPUT_PORTS_END - - - -/******************************************************************************* - - Machine Configs - -*******************************************************************************/ - -void galaxia_state::galaxia(machine_config &config) -{ - // basic machine hardware - S2650(config, m_maincpu, 14.318181_MHz_XTAL / 8); - m_maincpu->set_addrmap(AS_PROGRAM, &galaxia_state::mem_map); - m_maincpu->set_addrmap(AS_IO, &galaxia_state::io_map); - m_maincpu->set_addrmap(AS_DATA, &galaxia_state::data_map); - m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); - m_maincpu->flag_handler().set([this] (int state) { m_ram_view.select(state); }); - m_maincpu->intack_handler().set([this]() { m_maincpu->set_input_line(0, CLEAR_LINE); return 0x03; }); - - // video hardware - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_refresh_hz(50); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(3500)); - m_screen->set_size(256, 312); - m_screen->set_visarea(0*8, 29*8-1, 0*8, 34*8-1); - m_screen->set_screen_update(FUNC(galaxia_state::screen_update)); - m_screen->set_palette(m_palette); - m_screen->screen_vblank().set_inputline(m_maincpu, 0, ASSERT_LINE); - m_screen->screen_vblank().append(FUNC(galaxia_state::scroll_stars)); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_galaxia); - PALETTE(config, m_palette, FUNC(galaxia_state::palette), 0x18 + 0x40); - - S2636(config, m_s2636[0], 0); - m_s2636[0]->set_offsets(3, -26); - m_s2636[0]->add_route(ALL_OUTPUTS, "mono", 0.25); - - S2636(config, m_s2636[1], 0); - m_s2636[1]->set_offsets(3, -26); - m_s2636[1]->add_route(ALL_OUTPUTS, "mono", 0.25); - - S2636(config, m_s2636[2], 0); - m_s2636[2]->set_offsets(3, -26); - m_s2636[2]->add_route(ALL_OUTPUTS, "mono", 0.25); - - // sound hardware - SPEAKER(config, "mono").front_center(); -} - -void astrowar_state::astrowar(machine_config &config) -{ - galaxia(config); - - // video hardware - GFXDECODE(config.replace(), m_gfxdecode, m_palette, gfx_astrowar); - - m_s2636[0]->set_offsets(3, -8); - config.device_remove("s2636_1"); - config.device_remove("s2636_2"); -} - - - -/******************************************************************************* - - Game drivers - -*******************************************************************************/ - -ROM_START( galaxia ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(c4482770) SHA1(aee983cc3d80989f49aea4138961bb623039484a) ) - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(c0baa654) SHA1(80e0880c32ad285fbce0f7f552268b964b97cab3) ) - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) - ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) - - ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority -ROM_END - -ROM_START( galaxiaa ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(c4482770) SHA1(aee983cc3d80989f49aea4138961bb623039484a) ) - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent - ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent - - ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority -ROM_END - -ROM_START( galaxiab ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(1d22219b) SHA1(6ab8ea8c78db30d80de98879018726d0420d30fe) ) // sldh - only 1 bit difference compared with to galaxiaa, not a bad dump, see notes above - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent - ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent - - ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority -ROM_END - -ROM_START( galaxiac ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(5682d56f) SHA1(15afb3296e93f8371d36b686ce372f917bd5b771) ) // sldh - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(80dafe84) SHA1(8a71a05f1b0ddba36bf748a4801f3a78f63af1db) ) // sldh - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(ffe86fdb) SHA1(67b02a5c39dbe515b6d68583c8831b0dae15374a) ) // sldh - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(8e3f5343) SHA1(6298be9bb33975854cb3d009b89913b1a8018aee) ) // sldh - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent - ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent - - ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority -ROM_END - - -ROM_START( astrowar ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "astro.8h", 0x00000, 0x0400, CRC(b0ec246c) SHA1(f9123b5e317938655f5e8b3f8a5810d0b2b7c7af) ) - ROM_LOAD( "astro.10h", 0x00400, 0x0400, CRC(090d360f) SHA1(528ddcdc30a5a291bd8850ff6f134fcc19af562f) ) - ROM_LOAD( "astro.11h", 0x00800, 0x0400, CRC(72ab1378) SHA1(50743c64c4775076aa6f1d8ab2e05c14884bf0ba) ) - ROM_LOAD( "astro.13h", 0x00c00, 0x0400, CRC(2dc4c895) SHA1(831afbfd4ebfd6522ab0758222bc6f9826148a5d) ) - ROM_LOAD( "astro.8i", 0x01000, 0x0400, CRC(ab87fbfc) SHA1(34b670f96c260f186c643e588995ae5d80377784) ) - ROM_LOAD( "astro.10i", 0x02000, 0x0400, CRC(533675c1) SHA1(69cc066e1874a135a53a21b7b2461bda456504f1) ) - ROM_LOAD( "astro.11i", 0x02400, 0x0400, CRC(59cf8901) SHA1(e849d4c99350b7e3453c156d91618b71b5be1163) ) - ROM_LOAD( "astro.13i", 0x02800, 0x0400, CRC(5149c121) SHA1(232ba594e283fb25c31d8ae0b7d8315a81852a71) BAD_DUMP ) // suspected bad byte at 0x2a00 - ROM_LOAD( "astro.11l", 0x02c00, 0x0400, CRC(29f52f57) SHA1(5cb50b82e09c537eeaeae167351fca686fde8228) ) - ROM_LOAD( "astro.13l", 0x03000, 0x0400, CRC(882cdb87) SHA1(062ee8d296316cbce2eb62e72774aa4181e9847d) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "astro.1d", 0x00000, 0x0400, CRC(6053f834) SHA1(e0b76800c241b3c8010c09869cecbc109b25310a) ) - ROM_LOAD( "astro.3d", 0x00400, 0x0400, CRC(822505aa) SHA1(f9d3465e14bb850a286f8b4f42aa0a4044413b67) ) -ROM_END - -} // anonymous namespace - - -GAME( 1979, galaxia, 0, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, galaxiaa, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, galaxiab, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 3)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, galaxiac, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 4)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1980, astrowar, 0, astrowar, galaxia, astrowar_state, empty_init, ROT90, "Zaccaria / Zelco", "Astro Wars", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 55fb8606964..a9fdeb7d06c 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -16663,13 +16663,6 @@ spacefrt // (c) 1981 Century superbik // (c) 1983 Century wallst // (c) 1982 Century -@source:cvs/galaxia.cpp -astrowar // (c) 1980 -galaxia // (c) 1979 -galaxiaa // (c) 1979 -galaxiab // (c) 1979 -galaxiac // (c) 1979 - @source:cxg/chess2001.cpp ch2001 @@ -47202,6 +47195,13 @@ magix // (c) 1995 Yun Sung magixb // bootleg rocktris // (c) 1994? Yun Sung +@source:zaccaria/galaxia.cpp +astrowar // (c) 1980 +galaxia // (c) 1979 +galaxiaa // (c) 1979 +galaxiab // (c) 1979 +galaxiac // (c) 1979 + @source:zaccaria/laserbat.cpp catnmous // (c) 1982 catnmousa // (c) 1982 diff --git a/src/mame/zaccaria/galaxia.cpp b/src/mame/zaccaria/galaxia.cpp new file mode 100644 index 00000000000..d92baa675b7 --- /dev/null +++ b/src/mame/zaccaria/galaxia.cpp @@ -0,0 +1,854 @@ +// license:BSD-3-Clause +// copyright-holders: David Haywood, hap + +/* + +Galaxia by Zaccaria (1979) +Also released in several regions as "Super Galaxians". +Set regions are unknown, so all are currently named Galaxia. + +Taken from an untested board. + +1K byte files were 2708 or equivalent. +512 byte file is a 82S130 PROM. + +This is not a direct pirate of Galaxian as you might think from the name. +The game uses a Signetics 2650A CPU with three 40-pin 2636 chips, which are +responsible for basic sound and some video functions. + +Other than that, the video hardware looks like it's similar to Galaxian +(2 x 2114, 2 x 2101, 2 x EPROM) but there is no attack RAM and the graphics +EPROMS are 2708. The graphics EPROMS do contain Galaxian-like graphics... + +Quick PCB sketch: + ------------------------------------------------------------------------------ + | | + | 13l 13i 13h | + | | + | PROM 11l 11i 11h S2636 S2621 XTAL | +|6-| 14.31818 | + | 10i 10h S2636 | +|5-| | +|--| 8i 8h S2636 S2650A | +|--| | +|--| | + | | +|4-| | +|--| | +|--| | +|--| | + | | +|3-| | +|--| | +|--| | +|--| DSW | + | 3d | +|2-| DSW |-1| + | 1d |--| + | |--| + ------------------------------------------------------------------------------ + +Astro Wars (port of Astro Fighter) is on a stripped down board of Galaxia, +using only one 2636 chip, less RAM, and no PROM. + +HW has many similarities with quasar.cpp / cvs.cpp / zac1b1120.cpp +real hardware video of Astro Wars can be seen here: youtu.be/eSrQFBMeDlM + +-------------------------------------------------------------------------------- + +About the 1-bit different 13H ROM in "galaxiab" compared to the one in "galaxia" +and "galaxiaa": The change is a RAM address from $1CD5(unknown) to $1CC5(player X +position). When an alien is diving down, it reads from there. Set "galaxiac" also +reads from $1CC5. + +Also note that "galaxiab" 13H was dumped from 2 boards, so that should take away +remaining suspicion that it might be a bad dump. + +TODO: +- astrowar resets at the boss fight, very likely a bad bit in one ROM (MT7016) +- Are there other versions of galaxia with different colors? The alternate sets + in MAME took the gfx roms from the parent, but there are references online + showing that not all versions look alike. +- support screen raw params, blanking is much like how laserbat hardware does it + and is needed to correct the speed in all machines +- provide accurate sprite/bg sync in astrowar +- improve starfield: density, blink rate, x repeat of 240, and the checkerboard + pattern (fast forward MAME to see) are all correct, the RNG is not right +- add sound board emulation (info is in the schematics) + +*/ + +#include "emu.h" + +#include "cpu/s2650/s2650.h" +#include "machine/s2636.h" +#include "sound/dac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class galaxia_state : public driver_device +{ +public: + galaxia_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_s2636(*this, "s2636_%u", 0U), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_video_ram(*this, "video_ram", 0x400, ENDIANNESS_BIG), + m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_BIG), + m_bullet_ram(*this, "bullet_ram"), + m_ram_view(*this, "video_color_ram_view") + { } + + void galaxia(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + // max stars is more than it needs to be, to allow experimenting with the star generator + static constexpr u16 MAX_STARS = 0x800; + static constexpr u8 STAR_PEN = 0x18; + + // devices + required_device m_maincpu; + optional_device_array m_s2636; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + // memory + memory_share_creator m_video_ram; + memory_share_creator m_color_ram; + required_shared_ptr m_bullet_ram; + + memory_view m_ram_view; + + bitmap_ind16 m_temp_bitmap; + tilemap_t *m_bg_tilemap = nullptr; + + u8 m_collision = 0; + u16 m_stars_scroll = 0; + u16 m_total_stars = 0; + + struct star_t + { + u16 x = 0; + u16 y = 0; + u8 color = 0; + }; + star_t m_stars[MAX_STARS]; + + template void video_w(offs_t offset, u8 data); + void data_map(address_map &map) ATTR_COLD; + void io_map(address_map &map) ATTR_COLD; + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + void stars_palette(palette_device &palette) const ATTR_COLD; + virtual void palette(palette_device &palette) const ATTR_COLD; + void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual void mem_map(address_map &map) ATTR_COLD; + + void scroll_stars(int state); + void init_stars() ATTR_COLD; + void update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void scroll_w(u8 data); + u8 collision_r(); + u8 collision_clear_r(); + void ctrlport_w(u8 data); + void dataport_w(u8 data); +}; + +class astrowar_state : public galaxia_state +{ +public: + astrowar_state(const machine_config &mconfig, device_type type, const char *tag) : + galaxia_state(mconfig, type, tag) + { } + + void astrowar(machine_config &config) ATTR_COLD; + +protected: + virtual void palette(palette_device &palette) const override ATTR_COLD; + virtual u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) override; + virtual void mem_map(address_map &map) override ATTR_COLD; +}; + + +void galaxia_state::machine_start() +{ + save_item(NAME(m_collision)); + save_item(NAME(m_stars_scroll)); +} + +void galaxia_state::machine_reset() +{ + m_collision = 0; + m_stars_scroll = 0; +} + + + +/******************************************************************************* + + Palette + +*******************************************************************************/ + +void galaxia_state::stars_palette(palette_device &palette) const +{ + // 6bpp pens for the stars + for (int i = 0; i < 0x40; i++) + { + int b = pal2bit(BIT(i, 1) << 1 | BIT(i, 0)); + int g = pal2bit(BIT(i, 3) << 1 | BIT(i, 2)); + int r = pal2bit(BIT(i, 5) << 1 | BIT(i, 4)); + + palette.set_pen_color(i + STAR_PEN, r, g, b); + } +} + +void galaxia_state::palette(palette_device &palette) const +{ + u8 const *const color_prom = memregion("proms")->base(); + + // background from A5-A8 + for (int i = 0; i < 0x10; i++) + { + int index = bitswap<4>(i, 0, 1, 2, 3) << 5; + u8 data = color_prom[index]; + + palette.set_pen_color(i, pal1bit(BIT(data, 0)), pal1bit(BIT(data, 1)), pal1bit(BIT(data, 2))); + } + + // sprites from A0-A3 + for (int i = 0; i < 8; i++) + { + u8 data = ~color_prom[i] & 7; + palette.set_pen_color(i | 0x10, pal1bit(BIT(data, 2)), pal1bit(BIT(data, 1)), pal1bit(BIT(data, 0))); + } + + stars_palette(palette); +} + +void astrowar_state::palette(palette_device &palette) const +{ + for (int i = 0; i < 8; i++) + { + // background + palette.set_pen_color(i * 2, 0, 0, 0); + palette.set_pen_color(i * 2 + 1, pal1bit(BIT(~i, 2)), pal1bit(BIT(~i, 1)), pal1bit(BIT(~i, 0))); + + // sprites + palette.set_pen_color(i | 0x10, pal1bit(BIT(i, 0)), pal1bit(BIT(i, 1)), pal1bit(BIT(i, 2))); + } + + stars_palette(palette); +} + + + +/******************************************************************************* + + Stars + +*******************************************************************************/ + +void galaxia_state::init_stars() +{ + u32 generator = 0; + m_total_stars = 0; + + // precalculate the star background + for (int y = 0; y < 272; y++) + { + for (int x = 0; x < 480; x++) + { + generator <<= 1; + generator |= BIT(~generator, 17) ^ BIT(generator, 5); + + // stars are enabled if the shift register output is 0, and bits 1-7 are set + if ((generator & 0x200fe) == 0xfe && m_total_stars != MAX_STARS) + { + m_stars[m_total_stars].x = x; + m_stars[m_total_stars].y = y; + m_stars[m_total_stars].color = generator >> 8 & 0x3f; + + m_total_stars++; + } + } + } +} + +void galaxia_state::update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = 0; offs < m_total_stars; offs++) + { + u8 x = ((m_stars[offs].x + m_stars_scroll) >> 1) % 240; + u16 y = m_stars[offs].y; + + if ((BIT(y, 4) ^ BIT(y, 8) ^ BIT(x, 5))) + { + if (cliprect.contains(x, y)) + bitmap.pix(y, x) = STAR_PEN + m_stars[offs].color; + } + } +} + +void galaxia_state::scroll_stars(int state) +{ + if (state) + m_stars_scroll++; + + m_stars_scroll %= 480; +} + + + +/******************************************************************************* + + Background + +*******************************************************************************/ + +TILE_GET_INFO_MEMBER(galaxia_state::get_bg_tile_info) +{ + u8 code = m_video_ram[tile_index]; // d7 unused for galaxia + u8 color = m_color_ram[tile_index]; // highest bits unused + + tileinfo.set(0, code, color, 0); +} + +void galaxia_state::video_start() +{ + init_stars(); + + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(galaxia_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap->set_transparent_pen(0); + m_bg_tilemap->set_scroll_cols(8); + + m_screen->register_screen_bitmap(m_temp_bitmap); +} + +static GFXDECODE_START( gfx_galaxia ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x2_planar, 0, 4 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_astrowar ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x1, 0, 8 ) +GFXDECODE_END + + +void galaxia_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_palette->black_pen(), cliprect); + update_stars(bitmap, cliprect); + + // tilemap doesn't wrap + rectangle bg_clip = cliprect; + bg_clip.max_y = 32*8-1; + bg_clip &= cliprect; + + m_temp_bitmap.fill(0, cliprect); + m_bg_tilemap->draw(screen, m_temp_bitmap, bg_clip, 0); + copybitmap_trans(bitmap, m_temp_bitmap, 0, 0, 0, 0, cliprect, 0); +} + + + +/******************************************************************************* + + Screen Update + +*******************************************************************************/ + +u32 galaxia_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); + bitmap_ind16 const &s2636_1_bitmap = m_s2636[1]->update(cliprect); + bitmap_ind16 const &s2636_2_bitmap = m_s2636[2]->update(cliprect); + + draw_background(screen, bitmap, cliprect); + + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) + { + for (int x = cliprect.left(); x <= cliprect.right(); x++) + { + int const bullet_pos = (((y < 0x100) ? m_bullet_ram[y] : 0) ^ 0xff) - 8; + bool const bullet = (bullet_pos != 0xff - 8) && (x <= bullet_pos && x > bullet_pos - 4); + bool const background = (m_temp_bitmap.pix(y, x) & 3) != 0; + + // draw bullets + if (bullet) + { + // background vs. bullet collision detection + if (background) m_collision |= 0x80; + + // draw white 1x4-size bullet + bitmap.pix(y, x) = m_palette->white_pen(); + } + + // copy the S2636 images into the main bitmap and check collision + int const pixel0 = s2636_0_bitmap.pix(y, x); + int const pixel1 = s2636_1_bitmap.pix(y, x); + int const pixel2 = s2636_2_bitmap.pix(y, x); + + int const pixel = pixel0 | pixel1 | pixel2; + + if (S2636_IS_PIXEL_DRAWN(pixel)) + { + // S2636 vs. S2636 collision detection + if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x01; + if (S2636_IS_PIXEL_DRAWN(pixel1) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x02; + if (S2636_IS_PIXEL_DRAWN(pixel2) && S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x04; + + // S2636 vs. bullet collision detection + if (bullet) m_collision |= 0x08; + + // S2636 vs. background collision detection + if (background) + { + /* bit4 causes problems on 2nd level + if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x10; */ + if (S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x20; + if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x40; + } + + bitmap.pix(y, x) = S2636_PIXEL_COLOR(pixel) | 0x10; + } + } + } + + return 0; +} + + +u32 astrowar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // astrowar has only one S2636 + bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); + + draw_background(screen, bitmap, cliprect); + + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) + { + for (int x = cliprect.left(); x <= cliprect.right(); x++) + { + int const bullet_pos = (((y < 0x100) ? m_bullet_ram[y] : 0) ^ 0xff) - 8; + bool const bullet = (bullet_pos != 0xff - 8) && (x <= bullet_pos && x > bullet_pos - 4); + + // draw bullets first + if (bullet) + { + // background vs. bullet collision detection + if (m_temp_bitmap.pix(y, x) & 1) + m_collision |= 0x02; + + // draw white 1x4-size bullet + bitmap.pix(y, x) = m_palette->white_pen(); + } + } + + for (int x = cliprect.left(); x <= cliprect.right(); x++) + { + // NOTE: similar to zac1b1120.cpp, the sprite chip runs at a different frequency than the background generator + // the exact timing ratio is unknown, so we'll have to do with guesswork + float const s_ratio = 256.0f / 196.0f; + + float const sx = x * s_ratio; + if (int(sx + 0.5f) > cliprect.right()) + break; + + // copy the S2636 bitmap into the main bitmap and check collision + int const pixel = s2636_0_bitmap.pix(y, x); + + if (S2636_IS_PIXEL_DRAWN(pixel)) + { + // S2636 vs. background collision detection + if ((m_temp_bitmap.pix(y, int(sx)) | m_temp_bitmap.pix(y, int(sx + 0.5f))) & 1) + m_collision |= 0x01; + + bitmap.pix(y, int(sx)) = S2636_PIXEL_COLOR(pixel) | 0x10; + bitmap.pix(y, int(sx + 0.5f)) = S2636_PIXEL_COLOR(pixel) | 0x10; + } + } + } + + return 0; +} + + + +/******************************************************************************* + + I/O + +*******************************************************************************/ + +template +void galaxia_state::video_w(offs_t offset, u8 data) +{ + m_bg_tilemap->mark_tile_dirty(offset); + Which ? m_video_ram[offset] = data : m_color_ram[offset] = data; +} + +void galaxia_state::scroll_w(u8 data) +{ + // fixed scrolling area + for (int i = 1; i < 6; i++) + m_bg_tilemap->set_scrolly(i, data); +} + +u8 galaxia_state::collision_r() +{ + return m_collision; +} + +u8 galaxia_state::collision_clear_r() +{ + if (!machine().side_effects_disabled()) + m_collision = 0; + + return 0; +} + +void galaxia_state::ctrlport_w(u8 data) +{ + // d0: triggers on every new credit + // d1: coin counter? if you put a coin in slot A, galaxia constantly + // strobes sets and clears the bit. if you put a coin in slot B + // however, the bit is set and cleared only once. + // d5: set as soon as the game completes selftest + // other bits: unknown +} + +void galaxia_state::dataport_w(u8 data) +{ + // seems to be related to sound board comms +} + +void galaxia_state::mem_map(address_map &map) +{ + map(0x0000, 0x13ff).rom(); + map(0x1400, 0x14ff).mirror(0x6000).ram().share(m_bullet_ram); + map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1600, 0x16ff).mirror(0x6000).rw(m_s2636[1], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1700, 0x17ff).mirror(0x6000).rw(m_s2636[2], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); + m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<0>)).share(m_color_ram); + m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<1>)).share(m_video_ram); + map(0x1c00, 0x1fff).mirror(0x6000).ram(); + map(0x2000, 0x33ff).rom(); + map(0x7214, 0x7214).portr("IN0"); +} + +void astrowar_state::mem_map(address_map &map) +{ + map(0x0000, 0x13ff).rom(); + map(0x1400, 0x14ff).mirror(0x6000).ram(); + map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); + m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<0>)).share(m_color_ram); + m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<1>)).share(m_video_ram); + map(0x1c00, 0x1cff).mirror(0x6000).ram().share(m_bullet_ram); + map(0x2000, 0x33ff).rom(); +} + +void galaxia_state::io_map(address_map &map) +{ + map.unmap_value_high(); + map(0x00, 0x00).w(FUNC(galaxia_state::scroll_w)).portr("IN0"); + map(0x02, 0x02).portr("IN1"); + map(0x05, 0x05).nopr(); + map(0x06, 0x06).portr("DSW0"); + map(0x07, 0x07).portr("DSW1"); + map(0xac, 0xac).nopr(); +} + +void galaxia_state::data_map(address_map &map) +{ + map(S2650_CTRL_PORT, S2650_CTRL_PORT).rw(FUNC(galaxia_state::collision_r), FUNC(galaxia_state::ctrlport_w)); + map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(galaxia_state::collision_clear_r), FUNC(galaxia_state::dataport_w)); +} + + + +/******************************************************************************* + + Inputs + +*******************************************************************************/ + +static INPUT_PORTS_START( galaxia ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY + PORT_BIT( 0xc3, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSW0") + PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x00, "A 1C_1C B 2C_1C" ) + PORT_DIPSETTING( 0x01, "A 1C_2C B 2C_1C" ) + PORT_DIPSETTING( 0x02, "A 1C_3C B 2C_1C" ) + PORT_DIPSETTING( 0x03, "A 1C_5C B 2C_1C" ) + PORT_DIPSETTING( 0x04, "A 1C_1C B 1C_1C" ) + PORT_DIPSETTING( 0x05, "A 1C_2C B 1C_1C" ) + PORT_DIPSETTING( 0x06, "A 1C_3C B 1C_1C" ) + PORT_DIPSETTING( 0x07, "A 1C_5C B 1C_1C" ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x00, "3" ) + PORT_DIPSETTING( 0x08, "5" ) + + PORT_DIPNAME( 0x10, 0x00, "UNK04" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "UNK05" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "UNK06" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "UNK07" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, "UNK10" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "UNK11" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "UNK12" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "UNK13" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + + PORT_DIPNAME( 0x10, 0x00, "UNK14" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "UNK15" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "UNK16" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "UNK17" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) +INPUT_PORTS_END + + + +/******************************************************************************* + + Machine Configs + +*******************************************************************************/ + +void galaxia_state::galaxia(machine_config &config) +{ + // basic machine hardware + S2650(config, m_maincpu, 14.318181_MHz_XTAL / 8); + m_maincpu->set_addrmap(AS_PROGRAM, &galaxia_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &galaxia_state::io_map); + m_maincpu->set_addrmap(AS_DATA, &galaxia_state::data_map); + m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); + m_maincpu->flag_handler().set([this] (int state) { m_ram_view.select(state); }); + m_maincpu->intack_handler().set([this]() { m_maincpu->set_input_line(0, CLEAR_LINE); return 0x03; }); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_refresh_hz(50); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(3500)); + m_screen->set_size(256, 312); + m_screen->set_visarea(0*8, 29*8-1, 0*8, 34*8-1); + m_screen->set_screen_update(FUNC(galaxia_state::screen_update)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set_inputline(m_maincpu, 0, ASSERT_LINE); + m_screen->screen_vblank().append(FUNC(galaxia_state::scroll_stars)); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_galaxia); + PALETTE(config, m_palette, FUNC(galaxia_state::palette), 0x18 + 0x40); + + S2636(config, m_s2636[0], 0); + m_s2636[0]->set_offsets(3, -26); + m_s2636[0]->add_route(ALL_OUTPUTS, "mono", 0.25); + + S2636(config, m_s2636[1], 0); + m_s2636[1]->set_offsets(3, -26); + m_s2636[1]->add_route(ALL_OUTPUTS, "mono", 0.25); + + S2636(config, m_s2636[2], 0); + m_s2636[2]->set_offsets(3, -26); + m_s2636[2]->add_route(ALL_OUTPUTS, "mono", 0.25); + + // sound hardware + SPEAKER(config, "mono").front_center(); +} + +void astrowar_state::astrowar(machine_config &config) +{ + galaxia(config); + + // video hardware + GFXDECODE(config.replace(), m_gfxdecode, m_palette, gfx_astrowar); + + m_s2636[0]->set_offsets(3, -8); + config.device_remove("s2636_1"); + config.device_remove("s2636_2"); +} + + + +/******************************************************************************* + + Game drivers + +*******************************************************************************/ + +ROM_START( galaxia ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) + ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) + ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) + ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(c4482770) SHA1(aee983cc3d80989f49aea4138961bb623039484a) ) + ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) + ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(c0baa654) SHA1(80e0880c32ad285fbce0f7f552268b964b97cab3) ) + ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) + ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) + ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) + ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) + ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority +ROM_END + +ROM_START( galaxiaa ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) + ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) + ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) + ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(c4482770) SHA1(aee983cc3d80989f49aea4138961bb623039484a) ) + ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) + ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh + ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) + ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) + ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) + ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent + ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority +ROM_END + +ROM_START( galaxiab ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) + ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) + ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) + ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(1d22219b) SHA1(6ab8ea8c78db30d80de98879018726d0420d30fe) ) // sldh - only 1 bit difference compared with to galaxiaa, not a bad dump, see notes above + ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) + ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh + ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) + ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) + ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) + ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent + ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority +ROM_END + +ROM_START( galaxiac ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) + ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) + ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(5682d56f) SHA1(15afb3296e93f8371d36b686ce372f917bd5b771) ) // sldh + ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(80dafe84) SHA1(8a71a05f1b0ddba36bf748a4801f3a78f63af1db) ) // sldh + ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) + ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh + ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) + ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(ffe86fdb) SHA1(67b02a5c39dbe515b6d68583c8831b0dae15374a) ) // sldh + ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(8e3f5343) SHA1(6298be9bb33975854cb3d009b89913b1a8018aee) ) // sldh + ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent + ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority +ROM_END + + +ROM_START( astrowar ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "astro.8h", 0x00000, 0x0400, CRC(b0ec246c) SHA1(f9123b5e317938655f5e8b3f8a5810d0b2b7c7af) ) + ROM_LOAD( "astro.10h", 0x00400, 0x0400, CRC(090d360f) SHA1(528ddcdc30a5a291bd8850ff6f134fcc19af562f) ) + ROM_LOAD( "astro.11h", 0x00800, 0x0400, CRC(72ab1378) SHA1(50743c64c4775076aa6f1d8ab2e05c14884bf0ba) ) + ROM_LOAD( "astro.13h", 0x00c00, 0x0400, CRC(2dc4c895) SHA1(831afbfd4ebfd6522ab0758222bc6f9826148a5d) ) + ROM_LOAD( "astro.8i", 0x01000, 0x0400, CRC(ab87fbfc) SHA1(34b670f96c260f186c643e588995ae5d80377784) ) + ROM_LOAD( "astro.10i", 0x02000, 0x0400, CRC(533675c1) SHA1(69cc066e1874a135a53a21b7b2461bda456504f1) ) + ROM_LOAD( "astro.11i", 0x02400, 0x0400, CRC(59cf8901) SHA1(e849d4c99350b7e3453c156d91618b71b5be1163) ) + ROM_LOAD( "astro.13i", 0x02800, 0x0400, CRC(5149c121) SHA1(232ba594e283fb25c31d8ae0b7d8315a81852a71) BAD_DUMP ) // suspected bad byte at 0x2a00 + ROM_LOAD( "astro.11l", 0x02c00, 0x0400, CRC(29f52f57) SHA1(5cb50b82e09c537eeaeae167351fca686fde8228) ) + ROM_LOAD( "astro.13l", 0x03000, 0x0400, CRC(882cdb87) SHA1(062ee8d296316cbce2eb62e72774aa4181e9847d) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "astro.1d", 0x00000, 0x0400, CRC(6053f834) SHA1(e0b76800c241b3c8010c09869cecbc109b25310a) ) + ROM_LOAD( "astro.3d", 0x00400, 0x0400, CRC(822505aa) SHA1(f9d3465e14bb850a286f8b4f42aa0a4044413b67) ) +ROM_END + +} // anonymous namespace + + + +/*************************************************************************** + + Game Drivers + +***************************************************************************/ + +// YEAR NAME PARENT MACHINE INPUT CLASS INIT SCREEN COMPANY FULLNAME FLAGS +GAME( 1979, galaxia, 0, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, galaxiaa, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, galaxiab, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 3)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, galaxiac, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 4)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, astrowar, 0, astrowar, galaxia, astrowar_state, empty_init, ROT90, "Zaccaria / Zelco", "Astro Wars", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/zaccaria/quasar.cpp b/src/mame/zaccaria/quasar.cpp index 720ffcf8ca9..dca4dc7cb3b 100644 --- a/src/mame/zaccaria/quasar.cpp +++ b/src/mame/zaccaria/quasar.cpp @@ -681,5 +681,13 @@ ROM_END } // anonymous namespace -GAME( 1980, quasar, 0, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1980, quasara, quasar, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) + +/*************************************************************************** + + Game Drivers + +***************************************************************************/ + +// YEAR NAME PARENT MACHINE INPUT CLASS INIT SCREEN COMPANY FULLNAME FLAGS +GAME( 1980, quasar, 0, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, quasara, quasar, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -- cgit v1.2.3