(MESS) vc4000: properly supported 4K carts with no RAM. [Fabio Priuli]

This commit is contained in:
etabeta78 2014-12-24 09:05:17 +01:00
parent ee47ba18c5
commit 6448cf6be4
7 changed files with 26 additions and 8 deletions

View file

@ -157,8 +157,7 @@
<publisher>Voltmace?</publisher> <publisher>Voltmace?</publisher>
<info name="serial" value="No.13"/> <info name="serial" value="No.13"/>
<part name="cart" interface="vc4000_cart"> <part name="cart" interface="vc4000_cart">
<!-- FIXME: PCB has no RAM, but 4k ROM => it needs a new slot option --> <feature name="slot" value="rom4k" />
<feature name="slot" value="std" />
<dataarea name="rom" size="4096"> <dataarea name="rom" size="4096">
<rom name="boxing.bin" size="4096" crc="922c9f0d" sha1="b49a37dd6d0272f6c71d778ffada6bc7c90f8348" offset="0" /> <rom name="boxing.bin" size="4096" crc="922c9f0d" sha1="b49a37dd6d0272f6c71d778ffada6bc7c90f8348" offset="0" />
</dataarea> </dataarea>
@ -229,8 +228,7 @@
<publisher>Voltmace?</publisher> <publisher>Voltmace?</publisher>
<info name="serial" value="No.24"/> <info name="serial" value="No.24"/>
<part name="cart" interface="vc4000_cart"> <part name="cart" interface="vc4000_cart">
<!-- FIXME: PCB has no RAM, but 4k ROM => it needs a new slot option --> <feature name="slot" value="rom4k" />
<feature name="slot" value="std" />
<dataarea name="rom" size="4096"> <dataarea name="rom" size="4096">
<rom name="munchcrn.bin" size="4096" crc="704a1593" sha1="5f0b95904d6d36368727c1e0c91d94627a7471d6" offset="0" /> <rom name="munchcrn.bin" size="4096" crc="704a1593" sha1="5f0b95904d6d36368727c1e0c91d94627a7471d6" offset="0" />
</dataarea> </dataarea>

View file

@ -236,12 +236,10 @@
<publisher>Interton</publisher> <publisher>Interton</publisher>
<info name="serial" value="18"/> <info name="serial" value="18"/>
<part name="cart" interface="vc4000_cart"> <part name="cart" interface="vc4000_cart">
<feature name="slot" value="ram1k" /> <feature name="slot" value="rom4k" />
<dataarea name="rom" size="4096"> <dataarea name="rom" size="4096">
<rom name="boxing.bin" size="4096" crc="922c9f0d" sha1="b49a37dd6d0272f6c71d778ffada6bc7c90f8348" offset="0" /> <rom name="boxing.bin" size="4096" crc="922c9f0d" sha1="b49a37dd6d0272f6c71d778ffada6bc7c90f8348" offset="0" />
</dataarea> </dataarea>
<dataarea name="ram" size="1024">
</dataarea>
</part> </part>
</software> </software>

View file

