odyssey2: add support for 16KB bankswitched roms

This commit is contained in:
hap 2020-08-11 22:42:58 +02:00
parent 4da7c01ccf
commit 9baaf19580
10 changed files with 133 additions and 24 deletions

View File

@ -46,9 +46,10 @@ adds 16K RAM and 16K ROM, that plugs into the G7000.
<publisher>Philips</publisher>
<info name="serial" value="58"/>
<part name="cart" interface="odyssey_cart">
<feature name="slot" value="o2_rom12" />
<dataarea name="rom" size="12288">
<rom name="air battle (europe).bin" size="12288" crc="d94d4109" sha1="66837bbd0b9df12c89215f533a1ec8b5a42d5610"/>
<feature name="slot" value="o2_rally" />
<dataarea name="rom" size="0x4000">
<rom name="air battle (europe).bin" offset="0x0000" size="0x3000" crc="d94d4109" sha1="66837bbd0b9df12c89215f533a1ec8b5a42d5610"/>
<rom offset="0x1000" size="0x3000" loadflag="reload" />
</dataarea>
</part>
</software>
@ -221,9 +222,9 @@ adds 16K RAM and 16K ROM, that plugs into the G7000.
<publisher>Philips</publisher>
<info name="serial" value="59"/>
<part name="cart" interface="odyssey_cart">
<feature name="slot" value="o2_rom16" />
<dataarea name="rom" size="16384">
<rom name="helicopter rescue (europe).bin" size="16384" crc="c4134df8" sha1="7369a2d3fb81ddc4c8086bbcd245c11ea7aaa331"/>
<feature name="slot" value="o2_rally" />
<dataarea name="rom" size="0x4000">
<rom name="helicopter rescue (europe).bin" size="0x4000" crc="c4134df8" sha1="7369a2d3fb81ddc4c8086bbcd245c11ea7aaa331"/>
</dataarea>
</part>
</software>
@ -294,9 +295,10 @@ adds 16K RAM and 16K ROM, that plugs into the G7000.
<publisher>Philips</publisher>
<info name="serial" value="55"/>
<part name="cart" interface="odyssey_cart">
<feature name="slot" value="o2_rom12" />
<dataarea name="rom" size="12288">
<rom name="neutron star (europe).bin" size="12288" crc="be11157c" sha1="fde3e0791b9cbef91a8462764ebf09a457ffe038"/>
<feature name="slot" value="o2_rally" />
<dataarea name="rom" size="0x4000">
<rom name="neutron star (europe).bin" offset="0x0000" size="0x3000" crc="be11157c" sha1="fde3e0791b9cbef91a8462764ebf09a457ffe038"/>
<rom offset="0x1000" size="0x3000" loadflag="reload" />
</dataarea>
</part>
</software>
@ -405,9 +407,9 @@ adds 16K RAM and 16K ROM, that plugs into the G7000.
<year>198?</year>
<publisher>Philips</publisher>
<part name="cart" interface="odyssey_cart">
<feature name="slot" value="o2_rom16" />
<dataarea name="rom" size="16384">
<rom name="trans american rally (europe).bin" size="16384" crc="0d2d721d" sha1="be8a9f2aa66acb4f5e288d1a77afada9565b530a"/>
<feature name="slot" value="o2_rally" />
<dataarea name="rom" size="0x4000">
<rom name="trans american rally (europe).bin" size="0x4000" crc="0d2d721d" sha1="be8a9f2aa66acb4f5e288d1a77afada9565b530a"/>
</dataarea>
</part>
</software>

View File

@ -1694,6 +1694,8 @@ if (BUSES["O2"]~=null) then
MAME_DIR .. "src/devices/bus/odyssey2/rom.h",
MAME_DIR .. "src/devices/bus/odyssey2/4in1.cpp",
MAME_DIR .. "src/devices/bus/odyssey2/4in1.h",
MAME_DIR .. "src/devices/bus/odyssey2/rally.cpp",
MAME_DIR .. "src/devices/bus/odyssey2/rally.h",
MAME_DIR .. "src/devices/bus/odyssey2/chess.cpp",
MAME_DIR .. "src/devices/bus/odyssey2/chess.h",
MAME_DIR .. "src/devices/bus/odyssey2/voice.cpp",

View File

@ -2,7 +2,7 @@
// copyright-holders:hap
/******************************************************************************
Videopac 40 cartridge emulation
Videopac 31/40 cartridge emulation
4KB ROM (program ROM is fixed, data ROM is 'bankswitched' via P11)
@ -15,14 +15,13 @@ Used in:
#include "emu.h"
#include "4in1.h"
DEFINE_DEVICE_TYPE(O2_ROM_4IN1, o2_4in1_device, "o2_4in1", "Odyssey 2 Videopac 40")
//-------------------------------------------------
// o2_4in1_device - constructor
//-------------------------------------------------
DEFINE_DEVICE_TYPE(O2_ROM_4IN1, o2_4in1_device, "o2_4in1", "Odyssey 2 Videopac 40")
o2_4in1_device::o2_4in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
o2_rom_device(mconfig, O2_ROM_4IN1, tag, owner, clock)
{ }
@ -36,7 +35,7 @@ void o2_4in1_device::device_start()
void o2_4in1_device::cart_init()
{
if (m_rom_size != 0x1000)
fatalerror("o2_4in1_device: Wrong ROM region size\n");
fatalerror("o2_4in1_device: ROM size must be 4096\n");
}

View File

@ -2,7 +2,7 @@
// copyright-holders:hap
/**********************************************************************
Videopac 40 cartridge emulation
Videopac 31/40 cartridge emulation
**********************************************************************/

