mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
Move SEI80BU encryption out of the SEIBU_SOUND device and make it a device of its own
Add MCFG_DEVICE_ROM to override region tag for device_rom_interface (nw)
This commit is contained in:
parent
2aeab228e8
commit
4c9814ab30
@ -3,6 +3,7 @@
|
||||
|
||||
device_rom_interface::device_rom_interface(const machine_config &mconfig, device_t &device, u8 addrwidth, endianness_t endian, u8 datawidth) :
|
||||
device_memory_interface(mconfig, device),
|
||||
m_rom_tag(device.basetag()),
|
||||
m_rom_config("rom", endian, datawidth, addrwidth)
|
||||
{
|
||||
}
|
||||
@ -11,6 +12,15 @@ device_rom_interface::~device_rom_interface()
|
||||
{
|
||||
}
|
||||
|
||||
void device_rom_interface::static_set_device_rom_tag(device_t &device, const char *tag)
|
||||
{
|
||||
device_rom_interface *romintf;
|
||||
if (!device.interface(romintf))
|
||||
throw emu_fatalerror("MCFG_DEVICE_ROM called on device '%s' with no ROM interface\n", device.tag());
|
||||
|
||||
romintf->m_rom_tag = tag;
|
||||
}
|
||||
|
||||
const address_space_config *device_rom_interface::memory_space_config(address_spacenum spacenum) const
|
||||
{
|
||||
return spacenum ? nullptr : &m_rom_config;
|
||||
@ -81,10 +91,11 @@ void device_rom_interface::interface_pre_start()
|
||||
device().machine().save().register_postload(save_prepost_delegate(FUNC(device_rom_interface::reset_bank), this));
|
||||
|
||||
if(!has_configured_map(0)) {
|
||||
memory_region *reg = device().memregion(DEVICE_SELF);
|
||||
memory_region *reg = device().owner()->memregion(m_rom_tag);
|
||||
if(reg)
|
||||
set_rom(reg->base(), reg->bytes());
|
||||
else {
|
||||
device().logerror("ROM region '%s' not found\n", m_rom_tag);
|
||||
u32 end = m_rom_config.addr_width() == 32 ? 0xffffffff : (1 << m_rom_config.addr_width()) - 1;
|
||||
space().unmap_read(0, end);
|
||||
}
|
||||
|
@ -17,12 +17,17 @@
|
||||
#ifndef MAME_EMU_DIROM_H
|
||||
#define MAME_EMU_DIROM_H
|
||||
|
||||
#define MCFG_DEVICE_ROM(_rom_tag) \
|
||||
device_rom_interface::static_set_device_rom_tag(*device, _rom_tag);
|
||||
|
||||
class device_rom_interface : public device_memory_interface
|
||||
{
|
||||
public:
|
||||
device_rom_interface(const machine_config &mconfig, device_t &device, u8 addrwidth, endianness_t endian = ENDIANNESS_LITTLE, u8 datawidth = 8);
|
||||
virtual ~device_rom_interface();
|
||||
|
||||
static void static_set_device_rom_tag(device_t &device, const char *tag);
|
||||
|
||||
inline u8 read_byte(offs_t byteaddress) { return m_rom_direct->read_byte(byteaddress); }
|
||||
inline u16 read_word(offs_t byteaddress) { return m_rom_direct->read_word(byteaddress); }
|
||||
inline u32 read_dword(offs_t byteaddress) { return m_rom_direct->read_dword(byteaddress); }
|
||||
@ -35,6 +40,7 @@ protected:
|
||||
virtual void rom_bank_updated() = 0;
|
||||
|
||||
private:
|
||||
const char *m_rom_tag;
|
||||
const address_space_config m_rom_config;
|
||||
direct_read_data *m_rom_direct;
|
||||
|
||||
|
@ -84,15 +84,12 @@ seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char
|
||||
m_rst10_irq(0xff),
|
||||
m_rst18_irq(0xff)
|
||||
{
|
||||
m_encryption_mode = 0;
|
||||
m_decrypted_opcodes = nullptr;
|
||||
}
|
||||
|
||||
void seibu_sound_device::set_cpu_tag_and_encryption(device_t &device, const char *tag, int mode)
|
||||
void seibu_sound_device::static_set_cpu_tag(device_t &device, const char *tag)
|
||||
{
|
||||
downcast<seibu_sound_device &>(device).m_sound_cpu.set_tag(tag);
|
||||
downcast<seibu_sound_device &>(device).m_sound_rom.set_tag(tag);
|
||||
downcast<seibu_sound_device &>(device).m_encryption_mode = mode;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -104,6 +101,8 @@ void seibu_sound_device::device_start()
|
||||
m_ym_read_cb.resolve_safe(0);
|
||||
m_ym_write_cb.resolve_safe();
|
||||
|
||||
if (m_sound_rom.found() && membank(":seibu_bank1") != nullptr)
|
||||
{
|
||||
if (m_sound_rom.length() > 0x10000)
|
||||
{
|
||||
membank(":seibu_bank1")->configure_entries(0, (m_sound_rom.length() - 0x10000) / 0x8000, &m_sound_rom[0x10000], 0x8000);
|
||||
@ -112,21 +111,6 @@ void seibu_sound_device::device_start()
|
||||
membank(":seibu_bank1")->set_entry(0);
|
||||
} else
|
||||
membank(":seibu_bank1")->set_base(&m_sound_rom[0x8000]);
|
||||
|
||||
switch(m_encryption_mode) {
|
||||
case 0: break;
|
||||
case 3: break;
|
||||
|
||||
case 1:
|
||||
get_custom_decrypt();
|
||||
memcpy(m_decrypted_opcodes.get(), &m_sound_rom[0], m_sound_rom.length());
|
||||
apply_decrypt(&m_sound_rom[0], m_decrypted_opcodes.get(), 0x2000);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
get_custom_decrypt();
|
||||
apply_decrypt(&m_sound_rom[0], m_decrypted_opcodes.get(), m_sound_rom.length());
|
||||
break;
|
||||
}
|
||||
|
||||
m_main2sub[0] = m_main2sub[1] = 0;
|
||||
@ -149,67 +133,6 @@ void seibu_sound_device::device_reset()
|
||||
update_irq_lines(VECTOR_INIT);
|
||||
}
|
||||
|
||||
static uint8_t decrypt_data(int a,int src)
|
||||
{
|
||||
if ( BIT(a,9) & BIT(a,8)) src ^= 0x80;
|
||||
if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40;
|
||||
if ( BIT(a,11) & ~BIT(a,8) & BIT(a,1)) src ^= 0x04;
|
||||
if ( BIT(a,13) & ~BIT(a,6) & BIT(a,4)) src ^= 0x02;
|
||||
if (~BIT(a,11) & BIT(a,9) & BIT(a,2)) src ^= 0x01;
|
||||
|
||||
if (BIT(a,13) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,3,2,0,1);
|
||||
if (BIT(a, 8) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,2,3,1,0);
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
static uint8_t decrypt_opcode(int a,int src)
|
||||
{
|
||||
if ( BIT(a,9) & BIT(a,8)) src ^= 0x80;
|
||||
if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40;
|
||||
if (~BIT(a,13) & BIT(a,12)) src ^= 0x20;
|
||||
if (~BIT(a,6) & BIT(a,1)) src ^= 0x10;
|
||||
if (~BIT(a,12) & BIT(a,2)) src ^= 0x08;
|
||||
if ( BIT(a,11) & ~BIT(a,8) & BIT(a,1)) src ^= 0x04;
|
||||
if ( BIT(a,13) & ~BIT(a,6) & BIT(a,4)) src ^= 0x02;
|
||||
if (~BIT(a,11) & BIT(a,9) & BIT(a,2)) src ^= 0x01;
|
||||
|
||||
if (BIT(a,13) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,3,2,0,1);
|
||||
if (BIT(a, 8) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,2,3,1,0);
|
||||
if (BIT(a,12) & BIT(a,9)) src = BITSWAP8(src,7,6,4,5,3,2,1,0);
|
||||
if (BIT(a,11) & ~BIT(a,6)) src = BITSWAP8(src,6,7,5,4,3,2,1,0);
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
uint8_t *seibu_sound_device::get_custom_decrypt()
|
||||
{
|
||||
if (m_decrypted_opcodes)
|
||||
return m_decrypted_opcodes.get();
|
||||
|
||||
int size = memregion(":audiocpu")->bytes();
|
||||
m_decrypted_opcodes = make_unique_clear<uint8_t[]>(size);
|
||||
membank(":seibu_bank0d")->set_base(m_decrypted_opcodes.get());
|
||||
if (size > 0x10000) {
|
||||
membank(":seibu_bank1d")->configure_entries(0, (size - 0x10000) / 0x8000, m_decrypted_opcodes.get() + 0x10000, 0x8000);
|
||||
membank(":seibu_bank1d")->set_entry(0);
|
||||
} else
|
||||
membank(":seibu_bank1d")->set_base(m_decrypted_opcodes.get() + 0x8000);
|
||||
|
||||
return m_decrypted_opcodes.get();
|
||||
}
|
||||
|
||||
void seibu_sound_device::apply_decrypt(uint8_t *rom, uint8_t *opcodes, int length)
|
||||
{
|
||||
for (int i = 0;i < length;i++)
|
||||
{
|
||||
uint8_t src = rom[i];
|
||||
|
||||
rom[i] = decrypt_data(i,src);
|
||||
opcodes[i] = decrypt_opcode(i,src);
|
||||
}
|
||||
}
|
||||
|
||||
void seibu_sound_device::update_irq_lines(int param)
|
||||
{
|
||||
// note: we use 0xff here for inactive irqline
|
||||
@ -283,8 +206,6 @@ WRITE8_MEMBER( seibu_sound_device::ym_w )
|
||||
WRITE8_MEMBER( seibu_sound_device::bank_w )
|
||||
{
|
||||
membank(":seibu_bank1")->set_entry(data & 1);
|
||||
if (m_decrypted_opcodes)
|
||||
membank(":seibu_bank1d")->set_entry(data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( seibu_sound_device::coin_w )
|
||||
@ -372,11 +293,6 @@ WRITE16_MEMBER( seibu_sound_device::main_mustb_w )
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
ADDRESS_MAP_START( seibu_sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, seibu_sound_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROMBANK("seibu_bank0d")
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1d")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
ADDRESS_MAP_START( seibu_sound_map, AS_PROGRAM, 8, seibu_sound_device )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
@ -395,6 +311,55 @@ ADDRESS_MAP_START( seibu_sound_map, AS_PROGRAM, 8, seibu_sound_device )
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
const device_type SEI80BU = &device_creator<sei80bu_device>;
|
||||
|
||||
sei80bu_device::sei80bu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, SEI80BU, "SEI80BU Encrypted Z80 Interface", tag, owner, clock, "sei80bu", __FILE__),
|
||||
device_rom_interface(mconfig, *this, 16)
|
||||
{
|
||||
}
|
||||
|
||||
READ8_MEMBER(sei80bu_device::data_r)
|
||||
{
|
||||
u16 a = offset;
|
||||
u8 src = read_byte(offset);
|
||||
|
||||
if ( BIT(a,9) & BIT(a,8)) src ^= 0x80;
|
||||
if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40;
|
||||
if ( BIT(a,11) & ~BIT(a,8) & BIT(a,1)) src ^= 0x04;
|
||||
if ( BIT(a,13) & ~BIT(a,6) & BIT(a,4)) src ^= 0x02;
|
||||
if (~BIT(a,11) & BIT(a,9) & BIT(a,2)) src ^= 0x01;
|
||||
|
||||
if (BIT(a,13) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,3,2,0,1);
|
||||
if (BIT(a, 8) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,2,3,1,0);
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sei80bu_device::opcode_r)
|
||||
{
|
||||
u16 a = offset;
|
||||
u8 src = read_byte(offset);
|
||||
|
||||
if ( BIT(a,9) & BIT(a,8)) src ^= 0x80;
|
||||
if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40;
|
||||
if (~BIT(a,13) & BIT(a,12)) src ^= 0x20;
|
||||
if (~BIT(a,6) & BIT(a,1)) src ^= 0x10;
|
||||
if (~BIT(a,12) & BIT(a,2)) src ^= 0x08;
|
||||
if ( BIT(a,11) & ~BIT(a,8) & BIT(a,1)) src ^= 0x04;
|
||||
if ( BIT(a,13) & ~BIT(a,6) & BIT(a,4)) src ^= 0x02;
|
||||
if (~BIT(a,11) & BIT(a,9) & BIT(a,2)) src ^= 0x01;
|
||||
|
||||
if (BIT(a,13) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,3,2,0,1);
|
||||
if (BIT(a, 8) & BIT(a,4)) src = BITSWAP8(src,7,6,5,4,2,3,1,0);
|
||||
if (BIT(a,12) & BIT(a,9)) src = BITSWAP8(src,7,6,4,5,3,2,1,0);
|
||||
if (BIT(a,11) & ~BIT(a,6)) src = BITSWAP8(src,6,7,5,4,3,2,1,0);
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Seibu ADPCM device
|
||||
(MSM5205 with interface to sample ROM provided by YM3931)
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/okiadpcm.h"
|
||||
|
||||
ADDRESS_MAP_EXTERN(seibu_sound_decrypted_opcodes_map, 8);
|
||||
ADDRESS_MAP_EXTERN(seibu_sound_map, 8);
|
||||
|
||||
class seibu_sound_device : public device_t
|
||||
@ -38,7 +37,7 @@ public:
|
||||
~seibu_sound_device() {}
|
||||
|
||||
// static configuration
|
||||
static void set_cpu_tag_and_encryption(device_t &device, const char *tag, int mode);
|
||||
static void static_set_cpu_tag(device_t &device, const char *tag);
|
||||
template<class _Object> static devcb_base &set_ym_read_callback(device_t &device, _Object object) { return downcast<seibu_sound_device &>(device).m_ym_read_cb.set_callback(object); }
|
||||
template<class _Object> static devcb_base &set_ym_write_callback(device_t &device, _Object object) { return downcast<seibu_sound_device &>(device).m_ym_write_cb.set_callback(object); }
|
||||
|
||||
@ -58,8 +57,6 @@ public:
|
||||
DECLARE_WRITE8_MEMBER( main_data_w );
|
||||
DECLARE_WRITE8_MEMBER( pending_w );
|
||||
|
||||
static void apply_decrypt(uint8_t *rom, uint8_t *opcodes, int length);
|
||||
uint8_t *get_custom_decrypt();
|
||||
void update_irq_lines(int param);
|
||||
|
||||
protected:
|
||||
@ -68,16 +65,13 @@ protected:
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
int m_encryption_mode;
|
||||
std::unique_ptr<uint8_t[]> m_decrypted_opcodes;
|
||||
|
||||
// device callbacks
|
||||
devcb_read8 m_ym_read_cb;
|
||||
devcb_write8 m_ym_write_cb;
|
||||
|
||||
// internal state
|
||||
required_device<cpu_device> m_sound_cpu;
|
||||
required_region_ptr<uint8_t> m_sound_rom;
|
||||
optional_region_ptr<uint8_t> m_sound_rom;
|
||||
uint8_t m_main2sub[2];
|
||||
uint8_t m_sub2main[2];
|
||||
int m_main2sub_pending;
|
||||
@ -98,6 +92,24 @@ private:
|
||||
extern const device_type SEIBU_SOUND;
|
||||
|
||||
|
||||
// SEI80BU (Z80 program decryption)
|
||||
|
||||
class sei80bu_device : public device_t, public device_rom_interface
|
||||
{
|
||||
public:
|
||||
sei80bu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
DECLARE_READ8_MEMBER(data_r);
|
||||
DECLARE_READ8_MEMBER(opcode_r);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override { }
|
||||
virtual void rom_bank_updated() override { }
|
||||
};
|
||||
|
||||
extern const device_type SEI80BU;
|
||||
|
||||
// Seibu ADPCM device
|
||||
|
||||
class seibu_adpcm_device : public device_t,
|
||||
@ -156,16 +168,7 @@ extern const device_type SEIBU_ADPCM;
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
#define MCFG_SEIBU_SOUND_CPU(_audiocputag) \
|
||||
seibu_sound_device::set_cpu_tag_and_encryption(*device, "^" _audiocputag, 0);
|
||||
|
||||
#define MCFG_SEIBU_SOUND_CPU_ENCRYPTED_LOW(_audiocputag) \
|
||||
seibu_sound_device::set_cpu_tag_and_encryption(*device, "^" _audiocputag, 1);
|
||||
|
||||
#define MCFG_SEIBU_SOUND_CPU_ENCRYPTED_FULL(_audiocputag) \
|
||||
seibu_sound_device::set_cpu_tag_and_encryption(*device, "^" _audiocputag, 2);
|
||||
|
||||
#define MCFG_SEIBU_SOUND_CPU_ENCRYPTED_CUSTOM(_audiocputag) \
|
||||
seibu_sound_device::set_cpu_tag_and_encryption(*device, "^" _audiocputag, 3);
|
||||
seibu_sound_device::static_set_cpu_tag(*device, "^" _audiocputag);
|
||||
|
||||
#define MCFG_SEIBU_SOUND_YM_READ_CB(_devcb) \
|
||||
devcb = &seibu_sound_device::set_ym_read_callback(*device, DEVCB_##_devcb);
|
||||
|
@ -279,7 +279,7 @@ static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, airrai
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( airraid_sound_map, AS_PROGRAM, 8, airraid_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("seibu_sound", seibu_sound_device, pending_w)
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
@ -295,6 +295,11 @@ static ADDRESS_MAP_START( airraid_sound_map, AS_PROGRAM, 8, airraid_state )
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( airraid_sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, airraid_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( airraid )
|
||||
PORT_START("IN0") /* IN0 (0xc200) */
|
||||
@ -388,7 +393,7 @@ static MACHINE_CONFIG_START( airraid, airraid_state )
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz/4) /* verified on pcb */
|
||||
MCFG_CPU_PROGRAM_MAP(airraid_sound_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(airraid_sound_decrypted_opcodes_map)
|
||||
|
||||
MCFG_QUANTUM_PERFECT_CPU("maincpu")
|
||||
|
||||
@ -406,9 +411,12 @@ static MACHINE_CONFIG_START( airraid, airraid_state )
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.50)
|
||||
|
||||
MCFG_DEVICE_ADD("seibu_sound", SEIBU_SOUND, 0)
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_LOW("audiocpu")
|
||||
MCFG_SEIBU_SOUND_CPU("audiocpu") //_ENCRYPTED_LOW("audiocpu")
|
||||
MCFG_SEIBU_SOUND_YM_READ_CB(DEVREAD8("ymsnd", ym2151_device, read))
|
||||
MCFG_SEIBU_SOUND_YM_WRITE_CB(DEVWRITE8("ymsnd", ym2151_device, write))
|
||||
|
||||
MCFG_DEVICE_ADD("sei80bu", SEI80BU, 0)
|
||||
MCFG_DEVICE_ROM("audiocpu")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -450,9 +458,9 @@ ROM_START( airraid )
|
||||
ROM_REGION( 0x10000, "maindata", 0 ) // cpu data
|
||||
ROM_LOAD( "2.19j", 0x00000, 0x10000, CRC(842ae6c2) SHA1(0468445e4ab6f42bac786f9a258df3972fd1fde9) )
|
||||
|
||||
ROM_REGION( 0x18000, "audiocpu", 0 ) // Sub/Sound CPU
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) // Sub/Sound CPU
|
||||
ROM_LOAD( "5.6f", 0x00000, 0x02000, CRC(30be398c) SHA1(6c61200ee8888d6270c8cec50423b3b5602c2027) )
|
||||
ROM_LOAD( "4.7f", 0x10000, 0x08000, CRC(3cd715b4) SHA1(da735fb5d262908ddf7ed7dacdea68899f1723ff) )
|
||||
ROM_LOAD( "4.7f", 0x08000, 0x08000, CRC(3cd715b4) SHA1(da735fb5d262908ddf7ed7dacdea68899f1723ff) )
|
||||
|
||||
ROM_REGION( 0x0200, "proms", 0 ) // this PCB type has different proms when compared to the cshootert hardware PCB where they were dumped
|
||||
ROM_LOAD( "pr.c19", 0x0000, 0x0200, NO_DUMP )
|
||||
@ -533,9 +541,9 @@ ROM_START( cshooter )
|
||||
ROM_REGION( 0x10000, "maindata", 0 ) // cpu data
|
||||
ROM_LOAD( "2.k20", 0x00000, 0x10000, CRC(5812fe72) SHA1(3b28bff6b62a411d2195bb228952db62ad32ef3d) )
|
||||
|
||||
ROM_REGION( 0x18000, "audiocpu", 0 ) // Sub/Sound CPU
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) // Sub/Sound CPU
|
||||
ROM_LOAD( "5.6f", 0x00000, 0x02000, CRC(30be398c) SHA1(6c61200ee8888d6270c8cec50423b3b5602c2027) ) // 5.g6
|
||||
ROM_LOAD( "4.7f", 0x10000, 0x08000, CRC(3cd715b4) SHA1(da735fb5d262908ddf7ed7dacdea68899f1723ff) ) // 4.g8
|
||||
ROM_LOAD( "4.7f", 0x08000, 0x08000, CRC(3cd715b4) SHA1(da735fb5d262908ddf7ed7dacdea68899f1723ff) ) // 4.g8
|
||||
|
||||
ROM_REGION( 0x0200, "proms", 0 ) // this PCB type has different proms when compared to the cshootert hardware PCB where they were dumped
|
||||
ROM_LOAD( "pr.c19", 0x0000, 0x0200, NO_DUMP )
|
||||
|
@ -183,6 +183,45 @@ WRITE8_MEMBER(cabal_state::cabalbl_coin_w)
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst18_ack_w)
|
||||
AM_RANGE(0x4005, 0x4006) AM_DEVWRITE("adpcm1", seibu_adpcm_device, adr_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, ym_r, ym_w)
|
||||
AM_RANGE(0x4010, 0x4011) AM_DEVREAD("seibu_sound", seibu_sound_device, soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_DEVREAD("seibu_sound", seibu_sound_device, main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
|
||||
AM_RANGE(0x401a, 0x401a) AM_DEVWRITE("adpcm1", seibu_adpcm_device, ctl_w)
|
||||
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
|
||||
AM_RANGE(0x6005, 0x6006) AM_DEVWRITE("adpcm2", seibu_adpcm_device, adr_w)
|
||||
AM_RANGE(0x601a, 0x601a) AM_DEVWRITE("adpcm2", seibu_adpcm_device, ctl_w)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, cabal_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("audiocpu", 0x8000)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( cabalbl_sound_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x2fff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
|
||||
AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("soundlatch3", generic_latch_8_device, write)
|
||||
AM_RANGE(0x4004, 0x4004) AM_WRITE(cabalbl_coin_w)
|
||||
AM_RANGE(0x4006, 0x4006) AM_READ_PORT("COIN")
|
||||
AM_RANGE(0x4008, 0x4008) AM_READ(cabalbl_snd2_r)
|
||||
AM_RANGE(0x400a, 0x400a) AM_READ(cabalbl_snd1_r)
|
||||
AM_RANGE(0x400c, 0x400c) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
|
||||
AM_RANGE(0x400e, 0x400f) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x6000, 0x6000) AM_WRITENOP /* ??? */
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( cabalbl2_sound_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
@ -201,19 +240,9 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( cabalbl_sound_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x2fff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
|
||||
AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("soundlatch3", generic_latch_8_device, write)
|
||||
AM_RANGE(0x4004, 0x4004) AM_WRITE(cabalbl_coin_w)
|
||||
AM_RANGE(0x4006, 0x4006) AM_READ_PORT("COIN")
|
||||
AM_RANGE(0x4008, 0x4008) AM_READ(cabalbl_snd2_r)
|
||||
AM_RANGE(0x400a, 0x400a) AM_READ(cabalbl_snd1_r)
|
||||
AM_RANGE(0x400c, 0x400c) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
|
||||
AM_RANGE(0x400e, 0x400f) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x6000, 0x6000) AM_WRITENOP /* ??? */
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM
|
||||
static ADDRESS_MAP_START( cabalbl2_predecrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, cabal_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("audiocpu", 0x2000)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("audiocpu", 0x8000)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/* the bootleg has 2x z80 sample players */
|
||||
@ -469,7 +498,7 @@ static GFXDECODE_START( cabal )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_START( cabal_base, cabal_state )
|
||||
static MACHINE_CONFIG_START( cabal, cabal_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz/2) /* verified on pcb */
|
||||
@ -478,6 +507,10 @@ static MACHINE_CONFIG_START( cabal_base, cabal_state )
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
|
||||
MCFG_CPU_PROGRAM_MAP(sound_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(sound_decrypted_opcodes_map)
|
||||
|
||||
MCFG_DEVICE_ADD("sei80bu", SEI80BU, 0)
|
||||
MCFG_DEVICE_ROM("audiocpu")
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(cabal_state,cabal)
|
||||
|
||||
@ -513,20 +546,12 @@ static MACHINE_CONFIG_START( cabal_base, cabal_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( cabal, cabal_base )
|
||||
MCFG_DEVICE_MODIFY("seibu_sound")
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_LOW("audiocpu")
|
||||
static MACHINE_CONFIG_DERIVED( cabalbl2, cabal )
|
||||
MCFG_DEVICE_REMOVE("sei80bu")
|
||||
|
||||
MCFG_DEVICE_MODIFY("audiocpu")
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( cabalbl2, cabal_base )
|
||||
MCFG_DEVICE_MODIFY("seibu_sound")
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_CUSTOM("audiocpu")
|
||||
|
||||
MCFG_DEVICE_MODIFY("audiocpu")
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MCFG_CPU_PROGRAM_MAP(cabalbl2_sound_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(cabalbl2_predecrypted_opcodes_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -891,20 +916,11 @@ DRIVER_INIT_MEMBER(cabal_state,cabal)
|
||||
m_adpcm2->decrypt();
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(cabal_state,cabalbl2)
|
||||
{
|
||||
uint8_t *decrypt = m_seibu_sound->get_custom_decrypt();
|
||||
memcpy(decrypt, memregion("audiocpu")->base()+0x2000, 0x2000);
|
||||
memcpy(decrypt+0x8000, memregion("audiocpu")->base()+0x8000, 0x8000);
|
||||
m_adpcm1->decrypt();
|
||||
m_adpcm2->decrypt();
|
||||
}
|
||||
|
||||
|
||||
GAME( 1988, cabal, 0, cabal, cabalj, cabal_state, cabal, ROT0, "TAD Corporation", "Cabal (World, Joystick)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, cabala, cabal, cabal, cabalj, cabal_state, cabal, ROT0, "TAD Corporation (Alpha Trading license)", "Cabal (Korea?, Joystick)", MACHINE_SUPPORTS_SAVE ) // korea?
|
||||
GAME( 1988, cabalbl, cabal, cabalbl, cabalbl,driver_device, 0, 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, cabalbl2,ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1988, cabalbl2,cabal, cabalbl2,cabalj, cabal_state, cabal, ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
GAME( 1988, cabalus, cabal, cabal, cabalt, cabal_state, cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 1, Trackball)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1988, cabalus2,cabal, cabal, cabalt, cabal_state, cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 2, Trackball)", MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -89,7 +89,7 @@ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, deadang_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, deadang_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("seibu_sound", seibu_sound_device, pending_w)
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
@ -110,6 +110,11 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, deadang_state )
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, deadang_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/* Input Ports */
|
||||
|
||||
static INPUT_PORTS_START( deadang )
|
||||
@ -270,7 +275,10 @@ static MACHINE_CONFIG_START( deadang, deadang_state )
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz/4)
|
||||
MCFG_CPU_PROGRAM_MAP(sound_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(sound_decrypted_opcodes_map)
|
||||
|
||||
MCFG_DEVICE_ADD("sei80bu", SEI80BU, 0)
|
||||
MCFG_DEVICE_ROM("audiocpu")
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(60)) // the game stops working with higher interleave rates..
|
||||
|
||||
@ -293,7 +301,7 @@ static MACHINE_CONFIG_START( deadang, deadang_state )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_DEVICE_ADD("seibu_sound", SEIBU_SOUND, 0)
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_LOW("audiocpu")
|
||||
MCFG_SEIBU_SOUND_CPU("audiocpu")
|
||||
MCFG_SEIBU_SOUND_YM_READ_CB(DEVREAD8("ym1", ym2203_device, read))
|
||||
MCFG_SEIBU_SOUND_YM_WRITE_CB(DEVWRITE8("ym1", ym2203_device, write))
|
||||
|
||||
|
@ -117,6 +117,32 @@ static ADDRESS_MAP_START( masterj_map, AS_PROGRAM, 16, dynduke_state )
|
||||
AM_RANGE(0xa0000, 0xfffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, dynduke_state )
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("seibu_sound", seibu_sound_device, pending_w)
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst18_ack_w)
|
||||
AM_RANGE(0x4007, 0x4007) AM_DEVWRITE("seibu_sound", seibu_sound_device, bank_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, ym_r, ym_w)
|
||||
AM_RANGE(0x4010, 0x4011) AM_DEVREAD("seibu_sound", seibu_sound_device, soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_DEVREAD("seibu_sound", seibu_sound_device, main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
|
||||
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
|
||||
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x0000, 0xffff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, dynduke_state )
|
||||
AM_RANGE(0x0000, 0xffff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sei80bu_encrypted_full_map, AS_PROGRAM, 8, dynduke_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION("audiocpu", 0)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/* Input Ports */
|
||||
|
||||
static INPUT_PORTS_START( dynduke )
|
||||
@ -286,8 +312,11 @@ static MACHINE_CONFIG_START( dynduke, dynduke_state )
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", dynduke_state, interrupt)
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, 14318180/4)
|
||||
MCFG_CPU_PROGRAM_MAP(seibu_sound_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MCFG_CPU_PROGRAM_MAP(sound_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(sound_decrypted_opcodes_map)
|
||||
|
||||
MCFG_DEVICE_ADD("sei80bu", SEI80BU, 0)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sei80bu_encrypted_full_map)
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(3600))
|
||||
|
||||
@ -319,7 +348,7 @@ static MACHINE_CONFIG_START( dynduke, dynduke_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
|
||||
MCFG_DEVICE_ADD("seibu_sound", SEIBU_SOUND, 0)
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_FULL("audiocpu")
|
||||
MCFG_SEIBU_SOUND_CPU("audiocpu")
|
||||
MCFG_SEIBU_SOUND_YM_READ_CB(DEVREAD8("ymsnd", ym3812_device, read))
|
||||
MCFG_SEIBU_SOUND_YM_WRITE_CB(DEVWRITE8("ymsnd", ym3812_device, write))
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -43,7 +43,8 @@ YM2151:
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, mustache_state )
|
||||
AM_RANGE(0x0000, 0xbfff) AM_ROM
|
||||
AM_RANGE(0x0000, 0x7fff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("t5182", t5182_device, sound_irq_w)
|
||||
AM_RANGE(0xd001, 0xd001) AM_DEVREAD("t5182", t5182_device, sharedram_semaphore_snd_r)
|
||||
@ -62,7 +63,7 @@ static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, mustache_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, mustache_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
|
||||
AM_RANGE(0x0000, 0x7fff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("maincpu", 0x8000)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -179,8 +180,10 @@ static MACHINE_CONFIG_START( mustache, mustache_state )
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mustache_state, scanline, "screen", 0, 1)
|
||||
|
||||
MCFG_DEVICE_ADD("t5182", T5182, 0)
|
||||
MCFG_DEVICE_ADD("sei80bu", SEI80BU, 0)
|
||||
MCFG_DEVICE_ROM("maincpu")
|
||||
|
||||
MCFG_DEVICE_ADD("t5182", T5182, 0)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
@ -301,8 +304,6 @@ DRIVER_INIT_MEMBER(mustache_state,mustache)
|
||||
/* SPR address lines */
|
||||
for (i = 0; i < 2*G2; i++)
|
||||
gfx2[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,12,11,10,9,8,7,6,5,4,13,14,3,2,1,0)];
|
||||
|
||||
seibu_sound_device::apply_decrypt(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -131,6 +131,35 @@ static ADDRESS_MAP_START( raidenb_main_map, AS_PROGRAM, 16, raiden_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static ADDRESS_MAP_START( raiden_sound_map, AS_PROGRAM, 8, raiden_state )
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("seibu_sound", seibu_sound_device, pending_w)
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst18_ack_w)
|
||||
AM_RANGE(0x4007, 0x4007) AM_DEVWRITE("seibu_sound", seibu_sound_device, bank_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, ym_r, ym_w)
|
||||
AM_RANGE(0x4010, 0x4011) AM_DEVREAD("seibu_sound", seibu_sound_device, soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_DEVREAD("seibu_sound", seibu_sound_device, main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
|
||||
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
|
||||
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x0000, 0xffff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( raiden_sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, raiden_state )
|
||||
AM_RANGE(0x0000, 0xffff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sei80bu_encrypted_full_map, AS_PROGRAM, 8, raiden_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION("audiocpu", 0)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static INPUT_PORTS_START( raiden )
|
||||
@ -314,11 +343,12 @@ static MACHINE_CONFIG_START( raiden, raiden_state )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( raidene, raiden )
|
||||
MCFG_DEVICE_MODIFY("seibu_sound")
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_FULL("audiocpu")
|
||||
|
||||
MCFG_DEVICE_MODIFY("audiocpu")
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MCFG_CPU_PROGRAM_MAP(raiden_sound_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(raiden_sound_decrypted_opcodes_map)
|
||||
|
||||
MCFG_DEVICE_ADD("sei80bu", SEI80BU, 0)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sei80bu_encrypted_full_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( raidenu, raidene )
|
||||
@ -638,15 +668,6 @@ DRIVER_INIT_MEMBER(raiden_state,raiden)
|
||||
common_decrypt();
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(raiden_state,raidenk)
|
||||
{
|
||||
common_decrypt();
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(raiden_state,raidenu)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
@ -657,10 +678,10 @@ GAME( 1990, raidenu, raiden, raidene, raiden, raiden_state, raiden, ROT270, "
|
||||
GAME( 1990, raident, raiden, raidene, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
/* Same as above, but the sound CPU code is not encrypted */
|
||||
GAME( 1990, raidenk, raiden, raiden, raiden, raiden_state, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1990, raidenk, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
/* Alternate hardware; SEI8904 + SEI9008 PCBs. Main & Sub CPU code not encrypted */
|
||||
GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, raidenu, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1990, raidenua, raiden, raidenu, raiden, driver_device, 0, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
/* Alternate hardware. Main, Sub & Sound CPU code not encrypted - could possibly be a bootleg?? It also sports Seibu custom CRTC. */
|
||||
GAME( 1990, raidenb, raiden, raidenb, raiden, driver_device, 0, ROT270, "Seibu Kaihatsu", "Raiden (set 3)", MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -179,6 +179,57 @@ ADDRESS_MAP_END
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static ADDRESS_MAP_START( toki_audio_map, AS_PROGRAM, 8, toki_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, data_r)
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("seibu_sound", seibu_sound_device, pending_w)
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst18_ack_w)
|
||||
AM_RANGE(0x4007, 0x4007) AM_DEVWRITE("seibu_sound", seibu_sound_device, bank_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, ym_r, ym_w)
|
||||
AM_RANGE(0x4010, 0x4011) AM_DEVREAD("seibu_sound", seibu_sound_device, soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_DEVREAD("seibu_sound", seibu_sound_device, main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
|
||||
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
|
||||
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( toki_audio_opcodes_map, AS_DECRYPTED_OPCODES, 8, toki_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_DEVREAD("sei80bu", sei80bu_device, opcode_r)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( jujuba_audio_map, AS_PROGRAM, 8, toki_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_READ(jujuba_z80_data_decrypt)
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("seibu_sound", seibu_sound_device, pending_w)
|
||||
AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("seibu_sound", seibu_sound_device, irq_clear_w)
|
||||
AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst10_ack_w)
|
||||
AM_RANGE(0x4003, 0x4003) AM_DEVWRITE("seibu_sound", seibu_sound_device, rst18_ack_w)
|
||||
AM_RANGE(0x4007, 0x4007) AM_DEVWRITE("seibu_sound", seibu_sound_device, bank_w)
|
||||
AM_RANGE(0x4008, 0x4009) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, ym_r, ym_w)
|
||||
AM_RANGE(0x4010, 0x4011) AM_DEVREAD("seibu_sound", seibu_sound_device, soundlatch_r)
|
||||
AM_RANGE(0x4012, 0x4012) AM_DEVREAD("seibu_sound", seibu_sound_device, main_data_pending_r)
|
||||
AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
|
||||
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
|
||||
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
|
||||
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( jujuba_audio_opcodes_map, AS_DECRYPTED_OPCODES, 8, toki_state )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("audiocpu", 0)
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
READ8_MEMBER(toki_state::jujuba_z80_data_decrypt)
|
||||
{
|
||||
return m_audiocpu_rom[offset] ^ 0x55;
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( tokib_audio_map, AS_PROGRAM, 8, toki_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
|
||||
@ -439,7 +490,11 @@ static MACHINE_CONFIG_START( toki, toki_state ) /* KOYO 20.000MHz near the cpu *
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", toki_state, irq1_line_hold)/* VBL */
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz/4) // verified on pcb
|
||||
MCFG_CPU_PROGRAM_MAP(seibu_sound_map)
|
||||
MCFG_CPU_PROGRAM_MAP(toki_audio_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(toki_audio_opcodes_map)
|
||||
|
||||
MCFG_DEVICE_ADD("sei80bu", SEI80BU, 0)
|
||||
MCFG_DEVICE_ROM("audiocpu")
|
||||
|
||||
/* video hardware */
|
||||
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
|
||||
@ -472,20 +527,12 @@ static MACHINE_CONFIG_START( toki, toki_state ) /* KOYO 20.000MHz near the cpu *
|
||||
MCFG_SEIBU_SOUND_YM_WRITE_CB(DEVWRITE8("ymsnd", ym3812_device, write))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( tokie, toki )
|
||||
MCFG_DEVICE_MODIFY("seibu_sound")
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_LOW("audiocpu")
|
||||
static MACHINE_CONFIG_DERIVED( jujuba, toki )
|
||||
MCFG_DEVICE_REMOVE("sei80bu")
|
||||
|
||||
MCFG_DEVICE_MODIFY("audiocpu")
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( tokic, toki )
|
||||
MCFG_DEVICE_MODIFY("seibu_sound")
|
||||
MCFG_SEIBU_SOUND_CPU_ENCRYPTED_CUSTOM("audiocpu")
|
||||
|
||||
MCFG_DEVICE_MODIFY("audiocpu")
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
|
||||
MCFG_CPU_PROGRAM_MAP(jujuba_audio_map)
|
||||
MCFG_CPU_DECRYPTED_OPCODES_MAP(jujuba_audio_opcodes_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_START( tokib, toki_state )
|
||||
@ -946,20 +993,6 @@ DRIVER_INIT_MEMBER(toki_state,jujuba)
|
||||
}
|
||||
}
|
||||
|
||||
/* Decrypt data for z80 program */
|
||||
{
|
||||
uint8_t *decrypt = m_seibu_sound->get_custom_decrypt();
|
||||
uint8_t *rom = memregion("audiocpu")->base();
|
||||
|
||||
memcpy(decrypt,rom,0x20000);
|
||||
|
||||
for (int i = 0;i < 0x2000;i++)
|
||||
{
|
||||
uint8_t src = decrypt[i];
|
||||
rom[i] = src^0x55;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
uint8_t *ROM = memregion("oki")->base();
|
||||
std::vector<uint8_t> buffer(0x20000);
|
||||
@ -975,18 +1008,18 @@ DRIVER_INIT_MEMBER(toki_state,jujuba)
|
||||
|
||||
|
||||
// these 2 are both unique revisions
|
||||
GAME( 1989, toki, 0, tokie, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, tokiu, toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, toki, 0, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, tokiu, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
GAME( 1989, tokip, toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, prototype?)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, tokip, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, prototype?)", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
|
||||
// these 3 are all the same revision, only the region byte differs
|
||||
GAME( 1989, tokia, toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, tokiua,toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, juju, toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, tokia, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, tokiua,toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, juju, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", MACHINE_SUPPORTS_SAVE )
|
||||
|
||||
GAME( 1990, tokib, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1990, jujub, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", MACHINE_SUPPORTS_SAVE )
|
||||
/* Sound hardware seems to have been slightly modified, the coins are handled ok, but there is no music and bad sfx. Program roms have a slight bitswap, Flipscreen also seems to be ignored */
|
||||
GAME( 1989, jujuba, toki, tokic, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // bootleg of tokia/juju revison
|
||||
GAME( 1989, jujuba, toki, jujuba, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // bootleg of tokia/juju revison
|
||||
|
@ -61,7 +61,6 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(cabalbl_2_adpcm_w);
|
||||
|
||||
DECLARE_DRIVER_INIT(cabal);
|
||||
DECLARE_DRIVER_INIT(cabalbl2);
|
||||
DECLARE_MACHINE_START(cabal);
|
||||
DECLARE_MACHINE_START(cabalbl);
|
||||
DECLARE_MACHINE_RESET(cabalbl);
|
||||
|
@ -12,8 +12,7 @@ public:
|
||||
m_screen(*this, "screen"),
|
||||
m_palette(*this, "palette"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_decrypted_opcodes(*this, "decrypted_opcodes") { }
|
||||
m_spriteram(*this, "spriteram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
@ -22,7 +21,6 @@ public:
|
||||
|
||||
required_shared_ptr<uint8_t> m_videoram;
|
||||
required_shared_ptr<uint8_t> m_spriteram;
|
||||
required_shared_ptr<uint8_t> m_decrypted_opcodes;
|
||||
|
||||
tilemap_t *m_bg_tilemap;
|
||||
int m_control_byte;
|
||||
|
@ -55,8 +55,6 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(raidenb_control_w);
|
||||
DECLARE_WRITE16_MEMBER(raidenb_layer_enable_w);
|
||||
DECLARE_WRITE16_MEMBER(raidenb_layer_scroll_w);
|
||||
DECLARE_DRIVER_INIT(raidenu);
|
||||
DECLARE_DRIVER_INIT(raidenk);
|
||||
DECLARE_DRIVER_INIT(raiden);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_back_tile_info);
|
||||
|
@ -13,6 +13,7 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_audiocpu_rom(*this, "audiocpu"),
|
||||
m_seibu_sound(*this, "seibu_sound"),
|
||||
m_msm(*this, "msm"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
@ -27,6 +28,7 @@ public:
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_region_ptr<u8> m_audiocpu_rom;
|
||||
optional_device<seibu_sound_device> m_seibu_sound;
|
||||
optional_device<msm5205_device> m_msm;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
@ -57,6 +59,8 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(tokib_adpcm_data_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(tokib_adpcm_int);
|
||||
|
||||
DECLARE_READ8_MEMBER(jujuba_z80_data_decrypt);
|
||||
|
||||
DECLARE_DRIVER_INIT(tokib);
|
||||
DECLARE_DRIVER_INIT(jujuba);
|
||||
DECLARE_DRIVER_INIT(toki);
|
||||
|
Loading…
Reference in New Issue
Block a user