mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
-astrohome: Added cassette support for the AstroBASIC cartridge. [Ryan Holtz, BallyAlley]
This commit is contained in:
parent
6b430378e1
commit
e23c64eb76
@ -132,6 +132,7 @@
|
||||
<year>1981</year>
|
||||
<publisher>Astrovision</publisher>
|
||||
<part name="cart" interface="astrocde_cart">
|
||||
<feature name="slot" value="rom_cass" />
|
||||
<dataarea name="rom" size="4096">
|
||||
<rom name="astrobas.bin" size="4096" crc="70514687" sha1="a2ac8995a6217b7190aa9b18f49261c0ed3c6b5a" offset="0" />
|
||||
</dataarea>
|
||||
|
@ -20,6 +20,7 @@
|
||||
DEFINE_DEVICE_TYPE(ASTROCADE_ROM_STD, astrocade_rom_device, "astrocade_rom", "Bally Astrocade Standard Carts")
|
||||
DEFINE_DEVICE_TYPE(ASTROCADE_ROM_256K, astrocade_rom_256k_device, "astrocade_256k", "Bally Astrocade 256K Carts")
|
||||
DEFINE_DEVICE_TYPE(ASTROCADE_ROM_512K, astrocade_rom_512k_device, "astrocade_512k", "Bally Astrocade 512K Carts")
|
||||
DEFINE_DEVICE_TYPE(ASTROCADE_ROM_CASS, astrocade_rom_cass_device, "astrocade_cass", "Bally Astrocade AstroBASIC Cart")
|
||||
|
||||
|
||||
astrocade_rom_device::astrocade_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
@ -42,6 +43,12 @@ astrocade_rom_512k_device::astrocade_rom_512k_device(const machine_config &mconf
|
||||
{
|
||||
}
|
||||
|
||||
astrocade_rom_cass_device::astrocade_rom_cass_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: astrocade_rom_device(mconfig, ASTROCADE_ROM_CASS, tag, owner, clock)
|
||||
, m_cassette(*this, "cassette")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void astrocade_rom_256k_device::device_start()
|
||||
{
|
||||
@ -95,3 +102,31 @@ READ8_MEMBER(astrocade_rom_512k_device::read_rom)
|
||||
else // 0x3fc0-0x3fff
|
||||
return m_base_bank = offset & 0x7f;
|
||||
}
|
||||
|
||||
READ8_MEMBER(astrocade_rom_cass_device::read_rom)
|
||||
{
|
||||
if (offset < m_rom_size)
|
||||
return m_rom[offset];
|
||||
else if ((offset & 0x1c00) == 0x1800)
|
||||
{
|
||||
m_cassette->output(+1);
|
||||
return 0xff;
|
||||
}
|
||||
else if ((offset & 0x1c00) == 0x1c00)
|
||||
{
|
||||
m_cassette->output(-1);
|
||||
return m_cassette->input() > 0.0 ? 0 : 1;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
mapper specific device configuration
|
||||
-------------------------------------------------*/
|
||||
|
||||
void astrocade_rom_cass_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
CASSETTE(config, m_cassette);
|
||||
m_cassette->set_default_state(CASSETTE_STOPPED);
|
||||
m_cassette->set_interface("astrocade_cass");
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "slot.h"
|
||||
#include "imagedev/cassette.h"
|
||||
|
||||
|
||||
// ======================> astrocade_rom_device
|
||||
@ -64,10 +65,30 @@ private:
|
||||
uint8_t m_base_bank;
|
||||
};
|
||||
|
||||
// ======================> astrocade_rom_cass_device
|
||||
|
||||
class astrocade_rom_cass_device : public astrocade_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
astrocade_rom_cass_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_rom) override;
|
||||
|
||||
private:
|
||||
virtual void device_start() override { }
|
||||
virtual void device_reset() override { }
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ASTROCADE_ROM_STD, astrocade_rom_device)
|
||||
DECLARE_DEVICE_TYPE(ASTROCADE_ROM_256K, astrocade_rom_256k_device)
|
||||
DECLARE_DEVICE_TYPE(ASTROCADE_ROM_512K, astrocade_rom_512k_device)
|
||||
DECLARE_DEVICE_TYPE(ASTROCADE_ROM_CASS, astrocade_rom_cass_device)
|
||||
|
||||
#endif // MAME_BUS_ASTROCADE_ROM_H
|
||||
|
@ -104,7 +104,8 @@ static const astrocade_slot slot_list[] =
|
||||
{
|
||||
{ ASTROCADE_STD, "rom" },
|
||||
{ ASTROCADE_256K, "rom_256k" },
|
||||
{ ASTROCADE_512K, "rom_512k" }
|
||||
{ ASTROCADE_512K, "rom_512k" },
|
||||
{ ASTROCADE_CASS, "rom_cass" }
|
||||
};
|
||||
|
||||
static int astrocade_get_pcb_id(const char *slot)
|
||||
|
@ -19,7 +19,8 @@ enum
|
||||
{
|
||||
ASTROCADE_STD = 0,
|
||||
ASTROCADE_256K,
|
||||
ASTROCADE_512K
|
||||
ASTROCADE_512K,
|
||||
ASTROCADE_CASS
|
||||
};
|
||||
|
||||
|
||||
|
@ -201,6 +201,7 @@ static void astrocade_cart(device_slot_interface &device)
|
||||
device.option_add_internal("rom", ASTROCADE_ROM_STD);
|
||||
device.option_add_internal("rom_256k", ASTROCADE_ROM_256K);
|
||||
device.option_add_internal("rom_512k", ASTROCADE_ROM_512K);
|
||||
device.option_add_internal("rom_cass", ASTROCADE_ROM_CASS);
|
||||
}
|
||||
|
||||
static void astrocade_exp(device_slot_interface &device)
|
||||
|
Loading…
Reference in New Issue
Block a user