mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
excellent/aquarium.cpp, excellent/gcpinbal.cpp, excellent/witch.cpp, f32/crospang.cpp: consolidated drivers in single files
This commit is contained in:
parent
09825827ca
commit
0e1c444a0d
@ -1,6 +1,7 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
/* Aquarium (c)1996 Excellent Systems */
|
||||
// copyright-holders: David Haywood
|
||||
|
||||
// Aquarium (c)1996 Excellent Systems
|
||||
|
||||
/*
|
||||
|
||||
@ -49,15 +50,210 @@ Notes:
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "aquarium.h"
|
||||
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "excellent_spr.h"
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/gen_latch.h"
|
||||
#include "machine/mb3773.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "sound/ymopm.h"
|
||||
#include "speaker.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
|
||||
// configurable logging
|
||||
#define LOG_AUDIOBANK (1U << 1)
|
||||
#define LOG_OKI (1U << 2)
|
||||
|
||||
//#define VERBOSE (LOG_GENERAL | LOG_AUDIOBANK | LOG_OKI)
|
||||
|
||||
#include "logmacro.h"
|
||||
|
||||
#define LOGAUDIOBANK(...) LOGMASKED(LOG_AUDIOBANK, __VA_ARGS__)
|
||||
#define LOGOKI(...) LOGMASKED(LOG_OKI, __VA_ARGS__)
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class aquarium_state : public driver_device
|
||||
{
|
||||
public:
|
||||
aquarium_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_mid_videoram(*this, "mid_videoram"),
|
||||
m_bak_videoram(*this, "bak_videoram"),
|
||||
m_txt_videoram(*this, "txt_videoram"),
|
||||
m_scroll(*this, "scroll"),
|
||||
m_audiobank(*this, "audiobank"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_oki(*this, "oki"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_sprgen(*this, "spritegen"),
|
||||
m_screen(*this, "screen"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_watchdog(*this, "watchdog")
|
||||
{ }
|
||||
|
||||
void init_aquarium();
|
||||
|
||||
void aquarium(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
// memory pointers
|
||||
required_shared_ptr<u16> m_mid_videoram;
|
||||
required_shared_ptr<u16> m_bak_videoram;
|
||||
required_shared_ptr<u16> m_txt_videoram;
|
||||
required_shared_ptr<u16> m_scroll;
|
||||
required_memory_bank m_audiobank;
|
||||
|
||||
// video-related
|
||||
tilemap_t *m_txt_tilemap = nullptr;
|
||||
tilemap_t *m_mid_tilemap = nullptr;
|
||||
tilemap_t *m_bak_tilemap = nullptr;
|
||||
std::unique_ptr<u8[]> m_decoded_gfx[2];
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<excellent_spr_device> m_sprgen;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
required_device<mb3773_device> m_watchdog;
|
||||
|
||||
void watchdog_w(u8 data);
|
||||
void z80_bank_w(u8 data);
|
||||
u8 oki_r();
|
||||
void oki_w(u8 data);
|
||||
|
||||
std::unique_ptr<u8[]> expand_gfx(int low, int hi);
|
||||
void txt_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void mid_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void bak_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
TILE_GET_INFO_MEMBER(get_txt_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_mid_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bak_tile_info);
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u8 snd_bitswap(u8 scrambled_data);
|
||||
void aquarium_colpri_cb(u32 &colour, u32 &pri_mask);
|
||||
|
||||
void main_map(address_map &map);
|
||||
void snd_map(address_map &map);
|
||||
void snd_portmap(address_map &map);
|
||||
};
|
||||
|
||||
|
||||
// video
|
||||
|
||||
// TXT Layer
|
||||
TILE_GET_INFO_MEMBER(aquarium_state::get_txt_tile_info)
|
||||
{
|
||||
const u32 tileno = (m_txt_videoram[tile_index] & 0x0fff);
|
||||
const u32 colour = (m_txt_videoram[tile_index] & 0xf000) >> 12;
|
||||
tileinfo.set(0, tileno, colour, 0);
|
||||
|
||||
tileinfo.category = (m_txt_videoram[tile_index] & 0x8000) >> 15;
|
||||
}
|
||||
|
||||
void aquarium_state::txt_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_txt_videoram[offset]);
|
||||
m_txt_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
// MID Layer
|
||||
TILE_GET_INFO_MEMBER(aquarium_state::get_mid_tile_info)
|
||||
{
|
||||
const u32 tileno = (m_mid_videoram[tile_index * 2] & 0x0fff);
|
||||
const u32 colour = (m_mid_videoram[tile_index * 2 + 1] & 0x001f);
|
||||
const int flag = TILE_FLIPYX((m_mid_videoram[tile_index * 2 + 1] & 0x300) >> 8);
|
||||
|
||||
tileinfo.set(1, tileno, colour, flag);
|
||||
|
||||
tileinfo.category = (m_mid_videoram[tile_index * 2 + 1] & 0x20) >> 5;
|
||||
}
|
||||
|
||||
void aquarium_state::mid_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_mid_videoram[offset]);
|
||||
m_mid_tilemap->mark_tile_dirty(offset / 2);
|
||||
}
|
||||
|
||||
// BAK Layer
|
||||
TILE_GET_INFO_MEMBER(aquarium_state::get_bak_tile_info)
|
||||
{
|
||||
const u32 tileno = (m_bak_videoram[tile_index * 2] & 0x0fff);
|
||||
const u32 colour = (m_bak_videoram[tile_index * 2 + 1] & 0x001f);
|
||||
const int flag = TILE_FLIPYX((m_bak_videoram[tile_index * 2 + 1] & 0x300) >> 8);
|
||||
|
||||
tileinfo.set(2, tileno, colour, flag);
|
||||
|
||||
tileinfo.category = (m_bak_videoram[tile_index * 2 + 1] & 0x20) >> 5;
|
||||
}
|
||||
|
||||
void aquarium_state::bak_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_bak_videoram[offset]);
|
||||
m_bak_tilemap->mark_tile_dirty(offset / 2);
|
||||
}
|
||||
|
||||
void aquarium_state::video_start()
|
||||
{
|
||||
m_txt_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(aquarium_state::get_txt_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
m_mid_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(aquarium_state::get_mid_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_bak_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(aquarium_state::get_bak_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
|
||||
m_txt_tilemap->set_transparent_pen(0);
|
||||
m_mid_tilemap->set_transparent_pen(0);
|
||||
m_bak_tilemap->set_transparent_pen(0);
|
||||
}
|
||||
|
||||
void aquarium_state::aquarium_colpri_cb(u32 &colour, u32 &pri_mask)
|
||||
{
|
||||
pri_mask = 0;
|
||||
if (colour & 8)
|
||||
pri_mask |= (GFX_PMASK_2 | GFX_PMASK_4 | GFX_PMASK_8);
|
||||
}
|
||||
|
||||
uint32_t aquarium_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_mid_tilemap->set_scrollx(0, m_scroll[0]);
|
||||
m_mid_tilemap->set_scrolly(0, m_scroll[1]);
|
||||
m_bak_tilemap->set_scrollx(0, m_scroll[2]);
|
||||
m_bak_tilemap->set_scrolly(0, m_scroll[3]);
|
||||
m_txt_tilemap->set_scrollx(0, m_scroll[4]);
|
||||
m_txt_tilemap->set_scrolly(0, m_scroll[5]);
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect); // WDUD logo suggests this
|
||||
|
||||
m_bak_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_mid_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
m_txt_tilemap->draw(screen, bitmap, cliprect, 1, 4);
|
||||
|
||||
m_bak_tilemap->draw(screen, bitmap, cliprect, 1, 8);
|
||||
m_sprgen->aquarium_draw_sprites(screen, bitmap, cliprect, 16);
|
||||
m_mid_tilemap->draw(screen, bitmap, cliprect, 1, 0);
|
||||
m_txt_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// machine
|
||||
|
||||
void aquarium_state::watchdog_w(u8 data)
|
||||
{
|
||||
@ -70,7 +266,7 @@ void aquarium_state::z80_bank_w(u8 data)
|
||||
// uses bits ---x --xx
|
||||
data = bitswap<8>(data, 7, 6, 5, 2, 3, 1, 4, 0);
|
||||
|
||||
//printf("aquarium bank %04x %04x\n", data, mem_mask);
|
||||
LOGAUDIOBANK("aquarium bank %04x\n", data);
|
||||
// aquarium bank 0003 00ff - correct (title) 011
|
||||
// aquarium bank 0006 00ff - correct (select) 110
|
||||
// aquarium bank 0005 00ff - level 1 (correct)
|
||||
@ -91,7 +287,7 @@ u8 aquarium_state::oki_r()
|
||||
|
||||
void aquarium_state::oki_w(u8 data)
|
||||
{
|
||||
logerror("%s:Writing %04x to the OKI M6295\n", machine().describe_context(), snd_bitswap(data));
|
||||
LOGOKI("%s:Writing %04x to the OKI M6295\n", machine().describe_context(), snd_bitswap(data));
|
||||
m_oki->write(snd_bitswap(data));
|
||||
}
|
||||
|
||||
@ -99,15 +295,15 @@ void aquarium_state::oki_w(u8 data)
|
||||
void aquarium_state::main_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x07ffff).rom();
|
||||
map(0xc00000, 0xc00fff).ram().w(FUNC(aquarium_state::mid_videoram_w)).share("mid_videoram");
|
||||
map(0xc01000, 0xc01fff).ram().w(FUNC(aquarium_state::bak_videoram_w)).share("bak_videoram");
|
||||
map(0xc02000, 0xc03fff).ram().w(FUNC(aquarium_state::txt_videoram_w)).share("txt_videoram");
|
||||
map(0xc00000, 0xc00fff).ram().w(FUNC(aquarium_state::mid_videoram_w)).share(m_mid_videoram);
|
||||
map(0xc01000, 0xc01fff).ram().w(FUNC(aquarium_state::bak_videoram_w)).share(m_bak_videoram);
|
||||
map(0xc02000, 0xc03fff).ram().w(FUNC(aquarium_state::txt_videoram_w)).share(m_txt_videoram);
|
||||
map(0xc80000, 0xc81fff).rw(m_sprgen, FUNC(excellent_spr_device::read), FUNC(excellent_spr_device::write)).umask16(0x00ff);
|
||||
map(0xd00000, 0xd00fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xd80014, 0xd8001f).writeonly().share("scroll");
|
||||
map(0xd80068, 0xd80069).nopw(); /* probably not used */
|
||||
map(0xd80014, 0xd8001f).writeonly().share(m_scroll);
|
||||
map(0xd80068, 0xd80069).nopw(); // probably not used
|
||||
map(0xd80080, 0xd80081).portr("DSW");
|
||||
map(0xd80082, 0xd80083).nopr(); /* stored but not read back ? check code at 0x01f440 */
|
||||
map(0xd80082, 0xd80083).nopr(); // stored but not read back ? check code at 0x01f440
|
||||
map(0xd80084, 0xd80085).portr("INPUTS");
|
||||
map(0xd80086, 0xd80087).portr("SYSTEM");
|
||||
map(0xd80088, 0xd80088).w(FUNC(aquarium_state::watchdog_w));
|
||||
@ -119,7 +315,7 @@ void aquarium_state::snd_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3fff).rom();
|
||||
map(0x7800, 0x7fff).ram();
|
||||
map(0x8000, 0xffff).bankr("bank1");
|
||||
map(0x8000, 0xffff).bankr(m_audiobank);
|
||||
}
|
||||
|
||||
void aquarium_state::snd_portmap(address_map &map)
|
||||
@ -141,16 +337,16 @@ static INPUT_PORTS_START( aquarium )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
|
||||
PORT_DIPNAME( 0x000c, 0x000c, "Winning Rounds (Player VS CPU)" ) PORT_DIPLOCATION("SW1:3,4")
|
||||
PORT_DIPSETTING( 0x000c, "1/1" )
|
||||
PORT_DIPSETTING( 0x0000, "1/1" ) // Not used or listed in manual
|
||||
PORT_DIPSETTING( 0x0008, "2/3" )
|
||||
PORT_DIPSETTING( 0x0004, "3/5" )
|
||||
// PORT_DIPSETTING( 0x0000, "1/1" ) /* Not used or listed in manual */
|
||||
PORT_DIPNAME( 0x0030, 0x0030, "Winning Rounds (Player VS Player)" ) PORT_DIPLOCATION("SW1:5,6")
|
||||
PORT_DIPSETTING( 0x0030, "1/1" )
|
||||
PORT_DIPSETTING( 0x0000, "1/1" ) // Not used or listed in manual
|
||||
PORT_DIPSETTING( 0x0020, "2/3" )
|
||||
PORT_DIPSETTING( 0x0010, "3/5" )
|
||||
// PORT_DIPSETTING( 0x0000, "1/1" ) /* Not used or listed in manual */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* Listed in the manual as always OFF */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) /* Listed in the manual as always OFF */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) // Listed in the manual as always OFF
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) // Listed in the manual as always OFF
|
||||
PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3")
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( 4C_1C ) )
|
||||
@ -160,15 +356,15 @@ static INPUT_PORTS_START( aquarium )
|
||||
PORT_DIPSETTING( 0x0600, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x0500, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) )
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW2:4" ) /* Listed in the manual as always OFF */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW2:4" ) // Listed in the manual as always OFF
|
||||
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:5")
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:6")
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
|
||||
PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) /* Listed in the manual as always OFF */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) /* Listed in the manual as always OFF */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) // Listed in the manual as always OFF
|
||||
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // Listed in the manual as always OFF
|
||||
|
||||
PORT_START("INPUTS")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
@ -177,7 +373,7 @@ static INPUT_PORTS_START( aquarium )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* used in testmode, but not in game? */
|
||||
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // used in testmode, but not in game?
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
@ -185,7 +381,7 @@ static INPUT_PORTS_START( aquarium )
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* used in testmode, but not in game? */
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // used in testmode, but not in game?
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 )
|
||||
|
||||
PORT_START("SYSTEM")
|
||||
@ -221,19 +417,19 @@ GFXDECODE_END
|
||||
|
||||
void aquarium_state::aquarium(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, XTAL(32'000'000)/2); // clock not verified on pcb
|
||||
// basic machine hardware
|
||||
M68000(config, m_maincpu, XTAL(32'000'000) / 2); // clock not verified on PCB
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &aquarium_state::main_map);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(aquarium_state::irq1_line_hold));
|
||||
|
||||
Z80(config, m_audiocpu, XTAL(32'000'000)/6); // clock not verified on pcb
|
||||
Z80(config, m_audiocpu, XTAL(32'000'000) / 6); // clock not verified on PCB
|
||||
m_audiocpu->set_addrmap(AS_PROGRAM, &aquarium_state::snd_map);
|
||||
m_audiocpu->set_addrmap(AS_IO, &aquarium_state::snd_portmap);
|
||||
|
||||
// Is this the actual IC type? Some other Excellent games from this period use a MAX693.
|
||||
// Confirmed IC type, even though some other Excellent games from this period use a MAX693.
|
||||
MB3773(config, m_watchdog, 0);
|
||||
|
||||
/* video hardware */
|
||||
// video hardware
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_refresh_hz(60);
|
||||
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
|
||||
@ -243,14 +439,14 @@ void aquarium_state::aquarium(machine_config &config)
|
||||
m_screen->set_palette(m_palette);
|
||||
|
||||
GFXDECODE(config, m_gfxdecode, m_palette, gfx_aquarium);
|
||||
PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 0x1000/2);
|
||||
PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 0x1000 / 2);
|
||||
|
||||
EXCELLENT_SPRITE(config, m_sprgen, 0);
|
||||
m_sprgen->set_palette(m_palette);
|
||||
m_sprgen->set_color_base(0x300);
|
||||
m_sprgen->set_colpri_callback(FUNC(aquarium_state::aquarium_colpri_cb));
|
||||
|
||||
/* sound hardware */
|
||||
// sound hardware
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
SPEAKER(config, "rspeaker").front_right();
|
||||
|
||||
@ -258,7 +454,7 @@ void aquarium_state::aquarium(machine_config &config)
|
||||
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
|
||||
m_soundlatch->set_separate_acknowledge(true);
|
||||
|
||||
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181)/4)); // clock not verified on pcb
|
||||
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181) / 4)); // clock not verified on PCB
|
||||
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
|
||||
ymsnd.add_route(0, "lspeaker", 0.45);
|
||||
ymsnd.add_route(1, "rspeaker", 0.45);
|
||||
@ -269,67 +465,67 @@ void aquarium_state::aquarium(machine_config &config)
|
||||
}
|
||||
|
||||
ROM_START( aquarium )
|
||||
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
|
||||
ROM_REGION( 0x080000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_WORD_SWAP( "aquar3.13h", 0x000000, 0x080000, CRC(f197991e) SHA1(0a217d735e2643605dbfd6ee20f98f46b37d4838) )
|
||||
|
||||
ROM_REGION( 0x40000, "audiocpu", 0 ) /* z80 (sound) code */
|
||||
ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "excellent_5.10c", 0x000000, 0x40000, CRC(fa555be1) SHA1(07236f2b2ba67e92984b9ddf4a8154221d535245) )
|
||||
|
||||
ROM_REGION( 0x080000, "mid", 0 ) /* BG Tiles */
|
||||
ROM_REGION( 0x080000, "mid", 0 ) // BG Tiles
|
||||
ROM_LOAD16_WORD_SWAP( "excellent_1.15b", 0x000000, 0x080000, CRC(575df6ac) SHA1(071394273e512666fe124facdd8591a767ad0819) ) // 4bpp
|
||||
/* data is expanded here from mid_hi */
|
||||
ROM_REGION( 0x020000, "mid_hi", 0 ) /* BG Tiles */
|
||||
// data is expanded here from mid_hi
|
||||
ROM_REGION( 0x020000, "mid_hi", 0 ) // BG Tiles
|
||||
ROM_LOAD( "excellent_6.15d", 0x000000, 0x020000, CRC(9065b146) SHA1(befc218bbcd63453ea7eb8f976796d36f2b2d552) ) // 1bpp
|
||||
|
||||
ROM_REGION( 0x080000, "bak", 0 ) /* BG Tiles */
|
||||
ROM_REGION( 0x080000, "bak", 0 ) // BG Tiles
|
||||
ROM_LOAD16_WORD_SWAP( "excellent_8.14g", 0x000000, 0x080000, CRC(915520c4) SHA1(308207cb20f1ed6df365710c808644a6e4f07614) ) // 4bpp
|
||||
/* data is expanded here from bak_hi */
|
||||
ROM_REGION( 0x020000, "bak_hi", 0 ) /* BG Tiles */
|
||||
// data is expanded here from bak_hi
|
||||
ROM_REGION( 0x020000, "bak_hi", 0 ) // BG Tiles
|
||||
ROM_LOAD( "excellent_7.17g", 0x000000, 0x020000, CRC(b96b2b82) SHA1(2b719d0c185d1eca4cd9ea66bed7842b74062288) ) // 1bpp
|
||||
|
||||
ROM_REGION( 0x060000, "txt", 0 ) /* FG Tiles */
|
||||
ROM_REGION( 0x060000, "txt", 0 ) // FG Tiles
|
||||
ROM_LOAD16_WORD_SWAP( "excellent_2.17e", 0x000000, 0x020000, CRC(aa071b05) SHA1(517415bfd8e4dd51c6eb03a25c706f8613d34a09) )
|
||||
|
||||
ROM_REGION( 0x200000, "spritegen", 0 ) /* Sprites? */
|
||||
ROM_REGION( 0x200000, "spritegen", 0 )
|
||||
ROM_LOAD16_WORD_SWAP( "d23c8000.1f", 0x000000, 0x0100000, CRC(14758b3c) SHA1(b372ccb42acb55a3dd15352a9d4ed576878a6731) ) // PCB denotes 23C16000 but a 23C8000 MASK is used
|
||||
|
||||
ROM_REGION( 0x100000, "oki", 0 ) /* Samples */
|
||||
ROM_REGION( 0x100000, "oki", 0 ) // Samples
|
||||
ROM_LOAD( "excellent_4.7d", 0x000000, 0x80000, CRC(9a4af531) SHA1(bb201b7a6c9fd5924a0d79090257efffd8d4aba1) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( aquariumj )
|
||||
ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
|
||||
ROM_REGION( 0x080000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_WORD_SWAP( "excellent_3.13h", 0x000000, 0x080000, CRC(344509a1) SHA1(9deb610732dee5066b3225cd7b1929b767579235) )
|
||||
|
||||
ROM_REGION( 0x40000, "audiocpu", 0 ) /* z80 (sound) code */
|
||||
ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "excellent_5.10c", 0x000000, 0x40000, CRC(fa555be1) SHA1(07236f2b2ba67e92984b9ddf4a8154221d535245) )
|
||||
|
||||
ROM_REGION( 0x080000, "mid", 0 ) /* BG Tiles */
|
||||
ROM_REGION( 0x080000, "mid", 0 ) // BG Tiles
|
||||
ROM_LOAD16_WORD_SWAP( "excellent_1.15b", 0x000000, 0x080000, CRC(575df6ac) SHA1(071394273e512666fe124facdd8591a767ad0819) ) // 4bpp
|
||||
/* data is expanded here from mid_hi */
|
||||
ROM_REGION( 0x020000, "mid_hi", 0 ) /* BG Tiles */
|
||||
// data is expanded here from mid_hi
|
||||
ROM_REGION( 0x020000, "mid_hi", 0 ) // BG Tiles
|
||||
ROM_LOAD( "excellent_6.15d", 0x000000, 0x020000, CRC(9065b146) SHA1(befc218bbcd63453ea7eb8f976796d36f2b2d552) ) // 1bpp
|
||||
|
||||
ROM_REGION( 0x080000, "bak", 0 ) /* BG Tiles */
|
||||
ROM_REGION( 0x080000, "bak", 0 ) // BG Tiles
|
||||
ROM_LOAD16_WORD_SWAP( "excellent_8.14g", 0x000000, 0x080000, CRC(915520c4) SHA1(308207cb20f1ed6df365710c808644a6e4f07614) ) // 4bpp
|
||||
/* data is expanded here from bak_hi */
|
||||
ROM_REGION( 0x020000, "bak_hi", 0 ) /* BG Tiles */
|
||||
// data is expanded here from bak_hi
|
||||
ROM_REGION( 0x020000, "bak_hi", 0 ) // BG Tiles
|
||||
ROM_LOAD( "excellent_7.17g", 0x000000, 0x020000, CRC(b96b2b82) SHA1(2b719d0c185d1eca4cd9ea66bed7842b74062288) ) // 1bpp
|
||||
|
||||
ROM_REGION( 0x060000, "txt", 0 ) /* FG Tiles */
|
||||
ROM_REGION( 0x060000, "txt", 0 ) // FG Tiles
|
||||
ROM_LOAD16_WORD_SWAP( "excellent_2.17e", 0x000000, 0x020000, CRC(aa071b05) SHA1(517415bfd8e4dd51c6eb03a25c706f8613d34a09) )
|
||||
|
||||
ROM_REGION( 0x200000, "spritegen", 0 ) /* Sprites? */
|
||||
ROM_REGION( 0x200000, "spritegen", 0 )
|
||||
ROM_LOAD16_WORD_SWAP( "d23c8000.1f", 0x000000, 0x0100000, CRC(14758b3c) SHA1(b372ccb42acb55a3dd15352a9d4ed576878a6731) ) // PCB denotes 23C16000 but a 23C8000 MASK is used
|
||||
|
||||
ROM_REGION( 0x100000, "oki", 0 ) /* Samples */
|
||||
ROM_REGION( 0x100000, "oki", 0 ) // Samples
|
||||
ROM_LOAD( "excellent_4.7d", 0x000000, 0x80000, CRC(9a4af531) SHA1(bb201b7a6c9fd5924a0d79090257efffd8d4aba1) )
|
||||
ROM_END
|
||||
|
||||
std::unique_ptr<u8[]> aquarium_state::expand_gfx(int low, int hi)
|
||||
{
|
||||
/* The BG tiles are 5bpp, this rearranges the data from
|
||||
the roms containing the 1bpp data so we can decode it
|
||||
the ROMs containing the 1bpp data so we can decode it
|
||||
correctly */
|
||||
gfx_element *gfx_l = m_gfxdecode->gfx(low);
|
||||
gfx_element *gfx_h = m_gfxdecode->gfx(hi);
|
||||
@ -371,12 +567,15 @@ void aquarium_state::init_aquarium()
|
||||
m_decoded_gfx[0] = expand_gfx(1, 4);
|
||||
m_decoded_gfx[1] = expand_gfx(2, 3);
|
||||
|
||||
u8 *Z80 = memregion("audiocpu")->base();
|
||||
u8 *z80 = memregion("audiocpu")->base();
|
||||
|
||||
/* configure and set up the sound bank */
|
||||
m_audiobank->configure_entries(0, 0x8, &Z80[0x00000], 0x8000);
|
||||
// configure and set up the sound bank
|
||||
m_audiobank->configure_entries(0, 0x8, &z80[0x00000], 0x8000);
|
||||
m_audiobank->set_entry(0x00);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
GAME( 1996, aquarium, 0, aquarium, aquarium, aquarium_state, init_aquarium, ROT0, "Excellent System", "Aquarium (US)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
|
||||
GAME( 1996, aquariumj, aquarium, aquarium, aquarium, aquarium_state, init_aquarium, ROT0, "Excellent System", "Aquarium (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
|
||||
|
@ -1,90 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
#ifndef MAME_INCLUDES_AQUARIUM_H
|
||||
#define MAME_INCLUDES_AQUARIUM_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/gen_latch.h"
|
||||
#include "machine/mb3773.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "excellent_spr.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
class aquarium_state : public driver_device
|
||||
{
|
||||
public:
|
||||
aquarium_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_mid_videoram(*this, "mid_videoram"),
|
||||
m_bak_videoram(*this, "bak_videoram"),
|
||||
m_txt_videoram(*this, "txt_videoram"),
|
||||
m_scroll(*this, "scroll"),
|
||||
m_audiobank(*this, "bank1"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_oki(*this, "oki"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_sprgen(*this, "spritegen"),
|
||||
m_screen(*this, "screen"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_watchdog(*this, "watchdog")
|
||||
{ }
|
||||
|
||||
void init_aquarium();
|
||||
|
||||
void aquarium(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
/* memory pointers */
|
||||
required_shared_ptr<u16> m_mid_videoram;
|
||||
required_shared_ptr<u16> m_bak_videoram;
|
||||
required_shared_ptr<u16> m_txt_videoram;
|
||||
required_shared_ptr<u16> m_scroll;
|
||||
required_memory_bank m_audiobank;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_txt_tilemap = nullptr;
|
||||
tilemap_t *m_mid_tilemap = nullptr;
|
||||
tilemap_t *m_bak_tilemap = nullptr;
|
||||
std::unique_ptr<u8[]> m_decoded_gfx[2];
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<excellent_spr_device> m_sprgen;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
required_device<mb3773_device> m_watchdog;
|
||||
|
||||
void watchdog_w(u8 data);
|
||||
void z80_bank_w(u8 data);
|
||||
u8 oki_r();
|
||||
void oki_w(u8 data);
|
||||
|
||||
std::unique_ptr<u8[]> expand_gfx(int low, int hi);
|
||||
void txt_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void mid_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void bak_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
TILE_GET_INFO_MEMBER(get_txt_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_mid_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bak_tile_info);
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u8 snd_bitswap(u8 scrambled_data);
|
||||
void aquarium_colpri_cb(u32 &colour, u32 &pri_mask);
|
||||
|
||||
void main_map(address_map &map);
|
||||
void snd_map(address_map &map);
|
||||
void snd_portmap(address_map &map);
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_AQUARIUM_H
|
@ -1,101 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
/* Aquarium */
|
||||
|
||||
#include "emu.h"
|
||||
#include "aquarium.h"
|
||||
|
||||
|
||||
/* TXT Layer */
|
||||
TILE_GET_INFO_MEMBER(aquarium_state::get_txt_tile_info)
|
||||
{
|
||||
const u32 tileno = (m_txt_videoram[tile_index] & 0x0fff);
|
||||
const u32 colour = (m_txt_videoram[tile_index] & 0xf000) >> 12;
|
||||
tileinfo.set(0, tileno, colour, 0);
|
||||
|
||||
tileinfo.category = (m_txt_videoram[tile_index] & 0x8000) >> 15;
|
||||
}
|
||||
|
||||
void aquarium_state::txt_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_txt_videoram[offset]);
|
||||
m_txt_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
/* MID Layer */
|
||||
TILE_GET_INFO_MEMBER(aquarium_state::get_mid_tile_info)
|
||||
{
|
||||
const u32 tileno = (m_mid_videoram[tile_index * 2] & 0x0fff);
|
||||
const u32 colour = (m_mid_videoram[tile_index * 2 + 1] & 0x001f);
|
||||
const int flag = TILE_FLIPYX((m_mid_videoram[tile_index * 2 + 1] & 0x300) >> 8);
|
||||
|
||||
tileinfo.set(1, tileno, colour, flag);
|
||||
|
||||
tileinfo.category = (m_mid_videoram[tile_index * 2 + 1] & 0x20) >> 5;
|
||||
}
|
||||
|
||||
void aquarium_state::mid_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_mid_videoram[offset]);
|
||||
m_mid_tilemap->mark_tile_dirty(offset / 2);
|
||||
}
|
||||
|
||||
/* BAK Layer */
|
||||
TILE_GET_INFO_MEMBER(aquarium_state::get_bak_tile_info)
|
||||
{
|
||||
const u32 tileno = (m_bak_videoram[tile_index * 2] & 0x0fff);
|
||||
const u32 colour = (m_bak_videoram[tile_index * 2 + 1] & 0x001f);
|
||||
const int flag = TILE_FLIPYX((m_bak_videoram[tile_index * 2 + 1] & 0x300) >> 8);
|
||||
|
||||
tileinfo.set(2, tileno, colour, flag);
|
||||
|
||||
tileinfo.category = (m_bak_videoram[tile_index * 2 + 1] & 0x20) >> 5;
|
||||
}
|
||||
|
||||
void aquarium_state::bak_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_bak_videoram[offset]);
|
||||
m_bak_tilemap->mark_tile_dirty(offset / 2);
|
||||
}
|
||||
|
||||
void aquarium_state::video_start()
|
||||
{
|
||||
m_txt_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(aquarium_state::get_txt_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
m_mid_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(aquarium_state::get_mid_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_bak_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(aquarium_state::get_bak_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
|
||||
m_txt_tilemap->set_transparent_pen(0);
|
||||
m_mid_tilemap->set_transparent_pen(0);
|
||||
m_bak_tilemap->set_transparent_pen(0);
|
||||
}
|
||||
|
||||
void aquarium_state::aquarium_colpri_cb(u32 &colour, u32 &pri_mask)
|
||||
{
|
||||
pri_mask = 0;
|
||||
if (colour & 8)
|
||||
pri_mask |= (GFX_PMASK_2 | GFX_PMASK_4 | GFX_PMASK_8);
|
||||
}
|
||||
|
||||
uint32_t aquarium_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_mid_tilemap->set_scrollx(0, m_scroll[0]);
|
||||
m_mid_tilemap->set_scrolly(0, m_scroll[1]);
|
||||
m_bak_tilemap->set_scrollx(0, m_scroll[2]);
|
||||
m_bak_tilemap->set_scrolly(0, m_scroll[3]);
|
||||
m_txt_tilemap->set_scrollx(0, m_scroll[4]);
|
||||
m_txt_tilemap->set_scrolly(0, m_scroll[5]);
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect); // WDUD logo suggests this
|
||||
|
||||
m_bak_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_mid_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
m_txt_tilemap->draw(screen, bitmap, cliprect, 1, 4);
|
||||
|
||||
m_bak_tilemap->draw(screen, bitmap, cliprect, 1, 8);
|
||||
m_sprgen->aquarium_draw_sprites(screen, bitmap, cliprect, 16);
|
||||
m_mid_tilemap->draw(screen, bitmap, cliprect, 1, 0);
|
||||
m_txt_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Graves, R. Belmont, David Haywood
|
||||
// copyright-holders: David Graves, R. Belmont, David Haywood
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Excellent System's ES-9209B Hardware
|
||||
@ -23,7 +24,6 @@ TODO
|
||||
----
|
||||
|
||||
- Screen flipping support
|
||||
- Modernize ES-8712 and hook up to MSM6585 and HCT157
|
||||
- Figure out which customs use D80010-D80077 and merge implementation with Aquarium
|
||||
- Is SW3 actually used?
|
||||
- Power Flipper reference video: https://www.youtube.com/watch?v=zBGjncVsSf4 (seems to have been recorded with 'flipscreen' dipswitch on, because it causes a jumping glitch before the raster effect, same in MAME)
|
||||
@ -81,13 +81,261 @@ NOTE: Mask ROMs from Power Flipper Pinball Shooting have not been dumped, but as
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "gcpinbal.h"
|
||||
|
||||
#include "excellent_spr.h"
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/eepromser.h"
|
||||
#include "machine/mb3773.h"
|
||||
#include "machine/timer.h"
|
||||
#include "sound/es8712.h"
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
|
||||
// configurable logging
|
||||
#define LOG_IOC (1U << 1)
|
||||
#define LOG_ESBANKSW (1U << 2)
|
||||
|
||||
//#define VERBOSE (LOG_GENERAL | LOG_IOC | LOG_ESBANKSW)
|
||||
|
||||
#include "logmacro.h"
|
||||
|
||||
#define LOGIOC(...) LOGMASKED(LOG_IOC, __VA_ARGS__)
|
||||
#define LOGESBANKSW(...) LOGMASKED(LOG_ESBANKSW, __VA_ARGS__)
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class gcpinbal_state : public driver_device
|
||||
{
|
||||
public:
|
||||
gcpinbal_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_tilemapram(*this, "tilemapram")
|
||||
, m_d80010_ram(*this, "d80010")
|
||||
, m_d80060_ram(*this, "d80060")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_eeprom(*this, "eeprom")
|
||||
, m_watchdog(*this, "watchdog")
|
||||
, m_oki(*this, "oki")
|
||||
, m_essnd(*this, "essnd")
|
||||
, m_sprgen(*this, "spritegen")
|
||||
, m_screen(*this, "screen")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_palette(*this, "palette")
|
||||
{ }
|
||||
|
||||
void gcpinbal(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<u16> m_tilemapram;
|
||||
required_shared_ptr<u16> m_d80010_ram;
|
||||
required_shared_ptr<u16> m_d80060_ram;
|
||||
|
||||
// video-related
|
||||
tilemap_t *m_tilemap[3]{};
|
||||
u16 m_scrollx[3]{};
|
||||
u16 m_scrolly[3]{};
|
||||
u16 m_bg_gfxset[2]{};
|
||||
#ifdef MAME_DEBUG
|
||||
u8 m_dislayer[4]{};
|
||||
#endif
|
||||
|
||||
// sound-related
|
||||
u8 m_msm_bank = 0U;
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<eeprom_serial_93cxx_device> m_eeprom;
|
||||
required_device<mb3773_device> m_watchdog;
|
||||
required_device<okim6295_device> m_oki;
|
||||
required_device<es8712_device> m_essnd;
|
||||
required_device<excellent_spr_device> m_sprgen;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
void d80010_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void d80040_w(offs_t offset, u8 data);
|
||||
void d80060_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void bank_w(u8 data);
|
||||
void eeprom_w(u8 data);
|
||||
void es8712_reset_w(u8 data);
|
||||
void tilemaps_word_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_bg0_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg1_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
|
||||
void colpri_cb(u32 &colour, u32 &pri_mask);
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
|
||||
|
||||
void program_map(address_map &map);
|
||||
};
|
||||
|
||||
|
||||
// video
|
||||
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(gcpinbal_state::get_bg0_tile_info)
|
||||
{
|
||||
const u16 tile = m_tilemapram[0 + tile_index * 2];
|
||||
const u16 attr = m_tilemapram[1 + tile_index * 2];
|
||||
|
||||
tileinfo.set(0,
|
||||
(tile & 0xfff) + m_bg_gfxset[0],
|
||||
(attr & 0x1f),
|
||||
TILE_FLIPYX((attr & 0x300) >> 8));
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(gcpinbal_state::get_bg1_tile_info)
|
||||
{
|
||||
const u16 tile = m_tilemapram[0x800 + tile_index * 2];
|
||||
const u16 attr = m_tilemapram[0x801 + tile_index * 2];
|
||||
|
||||
tileinfo.set(0,
|
||||
(tile & 0xfff) + 0x2000 + m_bg_gfxset[1],
|
||||
(attr & 0x1f) + 0x30,
|
||||
TILE_FLIPYX((attr & 0x300) >> 8));
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(gcpinbal_state::get_fg_tile_info)
|
||||
{
|
||||
const u16 tile = m_tilemapram[0x1000 + tile_index];
|
||||
tileinfo.set(1, (tile & 0xfff), (tile >> 12), 0);
|
||||
}
|
||||
|
||||
void gcpinbal_state::video_start()
|
||||
{
|
||||
int xoffs = 0;
|
||||
int yoffs = 0;
|
||||
|
||||
m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gcpinbal_state::get_bg0_tile_info)),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gcpinbal_state::get_bg1_tile_info)),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gcpinbal_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
|
||||
m_tilemap[0]->set_transparent_pen(0);
|
||||
m_tilemap[1]->set_transparent_pen(0);
|
||||
m_tilemap[2]->set_transparent_pen(0);
|
||||
|
||||
// flipscreen n/a
|
||||
m_tilemap[0]->set_scrolldx(-xoffs, 0);
|
||||
m_tilemap[1]->set_scrolldx(-xoffs, 0);
|
||||
m_tilemap[2]->set_scrolldx(-xoffs, 0);
|
||||
m_tilemap[0]->set_scrolldy(-yoffs, 0);
|
||||
m_tilemap[1]->set_scrolldy(-yoffs, 0);
|
||||
m_tilemap[2]->set_scrolldy(-yoffs, 0);
|
||||
}
|
||||
|
||||
void gcpinbal_state::colpri_cb(u32 &colour, u32 &pri_mask)
|
||||
{
|
||||
pri_mask = (m_d80060_ram[0x8 / 2] & 0x8800) ? 0xf0 : 0xfc;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
TILEMAP READ AND WRITE HANDLERS
|
||||
*******************************************************************/
|
||||
|
||||
void gcpinbal_state::tilemaps_word_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_tilemapram[offset]);
|
||||
|
||||
if (offset < 0x800) // BG0
|
||||
m_tilemap[0]->mark_tile_dirty(offset / 2);
|
||||
else if ((offset < 0x1000)) // BG1
|
||||
m_tilemap[1]->mark_tile_dirty((offset % 0x800) / 2);
|
||||
else if ((offset < 0x1800)) // FG
|
||||
m_tilemap[2]->mark_tile_dirty((offset % 0x800));
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************
|
||||
SCREEN REFRESH
|
||||
**************************************************************/
|
||||
|
||||
uint32_t gcpinbal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
uint8_t layer[3];
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (machine().input().code_pressed_once(KEYCODE_V))
|
||||
{
|
||||
m_dislayer[0] ^= 1;
|
||||
popmessage("bg0: %01x", m_dislayer[0]);
|
||||
}
|
||||
|
||||
if (machine().input().code_pressed_once(KEYCODE_B))
|
||||
{
|
||||
m_dislayer[1] ^= 1;
|
||||
popmessage("bg1: %01x", m_dislayer[1]);
|
||||
}
|
||||
|
||||
if (machine().input().code_pressed_once(KEYCODE_N))
|
||||
{
|
||||
m_dislayer[2] ^= 1;
|
||||
popmessage("fg: %01x", m_dislayer[2]);
|
||||
}
|
||||
#endif
|
||||
|
||||
m_scrollx[0] = m_d80010_ram[0x4 / 2];
|
||||
m_scrolly[0] = m_d80010_ram[0x6 / 2];
|
||||
m_scrollx[1] = m_d80010_ram[0x8 / 2];
|
||||
m_scrolly[1] = m_d80010_ram[0xa / 2];
|
||||
m_scrollx[2] = m_d80010_ram[0xc / 2];
|
||||
m_scrolly[2] = m_d80010_ram[0xe / 2];
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
m_tilemap[i]->set_scrollx(0, m_scrollx[i]);
|
||||
m_tilemap[i]->set_scrolly(0, m_scrolly[i]);
|
||||
}
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
layer[0] = 0;
|
||||
layer[1] = 1;
|
||||
layer[2] = 2;
|
||||
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (m_dislayer[layer[0]] == 0)
|
||||
#endif
|
||||
m_tilemap[layer[0]]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (m_dislayer[layer[1]] == 0)
|
||||
#endif
|
||||
m_tilemap[layer[1]]->draw(screen, bitmap, cliprect, 0, 2);
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (m_dislayer[layer[2]] == 0)
|
||||
#endif
|
||||
m_tilemap[layer[2]]->draw(screen, bitmap, cliprect, 0, 4);
|
||||
|
||||
m_sprgen->gcpinbal_draw_sprites(screen, bitmap, cliprect, 16);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// machine
|
||||
|
||||
/***********************************************************
|
||||
INTERRUPTS
|
||||
***********************************************************/
|
||||
@ -111,18 +359,18 @@ TIMER_DEVICE_CALLBACK_MEMBER(gcpinbal_state::scanline_cb)
|
||||
|
||||
void gcpinbal_state::d80010_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
//logerror("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n", m_maincpu->pc(), offset, data);
|
||||
LOGIOC("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n", m_maincpu->pc(), offset, data);
|
||||
COMBINE_DATA(&m_d80010_ram[offset]);
|
||||
}
|
||||
|
||||
void gcpinbal_state::d80040_w(offs_t offset, u8 data)
|
||||
{
|
||||
logerror("Writing byte value %02X to offset %X\n", data, offset);
|
||||
LOGIOC("Writing byte value %02X to offset %X\n", data, offset);
|
||||
}
|
||||
|
||||
void gcpinbal_state::d80060_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
//logerror("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n", m_maincpu->pc(), offset, data);
|
||||
LOGIOC("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n", m_maincpu->pc(), offset, data);
|
||||
COMBINE_DATA(&m_d80060_ram[offset]);
|
||||
}
|
||||
|
||||
@ -133,23 +381,23 @@ void gcpinbal_state::bank_w(u8 data)
|
||||
{
|
||||
m_msm_bank = ((data & 0x10) >> 4);
|
||||
m_essnd->set_rom_bank(m_msm_bank);
|
||||
logerror("Bankswitching ES8712 ROM %02x\n", m_msm_bank);
|
||||
LOGESBANKSW("Bankswitching ES8712 ROM %02x\n", m_msm_bank);
|
||||
}
|
||||
m_oki->set_rom_bank((data & 0x20) >> 5);
|
||||
|
||||
u32 old = m_bg0_gfxset;
|
||||
u32 old = m_bg_gfxset[0];
|
||||
u32 newbank = (data & 0x04) ? 0x1000 : 0;
|
||||
if (old != newbank)
|
||||
{
|
||||
m_bg0_gfxset = (data & 0x04) ? 0x1000 : 0;
|
||||
m_bg_gfxset[0] = (data & 0x04) ? 0x1000 : 0;
|
||||
m_tilemap[0]->mark_all_dirty();
|
||||
}
|
||||
|
||||
old = m_bg1_gfxset;
|
||||
old = m_bg_gfxset[1];
|
||||
newbank = (data & 0x08) ? 0x1000 : 0;
|
||||
if (old != newbank)
|
||||
{
|
||||
m_bg1_gfxset = (data & 0x04) ? 0x1000 : 0;
|
||||
m_bg_gfxset[1] = (data & 0x04) ? 0x1000 : 0;
|
||||
m_tilemap[1]->mark_all_dirty();
|
||||
}
|
||||
|
||||
@ -178,15 +426,15 @@ void gcpinbal_state::es8712_reset_w(u8 data)
|
||||
MEMORY STRUCTURES
|
||||
***********************************************************/
|
||||
|
||||
void gcpinbal_state::gcpinbal_map(address_map &map)
|
||||
void gcpinbal_state::program_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x1fffff).rom();
|
||||
map(0xc00000, 0xc03fff).ram().w(FUNC(gcpinbal_state::tilemaps_word_w)).share("tilemapram");
|
||||
map(0xc00000, 0xc03fff).ram().w(FUNC(gcpinbal_state::tilemaps_word_w)).share(m_tilemapram);
|
||||
map(0xc80000, 0xc81fff).rw(m_sprgen, FUNC(excellent_spr_device::read), FUNC(excellent_spr_device::write)).umask16(0x00ff);
|
||||
map(0xd00000, 0xd00fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xd80010, 0xd8002f).ram().w(FUNC(gcpinbal_state::d80010_w)).share("d80010");
|
||||
map(0xd80010, 0xd8002f).ram().w(FUNC(gcpinbal_state::d80010_w)).share(m_d80010_ram);
|
||||
map(0xd80040, 0xd8005b).w(FUNC(gcpinbal_state::d80040_w)).umask16(0x00ff);
|
||||
map(0xd80060, 0xd80077).ram().w(FUNC(gcpinbal_state::d80060_w)).share("d80060");
|
||||
map(0xd80060, 0xd80077).ram().w(FUNC(gcpinbal_state::d80060_w)).share(m_d80060_ram);
|
||||
map(0xd80080, 0xd80081).portr("DSW");
|
||||
map(0xd80084, 0xd80085).portr("IN0");
|
||||
map(0xd80086, 0xd80087).portr("IN1");
|
||||
@ -195,7 +443,7 @@ void gcpinbal_state::gcpinbal_map(address_map &map)
|
||||
map(0xd8008e, 0xd8008e).w(FUNC(gcpinbal_state::es8712_reset_w));
|
||||
map(0xd800a0, 0xd800a0).mirror(0x2).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
|
||||
map(0xd800c0, 0xd800cd).w(m_essnd, FUNC(es8712_device::write)).umask16(0xff00);
|
||||
map(0xff0000, 0xffffff).ram(); /* RAM */
|
||||
map(0xff0000, 0xffffff).ram();
|
||||
}
|
||||
|
||||
|
||||
@ -309,8 +557,7 @@ void gcpinbal_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_scrollx));
|
||||
save_item(NAME(m_scrolly));
|
||||
save_item(NAME(m_bg0_gfxset));
|
||||
save_item(NAME(m_bg1_gfxset));
|
||||
save_item(NAME(m_bg_gfxset));
|
||||
save_item(NAME(m_msm_bank));
|
||||
}
|
||||
|
||||
@ -322,16 +569,16 @@ void gcpinbal_state::machine_reset()
|
||||
m_scrolly[i] = 0;
|
||||
}
|
||||
|
||||
m_bg0_gfxset = 0;
|
||||
m_bg1_gfxset = 0;
|
||||
m_bg_gfxset[0] = 0;
|
||||
m_bg_gfxset[1] = 0;
|
||||
m_msm_bank = 0;
|
||||
}
|
||||
|
||||
void gcpinbal_state::gcpinbal(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, 32_MHz_XTAL/2); /* 16 MHz */
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &gcpinbal_state::gcpinbal_map);
|
||||
// basic machine hardware
|
||||
M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 16 MHz
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &gcpinbal_state::program_map);
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(gcpinbal_state::scanline_cb), "screen", 0, 1);
|
||||
|
||||
@ -339,24 +586,24 @@ void gcpinbal_state::gcpinbal(machine_config &config)
|
||||
|
||||
MB3773(config, m_watchdog, 0);
|
||||
|
||||
/* video hardware */
|
||||
// video hardware
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_refresh_hz(60);
|
||||
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0) /* frames per second, vblank duration */);
|
||||
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); // frames per second, vblank duration
|
||||
m_screen->set_size(40*8, 32*8);
|
||||
m_screen->set_visarea(0*8, 40*8-1, 2*8, 30*8-1);
|
||||
m_screen->set_screen_update(FUNC(gcpinbal_state::screen_update));
|
||||
m_screen->set_palette(m_palette);
|
||||
|
||||
GFXDECODE(config, m_gfxdecode, m_palette, gfx_gcpinbal);
|
||||
PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 0x1000/2);
|
||||
PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 0x1000 / 2);
|
||||
|
||||
EXCELLENT_SPRITE(config, m_sprgen, 0);
|
||||
m_sprgen->set_palette(m_palette);
|
||||
m_sprgen->set_color_base(0x600);
|
||||
m_sprgen->set_colpri_callback(FUNC(gcpinbal_state::gcpinbal_colpri_cb));
|
||||
m_sprgen->set_colpri_callback(FUNC(gcpinbal_state::colpri_cb));
|
||||
|
||||
/* sound hardware */
|
||||
// sound hardware
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
OKIM6295(config, m_oki, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.30);
|
||||
@ -368,7 +615,7 @@ void gcpinbal_state::gcpinbal(machine_config &config)
|
||||
|
||||
msm6585_device &msm(MSM6585(config, "msm", 640_kHz_XTAL));
|
||||
msm.vck_legacy_callback().set("essnd", FUNC(es8712_device::msm_int));
|
||||
msm.set_prescaler_selector(msm6585_device::S40); /* 16 kHz */
|
||||
msm.set_prescaler_selector(msm6585_device::S40); // 16 kHz
|
||||
msm.add_route(ALL_OUTPUTS, "mono", 1.0);
|
||||
}
|
||||
|
||||
@ -378,62 +625,64 @@ void gcpinbal_state::gcpinbal(machine_config &config)
|
||||
DRIVERS
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( pwrflip ) /* Updated version of Grand Cross Pinball or semi-sequel? */
|
||||
ROM_REGION( 0x200000, "maincpu", 0 ) /* 512k for 68000 program */
|
||||
ROM_LOAD16_WORD_SWAP( "p.f_1.33.u43", 0x000000, 0x80000, CRC(d760c987) SHA1(9200604377542193afc866c84733f2d3b5aa1c80) ) /* hand written labels on genuine EXCELLENT labels */
|
||||
ROM_FILL ( 0x80000, 0x080000, 0x00 ) /* unpopulated 27C4096 socket at U44 */
|
||||
ROM_START( pwrflip ) // Updated version of Grand Cross Pinball or semi-sequel?
|
||||
ROM_REGION( 0x200000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_WORD_SWAP( "p.f_1.33.u43", 0x000000, 0x80000, CRC(d760c987) SHA1(9200604377542193afc866c84733f2d3b5aa1c80) ) // hand written labels on genuine EXCELLENT labels
|
||||
ROM_FILL ( 0x80000, 0x080000, 0x00 ) // unpopulated 27C4096 socket at U44
|
||||
ROM_LOAD16_WORD_SWAP( "p.f.u45", 0x100000, 0x80000, CRC(6ad1a457) SHA1(8746c38efa05e3318e9b1a371470d149803fb6bb) )
|
||||
ROM_LOAD16_WORD_SWAP( "p.f.u46", 0x180000, 0x80000, CRC(e0f3a1b4) SHA1(761dddf374a92c1a1e4a211ead215d5be461a082) )
|
||||
|
||||
ROM_REGION( 0x200000, "bg0", 0 ) /* BG0 (16 x 16) */
|
||||
ROM_LOAD16_WORD_SWAP( "u1", 0x000000, 0x100000, CRC(afa459bb) SHA1(7a7c64bcb80d71b8cf3fdd3209ef109997b6417c) ) /* 23C8000 mask ROMs */
|
||||
ROM_REGION( 0x200000, "bg0", 0 ) // 16 x 16
|
||||
ROM_LOAD16_WORD_SWAP( "u1", 0x000000, 0x100000, CRC(afa459bb) SHA1(7a7c64bcb80d71b8cf3fdd3209ef109997b6417c) ) // 23C8000 mask ROMs
|
||||
ROM_LOAD16_WORD_SWAP( "u6", 0x100000, 0x100000, CRC(c3f024e5) SHA1(d197e2b715b154fc64ff9a61f8c6df111d6fd446) )
|
||||
|
||||
ROM_REGION( 0x020000, "fg0", 0 ) /* FG0 (8 x 8) */
|
||||
ROM_REGION( 0x020000, "fg0", 0 ) // 8 x 8
|
||||
ROM_LOAD16_WORD_SWAP( "p.f.u10", 0x000000, 0x020000, CRC(50e34549) SHA1(ca1808513ff3feb8bcd34d9aafd7b374e4244732) )
|
||||
|
||||
ROM_REGION( 0x200000, "spritegen", 0 ) /* Sprites (16 x 16) */
|
||||
ROM_LOAD16_WORD_SWAP( "u13", 0x000000, 0x200000, CRC(62f3952f) SHA1(7dc9ccb753d46b6aaa791bcbf6e18e6d872f6b79) ) /* 23C16000 mask ROM */
|
||||
ROM_REGION( 0x200000, "spritegen", 0 ) // 16 x 16
|
||||
ROM_LOAD16_WORD_SWAP( "u13", 0x000000, 0x200000, CRC(62f3952f) SHA1(7dc9ccb753d46b6aaa791bcbf6e18e6d872f6b79) ) // 23C16000 mask ROM
|
||||
|
||||
ROM_REGION( 0x080000, "oki", 0 ) /* M6295 acc to Raine */
|
||||
ROM_LOAD( "u55", 0x000000, 0x080000, CRC(b3063351) SHA1(825e63e8a824d67d235178897528e5b0b41e4485) ) /* OKI M534001B mask ROM */
|
||||
ROM_REGION( 0x080000, "oki", 0 )
|
||||
ROM_LOAD( "u55", 0x000000, 0x080000, CRC(b3063351) SHA1(825e63e8a824d67d235178897528e5b0b41e4485) ) // OKI M534001B mask ROM
|
||||
|
||||
ROM_REGION( 0x200000, "essnd", 0 ) /* M6585 acc to Raine but should be for ES-8712??? */
|
||||
ROM_LOAD( "u56", 0x000000, 0x200000, CRC(092b2c0f) SHA1(2ec1904e473ddddb50dbeaa0b561642064d45336) ) /* 23C16000 mask ROM */
|
||||
ROM_REGION( 0x200000, "essnd", 0 )
|
||||
ROM_LOAD( "u56", 0x000000, 0x200000, CRC(092b2c0f) SHA1(2ec1904e473ddddb50dbeaa0b561642064d45336) ) // 23C16000 mask ROM
|
||||
|
||||
ROM_REGION( 0x000400, "plds", 0 ) /* 2x TIBPAL16L8-15CN */
|
||||
ROM_REGION( 0x000400, "plds", 0 ) // 2x TIBPAL16L8-15CN
|
||||
ROM_LOAD( "a.u72", 0x000, 0x104, NO_DUMP )
|
||||
ROM_LOAD( "b.u73", 0x200, 0x104, NO_DUMP )
|
||||
ROM_END
|
||||
|
||||
ROM_START( gcpinbal )
|
||||
ROM_REGION( 0x200000, "maincpu", 0 ) /* 512k for 68000 program */
|
||||
ROM_LOAD16_WORD_SWAP( "2_excellent.u43", 0x000000, 0x80000, CRC(d174bd7f) SHA1(0e6c17265e1400de941e3e2ca3be835aaaff6695) ) /* Red line across label */
|
||||
ROM_FILL ( 0x80000, 0x080000, 0x00 ) /* unpopulated 27C4096 socket at U44 */
|
||||
ROM_REGION( 0x200000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_WORD_SWAP( "2_excellent.u43", 0x000000, 0x80000, CRC(d174bd7f) SHA1(0e6c17265e1400de941e3e2ca3be835aaaff6695) ) // Red line across label
|
||||
ROM_FILL ( 0x80000, 0x080000, 0x00 ) // unpopulated 27C4096 socket at U44
|
||||
ROM_LOAD16_WORD_SWAP( "3_excellent.u45", 0x100000, 0x80000, CRC(0511ad56) SHA1(e0602ece514126ce719ebc9de6649ebe907be904) )
|
||||
ROM_LOAD16_WORD_SWAP( "4_excellent.u46", 0x180000, 0x80000, CRC(e0f3a1b4) SHA1(761dddf374a92c1a1e4a211ead215d5be461a082) )
|
||||
|
||||
ROM_REGION( 0x200000, "bg0", 0 ) /* BG0 (16 x 16) */
|
||||
ROM_LOAD16_WORD_SWAP( "u1", 0x000000, 0x100000, CRC(afa459bb) SHA1(7a7c64bcb80d71b8cf3fdd3209ef109997b6417c) ) /* 23C8000 mask ROMs */
|
||||
ROM_REGION( 0x200000, "bg0", 0 ) // 16 x 16
|
||||
ROM_LOAD16_WORD_SWAP( "u1", 0x000000, 0x100000, CRC(afa459bb) SHA1(7a7c64bcb80d71b8cf3fdd3209ef109997b6417c) ) // 23C8000 mask ROMs
|
||||
ROM_LOAD16_WORD_SWAP( "u6", 0x100000, 0x100000, CRC(c3f024e5) SHA1(d197e2b715b154fc64ff9a61f8c6df111d6fd446) )
|
||||
|
||||
ROM_REGION( 0x020000, "fg0", 0 ) /* FG0 (8 x 8) */
|
||||
ROM_REGION( 0x020000, "fg0", 0 ) // 8 x 8
|
||||
ROM_LOAD16_WORD_SWAP( "1_excellent.u10", 0x000000, 0x020000, CRC(79321550) SHA1(61f1b772ed8cf95bfee9df8394b0c3ff727e8702) )
|
||||
|
||||
ROM_REGION( 0x200000, "spritegen", 0 ) /* Sprites (16 x 16) */
|
||||
ROM_LOAD16_WORD_SWAP( "u13", 0x000000, 0x200000, CRC(62f3952f) SHA1(7dc9ccb753d46b6aaa791bcbf6e18e6d872f6b79) ) /* 23C16000 mask ROM */
|
||||
ROM_REGION( 0x200000, "spritegen", 0 ) // 16 x 16
|
||||
ROM_LOAD16_WORD_SWAP( "u13", 0x000000, 0x200000, CRC(62f3952f) SHA1(7dc9ccb753d46b6aaa791bcbf6e18e6d872f6b79) ) // 23C16000 mask ROM
|
||||
|
||||
ROM_REGION( 0x080000, "oki", 0 ) /* M6295 acc to Raine */
|
||||
ROM_LOAD( "u55", 0x000000, 0x080000, CRC(b3063351) SHA1(825e63e8a824d67d235178897528e5b0b41e4485) ) /* OKI M534001B mask ROM */
|
||||
ROM_REGION( 0x080000, "oki", 0 )
|
||||
ROM_LOAD( "u55", 0x000000, 0x080000, CRC(b3063351) SHA1(825e63e8a824d67d235178897528e5b0b41e4485) ) // OKI M534001B mask ROM
|
||||
|
||||
ROM_REGION( 0x200000, "essnd", 0 ) /* M6585 acc to Raine but should be for ES-8712??? */
|
||||
ROM_LOAD( "u56", 0x000000, 0x200000, CRC(092b2c0f) SHA1(2ec1904e473ddddb50dbeaa0b561642064d45336) ) /* 23C16000 mask ROM */
|
||||
ROM_REGION( 0x200000, "essnd", 0 )
|
||||
ROM_LOAD( "u56", 0x000000, 0x200000, CRC(092b2c0f) SHA1(2ec1904e473ddddb50dbeaa0b561642064d45336) ) // 23C16000 mask ROM
|
||||
|
||||
ROM_REGION( 0x000400, "plds", 0 ) /* 2x TIBPAL16L8-15CN */
|
||||
ROM_REGION( 0x000400, "plds", 0 ) // 2x TIBPAL16L8-15CN
|
||||
ROM_LOAD( "a.u72", 0x000, 0x104, NO_DUMP )
|
||||
ROM_LOAD( "b.u73", 0x200, 0x104, NO_DUMP )
|
||||
ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
GAME( 1994, pwrflip, 0, gcpinbal, gcpinbal, gcpinbal_state, empty_init, ROT270, "Excellent System", "Power Flipper Pinball Shooting v1.33", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1994, gcpinbal, 0, gcpinbal, gcpinbal, gcpinbal_state, empty_init, ROT270, "Excellent System", "Grand Cross v1.02F", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
GAME( 1994, pwrflip, 0, gcpinbal, gcpinbal, gcpinbal_state, empty_init, ROT270, "Excellent System", "Power Flipper Pinball Shooting (v1.33)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1994, gcpinbal, 0, gcpinbal, gcpinbal, gcpinbal_state, empty_init, ROT270, "Excellent System", "Grand Cross (v1.02F)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -1,93 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Graves, R. Belmont
|
||||
#ifndef MAME_INCLUDES_GCPINBAL_H
|
||||
#define MAME_INCLUDES_GCPINBAL_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/eepromser.h"
|
||||
#include "machine/mb3773.h"
|
||||
#include "sound/es8712.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "excellent_spr.h"
|
||||
#include "emupal.h"
|
||||
#include "machine/timer.h"
|
||||
#include "screen.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
class gcpinbal_state : public driver_device
|
||||
{
|
||||
public:
|
||||
gcpinbal_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_tilemapram(*this, "tilemapram")
|
||||
, m_d80010_ram(*this, "d80010")
|
||||
, m_d80060_ram(*this, "d80060")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_eeprom(*this, "eeprom")
|
||||
, m_watchdog(*this, "watchdog")
|
||||
, m_oki(*this, "oki")
|
||||
, m_essnd(*this, "essnd")
|
||||
, m_sprgen(*this, "spritegen")
|
||||
, m_screen(*this, "screen")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_palette(*this, "palette")
|
||||
{ }
|
||||
|
||||
void gcpinbal(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<u16> m_tilemapram;
|
||||
required_shared_ptr<u16> m_d80010_ram;
|
||||
required_shared_ptr<u16> m_d80060_ram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_tilemap[3]{};
|
||||
u16 m_scrollx[3]{};
|
||||
u16 m_scrolly[3]{};
|
||||
u16 m_bg0_gfxset = 0U;
|
||||
u16 m_bg1_gfxset = 0U;
|
||||
#ifdef MAME_DEBUG
|
||||
u8 m_dislayer[4] = { 0, 0, 0, 0 };
|
||||
#endif
|
||||
|
||||
/* sound-related */
|
||||
u32 m_msm_bank = 0U;
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<eeprom_serial_93cxx_device> m_eeprom;
|
||||
required_device<mb3773_device> m_watchdog;
|
||||
required_device<okim6295_device> m_oki;
|
||||
required_device<es8712_device> m_essnd;
|
||||
required_device<excellent_spr_device> m_sprgen;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
void d80010_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void d80040_w(offs_t offset, u8 data);
|
||||
void d80060_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void bank_w(u8 data);
|
||||
void eeprom_w(u8 data);
|
||||
void es8712_reset_w(u8 data);
|
||||
void tilemaps_word_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_bg0_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg1_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
|
||||
void gcpinbal_colpri_cb(u32 &colour, u32 &pri_mask);
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
|
||||
|
||||
void gcpinbal_map(address_map &map);
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_GCPINBAL_H
|
@ -1,159 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Graves, R. Belmont, David Haywood
|
||||
#include "emu.h"
|
||||
#include "gcpinbal.h"
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(gcpinbal_state::get_bg0_tile_info)
|
||||
{
|
||||
const u16 tile = m_tilemapram[0 + tile_index * 2];
|
||||
const u16 attr = m_tilemapram[1 + tile_index * 2];
|
||||
|
||||
tileinfo.set(0,
|
||||
(tile & 0xfff) + m_bg0_gfxset,
|
||||
(attr & 0x1f),
|
||||
TILE_FLIPYX((attr & 0x300) >> 8));
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(gcpinbal_state::get_bg1_tile_info)
|
||||
{
|
||||
const u16 tile = m_tilemapram[0x800 + tile_index * 2];
|
||||
const u16 attr = m_tilemapram[0x801 + tile_index * 2];
|
||||
|
||||
tileinfo.set(0,
|
||||
(tile & 0xfff) + 0x2000 + m_bg1_gfxset,
|
||||
(attr & 0x1f) + 0x30,
|
||||
TILE_FLIPYX((attr & 0x300) >> 8));
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(gcpinbal_state::get_fg_tile_info)
|
||||
{
|
||||
const u16 tile = m_tilemapram[0x1000 + tile_index];
|
||||
tileinfo.set(1, (tile & 0xfff), (tile >> 12), 0);
|
||||
}
|
||||
|
||||
void gcpinbal_state::video_start()
|
||||
{
|
||||
int xoffs = 0;
|
||||
int yoffs = 0;
|
||||
|
||||
m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gcpinbal_state::get_bg0_tile_info)),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gcpinbal_state::get_bg1_tile_info)),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gcpinbal_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
|
||||
m_tilemap[0]->set_transparent_pen(0);
|
||||
m_tilemap[1]->set_transparent_pen(0);
|
||||
m_tilemap[2]->set_transparent_pen(0);
|
||||
|
||||
/* flipscreen n/a */
|
||||
m_tilemap[0]->set_scrolldx(-xoffs, 0);
|
||||
m_tilemap[1]->set_scrolldx(-xoffs, 0);
|
||||
m_tilemap[2]->set_scrolldx(-xoffs, 0);
|
||||
m_tilemap[0]->set_scrolldy(-yoffs, 0);
|
||||
m_tilemap[1]->set_scrolldy(-yoffs, 0);
|
||||
m_tilemap[2]->set_scrolldy(-yoffs, 0);
|
||||
}
|
||||
|
||||
void gcpinbal_state::gcpinbal_colpri_cb(u32 &colour, u32 &pri_mask)
|
||||
{
|
||||
pri_mask = (m_d80060_ram[0x8 / 2] & 0x8800) ? 0xf0 : 0xfc;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
TILEMAP READ AND WRITE HANDLERS
|
||||
*******************************************************************/
|
||||
|
||||
void gcpinbal_state::tilemaps_word_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_tilemapram[offset]);
|
||||
|
||||
if (offset < 0x800) /* BG0 */
|
||||
m_tilemap[0]->mark_tile_dirty(offset / 2);
|
||||
else if ((offset < 0x1000)) /* BG1 */
|
||||
m_tilemap[1]->mark_tile_dirty((offset % 0x800) / 2);
|
||||
else if ((offset < 0x1800)) /* FG */
|
||||
m_tilemap[2]->mark_tile_dirty((offset % 0x800));
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************
|
||||
SCREEN REFRESH
|
||||
**************************************************************/
|
||||
|
||||
uint32_t gcpinbal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
uint8_t layer[3];
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (machine().input().code_pressed_once(KEYCODE_V))
|
||||
{
|
||||
m_dislayer[0] ^= 1;
|
||||
popmessage("bg0: %01x", m_dislayer[0]);
|
||||
}
|
||||
|
||||
if (machine().input().code_pressed_once(KEYCODE_B))
|
||||
{
|
||||
m_dislayer[1] ^= 1;
|
||||
popmessage("bg1: %01x", m_dislayer[1]);
|
||||
}
|
||||
|
||||
if (machine().input().code_pressed_once(KEYCODE_N))
|
||||
{
|
||||
m_dislayer[2] ^= 1;
|
||||
popmessage("fg: %01x", m_dislayer[2]);
|
||||
}
|
||||
#endif
|
||||
|
||||
m_scrollx[0] = m_d80010_ram[0x4 / 2];
|
||||
m_scrolly[0] = m_d80010_ram[0x6 / 2];
|
||||
m_scrollx[1] = m_d80010_ram[0x8 / 2];
|
||||
m_scrolly[1] = m_d80010_ram[0xa / 2];
|
||||
m_scrollx[2] = m_d80010_ram[0xc / 2];
|
||||
m_scrolly[2] = m_d80010_ram[0xe / 2];
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
m_tilemap[i]->set_scrollx(0, m_scrollx[i]);
|
||||
m_tilemap[i]->set_scrolly(0, m_scrolly[i]);
|
||||
}
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
layer[0] = 0;
|
||||
layer[1] = 1;
|
||||
layer[2] = 2;
|
||||
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (m_dislayer[layer[0]] == 0)
|
||||
#endif
|
||||
m_tilemap[layer[0]]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (m_dislayer[layer[1]] == 0)
|
||||
#endif
|
||||
m_tilemap[layer[1]]->draw(screen, bitmap, cliprect, 0, 2);
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (m_dislayer[layer[2]] == 0)
|
||||
#endif
|
||||
m_tilemap[layer[2]]->draw(screen, bitmap, cliprect, 0, 4);
|
||||
|
||||
m_sprgen->gcpinbal_draw_sprites(screen, bitmap, cliprect, 16);
|
||||
|
||||
#if 0
|
||||
{
|
||||
// char buf[80];
|
||||
sprintf(buf,"bg0_gfx: %04x bg1_gfx: %04x ", m_bg0_gfxset, m_bg1_gfxset);
|
||||
popmessage(buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,143 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Tomasz Slanina
|
||||
/*
|
||||
|
||||
Witch / Pinball Champ '95 / Keirin Ou
|
||||
|
||||
*/
|
||||
|
||||
#ifndef MAME_INCLUDES_WITCH_H
|
||||
#define MAME_INCLUDES_WITCH_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/i8255.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/ticket.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "sound/es8712.h"
|
||||
#include "sound/ymopn.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
#define MAIN_CLOCK XTAL(12'000'000)
|
||||
#define CPU_CLOCK MAIN_CLOCK / 4
|
||||
#define YM2203_CLOCK MAIN_CLOCK / 4
|
||||
#define AY8910_CLOCK MAIN_CLOCK / 8
|
||||
#define MSM5202_CLOCK 384_kHz_XTAL
|
||||
|
||||
#define HOPPER_PULSE 50 // time between hopper pulses in milliseconds (not right for attendant pay)
|
||||
#define UNBANKED_SIZE 0x800
|
||||
|
||||
|
||||
class witch_state : public driver_device
|
||||
{
|
||||
public:
|
||||
witch_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_subcpu(*this, "sub")
|
||||
, m_ppi(*this, "ppi%u", 1U)
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_gfx0_vram(*this, "gfx0_vram")
|
||||
, m_gfx0_cram(*this, "gfx0_cram")
|
||||
, m_gfx1_vram(*this, "gfx1_vram")
|
||||
, m_gfx1_cram(*this, "gfx1_cram")
|
||||
, m_sprite_ram(*this, "sprite_ram")
|
||||
, m_palette(*this, "palette")
|
||||
, m_hopper(*this, "hopper")
|
||||
, m_mainbank(*this, "mainbank")
|
||||
{ }
|
||||
|
||||
void witch(machine_config &config);
|
||||
|
||||
void init_witch();
|
||||
|
||||
void gfx0_vram_w(offs_t offset, uint8_t data);
|
||||
void gfx0_cram_w(offs_t offset, uint8_t data);
|
||||
void gfx1_vram_w(offs_t offset, uint8_t data);
|
||||
void gfx1_cram_w(offs_t offset, uint8_t data);
|
||||
uint8_t gfx1_vram_r(offs_t offset);
|
||||
uint8_t gfx1_cram_r(offs_t offset);
|
||||
uint8_t read_a000();
|
||||
void write_a002(uint8_t data);
|
||||
void write_a006(uint8_t data);
|
||||
void main_write_a008(uint8_t data);
|
||||
void sub_write_a008(uint8_t data);
|
||||
uint8_t prot_read_700x(offs_t offset);
|
||||
void xscroll_w(uint8_t data);
|
||||
void yscroll_w(uint8_t data);
|
||||
|
||||
protected:
|
||||
void common_map(address_map &map);
|
||||
|
||||
tilemap_t *m_gfx0_tilemap = nullptr;
|
||||
tilemap_t *m_gfx1_tilemap = nullptr;
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device_array<i8255_device, 2> m_ppi;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
required_shared_ptr<uint8_t> m_gfx0_vram;
|
||||
required_shared_ptr<uint8_t> m_gfx0_cram;
|
||||
required_shared_ptr<uint8_t> m_gfx1_vram;
|
||||
required_shared_ptr<uint8_t> m_gfx1_cram;
|
||||
required_shared_ptr<uint8_t> m_sprite_ram;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
required_device<ticket_dispenser_device> m_hopper;
|
||||
|
||||
optional_memory_bank m_mainbank;
|
||||
|
||||
int m_scrollx = 0;
|
||||
int m_scrolly = 0;
|
||||
uint8_t m_reg_a002 = 0;
|
||||
uint8_t m_motor_active = 0;
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_gfx0_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_gfx1_tile_info);
|
||||
virtual void video_start() override;
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
virtual void machine_reset() override;
|
||||
|
||||
void witch_common_map(address_map &map);
|
||||
void witch_main_map(address_map &map);
|
||||
void witch_sub_map(address_map &map);
|
||||
|
||||
void video_common_init();
|
||||
bool has_spr_rom_bank = false;
|
||||
uint8_t m_spr_bank = 0;
|
||||
};
|
||||
|
||||
class keirinou_state : public witch_state
|
||||
{
|
||||
public:
|
||||
keirinou_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: witch_state(mconfig, type, tag),
|
||||
m_paletteram(*this, "paletteram")
|
||||
{ }
|
||||
|
||||
void keirinou(machine_config &config);
|
||||
|
||||
private:
|
||||
void keirinou_common_map(address_map &map);
|
||||
void keirinou_main_map(address_map &map);
|
||||
void keirinou_sub_map(address_map &map);
|
||||
|
||||
void write_keirinou_a002(uint8_t data);
|
||||
void palette_w(offs_t offset, uint8_t data);
|
||||
TILE_GET_INFO_MEMBER(get_keirinou_gfx1_tile_info);
|
||||
|
||||
virtual void video_start() override;
|
||||
|
||||
uint8_t m_bg_bank = 0;
|
||||
required_shared_ptr<uint8_t> m_paletteram;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -15,43 +15,257 @@
|
||||
No Copyright Notice is displayed for Cross Pang however http://www.f2.co.kr
|
||||
at one time did list it as being by F2 System, Released April 1998
|
||||
|
||||
Video seems to be the same as the tumblepop bootleg based hardware
|
||||
in dataeast/tumbleb.cpp
|
||||
|
||||
Cross Pang:
|
||||
Audio Test isn't correct when a sound is tested, instead musics are right.
|
||||
The sample rom says 'Oksan' (Oksan made Pass, its unclear how they are
|
||||
The sample ROM says 'Oksan' (Oksan made Pass, it's unclear how they are
|
||||
related to Cross Pang)
|
||||
Bestri:
|
||||
Bestri includes Heuk San Baek Sa as one of it's three sub games.
|
||||
Bestri includes Heuk San Baek Sa as one of its three sub games.
|
||||
|
||||
2008-08
|
||||
Added Service dipswitch and dip locations based on Service Mode.
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "crospang.h"
|
||||
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "decospr.h"
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/gen_latch.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "sound/ymopl.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
|
||||
/* main cpu */
|
||||
// configurable logging
|
||||
#define LOG_TILEBANK (1U << 1)
|
||||
|
||||
//#define VERBOSE (LOG_GENERAL | LOG_TILEBANK)
|
||||
|
||||
#include "logmacro.h"
|
||||
|
||||
#define LOGTILEBANK(...) LOGMASKED(LOG_TILEBANK, __VA_ARGS__)
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class crospang_state : public driver_device
|
||||
{
|
||||
public:
|
||||
crospang_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_fg_videoram(*this, "fg_videoram")
|
||||
, m_bg_videoram(*this, "bg_videoram")
|
||||
, m_spriteram(*this, "spriteram")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_sprgen(*this, "spritegen")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
{ }
|
||||
|
||||
void crospang(machine_config &config);
|
||||
void bestri(machine_config &config);
|
||||
void bestria(machine_config &config);
|
||||
void pitapat(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<u16> m_fg_videoram;
|
||||
required_shared_ptr<u16> m_bg_videoram;
|
||||
required_shared_ptr<u16> m_spriteram;
|
||||
|
||||
// video-related
|
||||
tilemap_t *m_bg_layer = nullptr;
|
||||
tilemap_t *m_fg_layer = nullptr;
|
||||
u8 m_tilebank[4]{};
|
||||
u8 m_tilebankselect = 0U;
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<decospr_device> m_sprgen;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
void tilebank_data_w(u16 data);
|
||||
void tilebank_select_w(u16 data);
|
||||
void bestri_bg_scrolly_w(u16 data);
|
||||
void bestri_fg_scrolly_w(u16 data);
|
||||
void bestri_fg_scrollx_w(u16 data);
|
||||
void bestri_bg_scrollx_w(u16 data);
|
||||
void fg_scrolly_w(u16 data);
|
||||
void bg_scrolly_w(u16 data);
|
||||
void fg_scrollx_w(u16 data);
|
||||
void bg_scrollx_w(u16 data);
|
||||
void fg_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void bg_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void base_map(address_map &map);
|
||||
void bestri_map(address_map &map);
|
||||
void bestria_map(address_map &map);
|
||||
void crospang_map(address_map &map);
|
||||
void pitapat_map(address_map &map);
|
||||
void sound_io_map(address_map &map);
|
||||
void sound_map(address_map &map);
|
||||
};
|
||||
|
||||
|
||||
// video
|
||||
|
||||
void crospang_state::tilebank_select_w(u16 data)
|
||||
{
|
||||
LOGTILEBANK("tilebank_select_w %04x\n", data);
|
||||
|
||||
m_tilebankselect = (data >> 8) & 3;
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::tilebank_data_w(u16 data)
|
||||
{
|
||||
LOGTILEBANK("tilebank_data_w %04x\n", data);
|
||||
|
||||
m_tilebank[m_tilebankselect] = data >> 8;
|
||||
|
||||
m_fg_layer->mark_all_dirty();
|
||||
m_bg_layer->mark_all_dirty();
|
||||
}
|
||||
|
||||
|
||||
// Bestri performs some unusual operations on the scroll values before writing them
|
||||
void crospang_state::bestri_bg_scrolly_w(u16 data)
|
||||
{
|
||||
// addi.w #$1f8, D0
|
||||
// eori.w #$154, D0
|
||||
int const scroll = (data & 0x3ff) ^ 0x0155;
|
||||
m_bg_layer->set_scrolly(0, -scroll + 7);
|
||||
}
|
||||
|
||||
void crospang_state::bestri_fg_scrolly_w(u16 data)
|
||||
{
|
||||
// addi.w #$1f8, D0
|
||||
// eori.w #$aa, D0
|
||||
int const scroll = (data & 0x3ff) ^ 0x00ab;
|
||||
m_fg_layer->set_scrolly(0, -scroll + 7);
|
||||
}
|
||||
|
||||
void crospang_state::bestri_fg_scrollx_w(u16 data)
|
||||
{
|
||||
// addi.w #$400, D1
|
||||
// eori.w #$1e0, D1
|
||||
int const scroll = (data & 0x3ff) ^ 0x1e1;
|
||||
m_fg_layer->set_scrollx(0, scroll - 1);
|
||||
}
|
||||
|
||||
void crospang_state::bestri_bg_scrollx_w(u16 data)
|
||||
{
|
||||
// addi.w #$3fc, D1
|
||||
// eori.w #$3c0, D1
|
||||
int const scroll = (data & 0x3ff) ^ 0x3c1;
|
||||
m_bg_layer->set_scrollx(0, scroll + 3);
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::fg_scrolly_w(u16 data)
|
||||
{
|
||||
m_fg_layer->set_scrolly(0, data + 8);
|
||||
}
|
||||
|
||||
void crospang_state::bg_scrolly_w(u16 data)
|
||||
{
|
||||
m_bg_layer->set_scrolly(0, data + 8);
|
||||
}
|
||||
|
||||
void crospang_state::fg_scrollx_w(u16 data)
|
||||
{
|
||||
m_fg_layer->set_scrollx(0, data);
|
||||
}
|
||||
|
||||
void crospang_state::bg_scrollx_w(u16 data)
|
||||
{
|
||||
m_bg_layer->set_scrollx(0, data + 4);
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::fg_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_fg_videoram[offset]);
|
||||
m_fg_layer->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
void crospang_state::bg_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_bg_videoram[offset]);
|
||||
m_bg_layer->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(crospang_state::get_bg_tile_info)
|
||||
{
|
||||
int const data = m_bg_videoram[tile_index];
|
||||
int tile = data & 0x03ff;
|
||||
int const tilebank = (data & 0x0c00) >> 10;
|
||||
tile = tile + (m_tilebank[tilebank] << 10);
|
||||
int const color = (data >> 12) & 0x0f;
|
||||
|
||||
tileinfo.set(1, tile, color + 0x20, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(crospang_state::get_fg_tile_info)
|
||||
{
|
||||
int const data = m_fg_videoram[tile_index];
|
||||
int tile = data & 0x03ff;
|
||||
int const tilebank = (data & 0x0c00) >> 10;
|
||||
tile = tile + (m_tilebank[tilebank] << 10);
|
||||
int const color = (data >> 12) & 0x0f;
|
||||
|
||||
tileinfo.set(1, tile, color + 0x10, 0);
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::video_start()
|
||||
{
|
||||
m_bg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(crospang_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_fg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(crospang_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
|
||||
m_fg_layer->set_transparent_pen(0);
|
||||
}
|
||||
|
||||
u32 crospang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_bg_layer->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_fg_layer->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// machine
|
||||
|
||||
// main COU
|
||||
|
||||
void crospang_state::base_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x0fffff).rom().nopw(); // writes to rom quite often
|
||||
map(0x000000, 0x0fffff).rom().nopw(); // writes to ROM quite often
|
||||
|
||||
map(0x100000, 0x100001).w(FUNC(crospang_state::tilebank_select_w));
|
||||
map(0x10000e, 0x10000f).w(FUNC(crospang_state::tilebank_data_w));
|
||||
|
||||
map(0x120000, 0x1207ff).ram().w(FUNC(crospang_state::fg_videoram_w)).share("fg_videoram");
|
||||
map(0x122000, 0x1227ff).ram().w(FUNC(crospang_state::bg_videoram_w)).share("bg_videoram");
|
||||
map(0x120000, 0x1207ff).ram().w(FUNC(crospang_state::fg_videoram_w)).share(m_fg_videoram);
|
||||
map(0x122000, 0x1227ff).ram().w(FUNC(crospang_state::bg_videoram_w)).share(m_bg_videoram);
|
||||
map(0x200000, 0x2005ff).ram().w("palette", FUNC(palette_device::write16)).share("palette");
|
||||
map(0x210000, 0x2107ff).ram().share("spriteram");
|
||||
map(0x270001, 0x270001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
|
||||
map(0x210000, 0x2107ff).ram().share(m_spriteram);
|
||||
map(0x270001, 0x270001).w("soundlatch", FUNC(generic_latch_8_device::write));
|
||||
map(0x270004, 0x270007).nopw(); // ??
|
||||
map(0x280000, 0x280001).portr("P1_P2");
|
||||
map(0x280002, 0x280003).portr("COIN");
|
||||
@ -108,7 +322,7 @@ void crospang_state::bestria_map(address_map &map)
|
||||
map(0x340000, 0x34ffff).ram();
|
||||
}
|
||||
|
||||
/* sound cpu */
|
||||
// sound CPU
|
||||
|
||||
void crospang_state::sound_map(address_map &map)
|
||||
{
|
||||
@ -121,11 +335,11 @@ void crospang_state::sound_io_map(address_map &map)
|
||||
map.global_mask(0xff);
|
||||
map(0x00, 0x01).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write));
|
||||
map(0x02, 0x02).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
|
||||
map(0x06, 0x06).r(m_soundlatch, FUNC(generic_latch_8_device::read));
|
||||
map(0x06, 0x06).r("soundlatch", FUNC(generic_latch_8_device::read));
|
||||
}
|
||||
|
||||
|
||||
/* verified from M68000 code */
|
||||
// verified from M68000 code
|
||||
static INPUT_PORTS_START( crospang )
|
||||
PORT_START("P1_P2")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
|
||||
@ -157,11 +371,11 @@ static INPUT_PORTS_START( crospang )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x0003, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") /* to be confirmed */
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) /* table at 0x02ee2c */
|
||||
PORT_DIPSETTING( 0x000c, DEF_STR( Medium ) ) /* table at 0x02e88c */
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) /* table at 0x02f96c */
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( Hardest ) ) /* table at 0x02f3cc */
|
||||
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") // to be confirmed
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) // table at 0x02ee2c
|
||||
PORT_DIPSETTING( 0x000c, DEF_STR( Medium ) ) // table at 0x02e88c
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) // table at 0x02f96c
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( Hardest ) ) // table at 0x02f3cc
|
||||
PORT_DIPNAME( 0x0010, 0x0010, "Bonus Power (Points)" ) PORT_DIPLOCATION("SW1:5")
|
||||
PORT_DIPSETTING( 0x0010, "5k 20k 15k+" )
|
||||
PORT_DIPSETTING( 0x0000, "8k 23k 15k+" )
|
||||
@ -173,7 +387,7 @@ static INPUT_PORTS_START( crospang )
|
||||
PORT_DIPSETTING( 0x0080, "2" )
|
||||
PORT_DIPSETTING( 0x0040, "3" )
|
||||
PORT_DIPSETTING( 0x0000, "4" )
|
||||
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2") /* code at 0x021672 - occurs after level 6 */
|
||||
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2") // code at 0x021672 - occurs after level 6
|
||||
PORT_DIPSETTING( 0x0300, "6/7" )
|
||||
PORT_DIPSETTING( 0x0200, "7/8" )
|
||||
PORT_DIPSETTING( 0x0100, "8/9" )
|
||||
@ -186,12 +400,12 @@ static INPUT_PORTS_START( crospang )
|
||||
PORT_DIPSETTING( 0x1000, "4" )
|
||||
PORT_DIPSETTING( 0x0800, "5" )
|
||||
PORT_DIPSETTING( 0x0000, "6" )
|
||||
PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" ) /* stored at 0x325414.w but not read back */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" ) // stored at 0x325414.w but not read back
|
||||
PORT_SERVICE_DIPLOC( 0x4000, IP_ACTIVE_LOW, "SW2:7" )
|
||||
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) /* stored at 0x325418.w but not read back */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // stored at 0x325418.w but not read back
|
||||
INPUT_PORTS_END
|
||||
|
||||
/* verified from M68000 code */
|
||||
// verified from M68000 code
|
||||
static INPUT_PORTS_START( heuksun )
|
||||
PORT_START("P1_P2")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
|
||||
@ -223,19 +437,19 @@ static INPUT_PORTS_START( heuksun )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x0003, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") /* stored at 0x324632.w */
|
||||
PORT_DIPSETTING( 0x000c, DEF_STR( Easy ) ) /* 1 */
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( Medium ) ) /* 2 */
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) /* 3 */
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) /* 4 */
|
||||
PORT_DIPNAME( 0x0010, 0x0010, "Help Penalty (Heuk Sun)" ) PORT_DIPLOCATION("SW1:5") /* code at 0x01878e and 0x0187f6 */
|
||||
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") // stored at 0x324632.w
|
||||
PORT_DIPSETTING( 0x000c, DEF_STR( Easy ) ) // 1
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( Medium ) ) // 2
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) // 3
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) // 4
|
||||
PORT_DIPNAME( 0x0010, 0x0010, "Help Penalty (Heuk Sun)" ) PORT_DIPLOCATION("SW1:5") // code at 0x01878e and 0x0187f6
|
||||
PORT_DIPSETTING( 0x0010, "Constant" )
|
||||
PORT_DIPSETTING( 0x0000, "Variable" ) /* based on "Difficulty" Dip Switch */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" ) /* read once during initialisation but not even stored */
|
||||
PORT_DIPUNKNOWN_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* stored at 0x32463a.w but not read back ? */
|
||||
PORT_DIPSETTING( 0x0000, "Variable" ) // based on "Difficulty" Dip Switch
|
||||
PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" ) // read once during initialisation but not even stored
|
||||
PORT_DIPUNKNOWN_DIPLOC( 0x0040, 0x0040, "SW1:7" ) // stored at 0x32463a.w but not read back ?
|
||||
PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
|
||||
/* bits are tested from most to less significant - code at 0x01023e */
|
||||
PORT_DIPNAME( 0xff00, 0xff00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2,3,4,5,6,7,8") /* stored at 0x324662.w but not read back ? */
|
||||
// bits are tested from most to less significant - code at 0x01023e
|
||||
PORT_DIPNAME( 0xff00, 0xff00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2,3,4,5,6,7,8") // stored at 0x324662.w but not read back ?
|
||||
PORT_DIPSETTING( 0xff00, "0" )
|
||||
PORT_DIPSETTING( 0xfe00, "1" )
|
||||
PORT_DIPSETTING( 0xfd00, "2" )
|
||||
@ -247,7 +461,7 @@ static INPUT_PORTS_START( heuksun )
|
||||
PORT_DIPSETTING( 0x7f00, "8" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/* verified from M68000 code */
|
||||
// verified from M68000 code
|
||||
static INPUT_PORTS_START( bestri )
|
||||
PORT_START("P1_P2")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
|
||||
@ -280,20 +494,20 @@ static INPUT_PORTS_START( bestri )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x0006, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5") /* stored at 0x3a6f78.w */
|
||||
PORT_DIPSETTING( 0x0018, DEF_STR( Easy ) ) /* 1 */
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( Medium ) ) /* 2 */
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( Hard ) ) /* 3 */
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) /* 4 */
|
||||
PORT_DIPNAME( 0x0020, 0x0020, "Help Penalty (Heuk Sun)" ) PORT_DIPLOCATION("SW1:6") /* code at 0x0b7152 and 0x07b1ba */
|
||||
PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5") // stored at 0x3a6f78.w
|
||||
PORT_DIPSETTING( 0x0018, DEF_STR( Easy ) ) // 1
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( Medium ) ) // 2
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( Hard ) ) // 3
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) // 4
|
||||
PORT_DIPNAME( 0x0020, 0x0020, "Help Penalty (Heuk Sun)" ) PORT_DIPLOCATION("SW1:6") // code at 0x0b7152 and 0x07b1ba
|
||||
PORT_DIPSETTING( 0x0020, "Constant" )
|
||||
PORT_DIPSETTING( 0x0000, "Variable" ) /* based on "Difficulty" Dip Switch */
|
||||
PORT_DIPNAME( 0x00c0, 0x00c0, "Girls" ) PORT_DIPLOCATION("SW1:7,8") /* stored at 0x3a6faa.w */
|
||||
PORT_DIPSETTING( 0x0000, "Variable" ) // based on "Difficulty" Dip Switch
|
||||
PORT_DIPNAME( 0x00c0, 0x00c0, "Girls" ) PORT_DIPLOCATION("SW1:7,8") // stored at 0x3a6faa.w
|
||||
PORT_DIPSETTING( 0x00c0, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( Yes ) )
|
||||
PORT_DIPSETTING( 0x0040, "No (duplicate 1)" )
|
||||
PORT_DIPSETTING( 0x0000, "No (duplicate 2)" )
|
||||
PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2,3") /* stored at 0x3a6fa6.w but not read back ? */
|
||||
PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2,3") // stored at 0x3a6fa6.w but not read back ?
|
||||
PORT_DIPSETTING( 0x0700, "0" )
|
||||
PORT_DIPSETTING( 0x0300, "1" )
|
||||
PORT_DIPSETTING( 0x0500, "2" )
|
||||
@ -302,16 +516,16 @@ static INPUT_PORTS_START( bestri )
|
||||
PORT_DIPSETTING( 0x0200, "5" )
|
||||
PORT_DIPSETTING( 0x0400, "6" )
|
||||
PORT_DIPSETTING( 0x0000, "7" )
|
||||
PORT_DIPNAME( 0x1800, 0x1800, "Unknown (Die Break)" ) PORT_DIPLOCATION("SW2:4,5") /* stored at 0x3a6fa8.w */
|
||||
PORT_DIPNAME( 0x1800, 0x1800, "Unknown (Die Break)" ) PORT_DIPLOCATION("SW2:4,5") // stored at 0x3a6fa8.w
|
||||
PORT_DIPSETTING( 0x1800, "0" )
|
||||
PORT_DIPSETTING( 0x0800, "1" )
|
||||
PORT_DIPSETTING( 0x1000, "2" )
|
||||
PORT_DIPSETTING( 0x0000, "3" )
|
||||
PORT_DIPNAME( 0x2000, 0x2000, "Time (Penta)" ) PORT_DIPLOCATION("SW2:6") /* stored at 0x3a6fac.w */
|
||||
PORT_DIPNAME( 0x2000, 0x2000, "Time (Penta)" ) PORT_DIPLOCATION("SW2:6") // stored at 0x3a6fac.w
|
||||
PORT_DIPSETTING( 0x0000, "60" )
|
||||
PORT_DIPSETTING( 0x2000, "90" )
|
||||
PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) /* read once during initialisation but not even stored */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) /* read once during initialisation but not even stored */
|
||||
PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) // read once during initialisation but not even stored
|
||||
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // read once during initialisation but not even stored
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( pitapat )
|
||||
@ -411,8 +625,8 @@ static const gfx_layout tlayout_alt =
|
||||
|
||||
|
||||
static GFXDECODE_START( gfx_crospang )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, tlayout, 0, 64 ) /* Sprites 16x16 */
|
||||
GFXDECODE_ENTRY( "gfx1", 0, tlayout_alt, 0, 64 ) /* Tiles 16x16 */
|
||||
GFXDECODE_ENTRY( "sprites", 0, tlayout, 0, 64 ) // 16x16
|
||||
GFXDECODE_ENTRY( "tiles", 0, tlayout_alt, 0, 64 ) // 16x16
|
||||
GFXDECODE_END
|
||||
|
||||
void crospang_state::machine_start()
|
||||
@ -433,16 +647,16 @@ void crospang_state::machine_reset()
|
||||
|
||||
void crospang_state::crospang(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, XTAL(14'318'181)/2); /* 68000P10 @ 7.15909MHz */
|
||||
// basic machine hardware
|
||||
M68000(config, m_maincpu, XTAL(14'318'181) / 2); // 68000P10 @ 7.15909MHz
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &crospang_state::crospang_map);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(crospang_state::irq6_line_hold));
|
||||
|
||||
z80_device &audiocpu(Z80(config, "audiocpu", XTAL(14'318'181)/4)); /* 3.579545MHz */
|
||||
z80_device &audiocpu(Z80(config, "audiocpu", XTAL(14'318'181) / 4)); // 3.579545MHz
|
||||
audiocpu.set_addrmap(AS_PROGRAM, &crospang_state::sound_map);
|
||||
audiocpu.set_addrmap(AS_IO, &crospang_state::sound_io_map);
|
||||
|
||||
/* video hardware */
|
||||
// video hardware
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_refresh_hz(60);
|
||||
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
|
||||
@ -460,16 +674,16 @@ void crospang_state::crospang(machine_config &config)
|
||||
m_sprgen->set_offsets(5, 7);
|
||||
m_sprgen->set_gfxdecode_tag(m_gfxdecode);
|
||||
|
||||
/* sound hardware */
|
||||
// sound hardware
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
GENERIC_LATCH_8(config, m_soundlatch);
|
||||
GENERIC_LATCH_8(config, "soundlatch");
|
||||
|
||||
ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181)/4)); /* 3.579545MHz */
|
||||
ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181) / 4)); // 3.579545MHz
|
||||
ymsnd.irq_handler().set_inputline("audiocpu", 0);
|
||||
ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
|
||||
|
||||
okim6295_device &oki(OKIM6295(config, "oki", XTAL(14'318'181)/16, okim6295_device::PIN7_HIGH)); // 1.789772MHz or 0.894886MHz?? & pin 7 not verified
|
||||
okim6295_device &oki(OKIM6295(config, "oki", XTAL(14'318'181) / 16, okim6295_device::PIN7_HIGH)); // 1.789772MHz or 0.894886MHz?? & pin 7 not verified
|
||||
oki.add_route(ALL_OUTPUTS, "mono", 1.0);
|
||||
}
|
||||
|
||||
@ -477,7 +691,7 @@ void crospang_state::bestri(machine_config &config)
|
||||
{
|
||||
crospang(config);
|
||||
|
||||
/* basic machine hardware */
|
||||
// basic machine hardware
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &crospang_state::bestri_map);
|
||||
}
|
||||
|
||||
@ -485,7 +699,7 @@ void crospang_state::bestria(machine_config &config)
|
||||
{
|
||||
crospang(config);
|
||||
|
||||
/* basic machine hardware */
|
||||
// basic machine hardware
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &crospang_state::bestria_map);
|
||||
}
|
||||
|
||||
@ -493,31 +707,28 @@ void crospang_state::pitapat(machine_config &config)
|
||||
{
|
||||
crospang(config);
|
||||
|
||||
// can't be 14'318'181 / 2 as the inputs barely respond and the background graphics glitch badly when the screen fills, doesn't appear to be a vblank bit anywhere to negate this either, P12 reated part
|
||||
// can't be 14'318'181 / 2 as the inputs barely respond and the background graphics glitch badly when the screen fills, doesn't appear to be a vblank bit anywhere to negate this either, P12 rated part
|
||||
M68000(config.replace(), m_maincpu, XTAL(14'318'181));
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &crospang_state::pitapat_map);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(crospang_state::irq6_line_hold));
|
||||
|
||||
/* basic machine hardware */
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &crospang_state::pitapat_map);
|
||||
}
|
||||
|
||||
ROM_START( crospang ) /* Developed April 1998 */
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */
|
||||
ROM_START( crospang ) // Developed April 1998
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_BYTE( "p1.bin", 0x00001, 0x20000, CRC(0bcbbaad) SHA1(807f07be340d7af0aad8d49461b5a7f0221ea3b7) )
|
||||
ROM_LOAD16_BYTE( "p2.bin", 0x00000, 0x20000, CRC(0947d204) SHA1(35e7e277c51888a66d305994bf05c3f6bfc3c29e) )
|
||||
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) /* z80 */
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "s1.bin", 0x00000, 0x10000, CRC(d61a224c) SHA1(5cd1b2d136ad58ab550c7ba135558d6c8a4cd8f6) )
|
||||
|
||||
ROM_REGION( 0x40000, "oki", 0 ) /* samples */
|
||||
ROM_LOAD( "s2.bin", 0x00000, 0x20000, CRC(9f9ecd22) SHA1(631ffe14018ba39658c435b8ecb23b19a14569ee) ) // sample rom contains oksan
|
||||
ROM_REGION( 0x40000, "oki", 0 ) // samples
|
||||
ROM_LOAD( "s2.bin", 0x00000, 0x20000, CRC(9f9ecd22) SHA1(631ffe14018ba39658c435b8ecb23b19a14569ee) ) // sample ROM contains oksan
|
||||
|
||||
ROM_REGION( 0x80000, "gfx1", 0 ) /* bg tiles */
|
||||
ROM_REGION( 0x80000, "tiles", 0 )
|
||||
ROM_LOAD16_BYTE( "rom1.bin", 0x00000, 0x40000, CRC(905042bb) SHA1(ed5b97e88d24e55f8fcfaaa34251582976cb2527) )
|
||||
ROM_LOAD16_BYTE( "rom2.bin", 0x00001, 0x40000, CRC(bc4381e9) SHA1(af0690c253bead3448db5ec8fb258d8284646e89) )
|
||||
|
||||
ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
|
||||
ROM_REGION( 0x200000, "sprites", 0 )
|
||||
ROM_LOAD16_BYTE( "rom3.bin", 0x000000, 0x80000, CRC(cc6e1fce) SHA1(eb5b3ca7222f48916dc6206f987b2669fe7e7c6b) )
|
||||
ROM_LOAD16_BYTE( "rom4.bin", 0x000001, 0x80000, CRC(9a91d494) SHA1(1c6280f662f1cf53f7f6defb7e215da75b573fdf) )
|
||||
ROM_LOAD16_BYTE( "rom5.bin", 0x100000, 0x80000, CRC(53a34dc5) SHA1(2e5cf8093bf507e81d7447736b7727c3fd20c471) )
|
||||
@ -551,17 +762,17 @@ OKI M6295
|
||||
*/
|
||||
|
||||
ROM_START( heuksun )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_BYTE( "ua02.j3", 0x00001, 0x80000, CRC(db2b9c8e) SHA1(aa37e3a056957a12888e2e3112fe78a6bff7d76f) )
|
||||
ROM_LOAD16_BYTE( "ua03.j5", 0x00000, 0x80000, CRC(de9f01e8) SHA1(3ee9206e7c3c7bebd7cde6f201c2fa7f9f6553b7) )
|
||||
|
||||
ROM_REGION( 0x040000, "audiocpu", 0 ) /* Z80 */
|
||||
ROM_REGION( 0x040000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "us02.r4", 0x00000, 0x10000, CRC(c7cc05fa) SHA1(5fbf479be98f618c63e4c74a250d51279c2f5e3b) )
|
||||
|
||||
ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
|
||||
ROM_REGION( 0x040000, "oki", 0 ) // samples
|
||||
ROM_LOAD( "us08.u7", 0x00000, 0x40000, CRC(ae177589) SHA1(9a1e2b848046f3506ede4f218a9175cc8e984ad8) )
|
||||
|
||||
ROM_REGION( 0x200000, "gfx1", 0 ) // tiles
|
||||
ROM_REGION( 0x200000, "tiles", 0 )
|
||||
ROM_LOAD16_BYTE( "uc08.r11", 0x00001, 0x20000, CRC(242cee69) SHA1(71112ea6aac4db9b923315656f12d2f72173d9cd) )
|
||||
ROM_CONTINUE ( 0x100001,0x20000)
|
||||
ROM_CONTINUE ( 0x040001,0x20000)
|
||||
@ -571,7 +782,7 @@ ROM_START( heuksun )
|
||||
ROM_CONTINUE ( 0x040000,0x20000)
|
||||
ROM_CONTINUE ( 0x140000,0x20000)
|
||||
|
||||
ROM_REGION( 0x100000, "gfx2", 0 ) // sprites
|
||||
ROM_REGION( 0x100000, "sprites", 0 )
|
||||
ROM_LOAD16_BYTE( "ud14.p11", 0x00000, 0x40000, CRC(4fc2b574) SHA1(f3330d9cc3065b5a96e222300c2ae01e57241632) )
|
||||
ROM_LOAD16_BYTE( "ud15.m11", 0x00001, 0x40000, CRC(1d6187a6) SHA1(51f1ac086d67e8b35081ddc14e28b218d3153779) )
|
||||
ROM_LOAD16_BYTE( "ud16.l11", 0x80000, 0x40000, CRC(eabec43e) SHA1(fa0a7886ccaf90e9ed59dc283e27f9e8e9aa7d29) )
|
||||
@ -609,7 +820,7 @@ OKI M6295
|
||||
ua02.i3 (Odd)
|
||||
ua03.i5 (even)
|
||||
|
||||
Numbers/letters to right of rom name denotes
|
||||
Numbers/letters to right of ROM name denotes
|
||||
numbers/letters silkscreened under socket
|
||||
|
||||
uc07.p12 0
|
||||
@ -623,18 +834,18 @@ ud17.e12 D
|
||||
|
||||
*/
|
||||
|
||||
ROM_START( bestri ) /* Developed March 1998 */
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
|
||||
ROM_START( bestri ) // Developed March 1998
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_BYTE( "ua02.i3", 0x00001, 0x80000, CRC(9e94023d) SHA1(61a07eb835d324cb4fe7e3d366dd3907838b2554) )
|
||||
ROM_LOAD16_BYTE( "ua03.i5", 0x00000, 0x80000, CRC(08cfa8d8) SHA1(684729887bf2dd2fe22e5bd2e32073169d426e02) )
|
||||
|
||||
ROM_REGION( 0x040000, "audiocpu", 0 ) /* Z80 */
|
||||
ROM_LOAD( "us02.p3", 0x00000, 0x10000, CRC(c7cc05fa) SHA1(5fbf479be98f618c63e4c74a250d51279c2f5e3b) ) // same as huek
|
||||
ROM_REGION( 0x040000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "us02.p3", 0x00000, 0x10000, CRC(c7cc05fa) SHA1(5fbf479be98f618c63e4c74a250d51279c2f5e3b) ) // same as heuksun
|
||||
|
||||
ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
|
||||
ROM_REGION( 0x040000, "oki", 0 ) // samples
|
||||
ROM_LOAD( "us08.q7", 0x00000, 0x40000, CRC(85d8f3de) SHA1(af55678bbe2c187cfee063c6f74cdd568307a7a2) )
|
||||
|
||||
ROM_REGION( 0x200000, "gfx1", 0 ) // tiles
|
||||
ROM_REGION( 0x200000, "tiles", 0 )
|
||||
|
||||
ROM_LOAD16_BYTE( "uc08.m12", 0x00001, 0x20000, CRC(2fc0c30e) SHA1(0c50efd20340f10961e872b3cd63c36aefed26f0) )
|
||||
ROM_CONTINUE ( 0x100001,0x20000)
|
||||
@ -653,25 +864,25 @@ ROM_START( bestri ) /* Developed March 1998 */
|
||||
ROM_CONTINUE ( 0x0c0000,0x20000)
|
||||
ROM_CONTINUE ( 0x1c0000,0x20000)
|
||||
|
||||
ROM_REGION( 0x200000, "gfx2", 0 ) // sprites
|
||||
ROM_REGION( 0x200000, "sprites", 0 )
|
||||
ROM_LOAD16_BYTE( "ud14.j12", 0x000000, 0x80000, CRC(141c696e) SHA1(3d35a20f7c12a8d8a9f6d351f06fb9df0c673354) )
|
||||
ROM_LOAD16_BYTE( "ud15.h12", 0x000001, 0x80000, CRC(7c04adc0) SHA1(9883565d6556ce8ae3da6c91cbf04894e87e6923) )
|
||||
ROM_LOAD16_BYTE( "ud16.g12", 0x100000, 0x80000, CRC(3282ea76) SHA1(cc21cac35f47ba299823c2cfe6b4946f8483b821) )
|
||||
ROM_LOAD16_BYTE( "ud17.e12", 0x100001, 0x80000, CRC(3a3a3f1a) SHA1(48843140cd63c9387e09b84bd41b13dba35f48ad) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( bestria ) /* Developed March 1998 */
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
|
||||
ROM_START( bestria ) // Developed March 1998
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_BYTE( "o_ua02.i3", 0x00001, 0x80000, CRC(035c86f6) SHA1(d501553ed7fdb462c9c26fff6473cefe71424e26) )
|
||||
ROM_LOAD16_BYTE( "e_ua03.i5", 0x00000, 0x80000, CRC(7c53d9f8) SHA1(92dc92471497292d3ba90f3f2fb35f7b4fba240c) )
|
||||
|
||||
ROM_REGION( 0x040000, "audiocpu", 0 ) /* Z80 */
|
||||
ROM_LOAD( "us02.p3", 0x00000, 0x10000, CRC(c7cc05fa) SHA1(5fbf479be98f618c63e4c74a250d51279c2f5e3b)) // same as huek
|
||||
ROM_REGION( 0x040000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "us02.p3", 0x00000, 0x10000, CRC(c7cc05fa) SHA1(5fbf479be98f618c63e4c74a250d51279c2f5e3b)) // same as heuksun
|
||||
|
||||
ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
|
||||
ROM_REGION( 0x040000, "oki", 0 ) // samples
|
||||
ROM_LOAD( "us08.q7", 0x00000, 0x40000, CRC(85d8f3de) SHA1(af55678bbe2c187cfee063c6f74cdd568307a7a2) )
|
||||
|
||||
ROM_REGION( 0x200000, "gfx1", 0 ) // tiles
|
||||
ROM_REGION( 0x200000, "tiles", 0 )
|
||||
|
||||
ROM_LOAD16_BYTE( "2_uc08.m12", 0x00001, 0x20000, CRC(23778472) SHA1(00f54aefe52f2f76ab2f2628bf2e860d468e4a02) )
|
||||
ROM_CONTINUE ( 0x100001,0x20000)
|
||||
@ -690,7 +901,7 @@ ROM_START( bestria ) /* Developed March 1998 */
|
||||
ROM_CONTINUE ( 0x0c0000,0x20000)
|
||||
ROM_CONTINUE ( 0x1c0000,0x20000)
|
||||
|
||||
ROM_REGION( 0x200000, "gfx2", 0 ) // sprites
|
||||
ROM_REGION( 0x200000, "sprites", 0 )
|
||||
ROM_LOAD16_BYTE( "a_ud14.j12", 0x000000, 0x80000, CRC(3502f71b) SHA1(ec012c414ace560ab67d60ce407bd67a4640c217) )
|
||||
ROM_LOAD16_BYTE( "b_ud15.h12", 0x000001, 0x80000, CRC(2636b837) SHA1(692987bd8ace452ee40a253437f1e3672f737f98) )
|
||||
ROM_LOAD16_BYTE( "c_ud16.g12", 0x100000, 0x80000, CRC(68b0ff81) SHA1(969579c2a29b577b9077e70a03c0ec92997ddcc0) )
|
||||
@ -725,17 +936,17 @@ Sound CPU: NEC D780C
|
||||
*/
|
||||
|
||||
ROM_START( pitapat )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // 68000
|
||||
ROM_LOAD16_BYTE( "ua02", 0x00001, 0x40000, CRC(b3d3ac7e) SHA1(7ff894cb6bcb724834de95bdefdb6a6c0ae1d39b) )
|
||||
ROM_LOAD16_BYTE( "ua03", 0x00000, 0x40000, CRC(eda85635) SHA1(b6723f5c196c4a531e411fc0d1f2632f514050ac) )
|
||||
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) /* z80 */
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "us02", 0x00000, 0x10000, CRC(c7cc05fa) SHA1(5fbf479be98f618c63e4c74a250d51279c2f5e3b) )
|
||||
|
||||
ROM_REGION( 0x40000, "oki", 0 ) /* samples */
|
||||
ROM_LOAD( "us08", 0x00000, 0x40000, CRC(dab99a43) SHA1(32d329f9423ec91eb83ea42ee04de70d92568328) ) // sample rom contains oksan?
|
||||
ROM_REGION( 0x40000, "oki", 0 ) // samples
|
||||
ROM_LOAD( "us08", 0x00000, 0x40000, CRC(dab99a43) SHA1(32d329f9423ec91eb83ea42ee04de70d92568328) ) // sample ROM contains oksan?
|
||||
|
||||
ROM_REGION( 0x200000, "gfx1", 0 ) /* bg tiles */
|
||||
ROM_REGION( 0x200000, "tiles", 0 )
|
||||
ROM_LOAD16_BYTE( "uc08", 0x00001, 0x20000, CRC(3f827218) SHA1(38a3f427fad1850776a21a6486251fe33d7af498) )
|
||||
ROM_CONTINUE ( 0x100001,0x20000)
|
||||
ROM_CONTINUE ( 0x040001,0x20000)
|
||||
@ -745,16 +956,18 @@ ROM_START( pitapat )
|
||||
ROM_CONTINUE ( 0x040000,0x20000)
|
||||
ROM_CONTINUE ( 0x140000,0x20000)
|
||||
|
||||
ROM_REGION( 0x100000, "gfx2", 0 ) /* sprites */
|
||||
ROM_REGION( 0x100000, "sprites", 0 )
|
||||
ROM_LOAD16_BYTE( "ud14", 0x000000, 0x40000, CRC(92e23e92) SHA1(4e1b85cef2a55a54ca571bf948809715dd789f30) )
|
||||
ROM_LOAD16_BYTE( "ud15", 0x000001, 0x40000, CRC(7d3d6dba) SHA1(d543613fa22407bc8570e9e388c35620850ecd15) )
|
||||
ROM_LOAD16_BYTE( "ud16", 0x080000, 0x40000, CRC(5c09dff8) SHA1(412260784e45c6d742e02a285e3adc7361034268) )
|
||||
ROM_LOAD16_BYTE( "ud17", 0x080001, 0x40000, CRC(d4c67e2e) SHA1(e684b58333d64f5961983b42f56c61bb0bea2e5c) )
|
||||
ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
GAME( 1998, crospang, 0, crospang, crospang, crospang_state, empty_init, ROT0, "F2 System", "Cross Pang", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
GAME( 1998, crospang, 0, crospang, crospang, crospang_state, empty_init, ROT0, "F2 System", "Cross Pang", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1997, heuksun, 0, crospang, heuksun, crospang_state, empty_init, ROT0, "Oksan / F2 System", "Heuk Sun Baek Sa (Korea)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1998, bestri, 0, bestri, bestri, crospang_state, empty_init, ROT0, "F2 System", "Bestri (Korea, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1998, bestria, bestri, bestria, bestri, crospang_state, empty_init, ROT0, "F2 System", "Bestri (Korea, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1997, pitapat, 0, pitapat, pitapat, crospang_state, empty_init, ROT0, "F2 System", "Pitapat Puzzle", MACHINE_SUPPORTS_SAVE ) // Test Mode calls it 'Puzzle Ball'
|
||||
GAME( 1998, bestri, 0, bestri, bestri, crospang_state, empty_init, ROT0, "F2 System", "Bestri (Korea, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1998, bestria, bestri, bestria, bestri, crospang_state, empty_init, ROT0, "F2 System", "Bestri (Korea, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1997, pitapat, 0, pitapat, pitapat, crospang_state, empty_init, ROT0, "F2 System", "Pitapat Puzzle", MACHINE_SUPPORTS_SAVE ) // Test Mode calls it 'Puzzle Ball'
|
||||
|
@ -1,85 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Pierpaolo Prazzoli, David Haywood
|
||||
/*************************************************************************
|
||||
|
||||
Cross Pang
|
||||
|
||||
*************************************************************************/
|
||||
#ifndef MAME_INCLUDES_CROSPANG_H
|
||||
#define MAME_INCLUDES_CROSPANG_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "decospr.h"
|
||||
|
||||
#include "machine/gen_latch.h"
|
||||
|
||||
#include "tilemap.h"
|
||||
|
||||
class crospang_state : public driver_device
|
||||
{
|
||||
public:
|
||||
crospang_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_fg_videoram(*this, "fg_videoram")
|
||||
, m_bg_videoram(*this, "bg_videoram")
|
||||
, m_spriteram(*this, "spriteram")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_sprgen(*this, "spritegen")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_soundlatch(*this, "soundlatch")
|
||||
{ }
|
||||
|
||||
void crospang(machine_config &config);
|
||||
void bestri(machine_config &config);
|
||||
void bestria(machine_config &config);
|
||||
void pitapat(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<u16> m_fg_videoram;
|
||||
required_shared_ptr<u16> m_bg_videoram;
|
||||
required_shared_ptr<u16> m_spriteram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_bg_layer = nullptr;
|
||||
tilemap_t *m_fg_layer = nullptr;
|
||||
u8 m_tilebank[4]{};
|
||||
u8 m_tilebankselect = 0U;
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<decospr_device> m_sprgen;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
|
||||
void tilebank_data_w(u16 data);
|
||||
void tilebank_select_w(u16 data);
|
||||
void bestri_bg_scrolly_w(u16 data);
|
||||
void bestri_fg_scrolly_w(u16 data);
|
||||
void bestri_fg_scrollx_w(u16 data);
|
||||
void bestri_bg_scrollx_w(u16 data);
|
||||
void fg_scrolly_w(u16 data);
|
||||
void bg_scrolly_w(u16 data);
|
||||
void fg_scrollx_w(u16 data);
|
||||
void bg_scrollx_w(u16 data);
|
||||
void fg_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void bg_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void base_map(address_map &map);
|
||||
void bestri_map(address_map &map);
|
||||
void bestria_map(address_map &map);
|
||||
void crospang_map(address_map &map);
|
||||
void pitapat_map(address_map &map);
|
||||
void sound_io_map(address_map &map);
|
||||
void sound_map(address_map &map);
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_CROSPANG_H
|
@ -1,141 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Pierpaolo Prazzoli, David Haywood
|
||||
/*
|
||||
|
||||
Cross Pang
|
||||
video hardware emulation
|
||||
|
||||
-- this seems to be the same as the tumblepop bootleg based hardware
|
||||
in tumbleb.cpp
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "crospang.h"
|
||||
|
||||
|
||||
void crospang_state::tilebank_select_w(u16 data)
|
||||
{
|
||||
logerror("tilebank_select_w %04x\n", data);
|
||||
|
||||
m_tilebankselect = (data >> 8) & 3;
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::tilebank_data_w(u16 data)
|
||||
{
|
||||
logerror("tilebank_data_w %04x\n", data);
|
||||
|
||||
m_tilebank[m_tilebankselect] = data >> 8;
|
||||
|
||||
m_fg_layer->mark_all_dirty();
|
||||
m_bg_layer->mark_all_dirty();
|
||||
}
|
||||
|
||||
|
||||
// Bestri performs some unusual operations on the scroll values before writing them
|
||||
void crospang_state::bestri_bg_scrolly_w(u16 data)
|
||||
{
|
||||
// addi.w #$1f8, D0
|
||||
// eori.w #$154, D0
|
||||
int scroll = (data & 0x3ff) ^ 0x0155;
|
||||
m_bg_layer->set_scrolly(0, -scroll + 7);
|
||||
}
|
||||
|
||||
void crospang_state::bestri_fg_scrolly_w(u16 data)
|
||||
{
|
||||
// addi.w #$1f8, D0
|
||||
// eori.w #$aa, D0
|
||||
int scroll = (data & 0x3ff) ^ 0x00ab;
|
||||
m_fg_layer->set_scrolly(0, -scroll + 7);
|
||||
}
|
||||
|
||||
void crospang_state::bestri_fg_scrollx_w(u16 data)
|
||||
{
|
||||
// addi.w #$400, D1
|
||||
// eori.w #$1e0, D1
|
||||
int scroll = (data & 0x3ff) ^ 0x1e1;
|
||||
m_fg_layer->set_scrollx(0, scroll - 1);
|
||||
}
|
||||
|
||||
void crospang_state::bestri_bg_scrollx_w(u16 data)
|
||||
{
|
||||
// addi.w #$3fc, D1
|
||||
// eori.w #$3c0, D1
|
||||
int scroll = (data & 0x3ff) ^ 0x3c1;
|
||||
m_bg_layer->set_scrollx(0, scroll + 3);
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::fg_scrolly_w(u16 data)
|
||||
{
|
||||
m_fg_layer->set_scrolly(0, data + 8);
|
||||
}
|
||||
|
||||
void crospang_state::bg_scrolly_w(u16 data)
|
||||
{
|
||||
m_bg_layer->set_scrolly(0, data + 8);
|
||||
}
|
||||
|
||||
void crospang_state::fg_scrollx_w(u16 data)
|
||||
{
|
||||
m_fg_layer->set_scrollx(0, data);
|
||||
}
|
||||
|
||||
void crospang_state::bg_scrollx_w(u16 data)
|
||||
{
|
||||
m_bg_layer->set_scrollx(0, data + 4);
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::fg_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_fg_videoram[offset]);
|
||||
m_fg_layer->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
void crospang_state::bg_videoram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_bg_videoram[offset]);
|
||||
m_bg_layer->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(crospang_state::get_bg_tile_info)
|
||||
{
|
||||
int data = m_bg_videoram[tile_index];
|
||||
int tile = data & 0x03ff;
|
||||
int tilebank = (data & 0x0c00) >> 10;
|
||||
tile = tile + (m_tilebank[tilebank] << 10);
|
||||
int color = (data >> 12) & 0x0f;
|
||||
|
||||
tileinfo.set(1, tile, color + 0x20, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(crospang_state::get_fg_tile_info)
|
||||
{
|
||||
int data = m_fg_videoram[tile_index];
|
||||
int tile = data & 0x03ff;
|
||||
int tilebank = (data & 0x0c00) >> 10;
|
||||
tile = tile + (m_tilebank[tilebank] << 10);
|
||||
int color = (data >> 12) & 0x0f;
|
||||
|
||||
tileinfo.set(1, tile, color + 0x10, 0);
|
||||
}
|
||||
|
||||
|
||||
void crospang_state::video_start()
|
||||
{
|
||||
m_bg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(crospang_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_fg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(crospang_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
|
||||
m_fg_layer->set_transparent_pen(0);
|
||||
}
|
||||
|
||||
u32 crospang_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_bg_layer->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_fg_layer->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user