apple2: Added support for the ProDOS ROM Drive card. [R. Belmont]

This commit is contained in:
arbee 2022-01-04 21:26:58 -05:00
parent 6b615007ff
commit 436525a8c7
4 changed files with 145 additions and 0 deletions

View File

@ -2587,6 +2587,8 @@ if (BUSES["A2BUS"]~=null) then
MAME_DIR .. "src/devices/bus/a2bus/nippelclock.h",
MAME_DIR .. "src/devices/bus/a2bus/pc_xporter.cpp",
MAME_DIR .. "src/devices/bus/a2bus/pc_xporter.h",
MAME_DIR .. "src/devices/bus/a2bus/prodosromdrive.cpp",
MAME_DIR .. "src/devices/bus/a2bus/prodosromdrive.h",
MAME_DIR .. "src/devices/bus/a2bus/q68.cpp",
MAME_DIR .. "src/devices/bus/a2bus/q68.h",
MAME_DIR .. "src/devices/bus/a2bus/ramcard128k.cpp",

View File

@ -47,6 +47,7 @@
#include "bus/a2bus/grappler.h"
#include "bus/a2bus/laser128.h"
#include "bus/a2bus/mouse.h"
#include "bus/a2bus/prodosromdrive.h"
#include "bus/a2bus/ramcard128k.h"
#include "bus/a2bus/ramcard16k.h"
#include "bus/a2bus/ssbapple.h"
@ -215,6 +216,7 @@ void apple2e_cards(device_slot_interface &device)
device.option_add("q68plus", A2BUS_Q68PLUS); // Stellation Q68 Plus 68000 card
device.option_add("a2sd", A2BUS_A2SD); // Florian Reitz AppleIISD
device.option_add("grafex", A2BUS_GRAFEX); // Grafex card (uPD7220 graphics)
device.option_add("pdromdrive", A2BUS_PRODOSROMDRIVE); // ProDOS ROM Drive
}
void apple2gs_cards(device_slot_interface &device)
@ -285,6 +287,7 @@ void apple2gs_cards(device_slot_interface &device)
device.option_add("q68", A2BUS_Q68); // Stellation Q68 68000 card
device.option_add("q68plus", A2BUS_Q68PLUS); // Stellation Q68 Plus 68000 card
device.option_add("grafex", A2BUS_GRAFEX); // Grafex card (uPD7220 graphics)
device.option_add("pdromdrive", A2BUS_PRODOSROMDRIVE); // ProDOS ROM Drive
}
void apple3_cards(device_slot_interface &device)

View File

@ -0,0 +1,119 @@
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/*********************************************************************
prodosromdrive.cpp
Implementation of the ProDOS ROM Drive card
This is a hobbyist board which provides a minimal SmartPort API
interface to boot from a 1 MiB disk image stored in a 27C080 or
compatible EPROM.
Board and firmware by Terence J. Boldt
http://apple2.ca/
https://github.com/tjboldt/ProDOS-ROM-Drive
The firmware requires a IIe or better, and some of the games
included require a 65C02 (enhanced IIe).
*********************************************************************/
#include "emu.h"
#include "prodosromdrive.h"
namespace {
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class a2bus_pdromdrive_device : public device_t,
public device_a2bus_card_interface
{
public:
// construction/destruction
a2bus_pdromdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
a2bus_pdromdrive_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_start() override;
virtual const tiny_rom_entry *device_rom_region() const override;
// overrides of standard a2bus slot functions
virtual uint8_t read_c0nx(uint8_t offset) override;
virtual void write_c0nx(uint8_t offset, uint8_t data) override;
virtual uint8_t read_cnxx(uint8_t offset) override;
private:
required_region_ptr<u8> m_rom;
u16 m_latch;
};
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
a2bus_pdromdrive_device::a2bus_pdromdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
a2bus_pdromdrive_device(mconfig, A2BUS_PRODOSROMDRIVE, tag, owner, clock)
{
}
a2bus_pdromdrive_device::a2bus_pdromdrive_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
device_a2bus_card_interface(mconfig, *this),
m_rom(*this, "romdrive")
{
}
void a2bus_pdromdrive_device::device_start()
{
save_item(NAME(m_latch));
}
ROM_START( pdromdrive )
ROM_REGION(0x100000, "romdrive", 0)
ROM_LOAD( "gameswithfirmware.bin", 0x000000, 0x100000, CRC(a1efd23b) SHA1(f0733b7a68126adc5247a1008de2ea4f65ad645a) )
ROM_END
const tiny_rom_entry *a2bus_pdromdrive_device::device_rom_region() const
{
return ROM_NAME(pdromdrive);
}
uint8_t a2bus_pdromdrive_device::read_c0nx(uint8_t offset)
{
return m_rom[(m_latch << 4) | (offset & 0xf)];
}
void a2bus_pdromdrive_device::write_c0nx(uint8_t offset, uint8_t data)
{
switch (offset)
{
case 0:
m_latch &= 0xff00;
m_latch |= data;
break;
case 1:
m_latch &= 0x00ff;
m_latch |= (data << 8);
break;
}
}
uint8_t a2bus_pdromdrive_device::read_cnxx(uint8_t offset)
{
return m_rom[offset + 0x300];
}
} // anonymous namespace
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_PRODOSROMDRIVE, device_a2bus_card_interface, a2bus_pdromdrive_device, "a2pdromdr", "ProDOS ROM Drive")

View File

@ -0,0 +1,21 @@
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/*********************************************************************
prodosromdrive.h
Implementation of the ProDOS ROM Drive card
*********************************************************************/
#ifndef MAME_BUS_A2BUS_PRODOSROMDRIVE_H
#define MAME_BUS_A2BUS_PRODOSROMDRIVE_H
#pragma once
#include "a2bus.h"
// device type definition
DECLARE_DEVICE_TYPE(A2BUS_PRODOSROMDRIVE, device_a2bus_card_interface)
#endif // MAME_BUS_A2BUS_PRODOSROMDRIVE_H