Proper support for Rescue on Fractalus (proto) - No Bankswitch + 2K Mirror RAM. [Mike Saarna]

This commit is contained in:
Scott Stone 2016-12-02 16:13:45 -05:00
parent a38d5c1d84
commit 53e9168f15
6 changed files with 73 additions and 4 deletions

View File

@ -1806,7 +1806,7 @@ almost nothing like the prototype.
<info name="serial" value="CX7816"/>
<sharedfeat name="compatibility" value="NTSC"/>
<part name="cart" interface="a7800_cart">
<feature name="slot" value="a78_sg_ram" />
<feature name="slot" value="a78_mram" />
<dataarea name="rom" size="32768">
<rom name="rescuefr.bin" size="32768" crc="9a74fbf2" sha1="6653022f38e553d475896a918850158eaf8f77ff" offset="0" />
</dataarea>

View File

@ -17,6 +17,7 @@ static SLOT_INTERFACE_START(a7800_cart)
SLOT_INTERFACE_INTERNAL("a78_sg_pokey", A78_ROM_SG_POKEY)
SLOT_INTERFACE_INTERNAL("a78_sg_ram", A78_ROM_SG_RAM)
SLOT_INTERFACE_INTERNAL("a78_sg9", A78_ROM_SG9)
SLOT_INTERFACE_INTERNAL("a78_mram", A78_ROM_MRAM)
SLOT_INTERFACE_INTERNAL("a78_abs", A78_ROM_ABSOLUTE)
SLOT_INTERFACE_INTERNAL("a78_act", A78_ROM_ACTIVISION)
SLOT_INTERFACE_INTERNAL("a78_hsc", A78_HISCORE)

View File

