a800: Add support for the ICD R-Time 8 cartridge

This commit is contained in:
AJR 2022-07-30 15:36:04 -04:00
parent 77eff86988
commit c19f2c5d46
5 changed files with 119 additions and 0 deletions

View File

@ -53,6 +53,8 @@ if (BUSES["A800"]~=null) then
MAME_DIR .. "src/devices/bus/a800/rom.h",
MAME_DIR .. "src/devices/bus/a800/oss.cpp",
MAME_DIR .. "src/devices/bus/a800/oss.h",
MAME_DIR .. "src/devices/bus/a800/rtime8.cpp",
MAME_DIR .. "src/devices/bus/a800/rtime8.h",
MAME_DIR .. "src/devices/bus/a800/sparta.cpp",
MAME_DIR .. "src/devices/bus/a800/sparta.h",
}

View File

@ -7,6 +7,7 @@
#include "rom.h"
#include "rtime8.h"
#include "oss.h"
#include "sparta.h"
@ -31,6 +32,7 @@ static void a800_left(device_slot_interface &device)
device.option_add_internal("a800_tlink2", A800_ROM_TELELINK2);
device.option_add_internal("a800_sitsa", A800_ROM_MICROCALC);
device.option_add_internal("a800_corina", A800_ROM); // NOT SUPPORTED YET!
device.option_add( "rtime8", A800_RTIME8); // not a ROM cartridge
device.option_add_internal("xegs", XEGS_ROM);
}

View File

@ -0,0 +1,70 @@
// license:BSD-3-Clause
// copyright-holders:AJR
/***********************************************************************************************************
ICD R-Time 8 (Atari 800 cartridge)
The circuitry in this clock cartridge is very simple, containing the RTC itself, oscillator and
battery, and a 74HCT138 to decode the $D5B8-$D5BF address range from the /CCTL and A7-A3 pins. No ROM
is included; however, the cartridge can be placed in the (currently unemulated) passthrough slot of the
SpartaDOS X cartridge.
***********************************************************************************************************/
#include "emu.h"
#include "rtime8.h"
// device type definition
DEFINE_DEVICE_TYPE(A800_RTIME8, a800_rtime8_device, "a800_rtime8", "ICD R-Time 8")
//-------------------------------------------------
// a800_rtime8_device - constructor
//-------------------------------------------------
a800_rtime8_device::a800_rtime8_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, A800_RTIME8, tag, owner, clock)
, device_a800_cart_interface(mconfig, *this)
, m_rtc(*this, "rtc")
{
}
//-------------------------------------------------
// device_add_mconfig - configure subdevices
//-------------------------------------------------
void a800_rtime8_device::device_add_mconfig(machine_config &config)
{
M3002(config, m_rtc, 32.768_kHz_XTAL);
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void a800_rtime8_device::device_start()
{
}
//-------------------------------------------------
// read_d5xx - handle reads from $D500-$D5FF
//-------------------------------------------------
u8 a800_rtime8_device::read_d5xx(offs_t offset)
{
if ((offset & 0xf8) == 0xb8)
return m_rtc->read(); // TODO: D7-D4 is open bus, in case this matters
else
return 0xff;
}
//-------------------------------------------------
// write_d5xx - handle writes to $D500-$D5FF
//-------------------------------------------------
void a800_rtime8_device::write_d5xx(offs_t offset, u8 data)
{
if ((offset & 0xf8) == 0xb8)
m_rtc->write(data & 0x0f);
}

View File

@ -0,0 +1,37 @@
// license:BSD-3-Clause
// copyright-holders:AJR
#ifndef MAME_BUS_A800_RTIME8_H
#define MAME_BUS_A800_RTIME8_H
#pragma once
#include "a800_slot.h"
#include "machine/m3002.h"
// ======================> a800_rtime8_device
class a800_rtime8_device : public device_t, public device_a800_cart_interface
{
public:
// construction/destruction
a800_rtime8_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// device-level overrides
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
// device_a800_cart_interface overrides
virtual u8 read_d5xx(offs_t offset) override;
virtual void write_d5xx(offs_t offset, u8 data) override;
private:
required_device<m3002_device> m_rtc;
};
// device type declaration
DECLARE_DEVICE_TYPE(A800_RTIME8, a800_rtime8_device)
#endif // MAME_BUS_A800_RTIME8_H

View File

@ -1919,6 +1919,7 @@ void a400_state::setup_cart(a800_cart_slot_device *slot)
m_cart_disabled = 0;
m_last_offs = -1;
// FIXME: this driver should not have to differentiate between cartridge types
if (slot->exists())
{
switch (slot->get_cart_type())
@ -2002,6 +2003,13 @@ void a400_state::setup_cart(a800_cart_slot_device *slot)
break;
}
}
else if (slot->get_card_device() != nullptr)
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8sm_delegate(*slot, FUNC(a800_cart_slot_device::read_80xx)));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xbfff, write8sm_delegate(*slot, FUNC(a800_cart_slot_device::write_80xx)));
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd500, 0xd5ff, read8sm_delegate(*slot, FUNC(a800_cart_slot_device::read_d5xx)));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8sm_delegate(*slot, FUNC(a800_cart_slot_device::write_d5xx)));
}
}