@ -193,6 +193,7 @@
//------------------------------------------------- //-------------------------------------------------
const device_type VC4000_ROM_STD = &device_creator<vc4000_rom_device>; const device_type VC4000_ROM_STD = &device_creator<vc4000_rom_device>;
const device_type VC4000_ROM_ROM4K = &device_creator<vc4000_rom4k_device>;
const device_type VC4000_ROM_RAM1K = &device_creator<vc4000_ram1k_device>; const device_type VC4000_ROM_RAM1K = &device_creator<vc4000_ram1k_device>;
const device_type VC4000_ROM_CHESS2 = &device_creator<vc4000_chess2_device>; const device_type VC4000_ROM_CHESS2 = &device_creator<vc4000_chess2_device>;
@ -209,6 +210,11 @@ vc4000_rom_device::vc4000_rom_device(const machine_config &mconfig, const char *
{ {
} }
vc4000_rom4k_device::vc4000_rom4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: vc4000_rom_device(mconfig, VC4000_ROM_ROM4K, "VC 4000 Carts w/4K ROM", tag, owner, clock, "vc4000_rom4k", __FILE__)
{
}
vc4000_ram1k_device::vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) vc4000_ram1k_device::vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: vc4000_rom_device(mconfig, VC4000_ROM_RAM1K, "VC 4000 Carts w/1K RAM", tag, owner, clock, "vc4000_ram1k", __FILE__) : vc4000_rom_device(mconfig, VC4000_ROM_RAM1K, "VC 4000 Carts w/1K RAM", tag, owner, clock, "vc4000_ram1k", __FILE__)
{ {

View file

@ -24,6 +24,15 @@ public:
virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_READ8_MEMBER(read_rom);
}; };
// ======================> vc4000_rom4k_device
class vc4000_rom4k_device : public vc4000_rom_device
{
public:
// construction/destruction
vc4000_rom4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// ======================> vc4000_ram1k_device // ======================> vc4000_ram1k_device
class vc4000_ram1k_device : public vc4000_rom_device class vc4000_ram1k_device : public vc4000_rom_device
@ -57,6 +66,7 @@ public:
// device type definition // device type definition
extern const device_type VC4000_ROM_STD; extern const device_type VC4000_ROM_STD;
extern const device_type VC4000_ROM_ROM4K;
extern const device_type VC4000_ROM_RAM1K; extern const device_type VC4000_ROM_RAM1K;
extern const device_type VC4000_ROM_CHESS2; extern const device_type VC4000_ROM_CHESS2;

View file

@ -127,6 +127,7 @@ struct vc4000_slot
static const vc4000_slot slot_list[] = static const vc4000_slot slot_list[] =
{ {
{ VC4000_STD, "std" }, { VC4000_STD, "std" },
{ VC4000_ROM4K, "rom4k" },
{ VC4000_RAM1K, "ram1k" }, { VC4000_RAM1K, "ram1k" },
{ VC4000_CHESS2, "chess2" } { VC4000_CHESS2, "chess2" }
}; };
@ -183,7 +184,7 @@ bool vc4000_cart_slot_device::call_load()
// attempt to identify the non-standard types // attempt to identify the non-standard types
if (size > 0x1000) // 6k rom + 1k ram - Chess2 only if (size > 0x1000) // 6k rom + 1k ram - Chess2 only
m_type = VC4000_CHESS2; m_type = VC4000_CHESS2;
else if (size > 0x0800) // some 4k roms have 1k of mirrored ram else if (size > 0x0800) // some 4k roms have 1k of mirrored ram (those who don't still work with RAM emulated luckily)
m_type = VC4000_RAM1K; m_type = VC4000_RAM1K;
if (m_type == VC4000_RAM1K || m_type == VC4000_CHESS2) if (m_type == VC4000_RAM1K || m_type == VC4000_CHESS2)

View file

@ -12,6 +12,7 @@
enum enum
{ {
VC4000_STD = 0, VC4000_STD = 0,
VC4000_ROM4K,
VC4000_RAM1K, VC4000_RAM1K,
VC4000_CHESS2 VC4000_CHESS2
}; };

View file

@ -369,6 +369,9 @@ void vc4000_state::machine_start()
case VC4000_STD: case VC4000_STD:
m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x07ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart)); m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x07ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart));
break; break;
case VC4000_ROM4K:
m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x0fff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart));
break;
case VC4000_RAM1K: case VC4000_RAM1K:
m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x0fff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart)); m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x0fff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart));
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x15ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart)); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x15ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart));
@ -513,6 +516,7 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000)
static SLOT_INTERFACE_START(vc4000_cart) static SLOT_INTERFACE_START(vc4000_cart)
SLOT_INTERFACE_INTERNAL("std", VC4000_ROM_STD) SLOT_INTERFACE_INTERNAL("std", VC4000_ROM_STD)
SLOT_INTERFACE_INTERNAL("rom4k", VC4000_ROM_ROM4K)
SLOT_INTERFACE_INTERNAL("ram1k", VC4000_ROM_RAM1K) SLOT_INTERFACE_INTERNAL("ram1k", VC4000_ROM_RAM1K)
SLOT_INTERFACE_INTERNAL("chess2", VC4000_ROM_CHESS2) SLOT_INTERFACE_INTERNAL("chess2", VC4000_ROM_CHESS2)
SLOT_INTERFACE_END SLOT_INTERFACE_END