New working clones

------------------
Flicky (128k Version, 315-5051, larger roms, newer) [Bisboch]

- seibu/cabal.cpp, seibu/darkmist.cpp, seibu/dcon.cpp: consolidated drivers into single files
This commit is contained in:
Ivan Vangelista 2024-03-06 22:19:49 +01:00
parent 2c40cf660e
commit 7f407625e0
11 changed files with 1087 additions and 1121 deletions

View File

@ -40353,6 +40353,7 @@ chopliftu // 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2)
dakkochn // 836-6483 (S2)
flicky // (c) 1984 (S1)
flickya // (c) 1984 (S1)
flickyb // (c) 1984 (S1)
flickyo // (c) 1984 (S1)
flickys1 // (c) 1984 (S1)
flickys2 // (c) 1984 (S1)

View File

@ -1119,6 +1119,17 @@ static INPUT_PORTS_START( flicky )
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
INPUT_PORTS_END
static INPUT_PORTS_START( flickyb )
PORT_INCLUDE( flicky )
PORT_MODIFY("SWB")
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
PORT_DIPSETTING( 0x0c, "1" )
PORT_DIPSETTING( 0x08, "2" )
PORT_DIPSETTING( 0x04, "3" )
PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) )
INPUT_PORTS_END
static INPUT_PORTS_START( flickys1 )
PORT_INCLUDE( flicky )
@ -2962,6 +2973,27 @@ ROM_START( flickya ) /* Sega game ID# 834-5411-11 FLICKY */
ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
ROM_END
ROM_START( flickyb ) /* Sega game ID# 834-5411-11 FLICKY, only the two program ROMs differ from flickya. Legit or hack? */
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "e-2_0.116", 0x0000, 0x4000, CRC(ec94fdbb) SHA1(a3289dd59a4cede1aeed8898cc38cfb82da3b778) ) // white, non original, handwritten label
ROM_LOAD( "109", 0x4000, 0x4000, CRC(aa11b394) SHA1(538b28b194162c04ed7a46e3a4fa97760201405d) ) // blue, non original, blank label
ROM_REGION( 0x10000, "soundcpu", 0 )
ROM_LOAD( "epr-5869.120", 0x0000, 0x2000, CRC(6d220d4e) SHA1(fe02a7a94a1ad046fc775a7f67f460c8d0f6dca6) )
ROM_REGION( 0xc000, "tiles", 0 )
ROM_LOAD( "epr-6001.62", 0x0000, 0x4000, CRC(f1a75200) SHA1(47e57b5dbd687d0fa91de91f35f199e88d5a5d99) )
ROM_LOAD( "epr-6000.64", 0x4000, 0x4000, CRC(299aefb7) SHA1(d0301f0bf706807891845f090e4e1f1c38dbbd54) )
ROM_LOAD( "epr-5999.66", 0x8000, 0x4000, CRC(1ca53157) SHA1(46b4b9dac3f0506edc3957cee768e41c4754b0f4) )
ROM_REGION( 0x8000, "sprites", 0 )
ROM_LOAD( "epr-5855.117", 0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) )
ROM_LOAD( "epr-5856.110", 0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
ROM_REGION( 0x0100, "lookup_proms", 0 )
ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
ROM_END
ROM_START( flickys2 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "epr-6621.bin", 0x0000, 0x4000, CRC(b21ff546) SHA1(e1d5438eaf0efeaeb4687dcfc12bf325e804182f) )
@ -5689,10 +5721,10 @@ GAME( 1983, regulusu, regulus, sys1ppi, regulus, system1_state, e
GAME( 1984, mrviking, 0, sys1ppisx_315_5041,mrviking, system1_state, empty_init, ROT270, "Sega", "Mister Viking (315-5041)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, mrvikingj, mrviking, sys1ppisx_315_5041,mrvikingj, system1_state, empty_init, ROT270, "Sega", "Mister Viking (315-5041, Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, swat, 0, sys1ppix_315_5048, swat, system1_state, empty_init, ROT270, "Coreland / Sega", "SWAT (315-5048)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyo, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickys1, flicky, sys1ppix_315_5051, flickys1, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyup, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, on Up'n Down boardset, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyupa, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "bootleg", "Flicky (64k Version, on Up'n Down boardset, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickyo, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 1)", MACHINE_SUPPORTS_SAVE ) // 84/5/24
GAME( 1984, flickys1, flicky, sys1ppix_315_5051, flickys1, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, 315-5051, set 2)", MACHINE_SUPPORTS_SAVE ) // 84/11/26
GAME( 1984, flickyup, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (64k Version, on Up'n Down boardset, set 1)", MACHINE_SUPPORTS_SAVE ) // 84/5/17
GAME( 1984, flickyupa, flicky, sys1ppix_315_5051, flicky, system1_state, empty_init, ROT0, "bootleg", "Flicky (64k Version, on Up'n Down boardset, set 2)", MACHINE_SUPPORTS_SAVE ) // 84/7/05
GAME( 1984, wmatch, 0, sys1ppisx_315_5064,wmatch, system1_state, empty_init, ROT270, "Sega", "Water Match (315-5064)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, bullfgt, 0, sys1ppix_315_5065, bullfgt, system1_state, empty_init, ROT0, "Coreland / Sega", "Bullfight (315-5065)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, nprinces, seganinj, sys1ppix_315_5051, seganinj, system1_state, empty_init, ROT0, "bootleg?", "Ninja Princess (315-5051, 64k Ver. bootleg?)", MACHINE_SUPPORTS_SAVE )
@ -5706,8 +5738,9 @@ GAME( 1986, nobb, nob, nob, nob, system1_state, i
GAME( 1986, raflesiau, raflesia, sys1ppi, raflesia, system1_state, empty_init, ROT270, "Coreland / Sega", "Rafflesia (not encrypted)", MACHINE_SUPPORTS_SAVE )
/* PIO-based System 1 */
GAME( 1984, flicky, 0, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flickya, flicky, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051, larger roms)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, flicky, 0, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051)", MACHINE_SUPPORTS_SAVE ) // 1984/05/24
GAME( 1984, flickya, flicky, sys1piox_315_5051, flicky, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051, larger roms)", MACHINE_SUPPORTS_SAVE ) // 1984/05/24
GAME( 1984, flickyb, flicky, sys1piox_315_5051, flickyb, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, 315-5051, larger roms, newer)", MACHINE_SUPPORTS_SAVE ) // 1984/10/07
GAME( 1984, flickys2, flicky, sys1pio, flickys2, system1_state, empty_init, ROT0, "Sega", "Flicky (128k Version, not encrypted)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, thetogyu, bullfgt, sys1piox_315_5065, bullfgt, system1_state, empty_init, ROT0, "Coreland / Sega", "The Togyu (315-5065, Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, spatter, 0, sys1piosx_315_5096,spatter, system1_state, empty_init, ROT0, "Sega", "Spatter (315-5096)", MACHINE_SUPPORTS_SAVE )

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
// copyright-holders: Carlos A. Lozano
/******************************************************************
Cabal (c)1988/1989 Tad
@ -163,17 +164,254 @@ Notes:
******************************************************************/
#include "emu.h"
#include "cabal.h"
#include "seibusound.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/upd4701.h"
#include "sound/msm5205.h"
#include "sound/ymopm.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
namespace {
class cabal_base_state : public driver_device
{
public:
cabal_base_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_msm(*this, "msm%u", 1U),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram"),
m_videoram(*this, "videoram")
{ }
protected:
virtual void video_start() override;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device_array<msm5205_device, 2> m_msm;
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_colorram;
required_shared_ptr<uint16_t> m_videoram;
void flipscreen_w(uint8_t data);
void background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
tilemap_t *m_background_layer = nullptr;
tilemap_t *m_text_layer = nullptr;
TILE_GET_INFO_MEMBER(get_back_tile_info);
TILE_GET_INFO_MEMBER(get_text_tile_info);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
class cabal_state : public cabal_base_state
{
public:
cabal_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag),
m_seibu_sound(*this, "seibu_sound"),
m_adpcm(*this, "adpcm%u", 1U)
{ }
void cabal(machine_config &config);
void cabalbl2(machine_config &config);
void cabalt(machine_config &config);
void init_cabal();
private:
required_device<seibu_sound_device> m_seibu_sound;
required_device_array<seibu_adpcm_device, 2> m_adpcm;
void sound_irq_trigger_word_w(offs_t offset, uint16_t data, uint16_t mem_mask);
void main_map(address_map &map);
void sound_decrypted_opcodes_map(address_map &map);
void sound_map(address_map &map);
void trackball_main_map(address_map &map);
void cabalbl2_predecrypted_opcodes_map(address_map &map);
void cabalbl2_sound_map(address_map &map);
};
class cabalbl_state : public cabal_base_state
{
public:
cabalbl_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag)
{ }
void cabalbl(machine_config &config);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
int m_sound_command[2]{};
void sndcmd_w(offs_t offset, uint16_t data);
void sound_irq_trigger_word_w(uint16_t data);
template<uint8_t Which> uint8_t snd_r();
void coin_w(uint8_t data);
template<uint8_t Which> void adpcm_w(uint8_t data);
void main_map(address_map &map);
void sound_map(address_map &map);
void talk1_map(address_map &map);
void talk1_portmap(address_map &map);
void talk2_map(address_map &map);
void talk2_portmap(address_map &map);
};
// video
TILE_GET_INFO_MEMBER(cabal_base_state::get_back_tile_info)
{
int tile = m_videoram[tile_index];
int const color = (tile >> 12) & 0xf;
tile &= 0xfff;
tileinfo.set(1, tile, color, 0);
}
TILE_GET_INFO_MEMBER(cabal_base_state::get_text_tile_info)
{
int tile = m_colorram[tile_index];
int const color = (tile >> 10);
tile &= 0x3ff;
tileinfo.set(0, tile, color, 0);
}
void cabal_base_state::video_start()
{
m_background_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_text_layer->set_transparent_pen(3);
m_background_layer->set_transparent_pen(15);
}
/**************************************************************************/
void cabal_base_state::flipscreen_w(uint8_t data)
{
int const flip = (data & 0x20) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
m_background_layer->set_flip(flip);
m_text_layer->set_flip(flip);
flip_screen_set(data & 0x20);
}
void cabal_base_state::background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_videoram[offset]);
m_background_layer->mark_tile_dirty(offset);
}
void cabal_base_state::text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_colorram[offset]);
m_text_layer->mark_tile_dirty(offset);
}
/********************************************************************
Cabal Spriteram
---------------
+0 .......x ........ Sprite enable bit
+0 ........ xxxxxxxx Sprite Y coordinate
+1 ..??.... ........ ??? unknown ???
+1 ....xxxx xxxxxxxx Sprite tile number
+2 .xxxx... ........ Sprite color bank
+2 .....x.. ........ Sprite flip x
+2 .......x xxxxxxxx Sprite X coordinate
+3 (unused)
-------E YYYYYYYY
----BBTT TTTTTTTT
-CCCCF-X XXXXXXXX
-------- --------
********************************************************************/
void cabal_base_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = m_spriteram.bytes() / 2 - 4; offs >= 0; offs -= 4)
{
int const data0 = m_spriteram[offs];
int const data1 = m_spriteram[offs + 1];
int const data2 = m_spriteram[offs + 2];
if (data0 & 0x100)
{
int const tile_number = data1 & 0xfff;
int const color = (data2 & 0x7800) >> 11;
int sy = (data0 & 0xff);
int sx = (data2 & 0x1ff);
int flipx = (data2 & 0x0400);
int flipy = 0;
if (sx > 256) sx -= 512;
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(2)->transpen(bitmap, cliprect,
tile_number,
color,
flipx, flipy,
sx, sy, 0xf);
}
}
}
uint32_t cabal_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
draw_sprites(bitmap, cliprect);
m_text_layer->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
// machine
void cabalbl_state::machine_start()
{
save_item(NAME(m_sound_command));
@ -203,12 +441,12 @@ void cabalbl_state::sndcmd_w(offs_t offset, uint16_t data)
void cabal_state::sound_irq_trigger_word_w(offs_t, u16 data, u16 mem_mask)
void cabal_state::sound_irq_trigger_word_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
m_seibu_sound->main_w(4, data & 0x00ff);
/* spin for a while to let the Z80 read the command, otherwise coins "stick" */
// spin for a while to let the Z80 read the command, otherwise coins "stick"
m_maincpu->spin_until_time(attotime::from_usec(50));
}
@ -223,15 +461,15 @@ void cabal_state::main_map(address_map &map)
{
map(0x00000, 0x3ffff).rom();
map(0x40000, 0x437ff).ram();
map(0x43800, 0x43fff).ram().share("spriteram");
map(0x43800, 0x43fff).ram().share(m_spriteram);
map(0x44000, 0x4ffff).ram();
map(0x60000, 0x607ff).ram().w(FUNC(cabal_state::text_videoram_w)).share("colorram");
map(0x80000, 0x801ff).ram().w(FUNC(cabal_state::background_videoram_w)).share("videoram");
map(0x60000, 0x607ff).ram().w(FUNC(cabal_state::text_videoram_w)).share(m_colorram);
map(0x80000, 0x801ff).ram().w(FUNC(cabal_state::background_videoram_w)).share(m_videoram);
map(0x80200, 0x803ff).ram();
map(0xa0000, 0xa0001).portr("DSW");
map(0xa0008, 0xa0009).portr("IN2");
map(0xa0010, 0xa0011).portr("INPUTS");
map(0xc0040, 0xc0041).nopw(); /* ??? */
map(0xc0040, 0xc0041).nopw(); // ???
map(0xc0081, 0xc0081).w(FUNC(cabal_state::flipscreen_w));
map(0xe0000, 0xe07ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0xe8000, 0xe800d).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff);
@ -255,15 +493,15 @@ void cabalbl_state::main_map(address_map &map)
{
map(0x00000, 0x3ffff).rom();
map(0x40000, 0x437ff).ram();
map(0x43800, 0x43fff).ram().share("spriteram");
map(0x43800, 0x43fff).ram().share(m_spriteram);
map(0x44000, 0x4ffff).ram();
map(0x60000, 0x607ff).ram().w(FUNC(cabalbl_state::text_videoram_w)).share("colorram");
map(0x80000, 0x801ff).ram().w(FUNC(cabalbl_state::background_videoram_w)).share("videoram");
map(0x60000, 0x607ff).ram().w(FUNC(cabalbl_state::text_videoram_w)).share(m_colorram);
map(0x80000, 0x801ff).ram().w(FUNC(cabalbl_state::background_videoram_w)).share(m_videoram);
map(0x80200, 0x803ff).ram();
map(0xa0000, 0xa0001).portr("DSW");
map(0xa0008, 0xa0009).portr("JOY");
map(0xa0010, 0xa0011).portr("INPUTS");
map(0xc0040, 0xc0041).nopw(); /* ??? */
map(0xc0040, 0xc0041).nopw(); // ???
map(0xc0081, 0xc0081).w(FUNC(cabalbl_state::flipscreen_w));
map(0xe0000, 0xe07ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0xe8000, 0xe8003).w(FUNC(cabalbl_state::sndcmd_w));
@ -276,7 +514,7 @@ void cabalbl_state::main_map(address_map &map)
template<uint8_t Which>
uint8_t cabalbl_state::snd_r()
{
return bitswap<8>(m_sound_command[Which], 7,2,4,5,3,6,1,0);
return bitswap<8>(m_sound_command[Which], 7, 2, 4, 5, 3, 6, 1, 0);
}
void cabalbl_state::coin_w(uint8_t data)
@ -325,7 +563,7 @@ void cabalbl_state::sound_map(address_map &map)
map(0x400a, 0x400a).r(FUNC(cabalbl_state::snd_r<0>));
map(0x400c, 0x400c).w("soundlatch", FUNC(generic_latch_8_device::write));
map(0x400e, 0x400f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
map(0x6000, 0x6000).nopw(); /* ??? */
map(0x6000, 0x6000).nopw(); // ???
map(0x8000, 0xffff).rom();
}
@ -355,13 +593,13 @@ void cabal_state::cabalbl2_predecrypted_opcodes_map(address_map &map)
map(0x8000, 0xffff).rom().region("audiocpu", 0x8000);
}
/* the bootleg has 2x z80 sample players */
// the bootleg has 2x z80 sample players
template<uint8_t Which>
void cabalbl_state::adpcm_w(uint8_t data)
{
m_msm[Which]->reset_w(BIT(data, 7));
/* ?? bit 6?? */
// ?? bit 6??
m_msm[Which]->data_w(data);
m_msm[Which]->vclk_w(1);
m_msm[Which]->vclk_w(0);
@ -449,14 +687,14 @@ static INPUT_PORTS_START( common )
PORT_DIPSETTING( 0x2000, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) )
PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW2:7" ) /* Left blank in the manual */
PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW2:7" ) // Left blank in the manual
PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4) /* read through sound cpu */
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(4) /* read through sound cpu */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4) // read through sound CPU
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(4) // read through sound CPU
INPUT_PORTS_END
static INPUT_PORTS_START( cabalt )
@ -496,7 +734,7 @@ static INPUT_PORTS_START( cabalj )
/* Since the Trackball version was produced first, and it doesn't use
the third button, Pin 24 of the JAMMA connector ('JAMMA button 3')
has no trace on the pcb. To work around this design issue the
has no trace on the PCB. To work around this design issue the
manufacturer had to use pin 15 which is usually the test / service
button
*/
@ -506,7 +744,7 @@ static INPUT_PORTS_START( cabalj )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0ff0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* the 3rd button connects to the service switch */
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // the 3rd button connects to the service switch
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 )
@ -601,30 +839,30 @@ static const gfx_layout sprite_layout =
static GFXDECODE_START( gfx_cabal )
GFXDECODE_ENTRY( "gfx1", 0x000000, text_layout, 0, 1024/4 )
GFXDECODE_ENTRY( "gfx2", 0x000000, tile_layout, 32*16, 16 )
GFXDECODE_ENTRY( "gfx3", 0x000000, sprite_layout, 16*16, 16 )
GFXDECODE_ENTRY( "chars", 0x000000, text_layout, 0, 1024/4 )
GFXDECODE_ENTRY( "tiles", 0x000000, tile_layout, 32*16, 16 )
GFXDECODE_ENTRY( "sprites", 0x000000, sprite_layout, 16*16, 16 )
GFXDECODE_END
void cabal_state::cabal(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(20'000'000)/2); /* verified on pcb */
// basic machine hardware
M68000(config, m_maincpu, XTAL(20'000'000) / 2); // verified on PCB
m_maincpu->set_addrmap(AS_PROGRAM, &cabal_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(cabal_state::irq1_line_hold));
Z80(config, m_audiocpu, XTAL(3'579'545)); /* verified on pcb */
Z80(config, m_audiocpu, XTAL(3'579'545)); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &cabal_state::sound_map);
m_audiocpu->set_addrmap(AS_OPCODES, &cabal_state::sound_decrypted_opcodes_map);
m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
SEI80BU(config, "sei80bu", 0).set_device_rom_tag("audiocpu");
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(59.60); /* verified on pcb */
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_refresh_hz(59.60); // verified on PCB
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
screen.set_size(256, 256);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
screen.set_screen_update(FUNC(cabal_state::screen_update));
@ -633,7 +871,7 @@ void cabal_state::cabal(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cabal);
PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 1024);
/* sound hardware */
// sound hardware
SEIBU_SOUND(config, m_seibu_sound, 0);
m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0);
m_seibu_sound->set_rom_tag("audiocpu");
@ -642,19 +880,19 @@ void cabal_state::cabal(machine_config &config)
SPEAKER(config, "mono").front_center();
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); /* verified on pcb */
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); // verified on PCB
ymsnd.irq_handler().set(m_seibu_sound, FUNC(seibu_sound_device::fm_irqhandler));
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.80);
SEIBU_ADPCM(config, m_adpcm[0], XTAL(12'000'000)/32/48, m_msm[0]);
SEIBU_ADPCM(config, m_adpcm[1], XTAL(12'000'000)/32/48, m_msm[1]);
SEIBU_ADPCM(config, m_adpcm[0], XTAL(12'000'000) /32 / 48, m_msm[0]);
SEIBU_ADPCM(config, m_adpcm[1], XTAL(12'000'000) /32 / 48, m_msm[1]);
MSM5205(config, m_msm[0], XTAL(12'000'000)/32); /* verified on pcb */
MSM5205(config, m_msm[0], XTAL(12'000'000) / 32); // verified on PCB
m_msm[0]->vck_callback().set(m_adpcm[0], FUNC(seibu_adpcm_device::msm_int));
m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */
m_msm[0]->add_route(ALL_OUTPUTS, "mono", 0.40);
MSM5205(config, m_msm[1], XTAL(12'000'000)/32); /* verified on pcb */
MSM5205(config, m_msm[1], XTAL(12'000'000) / 32); // verified on PCB
m_msm[1]->vck_callback().set(m_adpcm[1], FUNC(seibu_adpcm_device::msm_int));
m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 7.8125 kHz */
m_msm[1]->add_route(ALL_OUTPUTS, "mono", 0.40);
@ -684,34 +922,34 @@ void cabal_state::cabalbl2(machine_config &config)
}
/* the bootleg has different sound hardware (2 extra Z80s for ADPCM playback) */
// the bootleg has different sound hardware (2 extra Z80s for ADPCM playback)
void cabalbl_state::cabalbl(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(20'000'000)/2); /* verified on pcb */
// basic machine hardware
M68000(config, m_maincpu, XTAL(20'000'000) / 2); // verified on PCB
m_maincpu->set_addrmap(AS_PROGRAM, &cabalbl_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(cabalbl_state::irq1_line_hold));
Z80(config, m_audiocpu, XTAL(3'579'545)); /* verified on pcb */
Z80(config, m_audiocpu, XTAL(3'579'545)); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &cabalbl_state::sound_map);
/* there are 2x z80s for the ADPCM */
z80_device &adpcm_1(Z80(config, "adpcm_1", XTAL(3'579'545))); /* verified on pcb */
// there are 2x z80s for the ADPCM
z80_device &adpcm_1(Z80(config, "adpcm_1", XTAL(3'579'545))); // verified on PCB
adpcm_1.set_addrmap(AS_PROGRAM, &cabalbl_state::talk1_map);
adpcm_1.set_addrmap(AS_IO, &cabalbl_state::talk1_portmap);
adpcm_1.set_periodic_int(FUNC(cabalbl_state::irq0_line_hold), attotime::from_hz(8000));
z80_device &adpcm_2(Z80(config, "adpcm_2", XTAL(3'579'545))); /* verified on pcb */
z80_device &adpcm_2(Z80(config, "adpcm_2", XTAL(3'579'545))); // verified on PCB
adpcm_2.set_addrmap(AS_PROGRAM, &cabalbl_state::talk2_map);
adpcm_2.set_addrmap(AS_IO, &cabalbl_state::talk2_portmap);
adpcm_2.set_periodic_int(FUNC(cabalbl_state::irq0_line_hold), attotime::from_hz(8000));
config.set_maximum_quantum(attotime::from_hz(600));
/* 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(2500)); /* not accurate */
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
screen.set_size(256, 256);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
screen.set_screen_update(FUNC(cabalbl_state::screen_update));
@ -720,43 +958,43 @@ void cabalbl_state::cabalbl(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cabal);
PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 1024);
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, "soundlatch");
GENERIC_LATCH_8(config, "soundlatch2");
GENERIC_LATCH_8(config, "soundlatch3");
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); /* verified on pcb */
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); // verified on PCB
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.80);
MSM5205(config, m_msm[0], XTAL(12'000'000)/32); /* verified on pcb (no resonator) */
MSM5205(config, m_msm[0], XTAL(12'000'000) / 32); // verified on PCB (no resonator)
m_msm[0]->set_prescaler_selector(msm5205_device::SEX_4B);
m_msm[0]->add_route(ALL_OUTPUTS, "mono", 0.60);
MSM5205(config, m_msm[1], XTAL(12'000'000)/32); /* verified on pcb (no resonator)*/
MSM5205(config, m_msm[1], XTAL(12'000'000) / 32); // verified on PCB (no resonator)
m_msm[1]->set_prescaler_selector(msm5205_device::SEX_4B);
m_msm[1]->add_route(ALL_OUTPUTS, "mono", 0.60);
}
ROM_START( cabal )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "13.7h", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "11.6h", 0x00001, 0x10000, CRC(44736281) SHA1(1d6da95ef96d9c02aea70791e1cb87b70097d5ed) )
ROM_LOAD16_BYTE( "12.7j", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "10.6j", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
/* The Joystick versions use a sub-board instead of the mask roms
the content is the same as the mask roms */
ROM_REGION( 0x80000, "gfx2", 0 )
/* The Joystick versions use a sub-board instead of the mask ROMs
the content is the same as the mask ROMs */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "bg_rom1.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "bg_rom2.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "bg_rom3.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -766,7 +1004,7 @@ ROM_START( cabal )
ROM_LOAD16_BYTE( "bg_rom7.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "bg_rom8.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "sp_rom1.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "sp_rom2.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "sp_rom3.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -776,19 +1014,19 @@ ROM_START( cabal )
ROM_LOAD16_BYTE( "sp_rom7.bin", 0x60000, 0x10000, CRC(55c44764) SHA1(7fad1f2084664b5b4d1384c8081371b0c79c4f5e) )
ROM_LOAD16_BYTE( "sp_rom8.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabala )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "epr-a-9.7h", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "epr-a-7.6h", 0x00001, 0x10000, CRC(c89608db) SHA1(a56e77526227af5b693eea9ef74da0d9d57cc55c) )
ROM_LOAD16_BYTE( "epr-a-8.7k", 0x20000, 0x08000, CRC(fe84788a) SHA1(29c49ebbe62357c27befcdcc4c19841a8bf32b2d) )
@ -796,26 +1034,26 @@ ROM_START( cabala )
ROM_LOAD16_BYTE( "epr-a-6.6k", 0x20001, 0x08000, CRC(81eb1355) SHA1(bbf926d40164d78319e982da0e8fb8ec4d4f8b87) )
ROM_RELOAD(0x30001,0x08000)
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "epr-a-4.3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "epr-a-3.3p", 0x8000, 0x4000, CRC(c0097c55) SHA1(874f813c1b466dab2d15a707e340b9bdb200246c) )
ROM_REGION( 0x8000, "gfx1", 0 )
ROM_LOAD( "epr-a-5.6s", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) ) /* characters */
ROM_REGION( 0x8000, "chars", 0 )
ROM_LOAD( "epr-a-5.6s", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "epr-a-2.1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "epr-a-1.1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
@ -823,54 +1061,54 @@ ROM_END
ROM_START( cabaluk )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "9-7h.bin", 0x00000, 0x10000, CRC(f66378e5) SHA1(b3802f24863f857506ae1aeddc4e5c2908810695) )
ROM_LOAD16_BYTE( "7-6h.bin", 0x00001, 0x10000, CRC(960991ac) SHA1(7e3ab0673585424206d791e8b0ed6af38e2ae8a9) )
ROM_LOAD16_BYTE( "8-7k.bin", 0x20000, 0x10000, CRC(82160ab0) SHA1(a486f30ec3068025b690da4c1ae7295e79e7cd74) )
ROM_LOAD16_BYTE( "6-6k.bin", 0x20001, 0x10000, CRC(7ef2ecc7) SHA1(43d621e2e7cfea8d906a968047817e23a3e4d047) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabalukj )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "13.7h", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "14.6h", 0x00001, 0x10000, CRC(5b04b101) SHA1(fc58b3a3854dbbf65251486a009035060349a66c) )
ROM_LOAD16_BYTE( "12.7j", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "10.6j", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
/* The Joystick versions use a sub-board instead of the mask roms
the content is the same as the mask roms */
ROM_REGION( 0x80000, "gfx2", 0 )
/* The Joystick versions use a sub-board instead of the mask ROMs
the content is the same as the mask ROMs */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "bg_rom1.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "bg_rom2.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "bg_rom3.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -880,7 +1118,7 @@ ROM_START( cabalukj )
ROM_LOAD16_BYTE( "bg_rom7.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "bg_rom8.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "sp_rom1.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "sp_rom2.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "sp_rom3.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -890,75 +1128,75 @@ ROM_START( cabalukj )
ROM_LOAD16_BYTE( "sp_rom7.bin", 0x60000, 0x10000, CRC(55c44764) SHA1(7fad1f2084664b5b4d1384c8081371b0c79c4f5e) )
ROM_LOAD16_BYTE( "sp_rom8.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabalus )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "h7_512.bin", 0x00000, 0x10000, CRC(8fe16fb4) SHA1(fedb2d0c6c21516f68cfa99093772fe8fa862389) )
ROM_LOAD16_BYTE( "h6_512.bin", 0x00001, 0x10000, CRC(6968101c) SHA1(d65005ac235dae5c32bbcd182cb365e8fa067fe7) )
ROM_LOAD16_BYTE( "k7_512.bin", 0x20000, 0x10000, CRC(562031a2) SHA1(ed5ef50a66c7797a7f345e479162cf83d6777f7c) )
ROM_LOAD16_BYTE( "k6_512.bin", 0x20001, 0x10000, CRC(4fda2856) SHA1(a213cb7443cdccbad3f2610e8d42b2e149cbedb9) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "t6_128.bin", 0x00000, 0x04000, CRC(1ccee214) SHA1(7c842bc1c6002ec90693160fd5407345092420bb) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "t6_128.bin", 0x00000, 0x04000, CRC(1ccee214) SHA1(7c842bc1c6002ec90693160fd5407345092420bb) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples? */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
ROM_START( cabalus2 )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "9-7h", 0x00000, 0x10000, CRC(ebbb9484) SHA1(2c77d5b4acdc37720dc7ccab526862981bf8da51) )
ROM_LOAD16_BYTE( "7-6h", 0x00001, 0x10000, CRC(51aeb49e) SHA1(df38dc58d8c6fa3d35904bf34e29111e7bd523ad) )
ROM_LOAD16_BYTE( "8-7k", 0x20000, 0x10000, CRC(4c24ed9a) SHA1(f0fc25c3e7dc8ac71fdad3e91ab618cd7a037123) )
ROM_LOAD16_BYTE( "6-6k", 0x20001, 0x10000, CRC(681620e8) SHA1(c9eacfb55059986dbecc2fae1339069a852f917b) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "4-3n", 0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
ROM_LOAD( "3-3p", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "5-6s", 0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "tad-2.7s", 0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD( "tad-1.5e", 0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "2-1s", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "1-1u", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_REGION( 0x0200, "proms", 0 ) /* unknown */
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "prom05.8e", 0x0000, 0x0100, CRC(a94b18c2) SHA1(e7db4c1efc9e313e36eef3f53ae5b2e573a38920) )
ROM_LOAD( "prom10.4j", 0x0100, 0x0100, CRC(261c93bc) SHA1(942470198143d584d3766f28587d1879abd912c1) )
ROM_END
@ -1000,21 +1238,21 @@ Note: The bootleg has *3* Z80s
*/
ROM_START( cabalbl )
ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD16_BYTE( "cabal_24.bin", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "cabal_22.bin", 0x00001, 0x10000, CRC(78c4af27) SHA1(31049d1ec76d76284682de7a0592f63d97019240) )
ROM_LOAD16_BYTE( "cabal_23.bin", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "cabal_21.bin", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "cabal_11.bin", 0x0000, 0x10000, CRC(d308a543) SHA1(4f45db42512f83266001daee55d06f49e7908e35) )
ROM_REGION( 0x8000, "gfx1", 0 )
ROM_LOAD( "cabal_20.bin", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) ) /* characters */
ROM_REGION( 0x8000, "chars", 0 )
ROM_LOAD( "cabal_20.bin", 0x00000, 0x08000, CRC(189033fd) SHA1(814f0cbc5f72345c04922d6d7c986f99d57335fa) )
/* The bootleg versions use a sub-board instead of the mask roms
the content is the same as the mask roms */
ROM_REGION( 0x80000, "gfx2", 0 )
/* The bootleg versions use a sub-board instead of the mask ROMs
the content is the same as the mask ROMs */
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "cabal_15.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "cabal_17.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "cabal_14.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -1024,7 +1262,7 @@ ROM_START( cabalbl )
ROM_LOAD16_BYTE( "cabal_13.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "cabal_19.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "cabal_04.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "cabal_05.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "cabal_03.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -1035,36 +1273,36 @@ ROM_START( cabalbl )
ROM_LOAD16_BYTE( "cabal_08.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm_1", 0 )
ROM_LOAD( "cabal_09.bin", 0x00000, 0x10000, CRC(4ffa7fe3) SHA1(381d8e765a7b94678fb3308965c748bbe9f8e247) ) /* Z80 code/adpcm data */
ROM_LOAD( "cabal_09.bin", 0x00000, 0x10000, CRC(4ffa7fe3) SHA1(381d8e765a7b94678fb3308965c748bbe9f8e247) ) // Z80 code/ADPCM data
ROM_REGION( 0x10000, "adpcm_2", 0 )
ROM_LOAD( "cabal_10.bin", 0x00000, 0x10000, CRC(958789b6) SHA1(344c3ee8a1e272b56499e5c0415bb714aec0ddcf) ) /* Z80 code/adpcm data */
ROM_LOAD( "cabal_10.bin", 0x00000, 0x10000, CRC(958789b6) SHA1(344c3ee8a1e272b56499e5c0415bb714aec0ddcf) ) // Z80 code/ADPCM data
ROM_END
// alternate bootleg
// this is much closer to the original, the only real difference is the soundcpu has been pre-decrypted,
// with the encrypted/decrypted data split across the rom
// this is much closer to the original, the only real difference is the sound CPU has been pre-decrypted,
// with the encrypted/decrypted data split across the ROM
// based on stickers present on the board it appears to have been manufactured by 'TAB-Austria' and is marked 'CA02'
ROM_START( cabalbl2 )
ROM_REGION( 0x40000, "maincpu", 0 ) /* 64k for cpu code */
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "c9.bin", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "c7.bin", 0x00001, 0x10000, CRC(44736281) SHA1(1d6da95ef96d9c02aea70791e1cb87b70097d5ed) )
ROM_LOAD16_BYTE( "c8.bin", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
ROM_LOAD16_BYTE( "c6.bin", 0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound cpu code */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "c4.bin", 0x2000, 0x2000, CRC(82f9f296) SHA1(2769ffdc28f003684e77d4806be07b87d50be31c) )
ROM_CONTINUE(0x0000,0x2000)
ROM_IGNORE(0x4000)
ROM_LOAD( "c3.bin", 0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "c5.bin", 0x00000, 0x04000, CRC(183e4834) SHA1(05ab0c388be8701930a9de437978206cda6fed68) ) /* characters */
ROM_REGION( 0x4000, "chars", 0 )
ROM_LOAD( "c5.bin", 0x00000, 0x04000, CRC(183e4834) SHA1(05ab0c388be8701930a9de437978206cda6fed68) )
ROM_CONTINUE(0x0000,0x4000)
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD16_BYTE( "c14.bin", 0x00000, 0x10000, CRC(1023319b) SHA1(38fcc8159776b82779b3163329b07c61be939fae) )
ROM_LOAD16_BYTE( "c10.bin", 0x00001, 0x10000, CRC(3b6d2b09) SHA1(4cdcd22836dce4ee6348c4e6df7c6360d12ef912) )
ROM_LOAD16_BYTE( "c15.bin", 0x20000, 0x10000, CRC(420b0801) SHA1(175be6e3ca3cb98672e4cdbc9b5f5b007bc531c9) )
@ -1074,7 +1312,7 @@ ROM_START( cabalbl2 )
ROM_LOAD16_BYTE( "c17.bin", 0x60000, 0x10000, CRC(d28d921e) SHA1(e133de5129a33ca9ff449948a959621bbfc58c11) )
ROM_LOAD16_BYTE( "c13.bin", 0x60001, 0x10000, CRC(67e4fe47) SHA1(15620fc5e985a249677da333b77331e40d2b24ab) )
ROM_REGION( 0x80000, "gfx3", 0 )
ROM_REGION( 0x80000, "sprites", 0 )
ROM_LOAD16_BYTE( "c18.bin", 0x00000, 0x10000, CRC(34d3cac8) SHA1(a6a2304fb576267db2c72cfbf0a3f66740ebe60e) )
ROM_LOAD16_BYTE( "c22.bin", 0x00001, 0x10000, CRC(4e49c28e) SHA1(ea74443a9423b14611a1f97e44692badfedd0ead) )
ROM_LOAD16_BYTE( "c19.bin", 0x20000, 0x10000, CRC(7065e840) SHA1(baa8cd28be60c678d782ecfabde6cd5e36480415) )
@ -1084,10 +1322,10 @@ ROM_START( cabalbl2 )
ROM_LOAD16_BYTE( "c21.bin", 0x60000, 0x10000, CRC(55c44764) SHA1(7fad1f2084664b5b4d1384c8081371b0c79c4f5e) )
ROM_LOAD16_BYTE( "c25.bin", 0x60001, 0x10000, CRC(702735c9) SHA1(e4ac799dc85ff5b7c8e578611605989c78f9e8b3) )
ROM_REGION( 0x10000, "adpcm1", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm1", 0 )
ROM_LOAD( "c2.bin", 0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
ROM_REGION( 0x10000, "adpcm2", 0 ) /* Samples */
ROM_REGION( 0x10000, "adpcm2", 0 )
ROM_LOAD( "c1.bin", 0x00000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
ROM_END
@ -1098,13 +1336,15 @@ void cabal_state::init_cabal()
m_adpcm[1]->decrypt();
}
} // anonymous namespace
GAME( 1988, cabal, 0, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation", "Cabal (World, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabala, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Alpha Trading license)", "Cabal (Korea?, Joystick)", MACHINE_SUPPORTS_SAVE ) // Korea?
GAME( 1989, cabalukj, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabal, 0, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation", "Cabal (World, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabala, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Alpha Trading license)", "Cabal (Korea?, Joystick)", MACHINE_SUPPORTS_SAVE ) // Korea?
GAME( 1989, cabalukj, cabal, cabal, cabalj, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Joystick)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalbl, cabal, cabalbl, cabalbl, cabalbl_state, empty_init, ROT0, "bootleg (Red Corporation)", "Cabal (bootleg of Joystick version, set 1, alternate sound hardware)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalbl2, cabal, cabalbl2, cabalj, cabal_state, init_cabal, ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalbl2, cabal, cabalbl2, cabalj, cabal_state, init_cabal, ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 1, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus2, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 2, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabaluk, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 1, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, cabalus2, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 2, Trackball)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, cabaluk, cabal, cabalt, cabalt, cabal_state, init_cabal, ROT0, "TAD Corporation (Electrocoin license)", "Cabal (UK, Trackball)", MACHINE_SUPPORTS_SAVE )

View File

@ -1,118 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
#ifndef MAME_SEIBU_CABAL_H
#define MAME_SEIBU_CABAL_H
#pragma once
#include "seibusound.h"
#include "sound/msm5205.h"
#include "emupal.h"
#include "tilemap.h"
class cabal_base_state : public driver_device
{
public:
cabal_base_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_msm(*this, "msm%u", 1U),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram"),
m_videoram(*this, "videoram")
{ }
protected:
virtual void video_start() override;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device_array<msm5205_device, 2> m_msm;
void flipscreen_w(uint8_t data);
void background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_colorram;
required_shared_ptr<uint16_t> m_videoram;
tilemap_t *m_background_layer = nullptr;
tilemap_t *m_text_layer = nullptr;
TILE_GET_INFO_MEMBER(get_back_tile_info);
TILE_GET_INFO_MEMBER(get_text_tile_info);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
class cabal_state : public cabal_base_state
{
public:
cabal_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag),
m_seibu_sound(*this, "seibu_sound"),
m_adpcm(*this, "adpcm%u", 1U)
{ }
void cabal(machine_config &config);
void cabalbl2(machine_config &config);
void cabalt(machine_config &config);
void init_cabal();
private:
required_device<seibu_sound_device> m_seibu_sound;
required_device_array<seibu_adpcm_device, 2> m_adpcm;
void sound_irq_trigger_word_w(offs_t, u16 data, u16 mem_mask);
void main_map(address_map &map);
void sound_decrypted_opcodes_map(address_map &map);
void sound_map(address_map &map);
void trackball_main_map(address_map &map);
void cabalbl2_predecrypted_opcodes_map(address_map &map);
void cabalbl2_sound_map(address_map &map);
};
class cabalbl_state : public cabal_base_state
{
public:
cabalbl_state(const machine_config &mconfig, device_type type, const char *tag) :
cabal_base_state(mconfig, type, tag)
{ }
void cabalbl(machine_config &config);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
int m_sound_command[2]{};
void sndcmd_w(offs_t offset, uint16_t data);
void sound_irq_trigger_word_w(uint16_t data);
template<uint8_t Which> uint8_t snd_r();
void coin_w(uint8_t data);
template<uint8_t Which> void adpcm_w(uint8_t data);
void main_map(address_map &map);
void sound_map(address_map &map);
void talk1_map(address_map &map);
void talk1_portmap(address_map &map);
void talk2_map(address_map &map);
void talk2_portmap(address_map &map);
};
#endif // MAME_SEIBU_CABAL_H

View File

@ -1,139 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano
/***************************************************************************
cabal.cpp
Functions to emulate the video hardware of the machine.
***************************************************************************/
#include "emu.h"
#include "cabal.h"
TILE_GET_INFO_MEMBER(cabal_base_state::get_back_tile_info)
{
int tile = m_videoram[tile_index];
int color = (tile>>12)&0xf;
tile &= 0xfff;
tileinfo.set(1,
tile,
color,
0);
}
TILE_GET_INFO_MEMBER(cabal_base_state::get_text_tile_info)
{
int tile = m_colorram[tile_index];
int color = (tile>>10);
tile &= 0x3ff;
tileinfo.set(0,
tile,
color,
0);
}
void cabal_base_state::video_start()
{
m_background_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cabal_base_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_text_layer->set_transparent_pen(3);
m_background_layer->set_transparent_pen(15);
}
/**************************************************************************/
void cabal_base_state::flipscreen_w(uint8_t data)
{
int flip = (data & 0x20) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
m_background_layer->set_flip(flip);
m_text_layer->set_flip(flip);
flip_screen_set(data & 0x20);
}
void cabal_base_state::background_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_videoram[offset]);
m_background_layer->mark_tile_dirty(offset);
}
void cabal_base_state::text_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_colorram[offset]);
m_text_layer->mark_tile_dirty(offset);
}
/********************************************************************
Cabal Spriteram
---------------
+0 .......x ........ Sprite enable bit
+0 ........ xxxxxxxx Sprite Y coordinate
+1 ..??.... ........ ??? unknown ???
+1 ....xxxx xxxxxxxx Sprite tile number
+2 .xxxx... ........ Sprite color bank
+2 .....x.. ........ Sprite flip x
+2 .......x xxxxxxxx Sprite X coordinate
+3 (unused)
-------E YYYYYYYY
----BBTT TTTTTTTT
-CCCCF-X XXXXXXXX
-------- --------
********************************************************************/
void cabal_base_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for( int offs = m_spriteram.bytes()/2 - 4; offs >= 0; offs -= 4 )
{
int data0 = m_spriteram[offs];
int data1 = m_spriteram[offs+1];
int data2 = m_spriteram[offs+2];
if( data0 & 0x100 )
{
int tile_number = data1 & 0xfff;
int color = ( data2 & 0x7800 ) >> 11;
int sy = ( data0 & 0xff );
int sx = ( data2 & 0x1ff );
int flipx = ( data2 & 0x0400 );
int flipy = 0;
if ( sx>256 ) sx -= 512;
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
tile_number,
color,
flipx,flipy,
sx,sy,0xf );
}
}
}
uint32_t cabal_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
draw_sprites(bitmap,cliprect);
m_text_layer->draw(screen, bitmap, cliprect, 0,0);
return 0;
}

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Nicola Salmoria, Tomasz Slanina
// copyright-holders: David Haywood, Nicola Salmoria, Tomasz Slanina
/*
***********************************************************************************
Dark Mist (c)1986 Taito / Seibu
@ -11,7 +12,7 @@ driver by
Tomasz Slanina
Main CPU : z80 (with encryption, external to z80)
Sound CPU: custom T5182 cpu (like seibu sound system but with internal code)
Sound CPU: custom T5182 CPU (like Seibu sound system but with internal code)
The SEI8608B sound board, which features the T5182 "CPU CUSTOM" and YM2151, also
has unpopulated locations for a 76489AN, 2x MSM5205, 2x 27512 EPROM (presumably
@ -21,58 +22,328 @@ $e000 - coins (two bytes)
$e2b7 - player 1 energy
TODO:
- when player soaks in water, color pen used is wrong (entry 1 at 0xf500 should be 0x0c and instead is 0x14), might be btanb?
- when player soaks in water, color pen used is wrong (entry 1 at 0xf500 should be 0x0c and instead is 0x14), might be BTANB?
- cocktail mode
- unknown bit in sprite attr (there's code used for OR-ing sprite attrib with some
value (taken from ram) when one of coords is greater than 256-16 )
value (taken from RAM) when one of coords is greater than 256-16 )
***********************************************************************************
*/
#include "emu.h"
#include "darkmist.h"
#include "t5182.h"
#include "cpu/z80/z80.h"
#include "machine/timer.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
namespace {
class darkmist_state : public driver_device
{
public:
darkmist_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_t5182(*this, "t5182"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_spritebank(*this, "spritebank"),
m_scroll(*this, "scroll"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_bg_clut(*this, "bg_clut"),
m_fg_clut(*this, "fg_clut"),
m_spr_clut(*this, "spr_clut"),
m_tx_clut(*this, "tx_clut"),
m_decrypted_opcodes(*this, "decrypted_opcodes"),
m_rombank(*this, "rombank")
{ }
void darkmist(machine_config &config);
void init_darkmist();
protected:
virtual void machine_start() override;
virtual void video_start() override;
private:
required_device<cpu_device> m_maincpu;
required_device<t5182_device> m_t5182;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_spritebank;
required_shared_ptr<uint8_t> m_scroll;
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_spriteram;
required_region_ptr<uint8_t> m_bg_clut;
required_region_ptr<uint8_t> m_fg_clut;
required_region_ptr<uint8_t> m_spr_clut;
required_region_ptr<uint8_t> m_tx_clut;
required_shared_ptr<uint8_t> m_decrypted_opcodes;
required_memory_bank m_rombank;
uint8_t m_hw = 0;
tilemap_t *m_bgtilemap = nullptr;
tilemap_t *m_fgtilemap = nullptr;
tilemap_t *m_txtilemap = nullptr;
void hw_w(uint8_t data);
void tx_vram_w(offs_t offset, uint8_t data);
TILE_GET_INFO_MEMBER(get_bgtile_info);
TILE_GET_INFO_MEMBER(get_fgtile_info);
TILE_GET_INFO_MEMBER(get_txttile_info);
void palette(palette_device &palette) const;
bitmap_ind16 m_temp_bitmap;
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *clut);
void decrypt_fgbgtiles(uint8_t *rgn, int size);
void decrypt_gfx();
void decrypt_snd();
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
void decrypted_opcodes_map(address_map &map);
void memmap(address_map &map);
};
// video
TILE_GET_INFO_MEMBER(darkmist_state::get_bgtile_info)
{
int code = memregion("bg_map")->base()[tile_index * 2]; // TTTTTTTT
int const attr = memregion("bg_map")->base()[(tile_index * 2) + 1]; // -PPP--TT - FIXED BITS (0xxx00xx)
code += (attr & 3) << 8;
int const pal = (attr >> 4) & 0xf;
tileinfo.set(1, code, pal, 0);
}
TILE_GET_INFO_MEMBER(darkmist_state::get_fgtile_info)
{
int code = memregion("fg_map")->base()[tile_index * 2]; // TTTTTTTT
int const attr = memregion("fg_map")->base()[(tile_index * 2) + 1]; // -PPP--TT - FIXED BITS (0xxx00xx)
code += (attr & 3) << 8;
int const pal = (attr >> 4) & 0xf;
tileinfo.set(2, code, pal, 0);
}
TILE_GET_INFO_MEMBER(darkmist_state::get_txttile_info)
{
int code = m_videoram[tile_index];
int const attr = m_videoram[tile_index + 0x400];
int const pal = (attr >> 1);
code += (attr & 1) << 8;
tileinfo.set(0, code, pal & 0xf, 0);
}
void darkmist_state::palette(palette_device &palette) const
{
//palette.set_indirect_color(0x100, rgb_t::black());
std::pair<uint8_t const *, uint8_t> const planes[4]{
{ &m_bg_clut[0], 0x80 },
{ &m_fg_clut[0], 0x00 },
{ &m_spr_clut[0], 0x40 },
{ &m_tx_clut[0], 0xc0 } };
for (unsigned plane = 0; std::size(planes) > plane; ++plane)
{
for (unsigned i = 0; 0x100 > i; ++i)
{
uint8_t const clut = planes[plane].first[i];
// if (clut & 0x40) // 0x40 indicates transparent pen
// ctabentry = 0x100;
// else
int const ctabentry = (clut & 0x3f) | planes[plane].second;
palette.set_pen_indirect((plane << 8) | i, ctabentry);
}
}
}
void darkmist_state::video_start()
{
m_bgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_bgtile_info)), TILEMAP_SCAN_ROWS, 16, 16, 512, 64);
m_fgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_fgtile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 256);
m_txtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_txttile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
// m_fgtilemap->set_transparent_pen(0);
// m_txtilemap->set_transparent_pen(0);
save_item(NAME(m_hw));
m_screen->register_screen_bitmap(m_temp_bitmap);
}
// TODO: move this code into framework or substitute with a valid alternative
void darkmist_state::mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *clut)
{
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
uint16_t *const dest = &bitmap.pix(y);
uint16_t const *const src = &m_temp_bitmap.pix(y);
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
uint16_t const pix = (src[x] & 0xff);
uint16_t const real = clut[pix];
if (!(real & 0x40))
dest[x] = src[x];
}
}
}
/*
Sprites
76543210
0 - TTTT TTTT - tile
1 - xyBP PPP? - palette (P), flips (x,y), B - use spritebank,
? - unknown, according to gamecode top bit of one of coords(y/x)
2 - YYYY YYYY - y coord
3 - XXXX XXXX - x coord
*/
void darkmist_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// fetch from top to bottom
for (int i = m_spriteram.bytes() - 32; i >= 0; i -= 32)
{
int const fy = m_spriteram[i + 1] & 0x40;
int const fx = m_spriteram[i + 1] & 0x80;
int tile = m_spriteram[i + 0];
if (m_spriteram[i + 1] & 0x20)
tile += (*m_spritebank << 8);
int palette = ((m_spriteram[i + 1]) >> 1) & 0xf;
if (m_spriteram[i + 1] & 0x1)
palette = machine().rand() & 15;
m_gfxdecode->gfx(3)->transpen(
bitmap, cliprect,
tile,
palette,
fx, fy,
m_spriteram[i + 3], m_spriteram[i + 2], 0);
}
}
uint32_t darkmist_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// vis. flags
constexpr int DISPLAY_SPR = 1;
constexpr int DISPLAY_FG = 2; // 2 or 8
constexpr int DISPLAY_BG = 4;
constexpr int DISPLAY_TXT = 16;
#define DM_GETSCROLL(n) (((m_scroll[(n)] << 1) & 0xff) + ((m_scroll[(n)] & 0x80) ? 1 : 0) +( ((m_scroll[(n) - 1] << 4) | (m_scroll[(n) - 1] << 12)) & 0xff00))
m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2));
m_bgtilemap->set_scrolly(0, DM_GETSCROLL(0x6));
m_fgtilemap->set_scrollx(0, DM_GETSCROLL(0xa));
m_fgtilemap->set_scrolly(0, DM_GETSCROLL(0xe));
m_temp_bitmap.fill(0, cliprect);
bitmap.fill(m_palette->black_pen(), cliprect);
if (m_hw & DISPLAY_BG)
{
m_bgtilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0);
mix_layer(screen, bitmap, cliprect, m_bg_clut);
}
if (m_hw & DISPLAY_FG)
{
m_fgtilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0);
mix_layer(screen, bitmap, cliprect, m_fg_clut);
}
if (m_hw & DISPLAY_SPR)
{
draw_sprites(m_temp_bitmap, cliprect);
mix_layer(screen, bitmap, cliprect, m_spr_clut);
}
if (m_hw & DISPLAY_TXT)
{
m_txtilemap->draw(screen, m_temp_bitmap, cliprect, 0, 0);
mix_layer(screen, bitmap, cliprect, m_tx_clut);
}
return 0;
}
void darkmist_state::tx_vram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_txtilemap->mark_tile_dirty(offset & 0x3ff);
}
// machine
void darkmist_state::machine_start()
{
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
m_rombank->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
}
void darkmist_state::hw_w(uint8_t data)
{
m_hw=data;
membank("bank1")->set_entry((data&0x80)?1:0);
m_hw = data;
m_rombank->set_entry(BIT(data, 7));
}
void darkmist_state::memmap(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0x8000, 0xbfff).bankr(m_rombank);
map(0xc801, 0xc801).portr("P1");
map(0xc802, 0xc802).portr("P2");
map(0xc803, 0xc803).portr("START");
map(0xc804, 0xc804).w(FUNC(darkmist_state::hw_w));
map(0xc805, 0xc805).writeonly().share("spritebank");
map(0xc805, 0xc805).writeonly().share(m_spritebank);
map(0xc806, 0xc806).portr("DSW1");
map(0xc807, 0xc807).portr("DSW2");
map(0xc808, 0xc808).portr("UNK");
map(0xd000, 0xd0ff).ram().w(m_palette, FUNC(palette_device::write_indirect)).share("palette");
map(0xd200, 0xd2ff).ram().w(m_palette, FUNC(palette_device::write_indirect_ext)).share("palette_ext");
map(0xd400, 0xd41f).ram().share("scroll");
map(0xd400, 0xd41f).ram().share(m_scroll);
map(0xd600, 0xd67f).rw(m_t5182, FUNC(t5182_device::sharedram_r), FUNC(t5182_device::sharedram_w));
map(0xd680, 0xd680).w(m_t5182, FUNC(t5182_device::sound_irq_w));
map(0xd681, 0xd681).r(m_t5182, FUNC(t5182_device::sharedram_semaphore_snd_r));
map(0xd682, 0xd682).w(m_t5182, FUNC(t5182_device::sharedram_semaphore_main_acquire_w));
map(0xd683, 0xd683).w(m_t5182, FUNC(t5182_device::sharedram_semaphore_main_release_w));
map(0xd800, 0xdfff).ram().w(FUNC(darkmist_state::tx_vram_w)).share("videoram");
map(0xd800, 0xdfff).ram().w(FUNC(darkmist_state::tx_vram_w)).share(m_videoram);
map(0xe000, 0xefff).ram().share("workram");
map(0xf000, 0xffff).ram().share("spriteram");
map(0xf000, 0xffff).ram().share(m_spriteram);
}
void darkmist_state::decrypted_opcodes_map(address_map &map)
{
map(0x0000, 0x7fff).rom().share("decrypted_opcodes");
map(0x8000, 0xbfff).bankr("bank1");
map(0x0000, 0x7fff).rom().share(m_decrypted_opcodes);
map(0x8000, 0xbfff).bankr(m_rombank);
}
static INPUT_PORTS_START( darkmist )
@ -132,7 +403,7 @@ static INPUT_PORTS_START( darkmist )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") /* Listed as "ALWAYS ON" */
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") // Listed as "ALWAYS ON"
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8")
@ -228,28 +499,28 @@ GFXDECODE_END
TIMER_DEVICE_CALLBACK_MEMBER(darkmist_state::scanline)
{
int scanline = param;
int const scanline = param;
if(scanline == 240) // vblank-out irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xd7); /* Z80 - RST 10h */
if (scanline == 240) // vblank-out irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 - RST 10h
if(scanline == 0) // vblank-in irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xcf); /* Z80 - RST 08h */
if (scanline == 0) // vblank-in irq
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 - RST 08h
}
void darkmist_state::darkmist(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 4000000); /* ? MHz */
// basic machine hardware
Z80(config, m_maincpu, 4'000'000); // ? MHz
m_maincpu->set_addrmap(AS_PROGRAM, &darkmist_state::memmap);
m_maincpu->set_addrmap(AS_OPCODES, &darkmist_state::decrypted_opcodes_map);
TIMER(config, "scantimer").configure_scanline(FUNC(darkmist_state::scanline), "screen", 0, 1);
T5182(config, m_t5182, 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));
@ -259,14 +530,14 @@ void darkmist_state::darkmist(machine_config &config)
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_darkmist);
PALETTE(config, m_palette, FUNC(darkmist_state::darkmist_palette));
PALETTE(config, m_palette, FUNC(darkmist_state::palette));
m_palette->set_format(palette_device::xRGB_444, 0x100*4);
m_palette->set_indirect_entries(256+1);
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
ym2151_device &ymsnd(YM2151(config, "ymsnd", 14318180/4)); /* 3.579545 MHz */
ym2151_device &ymsnd(YM2151(config, "ymsnd", 14'318'180 / 4)); // 3.579545 MHz
ymsnd.irq_handler().set(m_t5182, FUNC(t5182_device::ym2151_irq_handler));
ymsnd.add_route(0, "mono", 1.0);
ymsnd.add_route(1, "mono", 1.0);
@ -278,7 +549,7 @@ ROM_START( darkmist )
ROM_LOAD( "dm_16.rom", 0x10000, 0x08000, CRC(094579d9) SHA1(2449bc9ba38396912ee9b72dd870ea9fcff95776) )
ROM_REGION( 0x8000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */
ROM_REGION( 0x8000, "t5182_z80", 0 ) // Toshiba T5182 external ROM
ROM_LOAD( "dm_17.rom", 0x0000, 0x8000, CRC(7723dcae) SHA1(a0c69e7a7b6fd74f7ed6b9c6419aed94aabcd4b0) )
ROM_REGION( 0x4000, "tx_gfx", 0 )
@ -299,13 +570,11 @@ ROM_START( darkmist )
ROM_LOAD( "dm_10.rom", 0x20000, 0x10000, CRC(34fd52b5) SHA1(c4ee464ed79ec91f993b0f894572c0288f0ad1d4) )
ROM_LOAD( "dm_12.rom", 0x30000, 0x08000, CRC(cc4b9839) SHA1(b7e95513d2e06929fed5005caf3bf8c3fba0b597) )
ROM_REGION( 0x10000, "bg_map", 0 )
/* BG layer map ( 512x64 )*/
ROM_REGION( 0x10000, "bg_map", 0 ) // 512x64
ROM_LOAD16_BYTE( "dm_03.rom", 0x00000, 0x08000, CRC(60b40c2a) SHA1(c046273b15dab95ea4851c26ce941e580fa1b6ec) )
ROM_LOAD16_BYTE( "dm_04.rom", 0x00001, 0x08000, CRC(d47b8cd9) SHA1(86eb7a5d8ea63c0c91f455b1b8322cc7b9c4a968) )
ROM_REGION( 0x08000, "fg_map", 0 )
/* FG layer map ( 64x256 ) */
ROM_REGION( 0x08000, "fg_map", 0 ) // 64x256
ROM_LOAD16_BYTE( "dm_07.rom", 0x00000, 0x04000, CRC(889b1277) SHA1(78405110b9cf1ab988c0cbfdb668498dadb41229) )
ROM_LOAD16_BYTE( "dm_08.rom", 0x00001, 0x04000, CRC(f76f6f46) SHA1(ce1c67dc8976106b24fee8d3a0b9e5deb016a327) )
@ -318,8 +587,7 @@ ROM_START( darkmist )
ROM_REGION( 0x0100, "tx_clut", 0 )
ROM_LOAD( "63s281n.j15", 0x0000, 0x0100, CRC(2ea780a4) SHA1(0f8d6791114705e9982f9035f291d2a305b47f0a) )
ROM_REGION( 0x0200, "proms", 0 ) // unknown PROMs
ROM_REGION( 0x0200, "proms", 0 ) // unknown
ROM_LOAD( "63s281n.l1", 0x0000, 0x0100, CRC(208d17ca) SHA1(a77d56337bcac8d9a7bc3411239dfb3045e069ec) )
ROM_LOAD( "82s129.d11", 0x0100, 0x0100, CRC(866eab0e) SHA1(398ffe2b82b6e2235746fd987d5f5995d7dc8687) )
ROM_END
@ -327,26 +595,24 @@ ROM_END
void darkmist_state::decrypt_fgbgtiles(uint8_t* rom, int size)
void darkmist_state::decrypt_fgbgtiles(uint8_t *rom, int size)
{
std::vector<uint8_t> buf(0x40000);
/* data lines */
for (int i = 0;i < size/2;i++)
// data lines
for (int i = 0; i < size / 2; i++)
{
int w1;
int w1 = (rom[i + 0 * size / 2] << 8) + rom[i + 1 * size / 2];
w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2];
w1 = bitswap<16>(w1, 9, 14, 7, 2, 6, 8, 3, 15, 10, 13, 5, 12, 0, 11, 4, 1);
w1 = bitswap<16>(w1, 9,14,7,2, 6,8,3,15, 10,13,5,12, 0,11,4,1);
buf[i + 0*size/2] = w1 >> 8;
buf[i + 1*size/2] = w1 & 0xff;
buf[i + 0 * size / 2] = w1 >> 8;
buf[i + 1 * size / 2] = w1 & 0xff;
}
/* address lines */
for (int i = 0;i < size;i++)
// address lines
for (int i = 0; i < size; i++)
{
rom[i] = buf[bitswap<24>(i,23,22,21,20,19,18,17,16,15,14,13, 5,4,3,2, 12,11,10,9,8, 1,0, 7,6)];
rom[i] = buf[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 5, 4, 3, 2, 12, 11, 10, 9, 8, 1, 0, 7, 6)];
}
}
@ -355,30 +621,24 @@ void darkmist_state::decrypt_fgbgtiles(uint8_t* rom, int size)
void darkmist_state::decrypt_gfx()
{
std::vector<uint8_t> buf(0x40000);
uint8_t *rom;
int size;
int i;
uint8_t *rom = memregion("tx_gfx")->base();
int size = memregion("tx_gfx")->bytes();
rom = memregion("tx_gfx")->base();
size = memregion("tx_gfx")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
// data lines
for (int i = 0; i < size / 2; i++)
{
int w1;
int w1 = (rom[i + 0 * size / 2] << 8) + rom[i + 1 * size / 2];
w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2];
w1 = bitswap<16>(w1, 9, 14, 7, 2, 6, 8, 3, 15, 10, 13, 5, 12, 0, 11, 4, 1);
w1 = bitswap<16>(w1, 9,14,7,2, 6,8,3,15, 10,13,5,12, 0,11,4,1);
buf[i + 0*size/2] = w1 >> 8;
buf[i + 1*size/2] = w1 & 0xff;
buf[i + 0 * size / 2] = w1 >> 8;
buf[i + 1 * size / 2] = w1 & 0xff;
}
/* address lines */
for (i = 0;i < size;i++)
// address lines
for (int i = 0; i < size; i++)
{
rom[i] = buf[bitswap<24>(i,23,22,21,20,19,18,17,16,15,14,13,12, 3,2,1, 11,10,9,8, 0, 7,6,5,4)];
rom[i] = buf[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 3, 2, 1, 11, 10, 9, 8, 0, 7, 6, 5, 4)];
}
decrypt_fgbgtiles(memregion("bg_gfx")->base(), memregion("bg_gfx")->bytes());
@ -388,37 +648,35 @@ void darkmist_state::decrypt_gfx()
rom = memregion("spr_gfx")->base();
size = memregion("spr_gfx")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
// data lines
for (int i = 0; i < size / 2; i++)
{
int w1;
int w1 = (rom[i + 0 * size / 2] << 8) + rom[i + 1 * size / 2];
w1 = (rom[i + 0*size/2] << 8) + rom[i + 1*size/2];
w1 = bitswap<16>(w1, 9, 14, 7, 2, 6, 8, 3, 15, 10, 13, 5, 12, 0, 11, 4, 1);
w1 = bitswap<16>(w1, 9,14,7,2, 6,8,3,15, 10,13,5,12, 0,11,4,1);
buf[i + 0*size/2] = w1 >> 8;
buf[i + 1*size/2] = w1 & 0xff;
buf[i + 0 * size / 2] = w1 >> 8;
buf[i + 1 * size / 2] = w1 & 0xff;
}
/* address lines */
for (i = 0;i < size;i++)
// address lines
for (int i = 0; i < size; i++)
{
rom[i] = buf[bitswap<24>(i, 23,22,21,20,19,18,17,16,15,14, 12,11,10,9,8, 5,4,3, 13, 7,6, 1,0, 2)];
rom[i] = buf[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 12, 11, 10, 9, 8, 5, 4, 3, 13, 7, 6, 1, 0, 2)];
}
}
void darkmist_state::decrypt_snd()
{
uint8_t *ROM = memregion("t5182_z80")->base();
uint8_t *rom = memregion("t5182_z80")->base();
for (int i = 0x0000; i < 0x8000; i++)
ROM[i] = bitswap<8>(ROM[i], 7, 1, 2, 3, 4, 5, 6, 0);
rom[i] = bitswap<8>(rom[i], 7, 1, 2, 3, 4, 5, 6, 0);
}
void darkmist_state::init_darkmist()
{
uint8_t *ROM = memregion("maincpu")->base();
uint8_t *rom = memregion("maincpu")->base();
std::vector<uint8_t> buffer(0x10000);
decrypt_gfx();
@ -427,49 +685,52 @@ void darkmist_state::init_darkmist()
for (int i = 0; i < 0x8000; i++)
{
uint8_t p = ROM[i];
uint8_t p = rom[i];
uint8_t d = p;
if(((i & 0x20) == 0x00) && ((i & 0x8) != 0))
if (((i & 0x20) == 0x00) && ((i & 0x8) != 0))
p ^= 0x20;
if(((i & 0x20) == 0x00) && ((i & 0xa) != 0))
if (((i & 0x20) == 0x00) && ((i & 0xa) != 0))
d ^= 0x20;
if(((i & 0x200) == 0x200) && ((i & 0x408) != 0))
if (((i & 0x200) == 0x200) && ((i & 0x408) != 0))
p ^= 0x10;
if((i & 0x220) != 0x200)
if ((i & 0x220) != 0x200)
{
p = bitswap<8>(p, 7,6,5,2,3,4,1,0);
d = bitswap<8>(d, 7,6,5,2,3,4,1,0);
p = bitswap<8>(p, 7, 6, 5, 2, 3, 4, 1, 0);
d = bitswap<8>(d, 7, 6, 5, 2, 3, 4, 1, 0);
}
ROM[i] = d;
rom[i] = d;
m_decrypted_opcodes[i] = p;
}
membank("bank1")->set_base(&ROM[0x010000]);
m_rombank->set_base(&rom[0x10000]);
/* adr line swaps */
ROM = memregion("bg_map")->base();
// adr line swaps
rom = memregion("bg_map")->base();
int len = memregion("bg_map")->bytes();
memcpy( &buffer[0], ROM, len );
memcpy(&buffer[0], rom, len);
for (int i = 0; i < len; i++)
{
ROM[i]=buffer[bitswap<24>(i,23,22,21,20,19,18,17,16,7,6,5,4,3,15,14,13,12,9,8,2,1,11,10, 0)];
rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 7, 6, 5, 4, 3, 15, 14, 13, 12, 9, 8, 2, 1, 11, 10, 0)];
}
ROM = memregion("fg_map")->base();
rom = memregion("fg_map")->base();
len = memregion("fg_map")->bytes();
memcpy( &buffer[0], ROM, len );
memcpy(&buffer[0], rom, len);
for (int i = 0; i < len; i++)
{
ROM[i]=buffer[bitswap<24>(i,23,22,21,20,19,18,17,16,15 ,6,5,4,3,12,11,10,9,14,13,2,1,8,7 ,0 )];
rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15 , 6, 5, 4, 3, 12, 11, 10, 9, 14, 13, 2, 1, 8, 7, 0)];
}
}
} // anonymous namespace
GAME( 1986, darkmist, 0, darkmist, darkmist, darkmist_state, init_darkmist, ROT270, "Seibu Kaihatsu (Taito license)", "The Lost Castle In Darkmist", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )

