mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
a2bus, spectrum/exp: set a better example (nw)
This commit is contained in:
parent
f62e2dd925
commit
5b939d1d37
@ -101,8 +101,6 @@ a2bus_aesms_device::a2bus_aesms_device(const machine_config &mconfig, const char
|
||||
|
||||
void a2bus_sn76489_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
m_latch0 = m_latch1 = m_latch2 = m_latch3 = 0;
|
||||
|
||||
save_item(NAME(m_latch0));
|
||||
|
@ -87,9 +87,6 @@ a2bus_applicard_device::a2bus_applicard_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_applicard_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
// locate Z80 ROM
|
||||
m_z80rom = device().machine().root_device().memregion(this->subtag(Z80_ROM_REGION).c_str())->base();
|
||||
|
||||
|
@ -71,8 +71,6 @@ a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, devi
|
||||
|
||||
void a2bus_arcboard_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_arcboard_device::device_reset()
|
||||
|
@ -307,22 +307,30 @@ device_a2bus_card_interface::~device_a2bus_card_interface()
|
||||
void device_a2bus_card_interface::static_set_a2bus_tag(device_t &device, const char *tag, const char *slottag)
|
||||
{
|
||||
device_a2bus_card_interface &a2bus_card = dynamic_cast<device_a2bus_card_interface &>(device);
|
||||
assert(a2bus_card);
|
||||
a2bus_card.m_a2bus_tag = tag;
|
||||
a2bus_card.m_a2bus_slottag = slottag;
|
||||
}
|
||||
|
||||
void device_a2bus_card_interface::set_a2bus_device()
|
||||
void device_a2bus_card_interface::interface_pre_start()
|
||||
{
|
||||
// extract the slot number from the last digit of the slot tag
|
||||
int tlen = strlen(m_a2bus_slottag);
|
||||
|
||||
m_slot = (m_a2bus_slottag[tlen-1] - '0');
|
||||
|
||||
if (m_slot < 0 || m_slot > 7)
|
||||
if (!m_a2bus)
|
||||
{
|
||||
fatalerror("Slot %x out of range for Apple II Bus\n", m_slot);
|
||||
}
|
||||
// extract the slot number from the last digit of the slot tag
|
||||
size_t const tlen = strlen(m_a2bus_slottag);
|
||||
|
||||
m_a2bus = dynamic_cast<a2bus_device *>(device().machine().device(m_a2bus_tag));
|
||||
m_a2bus->add_a2bus_card(m_slot, this);
|
||||
m_slot = (m_a2bus_slottag[tlen-1] - '0');
|
||||
if (m_slot < 0 || m_slot > 7)
|
||||
fatalerror("Slot %x out of range for Apple II Bus\n", m_slot);
|
||||
|
||||
device_t *const bus = device().machine().device(m_a2bus_tag);
|
||||
if (!bus)
|
||||
fatalerror("Can't find Apple II Bus device %s\n", m_a2bus_tag);
|
||||
|
||||
m_a2bus = dynamic_cast<a2bus_device *>(bus);
|
||||
if (!m_a2bus)
|
||||
fatalerror("Device %s (%s) is not an instance of a2bus_device\n", bus->tag(), bus->name());
|
||||
|
||||
m_a2bus->add_a2bus_card(m_slot, this);
|
||||
}
|
||||
}
|
||||
|
@ -67,14 +67,14 @@ public:
|
||||
// construction/destruction
|
||||
a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
// inline configuration
|
||||
static void static_set_a2bus_slot(device_t &device, const char *tag, const char *slottag);
|
||||
protected:
|
||||
a2bus_slot_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;
|
||||
|
||||
// configuration
|
||||
const char *m_a2bus_tag, *m_a2bus_slottag;
|
||||
};
|
||||
@ -84,6 +84,7 @@ DECLARE_DEVICE_TYPE(A2BUS_SLOT, a2bus_slot_device)
|
||||
|
||||
|
||||
class device_a2bus_card_interface;
|
||||
|
||||
// ======================> a2bus_device
|
||||
class a2bus_device : public device_t
|
||||
{
|
||||
@ -167,8 +168,6 @@ public:
|
||||
|
||||
device_a2bus_card_interface *next() const { return m_next; }
|
||||
|
||||
void set_a2bus_device();
|
||||
|
||||
uint32_t get_slotromspace() { return 0xc000 | (m_slot<<8); } // return Cn00 address for this slot
|
||||
uint32_t get_slotiospace() { return 0xc080 + (m_slot<<4); } // return C0n0 address for this slot
|
||||
|
||||
@ -194,6 +193,12 @@ public:
|
||||
protected:
|
||||
device_a2bus_card_interface(const machine_config &mconfig, device_t &device);
|
||||
|
||||
virtual void interface_pre_start() override;
|
||||
|
||||
int slotno() const { assert(m_a2bus); return m_slot; }
|
||||
a2bus_device &a2bus() { assert(m_a2bus); return *m_a2bus; }
|
||||
|
||||
private:
|
||||
a2bus_device *m_a2bus;
|
||||
const char *m_a2bus_tag, *m_a2bus_slottag;
|
||||
int m_slot;
|
||||
|
@ -102,9 +102,6 @@ a2bus_cffa2_6502_device::a2bus_cffa2_6502_device(const machine_config &mconfig,
|
||||
|
||||
void a2bus_cffa2000_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(CFFA2_ROM_REGION).c_str())->base();
|
||||
|
||||
// patch default setting so slave device is enabled and up to 13 devices on both connectors
|
||||
@ -216,7 +213,7 @@ void a2bus_cffa2000_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||
|
||||
uint8_t a2bus_cffa2000_device::read_cnxx(uint8_t offset)
|
||||
{
|
||||
int slotimg = m_slot * 0x100;
|
||||
int const slotimg = slotno() * 0x100;
|
||||
|
||||
// ROM contains a CnXX image for each of slots 1-7
|
||||
return m_eeprom[offset+slotimg];
|
||||
|
@ -114,9 +114,6 @@ a2bus_corvus_device::a2bus_corvus_device(const machine_config &mconfig, const ch
|
||||
|
||||
void a2bus_corvus_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(CORVUS_ROM_REGION).c_str())->base();
|
||||
}
|
||||
|
||||
|
@ -117,9 +117,6 @@ a2bus_agat7flop_device::a2bus_agat7flop_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_floppy_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(DISKII_ROM_REGION).c_str())->base();
|
||||
}
|
||||
|
||||
|
@ -78,9 +78,6 @@ a2bus_diskiing_device::a2bus_diskiing_device(const machine_config &mconfig, cons
|
||||
|
||||
void a2bus_diskiing_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(DISKII_ROM_REGION).c_str())->base();
|
||||
}
|
||||
|
||||
|
@ -63,8 +63,6 @@ a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, const char *ta
|
||||
|
||||
void a2bus_dx1_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
uint8_t a2bus_dx1_device::read_c0nx(uint8_t offset)
|
||||
|
@ -61,8 +61,6 @@ a2bus_echoii_device::a2bus_echoii_device(const machine_config &mconfig, const ch
|
||||
|
||||
void a2bus_echoii_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_echoii_device::device_reset()
|
||||
|
@ -129,9 +129,6 @@ a2bus_hsscsi_device::a2bus_hsscsi_device(const machine_config &mconfig, const ch
|
||||
|
||||
void a2bus_hsscsi_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = machine().root_device().memregion(this->subtag(SCSI_ROM_REGION).c_str())->base();
|
||||
|
||||
memset(m_ram, 0, 8192);
|
||||
|
@ -81,8 +81,6 @@ a2bus_mcms1_device::a2bus_mcms1_device(const machine_config &mconfig, const char
|
||||
|
||||
void a2bus_mcms1_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_mcms1_device::device_reset()
|
||||
@ -159,18 +157,13 @@ a2bus_mcms2_device::a2bus_mcms2_device(const machine_config &mconfig, const char
|
||||
|
||||
void a2bus_mcms2_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
if (m_slot < 2)
|
||||
{
|
||||
if (slotno() < 2)
|
||||
fatalerror("MCMS: Card 2 must be in slot 2 or greater\n");
|
||||
}
|
||||
}
|
||||
|
||||
void a2bus_mcms2_device::device_reset()
|
||||
{
|
||||
m_card1 = static_cast<a2bus_mcms1_device *>(m_a2bus->m_device_list[m_slot-1]);
|
||||
m_card1 = downcast<a2bus_mcms1_device *>(a2bus().m_device_list[slotno()-1]);
|
||||
m_engine = m_card1->get_engine();
|
||||
}
|
||||
|
||||
|
@ -95,9 +95,6 @@ a2bus_ramfactor_device::a2bus_ramfactor_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_memexp_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(MEMEXP_ROM_REGION).c_str())->base();
|
||||
|
||||
memset(m_ram, 0xff, 1024*1024*sizeof(uint8_t));
|
||||
@ -193,15 +190,13 @@ void a2bus_memexp_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||
|
||||
uint8_t a2bus_memexp_device::read_cnxx(uint8_t offset)
|
||||
{
|
||||
int slotimg = m_slot * 0x100;
|
||||
int const slotimg = slotno() * 0x100;
|
||||
|
||||
// first 0x400 of ROM contains a CnXX image for each of slots 1-7, last 0x400 is c800 image
|
||||
if ((m_isramfactor) && (m_regs[0xf] & 0x01))
|
||||
{
|
||||
return m_rom[offset+slotimg+0x1000];
|
||||
}
|
||||
|
||||
return m_rom[offset+slotimg];
|
||||
else
|
||||
return m_rom[offset+slotimg];
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
@ -212,9 +207,7 @@ uint8_t a2bus_memexp_device::read_c800(uint16_t offset)
|
||||
{
|
||||
// c70a diags confirm: bit 1 of cn0F banks in the second half of the ROM
|
||||
if ((m_isramfactor) && (m_regs[0xf] & 0x01))
|
||||
{
|
||||
return m_rom[offset+0x1800];
|
||||
}
|
||||
|
||||
return m_rom[offset+0x800];
|
||||
else
|
||||
return m_rom[offset+0x800];
|
||||
}
|
||||
|
@ -74,8 +74,6 @@ a2bus_midi_device::a2bus_midi_device(const machine_config &mconfig, device_type
|
||||
|
||||
void a2bus_midi_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_midi_device::device_reset()
|
||||
|
@ -145,9 +145,6 @@ a2bus_echoplus_device::a2bus_echoplus_device(const machine_config &mconfig, cons
|
||||
|
||||
void a2bus_ayboard_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
save_item(NAME(m_porta1));
|
||||
save_item(NAME(m_porta2));
|
||||
}
|
||||
@ -250,7 +247,7 @@ void a2bus_ayboard_device::write_cnxx(uint8_t offset, uint8_t data)
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("Mockingboard(%d): unk write %02x to Cn%02X (%s)\n", m_slot, data, offset, machine().describe_context());
|
||||
logerror("Mockingboard(%d): unk write %02x to Cn%02X (%s)\n", slotno(), data, offset, machine().describe_context());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,9 +115,6 @@ a2bus_pic_device::a2bus_pic_device(const machine_config &mconfig, device_type ty
|
||||
|
||||
void a2bus_pic_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(PIC_ROM_REGION).c_str())->base();
|
||||
|
||||
m_timer = timer_alloc(0, nullptr);
|
||||
|
@ -55,8 +55,6 @@ a2bus_sam_device::a2bus_sam_device(const machine_config &mconfig, const char *ta
|
||||
|
||||
void a2bus_sam_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_sam_device::device_reset()
|
||||
|
@ -122,9 +122,6 @@ a2bus_scsi_device::a2bus_scsi_device(const machine_config &mconfig, const char *
|
||||
|
||||
void a2bus_scsi_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(SCSI_ROM_REGION).c_str())->base();
|
||||
|
||||
memset(m_ram, 0, 8192);
|
||||
|
@ -63,9 +63,6 @@ a2bus_softcard_device::a2bus_softcard_device(const machine_config &mconfig, cons
|
||||
|
||||
void a2bus_softcard_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
save_item(NAME(m_bEnabled));
|
||||
save_item(NAME(m_FirstZ80Boot));
|
||||
}
|
||||
|
@ -143,9 +143,6 @@ a2bus_ssc_device::a2bus_ssc_device(const machine_config &mconfig, device_type ty
|
||||
|
||||
void a2bus_ssc_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = machine().root_device().memregion(this->subtag(SSC_ROM_REGION).c_str())->base();
|
||||
}
|
||||
|
||||
|
@ -61,9 +61,6 @@ a2bus_swyft_device::a2bus_swyft_device(const machine_config &mconfig, device_typ
|
||||
|
||||
void a2bus_swyft_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(SWYFT_ROM_REGION).c_str())->base();
|
||||
|
||||
save_item(NAME(m_rombank));
|
||||
|
@ -79,9 +79,6 @@ a2bus_themill_device::a2bus_themill_device(const machine_config &mconfig, const
|
||||
|
||||
void a2bus_themill_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
save_item(NAME(m_bEnabled));
|
||||
save_item(NAME(m_flipAddrSpace));
|
||||
save_item(NAME(m_6809Mode));
|
||||
|
@ -89,9 +89,6 @@ a2bus_thunderclock_device::a2bus_thunderclock_device(const machine_config &mconf
|
||||
|
||||
void a2bus_thunderclock_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(THUNDERCLOCK_ROM_REGION).c_str())->base();
|
||||
|
||||
save_item(NAME(m_dataout));
|
||||
|
@ -157,9 +157,6 @@ a2bus_ultratermenh_device::a2bus_ultratermenh_device(const machine_config &mconf
|
||||
|
||||
void a2bus_videx160_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = machine().root_device().memregion(this->subtag(ULTRATERM_ROM_REGION).c_str())->base();
|
||||
|
||||
m_chrrom = machine().root_device().memregion(this->subtag(ULTRATERM_GFX_REGION).c_str())->base();
|
||||
@ -256,7 +253,7 @@ void a2bus_videx160_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||
|
||||
uint8_t a2bus_videx160_device::read_cnxx(uint8_t offset)
|
||||
{
|
||||
return m_rom[offset+(m_slot * 0x100)];
|
||||
return m_rom[offset+(slotno() * 0x100)];
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
@ -211,9 +211,6 @@ a2bus_aevm80_device::a2bus_aevm80_device(const machine_config &mconfig, const ch
|
||||
|
||||
void a2bus_videx80_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(VIDEOTERM_ROM_REGION).c_str())->base();
|
||||
|
||||
m_chrrom = device().machine().root_device().memregion(this->subtag(VIDEOTERM_GFX_REGION).c_str())->base();
|
||||
|
@ -131,9 +131,6 @@ a2bus_vulcangold_device::a2bus_vulcangold_device(const machine_config &mconfig,
|
||||
|
||||
void a2bus_vulcanbase_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(VULCAN_ROM_REGION).c_str())->base();
|
||||
|
||||
save_item(NAME(m_lastdata));
|
||||
@ -262,7 +259,7 @@ void a2bus_vulcanbase_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||
|
||||
uint8_t a2bus_vulcanbase_device::read_cnxx(uint8_t offset)
|
||||
{
|
||||
int slotimg = m_slot * 0x100;
|
||||
int const slotimg = slotno() * 0x100;
|
||||
|
||||
// ROM contains a CnXX image for each of slots 1-7 at 0x3400
|
||||
return m_rom[offset+slotimg+0x3400];
|
||||
|
@ -81,9 +81,6 @@ a2bus_zipdrive_device::a2bus_zipdrive_device(const machine_config &mconfig, cons
|
||||
|
||||
void a2bus_zipdrivebase_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(ZIPDRIVE_ROM_REGION).c_str())->base();
|
||||
|
||||
save_item(NAME(m_lastdata));
|
||||
@ -174,7 +171,7 @@ void a2bus_zipdrivebase_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||
|
||||
uint8_t a2bus_zipdrivebase_device::read_cnxx(uint8_t offset)
|
||||
{
|
||||
int slotimg = m_slot * 0x100;
|
||||
int const slotimg = slotno() * 0x100;
|
||||
|
||||
// ROM contains CnXX images for each of slots 1-7 at 0x0 and 0x1000
|
||||
return m_rom[offset+slotimg+0x1000];
|
||||
|
@ -48,9 +48,6 @@ a2bus_agat7langcard_device::a2bus_agat7langcard_device(const machine_config &mco
|
||||
|
||||
void a2bus_agat7langcard_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
memset(m_ram, 0, 32 * 1024);
|
||||
|
||||
save_item(NAME(m_inh_state));
|
||||
|
@ -48,9 +48,6 @@ a2bus_agat7ram_device::a2bus_agat7ram_device(const machine_config &mconfig, cons
|
||||
|
||||
void a2bus_agat7ram_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
memset(m_ram, 0, 32 * 1024);
|
||||
|
||||
save_item(NAME(m_inh_state));
|
||||
|
@ -133,9 +133,6 @@ void a2bus_agat840k_hle_device::index_callback(int unit, int state)
|
||||
|
||||
void a2bus_agat840k_hle_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(AGAT840K_ROM_REGION).c_str())->base();
|
||||
|
||||
m_mxcs = MXCSR_SYNC;
|
||||
|
@ -128,9 +128,6 @@ a2bus_corvfdc01_device::a2bus_corvfdc01_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_corvfdc01_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(FDC01_ROM_REGION).c_str())->base();
|
||||
|
||||
save_item(NAME(m_fdc_local_status));
|
||||
|
@ -96,9 +96,6 @@ a2bus_corvfdc02_device::a2bus_corvfdc02_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_corvfdc02_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(FDC02_ROM_REGION).c_str())->base();
|
||||
|
||||
m_timer = timer_alloc(0);
|
||||
|
@ -120,8 +120,6 @@ a2bus_ezcgi_9958_device::a2bus_ezcgi_9958_device(const machine_config &mconfig,
|
||||
|
||||
void a2bus_ezcgi_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_ezcgi_device::device_reset()
|
||||
@ -130,8 +128,6 @@ void a2bus_ezcgi_device::device_reset()
|
||||
|
||||
void a2bus_ezcgi_9938_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_ezcgi_9938_device::device_reset()
|
||||
@ -140,8 +136,6 @@ void a2bus_ezcgi_9938_device::device_reset()
|
||||
|
||||
void a2bus_ezcgi_9958_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_ezcgi_9958_device::device_reset()
|
||||
|
@ -11,6 +11,9 @@
|
||||
#include "emu.h"
|
||||
#include "laser128.h"
|
||||
|
||||
//#define VERBOSE 1
|
||||
#include "logmacro.h"
|
||||
|
||||
/***************************************************************************
|
||||
PARAMETERS
|
||||
***************************************************************************/
|
||||
@ -54,9 +57,6 @@ a2bus_laser128_device::a2bus_laser128_device(const machine_config &mconfig, cons
|
||||
|
||||
void a2bus_laser128_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
save_item(NAME(m_slot7_bank));
|
||||
save_item(NAME(m_slot7_ram_bank));
|
||||
}
|
||||
@ -79,12 +79,12 @@ void a2bus_laser128_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||
|
||||
uint8_t a2bus_laser128_device::read_cnxx(uint8_t offset)
|
||||
{
|
||||
return m_rom[offset + (m_slot * 0x100) + 0x4000];
|
||||
return m_rom[offset + (slotno() * 0x100) + 0x4000];
|
||||
}
|
||||
|
||||
uint8_t a2bus_laser128_device::read_c800(uint16_t offset)
|
||||
{
|
||||
switch (m_slot)
|
||||
switch (slotno())
|
||||
{
|
||||
case 1:
|
||||
return m_rom[(offset & 0x7ff) + 0x4800];
|
||||
@ -100,10 +100,9 @@ uint8_t a2bus_laser128_device::read_c800(uint16_t offset)
|
||||
|
||||
case 7:
|
||||
if (offset < 0x400)
|
||||
{
|
||||
return m_slot7_ram[offset];
|
||||
}
|
||||
return m_rom[(offset & 0x3ff) + 0x6000 + m_slot7_bank];
|
||||
else
|
||||
return m_rom[(offset & 0x3ff) + 0x6000 + m_slot7_bank];
|
||||
}
|
||||
|
||||
return 0xff;
|
||||
@ -111,29 +110,34 @@ uint8_t a2bus_laser128_device::read_c800(uint16_t offset)
|
||||
|
||||
void a2bus_laser128_device::write_c800(uint16_t offset, uint8_t data)
|
||||
{
|
||||
if ((m_slot == 7) && (offset < 0x400))
|
||||
if ((slotno() == 7) && (offset < 0x400))
|
||||
{
|
||||
m_slot7_ram[offset] = data;
|
||||
}
|
||||
|
||||
// UDCREG
|
||||
if ((m_slot == 7) && (offset == 0x7f8))
|
||||
if ((slotno() == 7) && (offset == 0x7f8))
|
||||
{
|
||||
// printf("%02x to UDCREG\n", data);
|
||||
LOG("%02x to UDCREG\n", data);
|
||||
|
||||
m_slot7_ram_bank = (data & 0x8) ? 0x400 : 0;
|
||||
m_slot7_bank = (((data >> 4) & 0x7) * 0x400);
|
||||
|
||||
// printf("\tRAM bank %x, ROM bank %x\n", m_slot7_ram_bank, m_slot7_bank);
|
||||
LOG("\tRAM bank %x, ROM bank %x\n", m_slot7_ram_bank, m_slot7_bank);
|
||||
}
|
||||
}
|
||||
|
||||
bool a2bus_laser128_device::take_c800()
|
||||
{
|
||||
if ((m_slot == 1) || (m_slot == 2) || (m_slot == 5) || (m_slot == 6) || (m_slot == 7))
|
||||
switch (slotno())
|
||||
{
|
||||
return true;
|
||||
case 1:
|
||||
case 2:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -180,9 +180,6 @@ a2bus_mouse_device::a2bus_mouse_device(const machine_config &mconfig, const char
|
||||
|
||||
void a2bus_mouse_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
// register save state variables
|
||||
save_item(NAME(m_port_a_in));
|
||||
save_item(NAME(m_port_b_in));
|
||||
|
@ -202,9 +202,6 @@ a2bus_pcxporter_device::a2bus_pcxporter_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_pcxporter_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
memset(m_ram, 0, 768*1024);
|
||||
memset(m_regs, 0, 0x400);
|
||||
m_offset = 0;
|
||||
|
@ -46,9 +46,6 @@ a2bus_ssramcard_device::a2bus_ssramcard_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_ssramcard_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
memset(m_ram, 0, 128*1024);
|
||||
|
||||
save_item(NAME(m_inh_state));
|
||||
|
@ -46,9 +46,6 @@ a2bus_ramcard_device::a2bus_ramcard_device(const machine_config &mconfig, const
|
||||
|
||||
void a2bus_ramcard_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
memset(m_ram, 0, 16*1024);
|
||||
|
||||
save_item(NAME(m_inh_state));
|
||||
|
@ -62,13 +62,8 @@ a2bus_ssb_device::a2bus_ssb_device(const machine_config &mconfig, const char *ta
|
||||
|
||||
void a2bus_ssb_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
if (m_slot != 2)
|
||||
{
|
||||
if (slotno() != 2)
|
||||
popmessage("SSB Card should be in slot 2!\n");
|
||||
}
|
||||
}
|
||||
|
||||
void a2bus_ssb_device::device_reset()
|
||||
|
@ -71,8 +71,6 @@ a2bus_ssprite_device::a2bus_ssprite_device(const machine_config &mconfig, device
|
||||
|
||||
void a2bus_ssprite_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
}
|
||||
|
||||
void a2bus_ssprite_device::device_reset()
|
||||
|
@ -138,9 +138,6 @@ a2bus_timemasterho_device::a2bus_timemasterho_device(const machine_config &mconf
|
||||
|
||||
void a2bus_timemasterho_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_rom = device().machine().root_device().memregion(this->subtag(TIMEMASTER_ROM_REGION).c_str())->base();
|
||||
}
|
||||
|
||||
|
@ -151,9 +151,6 @@ a2bus_transwarp_device::a2bus_transwarp_device(const machine_config &mconfig, co
|
||||
|
||||
void a2bus_transwarp_device::device_start()
|
||||
{
|
||||
// set_a2bus_device makes m_slot valid
|
||||
set_a2bus_device();
|
||||
|
||||
m_timer = timer_alloc(0);
|
||||
|
||||
save_item(NAME(m_bEnabled));
|
||||
|
@ -68,13 +68,27 @@ spectrum_expansion_slot_device::~spectrum_expansion_slot_device()
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_validity_check - device-specific checks
|
||||
//-------------------------------------------------
|
||||
|
||||
void spectrum_expansion_slot_device::device_validity_check(validity_checker &valid) const
|
||||
{
|
||||
device_t *const card(get_card_device());
|
||||
if (card && !dynamic_cast<device_spectrum_expansion_interface *>(card))
|
||||
osd_printf_error("Card device %s (%s) does not implement device_spectrum_expansion_interface\n", card->tag(), card->name());
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void spectrum_expansion_slot_device::device_start()
|
||||
{
|
||||
m_card = dynamic_cast<device_spectrum_expansion_interface *>(get_card_device());
|
||||
device_t *const card_device(get_card_device());
|
||||
m_card = dynamic_cast<device_spectrum_expansion_interface *>(card_device);
|
||||
if (card_device && !m_card)
|
||||
throw emu_fatalerror("spectrum_expansion_slot_device: card device %s (%s) does not implement device_spectrum_expansion_interface\n", card_device->tag(), card_device->name());
|
||||
|
||||
// resolve callbacks
|
||||
m_irq_handler.resolve_safe();
|
||||
@ -87,10 +101,6 @@ void spectrum_expansion_slot_device::device_start()
|
||||
|
||||
void spectrum_expansion_slot_device::device_reset()
|
||||
{
|
||||
if (get_card_device())
|
||||
{
|
||||
get_card_device()->reset();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -104,6 +104,7 @@ public:
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_validity_check(validity_checker &valid) const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user