View File

@ -16,14 +16,13 @@ Service manual with schematics is available.
#include "emu.h"
#include "chess.h"
DEFINE_DEVICE_TYPE(O2_ROM_CHESS, o2_chess_device, "o2_chess", "Odyssey 2 Videopac C7010")
//-------------------------------------------------
// o2_chess_device - constructor
//-------------------------------------------------
DEFINE_DEVICE_TYPE(O2_ROM_CHESS, o2_chess_device, "o2_chess", "Odyssey 2 Videopac C7010")
o2_chess_device::o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
o2_rom_device(mconfig, O2_ROM_CHESS, tag, owner, clock),
m_cpu(*this, "subcpu"),

View File

@ -0,0 +1,59 @@
// license:BSD-3-Clause
// copyright-holders:hap
/******************************************************************************
Videopac 55/58/59/60 cartridge emulation
Bankswitched ROM via latch, either 16KB/2*8KB, or 4KB+8KB.
Used in:
- #55: Neutron Star
- #58: Air Battle
- #59: Helicopter Rescue
- #60: Trans American Rally
******************************************************************************/
#include "emu.h"
#include "rally.h"
DEFINE_DEVICE_TYPE(O2_ROM_RALLY, o2_rally_device, "o2_rally", "Odyssey 2 Videopac 60")
//-------------------------------------------------
// o2_rally_device - constructor
//-------------------------------------------------
o2_rally_device::o2_rally_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
o2_rom_device(mconfig, O2_ROM_RALLY, tag, owner, clock)
{ }
void o2_rally_device::device_start()
{
save_item(NAME(m_control));
save_item(NAME(m_bank));
}
void o2_rally_device::cart_init()
{
if (m_rom_size & (m_rom_size - 1) || m_rom_size < 0x800)
fatalerror("o2_rally_device: ROM size must be 2^x\n");
}
//-------------------------------------------------
// mapper specific handlers
//-------------------------------------------------
u8 o2_rally_device::read_rom04(offs_t offset)
{
// P10 enables latch output
u8 bank = (m_control & 1) ? ~0 : m_bank;
return m_rom[(offset + bank * 0x800) & (m_rom_size - 1)];
}
void o2_rally_device::io_write(offs_t offset, u8 data)
{
if (offset & 0x80 && ~m_control & 0x10)
m_bank = data;
}

View File

@ -0,0 +1,46 @@
// license:BSD-3-Clause
// copyright-holders:hap
/**********************************************************************
Videopac 55/58/59/60 cartridge emulation
**********************************************************************/
#ifndef MAME_BUS_ODYSSEY2_RALLY_H
#define MAME_BUS_ODYSSEY2_RALLY_H
#pragma once
#include "slot.h"
#include "rom.h"
// ======================> o2_rally_device
class o2_rally_device : public o2_rom_device
{
public:
// construction/destruction
o2_rally_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
virtual void cart_init() override;
virtual u8 read_rom04(offs_t offset) override;
virtual u8 read_rom0c(offs_t offset) override { return read_rom04(offset); }
virtual void write_p1(u8 data) override { m_control = data; }
virtual void io_write(offs_t offset, u8 data) override;
private:
u8 m_control = 0;
u8 m_bank = 0;
};
// device type definition
DECLARE_DEVICE_TYPE(O2_ROM_RALLY, o2_rally_device)
#endif // MAME_BUS_ODYSSEY2_RALLY_H

View File

@ -117,6 +117,7 @@ static const o2_slot slot_list[] =
{ O2_ROM12, "o2_rom12" },
{ O2_ROM16, "o2_rom16" },
{ O2_4IN1, "o2_4in1" },
{ O2_RALLY, "o2_rally" },
{ O2_CHESS, "o2_chess" },
{ O2_VOICE, "o2_voice" }
};
@ -252,6 +253,7 @@ uint8_t o2_cart_slot_device::io_read(offs_t offset)
#include "bus/odyssey2/rom.h"
#include "bus/odyssey2/4in1.h"
#include "bus/odyssey2/rally.h"
#include "bus/odyssey2/chess.h"
#include "bus/odyssey2/voice.h"
@ -261,6 +263,7 @@ void o2_cart(device_slot_interface &device)
device.option_add_internal("o2_rom12", O2_ROM_12K);
device.option_add_internal("o2_rom16", O2_ROM_16K);
device.option_add_internal("o2_4in1", O2_ROM_4IN1);
device.option_add_internal("o2_rally", O2_ROM_RALLY);
device.option_add_internal("o2_chess", O2_ROM_CHESS);
device.option_add_internal("o2_voice", O2_ROM_VOICE);
}

View File

@ -20,6 +20,7 @@ enum
O2_ROM12,
O2_ROM16,
O2_4IN1,
O2_RALLY,
O2_CHESS,
O2_VOICE
};

View File

@ -14,14 +14,12 @@ TODO:
#include "voice.h"
#include "speaker.h"
DEFINE_DEVICE_TYPE(O2_ROM_VOICE, o2_voice_device, "o2_voice", "Odyssey 2 The Voice Passthrough Cart")
//-------------------------------------------------
// o2_voice_device - constructor
//-------------------------------------------------
DEFINE_DEVICE_TYPE(O2_ROM_VOICE, o2_voice_device, "o2_voice", "Odyssey 2 The Voice Passthrough Cart")
o2_voice_device::o2_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
o2_rom_device(mconfig, O2_ROM_VOICE, tag, owner, clock),
m_speech(*this, "sp0256_speech"),