View File

@ -1,87 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Nicola Salmoria, Tomasz Slanina
#ifndef MAME_SEIBU_DARKMIST_H
#define MAME_SEIBU_DARKMIST_H
#pragma once
#include "t5182.h"
#include "machine/timer.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
class darkmist_state : public driver_device
{
public:
darkmist_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_t5182(*this, "t5182"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_spritebank(*this, "spritebank"),
m_scroll(*this, "scroll"),
m_videoram(*this, "videoram"),
m_workram(*this, "workram"),
m_spriteram(*this, "spriteram"),
m_bg_clut(*this, "bg_clut"),
m_fg_clut(*this, "fg_clut"),
m_spr_clut(*this, "spr_clut"),
m_tx_clut(*this, "tx_clut"),
m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
void darkmist(machine_config &config);
void init_darkmist();
private:
required_device<cpu_device> m_maincpu;
required_device<t5182_device> m_t5182;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_spritebank;
required_shared_ptr<uint8_t> m_scroll;
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_workram;
required_shared_ptr<uint8_t> m_spriteram;
required_region_ptr<uint8_t> m_bg_clut;
required_region_ptr<uint8_t> m_fg_clut;
required_region_ptr<uint8_t> m_spr_clut;
required_region_ptr<uint8_t> m_tx_clut;
optional_shared_ptr<uint8_t> m_decrypted_opcodes;
int m_hw = 0;
tilemap_t *m_bgtilemap = nullptr;
tilemap_t *m_fgtilemap = nullptr;
tilemap_t *m_txtilemap = nullptr;
void hw_w(uint8_t data);
void tx_vram_w(offs_t offset, uint8_t data);
TILE_GET_INFO_MEMBER(get_bgtile_info);
TILE_GET_INFO_MEMBER(get_fgtile_info);
TILE_GET_INFO_MEMBER(get_txttile_info);
virtual void machine_start() override;
virtual void video_start() override;
void darkmist_palette(palette_device &palette) const;
bitmap_ind16 m_temp_bitmap;
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* clut);
void decrypt_fgbgtiles(uint8_t* rgn, int size);
void decrypt_gfx();
void decrypt_snd();
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
void decrypted_opcodes_map(address_map &map);
void memmap(address_map &map);
};
#endif // MAME_SEIBU_DARKMIST_H

