mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
New working software list additions
----------------------------------- bbcm_cart: Master SD R2 [Ramptop]
This commit is contained in:
parent
852000bd4e
commit
cc7af448c6
@ -132,6 +132,18 @@ Acorn BBC Master ROM Cartridges
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="mastersdr2" cloneof="mastersd">
|
||||
<description>Master SD R2</description>
|
||||
<year>2020</year>
|
||||
<publisher>Ramtop</publisher>
|
||||
<part name="cart" interface="bbcm_cart">
|
||||
<feature name="slot" value="mastersdr2" />
|
||||
<dataarea name="rom" size="16384">
|
||||
<rom name="swmmfs-1.44r2.rom" size="16384" crc="36bc3af1" sha1="6086e31b3dd46595403a03e3027a5acd4d74d60b"/>
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="mega256">
|
||||
<description>Master Mega 256</description>
|
||||
<year>1987</year>
|
||||
|
@ -18,6 +18,7 @@
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(BBC_MASTERSD, bbc_mastersd_device, "bbc_mastersd", "MasterSD BBC Master SD Cartridge")
|
||||
DEFINE_DEVICE_TYPE(BBC_MASTERSDR2, bbc_mastersdr2_device, "bbc_mastersdr2", "MasterSD R2 BBC Master SD Cartridge")
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -38,8 +39,8 @@ void bbc_mastersd_device::device_add_mconfig(machine_config &config)
|
||||
// bbc_mastersd_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
bbc_mastersd_device::bbc_mastersd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, BBC_MASTERSD, tag, owner, clock)
|
||||
bbc_mastersd_device::bbc_mastersd_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_bbc_cart_interface(mconfig, *this)
|
||||
, m_sdcard(*this, "sdcard")
|
||||
, m_spi_clock_state(false)
|
||||
@ -48,6 +49,16 @@ bbc_mastersd_device::bbc_mastersd_device(const machine_config &mconfig, const ch
|
||||
{
|
||||
}
|
||||
|
||||
bbc_mastersd_device::bbc_mastersd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: bbc_mastersd_device(mconfig, BBC_MASTERSD, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
bbc_mastersdr2_device::bbc_mastersdr2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: bbc_mastersd_device(mconfig, BBC_MASTERSDR2, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
@ -110,6 +121,38 @@ uint8_t bbc_mastersd_device::read(offs_t offset, int infc, int infd, int romqa,
|
||||
return data;
|
||||
}
|
||||
|
||||
uint8_t bbc_mastersdr2_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
|
||||
{
|
||||
uint8_t data = 0xff;
|
||||
|
||||
if (infc)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x80: // SPI controller data port
|
||||
data = m_in_latch;
|
||||
break;
|
||||
|
||||
case 0x81: // SPI controller status register
|
||||
data = m_spi_clock_cycles > 0 ? 0x01 : 0x00;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (oe)
|
||||
{
|
||||
if (offset >= 0x3600 || romqa == 1)
|
||||
{
|
||||
data = m_ram[(offset & 0x3fff) | (romqa << 14)];
|
||||
}
|
||||
else
|
||||
{
|
||||
data = m_rom[offset & 0x3fff];
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// write - cartridge data write
|
||||
//-------------------------------------------------
|
||||
@ -139,6 +182,36 @@ void bbc_mastersd_device::write(offs_t offset, uint8_t data, int infc, int infd,
|
||||
}
|
||||
}
|
||||
|
||||
void bbc_mastersdr2_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
|
||||
{
|
||||
if (infc)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x80: // SPI controller data port
|
||||
m_out_latch = data;
|
||||
m_spi_clock_cycles = 8;
|
||||
|
||||
if (m_spi_clock_sysclk) // TODO: confirm fast/slow clock dividers
|
||||
m_spi_clock->adjust(attotime::from_hz(16_MHz_XTAL / 2), 0, attotime::from_hz(16_MHz_XTAL / 2));
|
||||
else
|
||||
m_spi_clock->adjust(attotime::from_hz(16_MHz_XTAL / 32), 0, attotime::from_hz(16_MHz_XTAL / 32));
|
||||
break;
|
||||
|
||||
case 0x81: // SPI controller clock register
|
||||
m_spi_clock_sysclk = bool(BIT(data, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (oe)
|
||||
{
|
||||
if (offset >= 0x3600 || romqa == 1)
|
||||
{
|
||||
m_ram[(offset & 0x3fff) | (romqa << 14)] = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TIMER_CALLBACK_MEMBER(bbc_mastersd_device::spi_clock)
|
||||
{
|
||||
|
@ -17,6 +17,8 @@
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> bbc_mastersd_device
|
||||
|
||||
class bbc_mastersd_device : public device_t, public device_bbc_cart_interface
|
||||
{
|
||||
public:
|
||||
@ -24,6 +26,8 @@ public:
|
||||
bbc_mastersd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
bbc_mastersd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
@ -35,7 +39,6 @@ protected:
|
||||
virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
|
||||
virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
|
||||
|
||||
private:
|
||||
required_device<spi_sdcard_device> m_sdcard;
|
||||
|
||||
TIMER_CALLBACK_MEMBER(spi_clock);
|
||||
@ -52,8 +55,25 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// ======================> bbc_mastersdr2_device
|
||||
|
||||
class bbc_mastersdr2_device : public bbc_mastersd_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
bbc_mastersdr2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// electron_cart_interface overrides
|
||||
virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
|
||||
virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(BBC_MASTERSD, bbc_mastersd_device)
|
||||
DECLARE_DEVICE_TYPE(BBC_MASTERSDR2, bbc_mastersdr2_device)
|
||||
|
||||
|
||||
#endif // MAME_BUS_BBC_CART_MASTERSD_H
|
||||
|
@ -75,6 +75,7 @@ void bbcm_cart(device_slot_interface &device)
|
||||
device.option_add_internal("aqr", ELECTRON_AQR);
|
||||
device.option_add_internal("click", BBC_CLICK);
|
||||
device.option_add_internal("mastersd", BBC_MASTERSD);
|
||||
device.option_add_internal("mastersdr2", BBC_MASTERSDR2);
|
||||
device.option_add_internal("mega256", BBC_MEGA256);
|
||||
device.option_add_internal("mr8000", BBC_MR8000);
|
||||
device.option_add_internal("msc", BBC_MSC);
|
||||
|
Loading…
Reference in New Issue
Block a user