@ -306,6 +306,7 @@ static const a78_slot slot_list[] =
{ A78_TYPE3, "a78_sg_pokey" },
{ A78_TYPE6, "a78_sg_ram" },
{ A78_TYPEA, "a78_sg9" },
{ A78_TYPE8, "a78_mram" },
{ A78_ABSOLUTE, "a78_abs" },
{ A78_ACTIVISION, "a78_act" },
{ A78_HSC, "a78_hsc" },
@ -429,6 +430,10 @@ image_init_result a78_cart_slot_device::call_load()
m_type = A78_ACTIVISION;
else if ((mapper & 0xff00) == 0x0200)
m_type = A78_ABSOLUTE;
// (for now) mirror ram implies no bankswitch format is used
else if ((mapper & 0x0080) == 0x0080)
m_type = A78_TYPE8;
logerror("Cart type: 0x%x\n", m_type);
@ -454,7 +459,7 @@ image_init_result a78_cart_slot_device::call_load()
m_cart->rom_alloc(len, tag());
fread(m_cart->get_rom_base(), len);
if (m_type == A78_TYPE6)
if (m_type == A78_TYPE6 || m_type == A78_TYPE8)
m_cart->ram_alloc(0x4000);
if (m_type == A78_MEGACART || (m_type >= A78_VERSABOARD && m_type <= A78_VERSA_POK450))
m_cart->ram_alloc(0x8000);
@ -570,6 +575,8 @@ std::string a78_cart_slot_device::get_default_card_software()
type = A78_ACTIVISION;
else if ((mapper & 0xff00) == 0x0200)
type = A78_ABSOLUTE;
else if ((mapper & 0x0080) == 0x0080)
type = A78_TYPE8;
logerror("Cart type: %x\n", type);
slot_string = a78_get_slot(type);
@ -706,7 +713,7 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
bit 4 [0x10] - bank 6 at $4000
bit 5 [0x20] - banked RAM at $4000
bit 6 [0x40] - POKEY at $0450
bit 7 [0x80] - currently unused
bit 7 [0x80] - Mirror RAM at $4000
(byte 53)
bit0 set = Absolute mapper (F18 Hornet)
@ -751,6 +758,9 @@ void a78_cart_slot_device::internal_header_logging(uint8_t *header, uint32_t len
case 0x0020:
cart_mapper.assign("SuperCart Bankswitch + 32K RAM");
break;
case 0x0080:
cart_mapper.assign("No Bankswitch + Mirror RAM");
break;
case 0x0100:
cart_mapper.assign("Activision Bankswitch");
break;
@ -809,6 +819,7 @@ void a78_cart_slot_device::internal_header_logging(uint8_t *header, uint32_t len
logerror( "\t\tbank6 at $4000: %s\n", BIT(head_mapper, 4) ? "Yes" : "No");
logerror( "\t\tbanked RAM: %s\n", BIT(head_mapper, 5) ? "Yes" : "No");
logerror( "\t\tPOKEY at $450: %s\n", BIT(head_mapper, 6) ? "Yes" : "No");
logerror( "\t\tmRAM at $4000: %s\n", BIT(head_mapper, 7) ? "Yes" : "No");
logerror( "\t\tSpecial: %s ", (head_mapper & 0xff00) ? "Yes" : "No");
if (head_mapper & 0xff00)
{

View File

@ -19,7 +19,8 @@ enum
A78_TYPE2, // Atari SuperGame pcb (8x16K banks with bankswitch)
A78_TYPE3, // as TYPE1 + POKEY chip on the PCB
A78_TYPE6, // as TYPE1 + RAM IC on the PCB
A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
A78_TYPE8, // Rescue on Fractalus, as TYPE0 + 2K Mirror RAM IC on the PCB
A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
A78_ABSOLUTE, // F18 Hornet
A78_ACTIVISION, // Double Dragon, Rampage
A78_HSC, // Atari HighScore cart

View File

@ -32,6 +32,7 @@ const device_type A78_ROM_POKEY = &device_creator<a78_rom_pokey_device>;
const device_type A78_ROM_SG_POKEY = &device_creator<a78_rom_sg_pokey_device>;
const device_type A78_ROM_SG_RAM = &device_creator<a78_rom_sg_ram_device>;
const device_type A78_ROM_SG9 = &device_creator<a78_rom_sg9_device>;
const device_type A78_ROM_MRAM = &device_creator<a78_rom_mram_device>;
const device_type A78_ROM_ABSOLUTE = &device_creator<a78_rom_abs_device>;
const device_type A78_ROM_ACTIVISION = &device_creator<a78_rom_act_device>;
@ -67,6 +68,16 @@ a78_rom_pokey_device::a78_rom_pokey_device(const machine_config &mconfig, const
}
a78_rom_mram_device::a78_rom_mram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: a78_rom_device(mconfig, type, name, tag, owner, clock, shortname, source)
{
}
a78_rom_mram_device::a78_rom_mram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: a78_rom_device(mconfig, A78_ROM_MRAM, "Atari 7800 ROM Carts + Mirror RAM", tag, owner, clock, "a78_rom_mram", __FILE__)
{
}
a78_rom_sg_device::a78_rom_sg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: a78_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_bank(0)
{
@ -261,6 +272,35 @@ machine_config_constructor a78_rom_pokey_device::device_mconfig_additions() cons
return MACHINE_CONFIG_NAME( a78_pokey );
}
/*-------------------------------------------------
Carts with no bankswitch + mRAM chip
The RAM chips are accessed by writing at
0x4000-0x7fff.
The A8 line of the RAM chip isn't used, to create
mirrors of even pages at odd page locations.
GAMES: Rescue on Fractalus (proto)
-------------------------------------------------*/
READ8_MEMBER(a78_rom_mram_device::read_40xx)
{
if (offset < 0x4000)
return m_ram[offset & 0xfeff];
if (offset + 0x4000 < m_base_rom)
return 0xff;
else
return m_rom[offset + 0x4000 - m_base_rom];
}
WRITE8_MEMBER(a78_rom_mram_device::write_40xx)
{
if (offset < 0x4000)
m_ram[offset&0xfeff] = data;
}
/*-------------------------------------------------

View File

@ -47,6 +47,21 @@ protected:
};
// ======================> a78_rom_sg_ram_device
class a78_rom_mram_device : public a78_rom_device
{
public:
// construction/destruction
a78_rom_mram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
a78_rom_mram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx) override;
virtual DECLARE_WRITE8_MEMBER(write_40xx) override;
};
// ======================> a78_rom_sg_device
class a78_rom_sg_device : public a78_rom_device
@ -248,6 +263,7 @@ extern const device_type A78_ROM_SG;
extern const device_type A78_ROM_POKEY;
extern const device_type A78_ROM_SG_POKEY;
extern const device_type A78_ROM_SG_RAM;
extern const device_type A78_ROM_MRAM;
extern const device_type A78_ROM_SG9;
extern const device_type A78_ROM_ABSOLUTE;
extern const device_type A78_ROM_ACTIVISION;