View File

@ -1,201 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Nicola Salmoria, Tomasz Slanina
#include "emu.h"
#include "darkmist.h"
/* vis. flags */
#define DISPLAY_SPR 1
#define DISPLAY_FG 2 /* 2 or 8 */
#define DISPLAY_BG 4
#define DISPLAY_TXT 16
TILE_GET_INFO_MEMBER(darkmist_state::get_bgtile_info)
{
int code,attr,pal;
code=memregion("bg_map")->base()[tile_index*2]; /* TTTTTTTT */
attr=memregion("bg_map")->base()[(tile_index*2)+1]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
code+=(attr&3)<<8;
pal=(attr>>4) & 0xf;
tileinfo.set(1,
code,
pal,
0);
}
TILE_GET_INFO_MEMBER(darkmist_state::get_fgtile_info)
{
int code,attr,pal;
code = memregion("fg_map")->base()[tile_index*2]; /* TTTTTTTT */
attr = memregion("fg_map")->base()[(tile_index*2)+1]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
code+=(attr&3)<<8;
pal=(attr>>4) & 0xf;
tileinfo.set(2,
code,
pal,
0);
}
TILE_GET_INFO_MEMBER(darkmist_state::get_txttile_info)
{
int code,attr,pal;
code=m_videoram[tile_index];
attr=m_videoram[tile_index+0x400];
pal=(attr>>1);
code+=(attr&1)<<8;
tileinfo.set(0,
code,
pal & 0xf,
0);
}
void darkmist_state::darkmist_palette(palette_device &palette) const
{
//palette.set_indirect_color(0x100, rgb_t::black());
std::pair<uint8_t const *, uint8_t> const planes[4]{
{ &m_bg_clut[0], 0x80 },
{ &m_fg_clut[0], 0x00 },
{ &m_spr_clut[0], 0x40 },
{ &m_tx_clut[0], 0xc0 } };
for (unsigned plane = 0; std::size(planes) > plane; ++plane)
{
for (unsigned i = 0; 0x100 > i; ++i)
{
uint8_t const clut = planes[plane].first[i];
// if (clut & 0x40) // 0x40 indicates transparent pen
// ctabentry = 0x100;
// else
int const ctabentry = (clut & 0x3f) | planes[plane].second;
palette.set_pen_indirect((plane << 8) | i, ctabentry);
}
}
}
void darkmist_state::video_start()
{
m_bgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_bgtile_info)), TILEMAP_SCAN_ROWS, 16, 16, 512, 64);
m_fgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_fgtile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 256);
m_txtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkmist_state::get_txttile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
// m_fgtilemap->set_transparent_pen(0);
// m_txtilemap->set_transparent_pen(0);
save_item(NAME(m_hw));
m_screen->register_screen_bitmap(m_temp_bitmap);
}
// TODO: move this code into framework or substitute with a valid alternative
void darkmist_state::mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* clut)
{
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
uint16_t *const dest = &bitmap.pix(y);
uint16_t const *const src = &m_temp_bitmap.pix(y);
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
uint16_t const pix = (src[x] & 0xff);
uint16_t const real = clut[pix];
if (!(real & 0x40))
dest[x] = src[x];
}
}
}
/*
Sprites
76543210
0 - TTTT TTTT - tile
1 - xyBP PPP? - palette (P), flips (x,y), B - use spritebank,
? - unknown, according to gamecode top bit of one of coords(y/x)
2 - YYYY YYYY - y coord
3 - XXXX XXXX - x coord
*/
void darkmist_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int i,fx,fy,tile,palette;
// fetch from top to bottom
for(i=m_spriteram.bytes()-32;i>=0;i-=32)
{
fy=m_spriteram[i+1]&0x40;
fx=m_spriteram[i+1]&0x80;
tile=m_spriteram[i+0];
if(m_spriteram[i+1]&0x20)
tile += (*m_spritebank << 8);
palette=((m_spriteram[i+1])>>1)&0xf;
if(m_spriteram[i+1]&0x1)
palette=machine().rand()&15;
m_gfxdecode->gfx(3)->transpen(
bitmap,cliprect,
tile,
palette,
fx,fy,
m_spriteram[i+3],m_spriteram[i+2],0 );
}
}
uint32_t darkmist_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
#define DM_GETSCROLL(n) (((m_scroll[(n)]<<1)&0xff) + ((m_scroll[(n)]&0x80)?1:0) +( ((m_scroll[(n)-1]<<4) | (m_scroll[(n)-1]<<12) )&0xff00))
m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2));
m_bgtilemap->set_scrolly(0, DM_GETSCROLL(0x6));
m_fgtilemap->set_scrollx(0, DM_GETSCROLL(0xa));
m_fgtilemap->set_scrolly(0, DM_GETSCROLL(0xe));
m_temp_bitmap.fill(0,cliprect);
bitmap.fill(m_palette->black_pen(), cliprect);
if(m_hw & DISPLAY_BG)
{
m_bgtilemap->draw(screen, m_temp_bitmap, cliprect, 0,0);
mix_layer(screen, bitmap, cliprect, m_bg_clut);
}
if(m_hw & DISPLAY_FG)
{
m_fgtilemap->draw(screen, m_temp_bitmap, cliprect, 0,0);
mix_layer(screen, bitmap, cliprect, m_fg_clut);
}
if(m_hw & DISPLAY_SPR)
{
draw_sprites(m_temp_bitmap,cliprect);
mix_layer(screen, bitmap, cliprect, m_spr_clut);
}
if(m_hw & DISPLAY_TXT)
{
m_txtilemap->draw(screen, m_temp_bitmap, cliprect, 0,0);
mix_layer(screen, bitmap, cliprect, m_tx_clut);
}
return 0;
}
void darkmist_state::tx_vram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_txtilemap->mark_tile_dirty(offset & 0x3ff);
}

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
// copyright-holders: Bryan McPhail
/***************************************************************************
D-Con (c) 1992 Success
@ -9,24 +10,280 @@
Emulation by Bryan McPhail, mish@tendril.co.uk
Coin inputs are handled by the sound CPU, so they don't work with sound
disabled. Use the service switch instead.
***************************************************************************/
#include "emu.h"
#include "dcon.h"
#include "sei021x_sei0220_spr.h"
#include "seibu_crtc.h"
#include "seibusound.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "sound/okim6295.h"
#include "sound/ymopm.h"
#include "sound/ymopl.h"
#include "seibu_crtc.h"
#include "sound/ymopm.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
namespace {
class dcon_state : public driver_device, public seibu_sound_common
{
public:
dcon_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_seibu_sound(*this, "seibu_sound"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_spritegen(*this, "spritegen"),
m_back_data(*this, "back_data"),
m_fore_data(*this, "fore_data"),
m_mid_data(*this, "mid_data"),
m_textram(*this, "textram"),
m_spriteram(*this, "spriteram")
{ }
void dcon(machine_config &config);
void sdgndmps(machine_config &config);
protected:
virtual void video_start() override;
private:
required_device<cpu_device> m_maincpu;
required_device<seibu_sound_device> m_seibu_sound;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<sei0211_device> m_spritegen;
required_shared_ptr<uint16_t> m_back_data;
required_shared_ptr<uint16_t> m_fore_data;
required_shared_ptr<uint16_t> m_mid_data;
required_shared_ptr<uint16_t> m_textram;
required_shared_ptr<uint16_t> m_spriteram;
tilemap_t *m_background_layer = nullptr;
tilemap_t *m_foreground_layer = nullptr;
tilemap_t *m_midground_layer = nullptr;
tilemap_t *m_text_layer = nullptr;
uint16_t m_gfx_bank_select = 0U;
uint16_t m_last_gfx_bank = 0U;
uint16_t m_scroll_ram[6]{};
uint16_t m_layer_en = 0U;
uint8_t sdgndmps_sound_comms_r(offs_t offset);
void layer_en_w(uint16_t data);
void layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void gfxbank_w(uint16_t data);
void background_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void midground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
TILE_GET_INFO_MEMBER(get_back_tile_info);
TILE_GET_INFO_MEMBER(get_fore_tile_info);
TILE_GET_INFO_MEMBER(get_mid_tile_info);
TILE_GET_INFO_MEMBER(get_text_tile_info);
uint32_t screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t pri_cb(uint8_t pri, uint8_t ext);
void dcon_map(address_map &map);
void sdgndmps_map(address_map &map);
};
// video
/******************************************************************************/
void dcon_state::gfxbank_w(uint16_t data)
{
if (data & 1)
m_gfx_bank_select = 0x1000;
else
m_gfx_bank_select = 0;
}
void dcon_state::background_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_back_data[offset]);
m_background_layer->mark_tile_dirty(offset);
}
void dcon_state::foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_fore_data[offset]);
m_foreground_layer->mark_tile_dirty(offset);
}
void dcon_state::midground_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_mid_data[offset]);
m_midground_layer->mark_tile_dirty(offset);
}
void dcon_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_textram[offset]);
m_text_layer->mark_tile_dirty(offset);
}
TILE_GET_INFO_MEMBER(dcon_state::get_back_tile_info)
{
int tile = m_back_data[tile_index];
int const color = (tile >> 12) & 0xf;
tile &= 0xfff;
tileinfo.set(1, tile, color, 0);
}
TILE_GET_INFO_MEMBER(dcon_state::get_fore_tile_info)
{
int tile = m_fore_data[tile_index];
int const color = (tile >> 12) & 0xf;
tile &= 0xfff;
tileinfo.set(2, tile, color, 0);
}
TILE_GET_INFO_MEMBER(dcon_state::get_mid_tile_info)
{
int tile = m_mid_data[tile_index];
int const color = (tile >> 12) & 0xf;
tile &= 0xfff;
tileinfo.set(3, tile | m_gfx_bank_select, color, 0);
}
TILE_GET_INFO_MEMBER(dcon_state::get_text_tile_info)
{
int tile = m_textram[tile_index];
int const color = (tile >> 12) & 0xf;
tile &= 0xfff;
tileinfo.set(0, tile, color, 0);
}
void dcon_state::video_start()
{
m_background_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_foreground_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_fore_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_midground_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_mid_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
m_midground_layer->set_transparent_pen(15);
m_foreground_layer->set_transparent_pen(15);
m_text_layer->set_transparent_pen(15);
m_gfx_bank_select = 0;
save_item(NAME(m_gfx_bank_select));
save_item(NAME(m_last_gfx_bank));
save_item(NAME(m_scroll_ram));
save_item(NAME(m_layer_en));
}
uint32_t dcon_state::pri_cb(uint8_t pri, uint8_t ext)
{
switch(pri)
{
case 0: return 0xf0; // above foreground layer
case 1: return 0xfc; // above midground layer
case 2: return 0xfe; // above background layer
case 3:
default: return 0; // above text layer
}
}
uint32_t dcon_state::screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
// Setup the tilemaps
m_background_layer->set_scrollx(0, m_scroll_ram[0]);
m_background_layer->set_scrolly(0, m_scroll_ram[1]);
m_midground_layer->set_scrollx(0, m_scroll_ram[2]);
m_midground_layer->set_scrolly(0, m_scroll_ram[3]);
m_foreground_layer->set_scrollx(0, m_scroll_ram[4]);
m_foreground_layer->set_scrolly(0, m_scroll_ram[5]);
if (BIT(~m_layer_en, 0))
m_background_layer->draw(screen, bitmap, cliprect, 0, 0);
else
bitmap.fill(15, cliprect); // Should always be black, not pen 15
if (BIT(~m_layer_en, 1))
m_midground_layer->draw(screen, bitmap, cliprect, 0, 1);
if (BIT(~m_layer_en, 2))
m_foreground_layer->draw(screen, bitmap, cliprect, 0, 2);
if (BIT(~m_layer_en, 3))
m_text_layer->draw(screen, bitmap, cliprect, 0, 4);
if (BIT(~m_layer_en, 4))
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_spriteram, m_spriteram.bytes());
return 0;
}
uint32_t dcon_state::screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
// Gfx banking
if (m_last_gfx_bank != m_gfx_bank_select)
{
m_midground_layer->mark_all_dirty();
m_last_gfx_bank = m_gfx_bank_select;
}
// Setup the tilemaps
m_background_layer->set_scrollx(0, m_scroll_ram[0] + 128);
m_background_layer->set_scrolly(0, m_scroll_ram[1]);
m_midground_layer->set_scrollx(0, m_scroll_ram[2] + 128);
m_midground_layer->set_scrolly(0, m_scroll_ram[3]);
m_foreground_layer->set_scrollx(0, m_scroll_ram[4] + 128);
m_foreground_layer->set_scrolly(0, m_scroll_ram[5]);
m_text_layer->set_scrollx(0, /*m_scroll_ram[6] + */ 128);
m_text_layer->set_scrolly(0, /*m_scroll_ram[7] + */ 0);
if (BIT(~m_layer_en, 0))
m_background_layer->draw(screen, bitmap, cliprect, 0, 0);
else
bitmap.fill(15, cliprect); // Should always be black, not pen 15
if (BIT(~m_layer_en, 1))
m_midground_layer->draw(screen, bitmap, cliprect, 0, 1);
if (BIT(~m_layer_en, 2))
m_foreground_layer->draw(screen, bitmap, cliprect, 0, 2);
if (BIT(~m_layer_en, 3))
m_text_layer->draw(screen, bitmap, cliprect, 0, 4);
if (BIT(~m_layer_en, 4))
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_spriteram, m_spriteram.bytes());
return 0;
}
// machine
/***************************************************************************/
u8 dcon_state::sdgndmps_sound_comms_r(offs_t offset)
@ -43,12 +300,12 @@ void dcon_state::dcon_map(address_map &map)
map(0x00000, 0x7ffff).rom();
map(0x80000, 0x8bfff).ram();
map(0x8c000, 0x8c7ff).ram().w(FUNC(dcon_state::background_w)).share("back_data");
map(0x8c800, 0x8cfff).ram().w(FUNC(dcon_state::foreground_w)).share("fore_data");
map(0x8d000, 0x8d7ff).ram().w(FUNC(dcon_state::midground_w)).share("mid_data");
map(0x8d800, 0x8e7ff).ram().w(FUNC(dcon_state::text_w)).share("textram");
map(0x8c000, 0x8c7ff).ram().w(FUNC(dcon_state::background_w)).share(m_back_data);
map(0x8c800, 0x8cfff).ram().w(FUNC(dcon_state::foreground_w)).share(m_fore_data);
map(0x8d000, 0x8d7ff).ram().w(FUNC(dcon_state::midground_w)).share(m_mid_data);
map(0x8d800, 0x8e7ff).ram().w(FUNC(dcon_state::text_w)).share(m_textram);
map(0x8e800, 0x8f7ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x8f800, 0x8ffff).ram().share("spriteram");
map(0x8f800, 0x8ffff).ram().share(m_spriteram);
map(0x9d000, 0x9d7ff).w(FUNC(dcon_state::gfxbank_w));
map(0xa0000, 0xa000d).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff);
@ -69,7 +326,7 @@ void dcon_state::sdgndmps_map(address_map &map)
/******************************************************************************/
static INPUT_PORTS_START( common )
SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */
SEIBU_COIN_INPUTS // coin inputs read through sound CPU
PORT_START("P1_P2")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
@ -228,9 +485,9 @@ INPUT_PORTS_END
static const gfx_layout dcon_charlayout =
{
8,8, /* 8*8 characters */
8,8, // 8*8 characters
RGN_FRAC(1,2),
4, /* 4 bits per pixel */
4, // 4 bits per pixel
{ 0,4,(0x10000*8)+0,0x10000*8+4 },
{ 3,2,1,0, 11,10,9,8 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
@ -239,9 +496,9 @@ static const gfx_layout dcon_charlayout =
static const gfx_layout dcon_tilelayout =
{
16,16, /* 16*16 tiles */
16,16, // 16*16 tiles
RGN_FRAC(1,1),
4, /* 4 bits per pixel */
4, // 4 bits per pixel
{ 8, 12, 0,4 },
{
3,2,1,0,19,18,17,16,
@ -280,19 +537,19 @@ void dcon_state::layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask)
void dcon_state::dcon(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 10000000);
// basic machine hardware
M68000(config, m_maincpu, 10'000'000);
m_maincpu->set_addrmap(AS_PROGRAM, &dcon_state::dcon_map);
m_maincpu->set_vblank_int("screen", FUNC(dcon_state::irq4_line_hold));
z80_device &audiocpu(Z80(config, "audiocpu", 4000000)); /* Perhaps 14318180/4? */
z80_device &audiocpu(Z80(config, "audiocpu", 4'000'000)); // Perhaps 14'318'180 / 4?
audiocpu.set_addrmap(AS_PROGRAM, &dcon_state::seibu_sound_map);
audiocpu.set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
/* 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(2500)); /* not accurate */
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
screen.set_size(40*8, 32*8);
screen.set_visarea(0*8, 40*8-1, 0*8, 28*8-1);
screen.set_screen_update(FUNC(dcon_state::screen_update_dcon));
@ -308,14 +565,14 @@ void dcon_state::dcon(machine_config &config)
SEI0211(config, m_spritegen, XTAL(14'318'181), m_palette, gfx_dcon_spr);
m_spritegen->set_pri_callback(FUNC(dcon_state::pri_cb));
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
ym3812_device &ymsnd(YM3812(config, "ymsnd", 4000000));
ym3812_device &ymsnd(YM3812(config, "ymsnd", 4'000'000));
ymsnd.irq_handler().set("seibu_sound", FUNC(seibu_sound_device::fm_irqhandler));
ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
okim6295_device &oki(OKIM6295(config, "oki", 1320000, okim6295_device::PIN7_LOW));
okim6295_device &oki(OKIM6295(config, "oki", 1'320'000, okim6295_device::PIN7_LOW));
oki.add_route(ALL_OUTPUTS, "mono", 0.40);
SEIBU_SOUND(config, m_seibu_sound, 0);
@ -326,21 +583,21 @@ void dcon_state::dcon(machine_config &config)
m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write));
}
void dcon_state::sdgndmps(machine_config &config) /* PCB number is PB91008 */
void dcon_state::sdgndmps(machine_config &config) // PCB number is PB91008
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(20'000'000)/2);
// basic machine hardware
M68000(config, m_maincpu, XTAL(20'000'000) / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &dcon_state::sdgndmps_map);
m_maincpu->set_vblank_int("screen", FUNC(dcon_state::irq4_line_hold));
z80_device &audiocpu(Z80(config, "audiocpu", XTAL(14'318'181)/4));
z80_device &audiocpu(Z80(config, "audiocpu", XTAL(14'318'181) / 4));
audiocpu.set_addrmap(AS_PROGRAM, &dcon_state::seibu_sound_map);
audiocpu.set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
/* 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(2500)); /* not accurate */
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
screen.set_size(40*8, 32*8);
screen.set_visarea(0*8, 40*8-1, 2*8, 30*8-1);
screen.set_screen_update(FUNC(dcon_state::screen_update_sdgndmps));
@ -356,15 +613,15 @@ void dcon_state::sdgndmps(machine_config &config) /* PCB number is PB91008 */
SEI0211(config, m_spritegen, XTAL(14'318'181), m_palette, gfx_dcon_spr);
m_spritegen->set_pri_callback(FUNC(dcon_state::pri_cb));
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181)/4));
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181) / 4));
ymsnd.irq_handler().set(m_seibu_sound, FUNC(seibu_sound_device::fm_irqhandler));
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.50);
okim6295_device &oki(OKIM6295(config, "oki", XTAL(20'000'000)/16, okim6295_device::PIN7_LOW)); /* 1.25Mhz? unverified clock & divisor (was 1320000) */
okim6295_device &oki(OKIM6295(config, "oki", XTAL(20'000'000) / 16, okim6295_device::PIN7_LOW)); // 1.25Mhz? unverified clock & divisor (was 1320000)
oki.add_route(ALL_OUTPUTS, "mono", 0.40);
SEIBU_SOUND(config, m_seibu_sound, 0);
@ -384,48 +641,48 @@ ROM_START( dcon )
ROM_LOAD16_BYTE("p1-0", 0x040000, 0x20000, CRC(3ec1ef7d) SHA1(6195f1402dba5b3d3913e97cd78ba1e8865f7692) )
ROM_LOAD16_BYTE("p1-1", 0x040001, 0x20000, CRC(4b8de320) SHA1(14a3ab347fc468869355951294c3e3a8f9211b6a) )
ROM_REGION( 0x20000, "audiocpu", 0 ) /* 64k code for sound Z80 */
ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "fmsnd", 0x000000, 0x08000, CRC(50450faa) SHA1(d4add7d357951b51d53ed7f143ece7f3bde7f4cb) )
ROM_CONTINUE( 0x010000, 0x08000 )
ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 )
ROM_CONTINUE( 0x010000, 0x08000 )
ROM_COPY( "audiocpu", 0x000000, 0x18000, 0x08000 )
ROM_REGION( 0x020000, "txtiles", 0 )
ROM_LOAD( "fix0", 0x000000, 0x10000, CRC(ab30061f) SHA1(14dba37fef7bd13c827fd542b24cc593dcdc9f99) ) /* chars */
ROM_LOAD( "fix0", 0x000000, 0x10000, CRC(ab30061f) SHA1(14dba37fef7bd13c827fd542b24cc593dcdc9f99) )
ROM_LOAD( "fix1", 0x010000, 0x10000, CRC(a0582115) SHA1(498d6e4f631a5dfe54d5c2813c47d40c466b694d) )
ROM_REGION( 0x080000, "bgtiles", 0 )
ROM_LOAD( "bg1", 0x000000, 0x80000, CRC(eac43283) SHA1(f5d384c98751002416013a9a920e2ab2cea61cb1) ) /* tiles */
ROM_LOAD( "bg1", 0x000000, 0x80000, CRC(eac43283) SHA1(f5d384c98751002416013a9a920e2ab2cea61cb1) )
ROM_REGION( 0x080000, "fgtiles", 0 )
ROM_LOAD( "bg3", 0x000000, 0x80000, CRC(1408a1e0) SHA1(d96fb8a60af02df313ffc9e0284611d7ca50540d) ) /* tiles */
ROM_LOAD( "bg3", 0x000000, 0x80000, CRC(1408a1e0) SHA1(d96fb8a60af02df313ffc9e0284611d7ca50540d) )
ROM_REGION( 0x080000, "mgtiles", 0 )
ROM_LOAD( "bg2", 0x000000, 0x80000, CRC(01864eb6) SHA1(78f755d7462a787bd1a378184e8fce8fa889f258) ) /* tiles */
ROM_LOAD( "bg2", 0x000000, 0x80000, CRC(01864eb6) SHA1(78f755d7462a787bd1a378184e8fce8fa889f258) )
ROM_REGION( 0x200000, "sprites", 0 )
ROM_LOAD( "obj0", 0x000000, 0x80000, CRC(c3af37db) SHA1(7d6ee07b6302aaec8d792faf78a37898a2ac3c4e) ) /* sprites */
ROM_LOAD( "obj0", 0x000000, 0x80000, CRC(c3af37db) SHA1(7d6ee07b6302aaec8d792faf78a37898a2ac3c4e) )
ROM_LOAD( "obj1", 0x080000, 0x80000, CRC(be1f53ba) SHA1(061b80487e6c4040618af6ed9c5315fba44f5d0c) )
ROM_LOAD( "obj2", 0x100000, 0x80000, CRC(24e0b51c) SHA1(434b4d58f785eefb5380c08a0704c8dea6609268) )
ROM_LOAD( "obj3", 0x180000, 0x80000, CRC(5274f02d) SHA1(69b94363624177c92e1b3413244ce649c2e5a696) )
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "pcm", 0x000000, 0x20000, CRC(d2133b85) SHA1(a2e61c9893da8a95c35c0b47e2c43c315b654de8) )
ROM_END
ROM_START( sdgndmps )
ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */
ROM_REGION( 0x80000, "maincpu", 0 )
ROM_LOAD16_BYTE( "911-a01.25", 0x00000, 0x20000, CRC(3362915d) SHA1(d98e2d4de402ca549664e148c9a6fe94fccfd5e9) )
ROM_LOAD16_BYTE( "911-a02.29", 0x00001, 0x20000, CRC(fbc78285) SHA1(85d40b0e7bb923a0daacbd78ce7d5bb9c80b9ffc) )
ROM_LOAD16_BYTE( "911-a03.27", 0x40000, 0x20000, CRC(6c24b4f2) SHA1(e9fb82884f47694bebcad9254cb57a0b01dcd9c8) )
ROM_LOAD16_BYTE( "911-a04.28", 0x40001, 0x20000, CRC(6ff9d716) SHA1(303faec19a84afd6cbcf3ca5d4877693c11d406e) )
ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 code, banked data */
ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "911-a05.010", 0x00000, 0x08000, CRC(90455406) SHA1(dd2c5b96ac4b51251a3d34d97cc9af360afaa38c) )
ROM_CONTINUE( 0x10000, 0x08000 )
ROM_COPY( "audiocpu", 0x000000, 0x18000, 0x08000 )
ROM_COPY( "audiocpu", 0x00000, 0x18000, 0x08000 )
ROM_REGION( 0x020000, "txtiles", 0 )
ROM_LOAD( "911-a08.66", 0x000000, 0x10000, CRC(e7e04823) SHA1(d9b1ace5cd8218d5a4767cf5adbc267dce7c0668) ) /* chars */
ROM_LOAD( "911-a08.66", 0x000000, 0x10000, CRC(e7e04823) SHA1(d9b1ace5cd8218d5a4767cf5adbc267dce7c0668) )
ROM_LOAD( "911-a07.73", 0x010000, 0x10000, CRC(6f40d4a9) SHA1(8abadb2dc07ac22081b2970358e9f92b90b174b0) )
ROM_REGION( 0x080000, "bgtiles", 0 )
@ -438,16 +695,19 @@ ROM_START( sdgndmps )
ROM_LOAD( "911-a13.64", 0x000000, 0x100000, CRC(f38a584a) SHA1(16dd8e7086949d14e9185c37313290024d6dafdc) )
ROM_REGION( 0x200000, "sprites", 0 )
ROM_LOAD( "911-a10.73", 0x000000, 0x100000, CRC(80e341fb) SHA1(619e71aefd0b13a01a6a2ed5d8613fe56242d209) ) /* sprites */
ROM_LOAD( "911-a10.73", 0x000000, 0x100000, CRC(80e341fb) SHA1(619e71aefd0b13a01a6a2ed5d8613fe56242d209) )
ROM_LOAD( "911-a09.74", 0x100000, 0x100000, CRC(98f34519) SHA1(20319d546df104485ee553ce0e58364f927d1135) )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_REGION( 0x040000, "oki", 0 )
ROM_LOAD( "911-a06.97", 0x00000, 0x40000, CRC(12c79440) SHA1(9e9987527f64dfd8a51a2ab49afc465e76c5e7ac) )
ROM_REGION( 512, "proms", 0 )
ROM_LOAD( "bnd-007.88", 0x00000, 512, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "bnd-007.88", 0x000, 0x200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) // Priority
ROM_END
} // anonymous namespace
/***************************************************************************/
GAME( 1991, sdgndmps, 0, sdgndmps, sdgndmps, dcon_state, empty_init, ROT0, "Banpresto / Bandai", "SD Gundam Psycho Salamander no Kyoui", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )

View File

@ -1,82 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
#ifndef MAME_SEIBU_DCON_H
#define MAME_SEIBU_DCON_H
#pragma once
#include "sei021x_sei0220_spr.h"
#include "seibusound.h"
#include "emupal.h"
#include "tilemap.h"
class dcon_state : public driver_device, public seibu_sound_common
{
public:
dcon_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_seibu_sound(*this, "seibu_sound"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_spritegen(*this, "spritegen"),
m_back_data(*this, "back_data"),
m_fore_data(*this, "fore_data"),
m_mid_data(*this, "mid_data"),
m_textram(*this, "textram"),
m_spriteram(*this, "spriteram")
{ }
void dcon(machine_config &config);
void sdgndmps(machine_config &config);
private:
required_device<cpu_device> m_maincpu;
required_device<seibu_sound_device> m_seibu_sound;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<sei0211_device> m_spritegen;
required_shared_ptr<uint16_t> m_back_data;
required_shared_ptr<uint16_t> m_fore_data;
required_shared_ptr<uint16_t> m_mid_data;
required_shared_ptr<uint16_t> m_textram;
required_shared_ptr<uint16_t> m_spriteram;
tilemap_t *m_background_layer = nullptr;
tilemap_t *m_foreground_layer = nullptr;
tilemap_t *m_midground_layer = nullptr;
tilemap_t *m_text_layer = nullptr;
int m_gfx_bank_select = 0;
int m_last_gfx_bank = 0;
uint16_t m_scroll_ram[6]{};
uint16_t m_layer_en = 0U;
u8 sdgndmps_sound_comms_r(offs_t offset);
void layer_en_w(uint16_t data);
void layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void gfxbank_w(uint16_t data);
void background_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void midground_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
TILE_GET_INFO_MEMBER(get_back_tile_info);
TILE_GET_INFO_MEMBER(get_fore_tile_info);
TILE_GET_INFO_MEMBER(get_mid_tile_info);
TILE_GET_INFO_MEMBER(get_text_tile_info);
virtual void video_start() override;
uint32_t screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t pri_cb(uint8_t pri, uint8_t ext);
void dcon_map(address_map &map);
void sdgndmps_map(address_map &map);
};
#endif // MAME_SEIBU_DCON_H

View File

@ -1,202 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
/***************************************************************************
D-Con video hardware.
***************************************************************************/
#include "emu.h"
#include "dcon.h"
#include "screen.h"
/******************************************************************************/
void dcon_state::gfxbank_w(uint16_t data)
{
if (data&1)
m_gfx_bank_select=0x1000;
else
m_gfx_bank_select=0;
}
void dcon_state::background_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_back_data[offset]);
m_background_layer->mark_tile_dirty(offset);
}
void dcon_state::foreground_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_fore_data[offset]);
m_foreground_layer->mark_tile_dirty(offset);
}
void dcon_state::midground_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_mid_data[offset]);
m_midground_layer->mark_tile_dirty(offset);
}
void dcon_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_textram[offset]);
m_text_layer->mark_tile_dirty(offset);
}
TILE_GET_INFO_MEMBER(dcon_state::get_back_tile_info)
{
int tile=m_back_data[tile_index];
int color=(tile>>12)&0xf;
tile&=0xfff;
tileinfo.set(1,
tile,
color,
0);
}
TILE_GET_INFO_MEMBER(dcon_state::get_fore_tile_info)
{
int tile=m_fore_data[tile_index];
int color=(tile>>12)&0xf;
tile&=0xfff;
tileinfo.set(2,
tile,
color,
0);
}
TILE_GET_INFO_MEMBER(dcon_state::get_mid_tile_info)
{
int tile=m_mid_data[tile_index];
int color=(tile>>12)&0xf;
tile&=0xfff;
tileinfo.set(3,
tile|m_gfx_bank_select,
color,
0);
}
TILE_GET_INFO_MEMBER(dcon_state::get_text_tile_info)
{
int tile = m_textram[tile_index];
int color=(tile>>12)&0xf;
tile&=0xfff;
tileinfo.set(0,
tile,
color,
0);
}
void dcon_state::video_start()
{
m_background_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_back_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_foreground_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_fore_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_midground_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_mid_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dcon_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
m_midground_layer->set_transparent_pen(15);
m_foreground_layer->set_transparent_pen(15);
m_text_layer->set_transparent_pen(15);
m_gfx_bank_select = 0;
save_item(NAME(m_gfx_bank_select));
save_item(NAME(m_last_gfx_bank));
save_item(NAME(m_scroll_ram));
save_item(NAME(m_layer_en));
}
uint32_t dcon_state::pri_cb(uint8_t pri, uint8_t ext)
{
switch(pri)
{
case 0: return 0xf0; // above foreground layer
case 1: return 0xfc; // above midground layer
case 2: return 0xfe; // above background layer
case 3:
default: return 0; // above text layer
}
}
uint32_t dcon_state::screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
/* Setup the tilemaps */
m_background_layer->set_scrollx(0, m_scroll_ram[0] );
m_background_layer->set_scrolly(0, m_scroll_ram[1] );
m_midground_layer->set_scrollx(0, m_scroll_ram[2] );
m_midground_layer->set_scrolly(0, m_scroll_ram[3] );
m_foreground_layer->set_scrollx(0, m_scroll_ram[4] );
m_foreground_layer->set_scrolly(0, m_scroll_ram[5] );
if (BIT(~m_layer_en, 0))
m_background_layer->draw(screen, bitmap, cliprect, 0,0);
else
bitmap.fill(15, cliprect); /* Should always be black, not pen 15 */
if (BIT(~m_layer_en, 1))
m_midground_layer->draw(screen, bitmap, cliprect, 0,1);
if (BIT(~m_layer_en, 2))
m_foreground_layer->draw(screen, bitmap, cliprect, 0,2);
if (BIT(~m_layer_en, 3))
m_text_layer->draw(screen, bitmap, cliprect, 0,4);
if (BIT(~m_layer_en, 4))
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_spriteram, m_spriteram.bytes());
return 0;
}
uint32_t dcon_state::screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
/* Gfx banking */
if (m_last_gfx_bank!=m_gfx_bank_select)
{
m_midground_layer->mark_all_dirty();
m_last_gfx_bank=m_gfx_bank_select;
}
/* Setup the tilemaps */
m_background_layer->set_scrollx(0, m_scroll_ram[0]+128 );
m_background_layer->set_scrolly(0, m_scroll_ram[1] );
m_midground_layer->set_scrollx(0, m_scroll_ram[2]+128 );
m_midground_layer->set_scrolly(0, m_scroll_ram[3] );
m_foreground_layer->set_scrollx(0, m_scroll_ram[4]+128 );
m_foreground_layer->set_scrolly(0, m_scroll_ram[5] );
m_text_layer->set_scrollx(0, /*m_scroll_ram[6] + */ 128 );
m_text_layer->set_scrolly(0, /*m_scroll_ram[7] + */ 0 );
if (BIT(~m_layer_en, 0))
m_background_layer->draw(screen, bitmap, cliprect, 0,0);
else
bitmap.fill(15, cliprect); /* Should always be black, not pen 15 */
if (BIT(~m_layer_en, 1))
m_midground_layer->draw(screen, bitmap, cliprect, 0,1);
if (BIT(~m_layer_en, 2))
m_foreground_layer->draw(screen, bitmap, cliprect, 0,2);
if (BIT(~m_layer_en, 3))
m_text_layer->draw(screen, bitmap, cliprect, 0,4);
if (BIT(~m_layer_en, 4))
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_spriteram, m_spriteram.bytes());
return 0;
}