emu/driver.cpp: Marked several device_t overrides as final.

There's too much opportunity for confusion if these are overridden
further down the tree.
This commit is contained in:
Vas Crabb 2026-05-24 04:31:13 +10:00
parent 2901f2b2d4
commit c47028689c
22 changed files with 229 additions and 232 deletions

View File

@ -3597,12 +3597,12 @@ if MACHINES["SPG2XX"] then
MAME_DIR .. "src/devices/machine/generalplus_gpl951xx_rtc.h", MAME_DIR .. "src/devices/machine/generalplus_gpl951xx_rtc.h",
MAME_DIR .. "src/devices/machine/generalplus_gpce4_soc.cpp", MAME_DIR .. "src/devices/machine/generalplus_gpce4_soc.cpp",
MAME_DIR .. "src/devices/machine/generalplus_gpce4_soc.h", MAME_DIR .. "src/devices/machine/generalplus_gpce4_soc.h",
MAME_DIR .. "src/devices/machine/generalplus_gpl_chx.cpp",
MAME_DIR .. "src/devices/machine/generalplus_gpl_chx.h",
MAME_DIR .. "src/devices/machine/generalplus_gpl_dma.cpp", MAME_DIR .. "src/devices/machine/generalplus_gpl_dma.cpp",
MAME_DIR .. "src/devices/machine/generalplus_gpl_dma.h", MAME_DIR .. "src/devices/machine/generalplus_gpl_dma.h",
MAME_DIR .. "src/devices/machine/generalplus_gpl_timebase.cpp", MAME_DIR .. "src/devices/machine/generalplus_gpl_timebase.cpp",
MAME_DIR .. "src/devices/machine/generalplus_gpl_timebase.h", MAME_DIR .. "src/devices/machine/generalplus_gpl_timebase.h",
MAME_DIR .. "src/devices/machine/generalplus_gpl_chx.cpp",
MAME_DIR .. "src/devices/machine/generalplus_gpl_chx.h",
MAME_DIR .. "src/devices/machine/spg_renderer.cpp", MAME_DIR .. "src/devices/machine/spg_renderer.cpp",
MAME_DIR .. "src/devices/machine/spg_renderer.h", MAME_DIR .. "src/devices/machine/spg_renderer.h",
MAME_DIR .. "src/devices/machine/gpl_renderer.cpp", MAME_DIR .. "src/devices/machine/gpl_renderer.cpp",

View File

@ -935,7 +935,6 @@ u16 gcm394_base_video_device::video_703a_palettebank_r()
void gcm394_base_video_device::video_703a_palettebank_w(u16 data) void gcm394_base_video_device::video_703a_palettebank_w(u16 data)
{ {
LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_703a_palettebank_w %04x\n", machine().describe_context(), data); LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_703a_palettebank_w %04x\n", machine().describe_context(), data);
m_703a_palettebank = data; m_703a_palettebank = data;
} }

View File

@ -479,6 +479,38 @@ u16 generalplus_gpl951xx_device::timer_ctrl_r()
template<int Timer> template<int Timer>
void generalplus_gpl951xx_device::timer_ctrl_w(u16 data) void generalplus_gpl951xx_device::timer_ctrl_w(u16 data)
{ {
char const *const SRCB_NAME[8] =
{
"2048Hz",
"1024Hz",
"256Hz",
"TimeBaseB",
"TimeBaseA",
"(logic low)",
"(logic high)",
"EXT1 with pre-scaler"
};
char const *const SRCA_NAME[16] =
{
"SYSCLK/2",
"SYSCLK/256",
"32768Hz",
"8192Hz",
"4096Hz",
"(logic high)",
"Timer Overflow",
"EXT0 with pre-scaler",
"(logic low)",
"9: reserved",
"a: reserved",
"b: reserved",
"c: reserved",
"d: reserved",
"e: reserved",
"f: reserved"
};
u8 tmxif_clear = (data & 0x8000) >> 15; u8 tmxif_clear = (data & 0x8000) >> 15;
u8 tmxie = (data & 0x4000) >> 14; u8 tmxie = (data & 0x4000) >> 14;
u8 tmxen = (data & 0x2000) >> 13; u8 tmxen = (data & 0x2000) >> 13;
@ -487,7 +519,9 @@ void generalplus_gpl951xx_device::timer_ctrl_w(u16 data)
u8 srcbsel = (data & 0x0070) >> 4; u8 srcbsel = (data & 0x0070) >> 4;
u8 srcasel = (data & 0x000f) >> 0; u8 srcasel = (data & 0x000f) >> 0;
logerror("%s: timer%c_ctrl_w %04x (tmxif_clear %01x) (interrupt enabled %01x) (timer enabled %01x) (ext0sel %01x) (ext1sel %01x) (srcbsel %01x) (srcasel %01x)\n", machine().describe_context(), 'a'+Timer, data, tmxif_clear, tmxie, tmxen, ext0sel, ext1sel, m_srcb[srcbsel], m_srca[srcasel]); logerror("%s: timer%c_ctrl_w %04x (tmxif_clear %01x) (interrupt enabled %01x) (timer enabled %01x) (ext0sel %01x) (ext1sel %01x) (srcbsel %01x) (srcasel %01x)\n",
machine().describe_context(), 'a'+Timer, data,
tmxif_clear, tmxie, tmxen, ext0sel, ext1sel, SRCB_NAME[srcbsel], SRCA_NAME[srcasel]);
if (data & 0x8000) if (data & 0x8000)
{ {
@ -830,6 +864,18 @@ u16 generalplus_gpl951xx_device::madc_ctrl_r()
void generalplus_gpl951xx_device::madc_ctrl_w(u16 data) void generalplus_gpl951xx_device::madc_ctrl_w(u16 data)
{ {
char const *const CHANNEL_NAME[8] =
{
"LINEIN 0",
"LINEIN 1",
"LINEIN 2",
"LINEIN 3",
"LINEIN 4",
"LINEIN 5",
"1.2V bandgap",
"LDOV50"
};
logerror("%s: madc_ctrl_w %04x\n", machine().describe_context(), data); logerror("%s: madc_ctrl_w %04x\n", machine().describe_context(), data);
if (data & 0x8000) if (data & 0x8000)
@ -857,7 +903,7 @@ void generalplus_gpl951xx_device::madc_ctrl_w(u16 data)
u8 channel = data & 0x0007; u8 channel = data & 0x0007;
logerror("manual ADC conversion on port %s\n", m_adc_channels[channel]); logerror("manual ADC conversion on port %s\n", CHANNEL_NAME[channel]);
if (channel < 6) if (channel < 6)
{ {

View File

@ -222,56 +222,12 @@ private:
inline u16 read_space(offs_t offset); inline u16 read_space(offs_t offset);
inline void write_space(offs_t offset, u16 data); inline void write_space(offs_t offset, u16 data);
template<int Timer> TIMER_DEVICE_CALLBACK_MEMBER(timer_cb); template<int Timer> TIMER_DEVICE_CALLBACK_MEMBER(timer_cb);
TIMER_DEVICE_CALLBACK_MEMBER(adc_timer_cb); TIMER_DEVICE_CALLBACK_MEMBER(adc_timer_cb);
u16 m_byteswap; u16 m_byteswap;
const char* m_srcb[8] =
{
"2048Hz",
"1024Hz",
"256Hz",
"TimeBaseB",
"TimeBaseA",
"(logic low)",
"(logic high)",
"EXT1 with pre-scaler"
};
const char* m_srca[16] =
{
"SYSCLK/2",
"SYSCLK/256",
"32768Hz",
"8192Hz",
"4096Hz",
"(logic high)",
"Timer Overflow",
"EXT0 with pre-scaler",
"(logic low)",
"9: reserved",
"a: reserved",
"b: reserved",
"c: reserved",
"d: reserved",
"e: reserved",
"f: reserved"
};
const char* m_adc_channels[8] =
{
"LINEIN 0",
"LINEIN 1",
"LINEIN 2",
"LINEIN 3",
"LINEIN 4",
"LINEIN 5",
"1.2V bandgap",
"LDOV50"
};
u16 m_timer_preload[8]; u16 m_timer_preload[8];
u16 m_timer_ctrl[8]; u16 m_timer_ctrl[8];

View File

@ -136,7 +136,6 @@ void gpl_chx_device::cha_data_w(u16 data)
{ {
// trying to overflow the FIFO // trying to overflow the FIFO
} }
} }
// P_CHA_FIFO // P_CHA_FIFO
@ -349,7 +348,3 @@ void gpl_chx_device::process_chb_fifo()
check_chb_fifo_empty(); check_chb_fifo_empty();
} }
void gpl_chx_device::device_add_mconfig(machine_config &config)
{
}

View File

@ -39,7 +39,6 @@ public:
protected: protected:
virtual void device_start() override ATTR_COLD; virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD; virtual void device_reset() override ATTR_COLD;
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
private: private:
u16 m_cha_ctrl; u16 m_cha_ctrl;

View File

@ -108,9 +108,9 @@ public:
/// ///
/// Provided as a convenience for systems that have no additional /// Provided as a convenience for systems that have no additional
/// initialisation tasks. /// initialisation tasks.
void empty_init(); void empty_init() ATTR_COLD;
// output heler // output helper
output_manager &output() const { return machine().output(); } output_manager &output() const { return machine().output(); }
void nmi_line_pulse(device_t &device); void nmi_line_pulse(device_t &device);
@ -155,12 +155,12 @@ protected:
virtual void sound_reset(); virtual void sound_reset();
virtual void video_reset(); virtual void video_reset();
// device-level overrides // device_t implementation
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; virtual const tiny_rom_entry *device_rom_region() const override final ATTR_COLD;
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual void device_add_mconfig(machine_config &config) override final ATTR_COLD;
virtual ioport_constructor device_input_ports() const override ATTR_COLD; virtual ioport_constructor device_input_ports() const override final ATTR_COLD;
virtual void device_start() override ATTR_COLD; virtual void device_start() override final ATTR_COLD;
virtual void device_reset_after_children() override; virtual void device_reset_after_children() override final;
// generic video // generic video
void flip_screen_set(int state); void flip_screen_set(int state);

View File

@ -747,7 +747,7 @@ void apple2gs_state::machine_start()
m_cnxx_slot = CNXX_UNCLAIMED; m_cnxx_slot = CNXX_UNCLAIMED;
// install ROM // install ROM
address_space& space = m_maincpu->space(AS_PROGRAM); address_space &space = m_maincpu->space(AS_PROGRAM);
if (m_is_rom3) if (m_is_rom3)
space.install_rom(0xfc0000, 0xffffff, m_rom); space.install_rom(0xfc0000, 0xffffff, m_rom);
@ -1169,21 +1169,21 @@ void apple2gs_state::palette_init(palette_device &palette)
static const unsigned char apple2gs_palette[] = static const unsigned char apple2gs_palette[] =
{ {
0x0, 0x0, 0x0, /* Black $0 $0000 */ 0x0, 0x0, 0x0, /* Black $0 $0000 */
0xD, 0x0, 0x3, /* Deep Red $1 $0D03 */ 0xd, 0x0, 0x3, /* Deep Red $1 $0D03 */
0x0, 0x0, 0x9, /* Dark Blue $2 $0009 */ 0x0, 0x0, 0x9, /* Dark Blue $2 $0009 */
0xD, 0x2, 0xD, /* Purple $3 $0D2D */ 0xd, 0x2, 0xd, /* Purple $3 $0D2D */
0x0, 0x7, 0x2, /* Dark Green $4 $0072 */ 0x0, 0x7, 0x2, /* Dark Green $4 $0072 */
0x5, 0x5, 0x5, /* Dark Gray $5 $0555 */ 0x5, 0x5, 0x5, /* Dark Gray $5 $0555 */
0x2, 0x2, 0xF, /* Medium Blue $6 $022F */ 0x2, 0x2, 0xf, /* Medium Blue $6 $022F */
0x6, 0xA, 0xF, /* Light Blue $7 $06AF */ 0x6, 0xa, 0xf, /* Light Blue $7 $06AF */
0x8, 0x5, 0x0, /* Brown $8 $0850 */ 0x8, 0x5, 0x0, /* Brown $8 $0850 */
0xF, 0x6, 0x0, /* Orange $9 $0F60 */ 0xf, 0x6, 0x0, /* Orange $9 $0F60 */
0xA, 0xA, 0xA, /* Light Gray $A $0AAA */ 0xa, 0xa, 0xa, /* Light Gray $A $0AAA */
0xF, 0x9, 0x8, /* Pink $B $0F98 */ 0xf, 0x9, 0x8, /* Pink $B $0F98 */
0x1, 0xD, 0x0, /* Light Green $C $01D0 */ 0x1, 0xd, 0x0, /* Light Green $C $01D0 */
0xF, 0xF, 0x0, /* Yellow $D $0FF0 */ 0xf, 0xf, 0x0, /* Yellow $D $0FF0 */
0x4, 0xF, 0x9, /* Aquamarine $E $04F9 */ 0x4, 0xf, 0x9, /* Aquamarine $E $04F9 */
0xF, 0xF, 0xF /* White $F $0FFF */ 0xf, 0xf, 0xf /* White $F $0FFF */
}; };
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
@ -2368,7 +2368,7 @@ void apple2gs_state::write_slot_rom(int slotbias, int offset, u8 data)
if (m_slotdevice[slotnum] != nullptr) if (m_slotdevice[slotnum] != nullptr)
{ {
if ((m_cnxx_slot == CNXX_UNCLAIMED) && (m_slotdevice[slotnum]->take_c800()) && (!machine().side_effects_disabled())) if ((m_cnxx_slot == CNXX_UNCLAIMED) && (m_slotdevice[slotnum]->take_c800()) && !machine().side_effects_disabled())
{ {
m_cnxx_slot = slotnum; m_cnxx_slot = slotnum;
update_slotrom_banks(); update_slotrom_banks();
@ -2397,7 +2397,7 @@ u8 apple2gs_state::c100_r(offs_t offset)
slow_cycle(); slow_cycle();
// SETSLOTCXROM is disabled, so the $C02D SLOT register controls what's in each slot // SETSLOTCXROM is disabled, so the $C02D SLOT register controls what's in each slot
if (!(m_slotromsel & (1 << slot))) if (!BIT(m_slotromsel, slot))
{ {
return read_int_rom(0x3c100, offset); return read_int_rom(0x3c100, offset);
} }
@ -2412,7 +2412,7 @@ void apple2gs_state::c100_w(offs_t offset, u8 data)
accel_slot(slot); accel_slot(slot);
slow_cycle(); slow_cycle();
if ((m_slotromsel & (1 << slot))) if (BIT(m_slotromsel, slot))
{ {
write_slot_rom(1, offset, data); write_slot_rom(1, offset, data);
} }
@ -2429,7 +2429,7 @@ u8 apple2gs_state::c400_r(offs_t offset)
accel_slot(slot); accel_slot(slot);
slow_cycle(); slow_cycle();
if (!(m_slotromsel & (1 << slot))) if (!BIT(m_slotromsel, slot))
{ {
return read_int_rom(0x3c400, offset); return read_int_rom(0x3c400, offset);
} }
@ -2444,7 +2444,7 @@ void apple2gs_state::c400_w(offs_t offset, u8 data)
accel_slot(slot); accel_slot(slot);
slow_cycle(); slow_cycle();
if ((m_slotromsel & (1 << slot))) if (BIT(m_slotromsel, slot))
{ {
write_slot_rom(4, offset, data); write_slot_rom(4, offset, data);
} }
@ -2809,7 +2809,7 @@ u8 apple2gs_state::read_floatingbus()
// approximate (for non-flow control instructions) by peeking at PC // approximate (for non-flow control instructions) by peeking at PC
offs_t pc = m_maincpu->pc(); offs_t pc = m_maincpu->pc();
// previous byte, wrapping at bank boundary // previous byte, wrapping at bank boundary
pc = (pc & 0xFF0000) | ((pc - 1) & 0xFFFF); pc = (pc & 0xff0000) | ((pc - 1) & 0xffff);
// prevent recursion via slot firmware or Mega II C07x // prevent recursion via slot firmware or Mega II C07x
recurse = true; recurse = true;
u8 res = m_maincpu->space(AS_PROGRAM).read_byte(pc); u8 res = m_maincpu->space(AS_PROGRAM).read_byte(pc);
@ -2934,7 +2934,7 @@ void apple2gs_state::b0ram0800_w(offs_t offset, u8 data)
m_ram_ptr[offset+0x800] = data; m_ram_ptr[offset+0x800] = data;
if (offset < 0x400) if (offset < 0x400)
{ {
if ((!(m_shadow & SHAD_TXTPG2)) && (m_is_rom3)) if (!(m_shadow & SHAD_TXTPG2) && m_is_rom3)
{ {
slow_cycle(); slow_cycle();
m_megaii_ram[offset+0x800] = data; m_megaii_ram[offset+0x800] = data;
@ -2985,7 +2985,7 @@ void apple2gs_state::b1ram0800_w(offs_t offset, u8 data)
m_ram_ptr[offset+0x10800] = data; m_ram_ptr[offset+0x10800] = data;
if (offset < 0x400) if (offset < 0x400)
{ {
if ((!(m_shadow & SHAD_TXTPG2)) && (m_is_rom3)) if (!(m_shadow & SHAD_TXTPG2) && m_is_rom3)
{ {
slow_cycle(); slow_cycle();
m_megaii_ram[offset+0x10800] = data; m_megaii_ram[offset+0x10800] = data;
@ -2996,7 +2996,7 @@ u8 apple2gs_state::b1ram2000_r(offs_t offset) { return m_ram_ptr[offset+0x12000
void apple2gs_state::b1ram2000_w(offs_t offset, u8 data) void apple2gs_state::b1ram2000_w(offs_t offset, u8 data)
{ {
m_ram_ptr[offset+0x12000] = data; m_ram_ptr[offset+0x12000] = data;
if ((!(m_shadow & SHAD_HIRESPG1) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) if ((!(m_shadow & SHAD_HIRESPG1) && !(m_shadow & SHAD_AUXHIRES)) || !(m_shadow & SHAD_SUPERHIRES))
{ {
auxram0000_w(offset+0x2000, data); auxram0000_w(offset+0x2000, data);
} }
@ -3007,7 +3007,7 @@ void apple2gs_state::b1ram4000_w(offs_t offset, u8 data)
m_ram_ptr[offset+0x14000] = data; m_ram_ptr[offset+0x14000] = data;
if (offset < 0x2000) if (offset < 0x2000)
{ {
if ((!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) if ((!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) || !(m_shadow & SHAD_SUPERHIRES))
{ {
auxram0000_w(offset+0x4000, data); auxram0000_w(offset+0x4000, data);
} }
@ -3088,7 +3088,7 @@ void apple2gs_state::bank1_0000_sh_w(offs_t offset, u8 data)
case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
if ((!(m_shadow & SHAD_HIRESPG1) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) if ((!(m_shadow & SHAD_HIRESPG1) && !(m_shadow & SHAD_AUXHIRES)) || !(m_shadow & SHAD_SUPERHIRES))
{ {
auxram0000_w(offset, data); auxram0000_w(offset, data);
} }
@ -3099,7 +3099,7 @@ void apple2gs_state::bank1_0000_sh_w(offs_t offset, u8 data)
case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
if ((!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) if ((!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) || !(m_shadow & SHAD_SUPERHIRES))
{ {
auxram0000_w(offset, data); auxram0000_w(offset, data);
} }
@ -3123,8 +3123,8 @@ void apple2gs_state::apple2gs_map(address_map &map)
map(0x000000, 0xffffff).r(FUNC(apple2gs_state::floatingbank_r)).nopw(); map(0x000000, 0xffffff).r(FUNC(apple2gs_state::floatingbank_r)).nopw();
map.unmap_value_high(); // with expansion slot, unpopulated banks return ff on ROM3 map.unmap_value_high(); // with expansion slot, unpopulated banks return ff on ROM3
/* "fast side" - runs 2.8 MHz minus RAM refresh, banks 00 and 01 usually have writes shadowed to E0/E1 where I/O lives */ // "fast side" - runs 2.8 MHz minus RAM refresh, banks 00 and 01 usually have writes shadowed to E0/E1 where I/O lives
/* Banks 00 and 01 also have their own independent language cards which are NOT shadowed. */ // Banks 00 and 01 also have their own independent language cards which are NOT shadowed.
map(0x000000, 0x0001ff).view(m_b0_0000bank); map(0x000000, 0x0001ff).view(m_b0_0000bank);
m_b0_0000bank[0](0x0000, 0x01ff).rw(FUNC(apple2gs_state::b0ram0000_r), FUNC(apple2gs_state::b0ram0000_w)); m_b0_0000bank[0](0x0000, 0x01ff).rw(FUNC(apple2gs_state::b0ram0000_r), FUNC(apple2gs_state::b0ram0000_w));
m_b0_0000bank[1](0x0000, 0x01ff).rw(FUNC(apple2gs_state::b1ram0000_r), FUNC(apple2gs_state::b1ram0000_w)); m_b0_0000bank[1](0x0000, 0x01ff).rw(FUNC(apple2gs_state::b1ram0000_r), FUNC(apple2gs_state::b1ram0000_w));
@ -3195,8 +3195,8 @@ void apple2gs_state::apple2gs_map(address_map &map)
m_lc01[0](0x1d000, 0x1ffff).rom().region("maincpu", 0x3d000).w(FUNC(apple2gs_state::lc_01_w)); m_lc01[0](0x1d000, 0x1ffff).rom().region("maincpu", 0x3d000).w(FUNC(apple2gs_state::lc_01_w));
m_lc01[1](0x1d000, 0x1ffff).rw(FUNC(apple2gs_state::lc_01_r), FUNC(apple2gs_state::lc_01_w)); m_lc01[1](0x1d000, 0x1ffff).rw(FUNC(apple2gs_state::lc_01_r), FUNC(apple2gs_state::lc_01_w));
/* "Mega II side" - this is basically a 128K IIe on a chip that runs merrily at 1 MHz */ // "Mega II side" - this is basically a 128K IIe on a chip that runs merrily at 1 MHz
/* Unfortunately all I/O happens here, including new IIgs-specific stuff */ // Unfortunately all I/O happens here, including new IIgs-specific stuff
map(0xe00000, 0xe001ff).view(m_e0_0000bank); map(0xe00000, 0xe001ff).view(m_e0_0000bank);
m_e0_0000bank[0](0xe00000, 0xe001ff).rw(FUNC(apple2gs_state::e0ram_r<0x0000>), FUNC(apple2gs_state::e0ram_w<0x0000>)); m_e0_0000bank[0](0xe00000, 0xe001ff).rw(FUNC(apple2gs_state::e0ram_r<0x0000>), FUNC(apple2gs_state::e0ram_w<0x0000>));
m_e0_0000bank[1](0xe00000, 0xe001ff).rw(FUNC(apple2gs_state::e1ram_r<0x0000>), FUNC(apple2gs_state::e1ram_w<0x0000>)); m_e0_0000bank[1](0xe00000, 0xe001ff).rw(FUNC(apple2gs_state::e1ram_r<0x0000>), FUNC(apple2gs_state::e1ram_w<0x0000>));

View File

@ -205,8 +205,10 @@ protected:
save_pointer(NAME(m_paletteram_flytiger), 0x1000); save_pointer(NAME(m_paletteram_flytiger), 0x1000);
} }
DECLARE_MACHINE_START(cpu_z80) virtual void machine_start() override ATTR_COLD
{ {
dooyong_state::machine_start();
m_mainbank->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000); m_mainbank->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000);
} }
@ -1503,8 +1505,6 @@ void dooyong_z80_ym2203_state::lastday(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4MHz verified for Last Day / D-day */ Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4MHz verified for Last Day / D-day */
m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_ym2203_state::lastday_sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_ym2203_state::lastday_sound_map);
MCFG_MACHINE_START_OVERRIDE(dooyong_z80_ym2203_state, cpu_z80)
/* video hardware */ /* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram); BUFFERED_SPRITERAM8(config, m_spriteram);
@ -1540,8 +1540,6 @@ void dooyong_z80_ym2203_state::gulfstrm(machine_config &config)
Z80(config, m_audiocpu, 8000000); /* ??? */ Z80(config, m_audiocpu, 8000000); /* ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_ym2203_state::lastday_sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_ym2203_state::lastday_sound_map);
MCFG_MACHINE_START_OVERRIDE(dooyong_z80_ym2203_state, cpu_z80)
/* video hardware */ /* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram); BUFFERED_SPRITERAM8(config, m_spriteram);
@ -1577,8 +1575,6 @@ void dooyong_z80_ym2203_state::pollux(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4Mhz */ Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4Mhz */
m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_ym2203_state::pollux_sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_ym2203_state::pollux_sound_map);
MCFG_MACHINE_START_OVERRIDE(dooyong_z80_ym2203_state, cpu_z80)
/* video hardware */ /* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram); BUFFERED_SPRITERAM8(config, m_spriteram);
@ -1614,8 +1610,6 @@ void dooyong_z80_state::bluehawk(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* ??? */ Z80(config, m_audiocpu, 4000000); /* ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_state::bluehawk_sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_state::bluehawk_sound_map);
MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
/* video hardware */ /* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram); BUFFERED_SPRITERAM8(config, m_spriteram);
@ -1660,8 +1654,6 @@ void dooyong_z80_state::flytiger(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4Mhz */ Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4Mhz */
m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_state::bluehawk_sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_state::bluehawk_sound_map);
MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
/* video hardware */ /* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram); BUFFERED_SPRITERAM8(config, m_spriteram);
@ -1698,8 +1690,6 @@ void dooyong_z80_state::primella(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4MHz */ Z80(config, m_audiocpu, 16_MHz_XTAL/4); /* 4MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_state::bluehawk_sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &dooyong_z80_state::bluehawk_sound_map);
MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
/* video hardware */ /* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60); screen.set_refresh_hz(60);

View File

@ -13,8 +13,8 @@
#include "machine/sa1111.h" #include "machine/sa1111.h"
#include "sound/uda1344.h" #include "sound/uda1344.h"
#include "video/sed1356.h" #include "video/sed1356.h"
#include "screen.h"
#include "emupal.h" #include "emupal.h"
#include "screen.h"
#include "speaker.h" #include "speaker.h"
#define LOG_MCU (1U << 1) #define LOG_MCU (1U << 1)
@ -23,8 +23,7 @@
#define VERBOSE (0) #define VERBOSE (0)
#include "logmacro.h" #include "logmacro.h"
namespace namespace {
{
class jornada_state : public driver_device class jornada_state : public driver_device
{ {
@ -150,7 +149,6 @@ protected:
// driver_device overrides // driver_device overrides
virtual void machine_start() override ATTR_COLD; virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD;
virtual void device_reset_after_children() override;
static constexpr u32 SA1110_CLOCK = 206000000; static constexpr u32 SA1110_CLOCK = 206000000;
@ -221,15 +219,6 @@ void jornada_state::main_map(address_map &map)
map(0xe0100000, 0xe01003ff).noprw(); // Cache-Flush Region 1 map(0xe0100000, 0xe01003ff).noprw(); // Cache-Flush Region 1
} }
void jornada_state::device_reset_after_children()
{
driver_device::device_reset_after_children();
m_sa_periphs->gpio_in<4>(0); // Flag as plugged into AC power
m_sa_periphs->gpio_in<9>(1); // Pen input is active-low
m_sa_periphs->gpio_in<26>(0); // Flag as charging
}
void jornada_state::cpu_rts_to_mcu(int state) void jornada_state::cpu_rts_to_mcu(int state)
{ {
const bool old = m_cpu_to_mcu_rts; const bool old = m_cpu_to_mcu_rts;
@ -599,6 +588,10 @@ void jornada_state::machine_reset()
memset(m_mcu_rx_fifo, 0, sizeof(m_mcu_rx_fifo)); memset(m_mcu_rx_fifo, 0, sizeof(m_mcu_rx_fifo));
m_mcu_rx_count = 0; m_mcu_rx_count = 0;
m_sa_periphs->gpio_in<4>(0); // Flag as plugged into AC power
m_sa_periphs->gpio_in<9>(1); // Pen input is active-low
m_sa_periphs->gpio_in<26>(0); // Flag as charging
LOGMASKED(LOG_MCU, "MCU State: %08x\n", m_mcu_state); LOGMASKED(LOG_MCU, "MCU State: %08x\n", m_mcu_state);
} }

View File

@ -233,20 +233,25 @@ public:
m_palette(*this, "palette") m_palette(*this, "palette")
{ } { }
void reaktor(machine_config &config); void trackfld(machine_config &config) ATTR_COLD;
void atlantol(machine_config &config); void trackfldu(machine_config &config) ATTR_COLD;
void yieartf(machine_config &config); void yieartf(machine_config &config) ATTR_COLD;
void wizzquiz(machine_config &config); void hyprolyb(machine_config &config) ATTR_COLD;
void trackfld(machine_config &config); void atlantol(machine_config &config) ATTR_COLD;
void trackfldu(machine_config &config); void mastkin(machine_config &config) ATTR_COLD;
void hyprolyb(machine_config &config); void wizzquiz(machine_config &config) ATTR_COLD;
void mastkin(machine_config &config); void reaktor(machine_config &config) ATTR_COLD;
void init_trackfld(); void init_trackfld() ATTR_COLD;
void init_atlantol(); void init_atlantol() ATTR_COLD;
void init_wizzquiz(); void init_wizzquiz() ATTR_COLD;
void init_mastkin(); void init_mastkin() ATTR_COLD;
void init_trackfldnz(); void init_trackfldnz() ATTR_COLD;
protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
private: private:
void questions_bank_w(uint8_t data); void questions_bank_w(uint8_t data);
@ -309,11 +314,7 @@ private:
void nmi_mask_w(int state); void nmi_mask_w(int state);
TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info);
DECLARE_MACHINE_START(trackfld);
DECLARE_MACHINE_RESET(trackfld);
DECLARE_VIDEO_START(trackfld);
void trackfld_palette(palette_device &palette) const; void trackfld_palette(palette_device &palette) const;
DECLARE_VIDEO_START(atlantol);
uint32_t screen_update_trackfld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_trackfld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void vblank_irq(int state); void vblank_irq(int state);
void vblank_nmi(int state); void vblank_nmi(int state);
@ -469,18 +470,10 @@ TILE_GET_INFO_MEMBER(trackfld_state::get_bg_tile_info)
tileinfo.set(1, code, color, flags); tileinfo.set(1, code, color, flags);
} }
VIDEO_START_MEMBER(trackfld_state,trackfld) void trackfld_state::video_start()
{ {
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(trackfld_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(trackfld_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
m_bg_tilemap->set_scroll_rows(32); m_bg_tilemap->set_scroll_rows(32);
m_sprites_gfx_banked = 0;
}
VIDEO_START_MEMBER(trackfld_state,atlantol)
{
VIDEO_START_CALL_MEMBER( trackfld );
m_sprites_gfx_banked = 1;
} }
@ -1201,7 +1194,7 @@ GFXDECODE_END
MACHINE_START_MEMBER(trackfld_state,trackfld) void trackfld_state::machine_start()
{ {
save_item(NAME(m_irq_mask)); save_item(NAME(m_irq_mask));
save_item(NAME(m_nmi_mask)); save_item(NAME(m_nmi_mask));
@ -1213,7 +1206,7 @@ MACHINE_START_MEMBER(trackfld_state,trackfld)
save_item(NAME(m_old_gfx_bank)); save_item(NAME(m_old_gfx_bank));
} }
MACHINE_RESET_MEMBER(trackfld_state,trackfld) void trackfld_state::machine_reset()
{ {
m_bg_bank = 0; m_bg_bank = 0;
m_sprite_bank1 = 0; m_sprite_bank1 = 0;
@ -1242,9 +1235,6 @@ void trackfld_state::trackfld(machine_config &config)
Z80(config, m_audiocpu, SOUND_CLOCK/4); Z80(config, m_audiocpu, SOUND_CLOCK/4);
m_audiocpu->set_addrmap(AS_PROGRAM, &trackfld_state::sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &trackfld_state::sound_map);
MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld)
MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld)
LS259(config, m_mainlatch); // 1D LS259(config, m_mainlatch); // 1D
m_mainlatch->q_out_cb<0>().set(FUNC(trackfld_state::flip_screen_set)); // FLIP m_mainlatch->q_out_cb<0>().set(FUNC(trackfld_state::flip_screen_set)); // FLIP
m_mainlatch->q_out_cb<1>().set("trackfld_audio", FUNC(trackfld_audio_device::sh_irqtrigger_w)); // 26 = SOUND ON m_mainlatch->q_out_cb<1>().set("trackfld_audio", FUNC(trackfld_audio_device::sh_irqtrigger_w)); // 26 = SOUND ON
@ -1268,7 +1258,7 @@ void trackfld_state::trackfld(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_trackfld); GFXDECODE(config, m_gfxdecode, m_palette, gfx_trackfld);
PALETTE(config, m_palette, FUNC(trackfld_state::trackfld_palette), 16*16+16*16, 32); PALETTE(config, m_palette, FUNC(trackfld_state::trackfld_palette), 16*16+16*16, 32);
MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld) m_sprites_gfx_banked = 0;
/* sound hardware */ /* sound hardware */
SPEAKER(config, "speaker").front_center(); SPEAKER(config, "speaker").front_center();
@ -1290,6 +1280,7 @@ void trackfld_state::trackfld(machine_config &config)
void trackfld_state::trackfldu(machine_config &config) void trackfld_state::trackfldu(machine_config &config)
{ {
trackfld(config); trackfld(config);
MC6809E(config.replace(), m_maincpu, MASTER_CLOCK/6/2); /* exact M6809 model unknown */ MC6809E(config.replace(), m_maincpu, MASTER_CLOCK/6/2); /* exact M6809 model unknown */
m_maincpu->set_addrmap(AS_PROGRAM, &trackfld_state::main_map); m_maincpu->set_addrmap(AS_PROGRAM, &trackfld_state::main_map);
} }
@ -1309,9 +1300,6 @@ void trackfld_state::yieartf(machine_config &config)
// NMI source assumed to be same as in yiear // NMI source assumed to be same as in yiear
TIMER(config, "16v").configure_scanline(FUNC(trackfld_state::yieartf_timer_irq), "screen", 16, 32); TIMER(config, "16v").configure_scanline(FUNC(trackfld_state::yieartf_timer_irq), "screen", 16, 32);
MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld)
MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld)
ls259_device &mainlatch(LS259(config, "mainlatch")); // 1D ls259_device &mainlatch(LS259(config, "mainlatch")); // 1D
mainlatch.q_out_cb<0>().set(FUNC(trackfld_state::flip_screen_set)); mainlatch.q_out_cb<0>().set(FUNC(trackfld_state::flip_screen_set));
mainlatch.q_out_cb<1>().set("trackfld_audio", FUNC(trackfld_audio_device::sh_irqtrigger_w)); mainlatch.q_out_cb<1>().set("trackfld_audio", FUNC(trackfld_audio_device::sh_irqtrigger_w));
@ -1335,7 +1323,7 @@ void trackfld_state::yieartf(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_trackfld); GFXDECODE(config, m_gfxdecode, m_palette, gfx_trackfld);
PALETTE(config, m_palette, FUNC(trackfld_state::trackfld_palette), 16*16+16*16, 32); PALETTE(config, m_palette, FUNC(trackfld_state::trackfld_palette), 16*16+16*16, 32);
MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld) m_sprites_gfx_banked = 0;
/* sound hardware */ /* sound hardware */
SPEAKER(config, "speaker").front_center(); SPEAKER(config, "speaker").front_center();
@ -1376,17 +1364,14 @@ void trackfld_state::hyprolyb_adpcm_map(address_map &map)
map(0x8000, 0xffff).rom(); map(0x8000, 0xffff).rom();
} }
/* same as the original, but uses ADPCM instead of VLM5030 */ // same as the original, but uses ADPCM instead of VLM5030
/* also different memory handlers do handle that */ // also different memory handlers to handle that
void trackfld_state::hyprolyb(machine_config &config) void trackfld_state::hyprolyb(machine_config &config)
{ {
trackfld(config); trackfld(config);
m_audiocpu->set_addrmap(AS_PROGRAM, &trackfld_state::hyprolyb_sound_map); m_audiocpu->set_addrmap(AS_PROGRAM, &trackfld_state::hyprolyb_sound_map);
MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld)
MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld)
/* sound hardware */ /* sound hardware */
config.device_remove("vlm"); config.device_remove("vlm");
M6802(config, "adpcm", XTAL(14'318'181)/8).set_addrmap(AS_PROGRAM, &trackfld_state::hyprolyb_adpcm_map); /* unknown clock */ M6802(config, "adpcm", XTAL(14'318'181)/8).set_addrmap(AS_PROGRAM, &trackfld_state::hyprolyb_adpcm_map); /* unknown clock */
@ -1405,7 +1390,7 @@ void trackfld_state::atlantol(machine_config &config)
{ {
hyprolyb(config); hyprolyb(config);
MCFG_VIDEO_START_OVERRIDE(trackfld_state,atlantol) m_sprites_gfx_banked = 1;
} }
void trackfld_state::mastkin(machine_config &config) void trackfld_state::mastkin(machine_config &config)
@ -1425,7 +1410,7 @@ void trackfld_state::wizzquiz(machine_config &config)
trackfld(config); trackfld(config);
/* basic machine hardware */ /* basic machine hardware */
// right cpu? // right CPU?
M6800(config.replace(), m_maincpu, 2048000); /* 1.400 MHz ??? */ M6800(config.replace(), m_maincpu, 2048000); /* 1.400 MHz ??? */
m_maincpu->set_addrmap(AS_PROGRAM, &trackfld_state::wizzquiz_map); m_maincpu->set_addrmap(AS_PROGRAM, &trackfld_state::wizzquiz_map);

View File

@ -1448,11 +1448,12 @@ public:
, m_codec(*this, "codec") , m_codec(*this, "codec")
{ } { }
void zaurus_sa1110(machine_config &config); void zaurus_sa1110(machine_config &config) ATTR_COLD;
protected:
virtual void machine_reset() override ATTR_COLD;
private: private:
virtual void device_reset_after_children() override;
void main_map(address_map &map) ATTR_COLD; void main_map(address_map &map) ATTR_COLD;
required_device<sa1110_periphs_device> m_sa_periphs; required_device<sa1110_periphs_device> m_sa_periphs;
@ -1470,10 +1471,10 @@ public:
, m_power(*this, "PWR") , m_power(*this, "PWR")
{ } { }
void zaurus_pxa_base(machine_config &config); void zaurus_pxa_base(machine_config &config) ATTR_COLD;
void zaurus_pxa250(machine_config &config); void zaurus_pxa250(machine_config &config) ATTR_COLD;
void zaurus_pxa255(machine_config &config); void zaurus_pxa255(machine_config &config) ATTR_COLD;
void zaurus_pxa270(machine_config &config); void zaurus_pxa270(machine_config &config) ATTR_COLD;
DECLARE_INPUT_CHANGED_MEMBER( system_start ); DECLARE_INPUT_CHANGED_MEMBER( system_start );
@ -1500,8 +1501,10 @@ void zaurus_pxa_state::main_map(address_map &map)
map(0xa0000000, 0xa07fffff).ram().share("ram"); map(0xa0000000, 0xa07fffff).ram().share("ram");
} }
void zaurus_sa_state::device_reset_after_children() void zaurus_sa_state::machine_reset()
{ {
zaurus_state::machine_reset();
m_sa_periphs->gpio_in<1>(1); m_sa_periphs->gpio_in<1>(1);
m_sa_periphs->gpio_in<24>(1); m_sa_periphs->gpio_in<24>(1);
//m_scoop->gpio_in<2>(1); // DIAG_BOOT1 //m_scoop->gpio_in<2>(1); // DIAG_BOOT1

View File

@ -12,7 +12,7 @@
The SoftBox can be used as a standalone computer with an RS-232 terminal, The SoftBox can be used as a standalone computer with an RS-232 terminal,
or as a PET/CBM peripheral. This is an emulation of the standalone mode. or as a PET/CBM peripheral. This is an emulation of the standalone mode.
For the peripheral mode, see: src/devices/bus/ieee488/softbox.c. For the peripheral mode, see: src/devices/bus/ieee488/softbox.cpp.
Using the Corvus hard disk Using the Corvus hard disk
@ -104,8 +104,10 @@
#include "machine/com8116.h" #include "machine/com8116.h"
#include "machine/i8251.h" #include "machine/i8251.h"
#include "machine/i8255.h" #include "machine/i8255.h"
#include "softlist_dev.h" #include "softlist_dev.h"
namespace { namespace {
#define Z80_TAG "z80" #define Z80_TAG "z80"
@ -114,7 +116,6 @@ namespace {
#define I8255_1_TAG "ic16" #define I8255_1_TAG "ic16"
#define COM8116_TAG "ic14" #define COM8116_TAG "ic14"
#define RS232_TAG "rs232" #define RS232_TAG "rs232"
#define CORVUS_HDC_TAG "corvus"
class softbox_state : public driver_device class softbox_state : public driver_device
{ {
@ -123,13 +124,27 @@ public:
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_maincpu(*this, Z80_TAG) , m_maincpu(*this, Z80_TAG)
, m_ieee(*this, IEEE488_TAG) , m_ieee(*this, IEEE488_TAG)
, m_hdc(*this, CORVUS_HDC_TAG) , m_hdc(*this, "corvus")
, m_rom(*this, Z80_TAG)
, m_boot_mem(*this, "bootmem")
, m_boot_m1(*this, "bootm1")
, m_leds(*this, "led%u", 0U) , m_leds(*this, "led%u", 0U)
{ } { }
void softbox(machine_config &config); void softbox(machine_config &config) ATTR_COLD;
protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
private: private:
enum
{
LED_A = 0,
LED_B,
LED_READY
};
// device_ieee488_interface overrides // device_ieee488_interface overrides
virtual void ieee488_ifc(int state); virtual void ieee488_ifc(int state);
@ -141,23 +156,21 @@ private:
uint8_t ppi1_pc_r(); uint8_t ppi1_pc_r();
void ppi1_pc_w(uint8_t data); void ppi1_pc_w(uint8_t data);
enum uint8_t boot_r(offs_t offset);
{
LED_A = 0,
LED_B,
LED_READY
};
void softbox_io(address_map &map) ATTR_COLD;
void softbox_mem(address_map &map) ATTR_COLD; void softbox_mem(address_map &map) ATTR_COLD;
int m_ifc = 0; // Tracks previous state of IEEE-488 IFC line void softbox_m1(address_map &map) ATTR_COLD;
void softbox_io(address_map &map) ATTR_COLD;
virtual void machine_start() override ATTR_COLD; int m_ifc = 0; // Tracks previous state of IEEE-488 IFC line
virtual void device_reset_after_children() override; bool m_boot_cnt = false;
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<ieee488_device> m_ieee; required_device<ieee488_device> m_ieee;
required_device<corvus_hdc_device> m_hdc; required_device<corvus_hdc_device> m_hdc;
required_region_ptr<uint8_t> m_rom;
memory_view m_boot_mem;
memory_view m_boot_m1;
output_finder<3> m_leds; output_finder<3> m_leds;
}; };
@ -177,8 +190,18 @@ private:
void softbox_state::softbox_mem(address_map &map) void softbox_state::softbox_mem(address_map &map)
{ {
map(0x0000, 0xefff).ram(); map(0x0000, 0xefff).ram().share("ram");
map(0xf000, 0xffff).rom().region(Z80_TAG, 0); map(0xf000, 0xffff).rom().region(Z80_TAG, 0);
map(0x0000, 0xffff).view(m_boot_mem);
m_boot_mem[0](0x0000, 0x0fff).mirror(0xf000).rom().region(Z80_TAG, 0);
}
void softbox_state::softbox_m1(address_map &map)
{
map(0x0000, 0xefff).ram().share("ram");
map(0xf000, 0xffff).rom().region(Z80_TAG, 0);
map(0x0000, 0xffff).view(m_boot_m1);
m_boot_m1[0](0x0000, 0xffff).r(FUNC(softbox_state::boot_r));
} }
@ -372,16 +395,24 @@ DEVICE_INPUT_DEFAULTS_END
void softbox_state::machine_start() void softbox_state::machine_start()
{ {
m_leds.resolve(); m_leds.resolve();
save_item(NAME(m_boot_cnt));
} }
//------------------------------------------------- //-------------------------------------------------
// device_reset_after_children - device-specific // machine_reset
// reset that must happen after child devices
// have performed their resets
//------------------------------------------------- //-------------------------------------------------
void softbox_state::device_reset_after_children() void softbox_state::machine_reset()
{
m_boot_mem.select(0);
m_boot_m1.select(0);
m_boot_cnt = false;
}
uint8_t softbox_state::boot_r(offs_t offset)
{ {
/* The Z80 starts at address 0x0000 but the SoftBox has RAM there and /* The Z80 starts at address 0x0000 but the SoftBox has RAM there and
needs to start from the BIOS at 0xf000. The PCB has logic and a needs to start from the BIOS at 0xf000. The PCB has logic and a
@ -389,11 +420,18 @@ void softbox_state::device_reset_after_children()
IC3 EPROM at 0xf000 is mapped to 0x0000 for the first instruction IC3 EPROM at 0xf000 is mapped to 0x0000 for the first instruction
fetch only. The instruction normally at 0xf000 is an absolute jump fetch only. The instruction normally at 0xf000 is an absolute jump
into the BIOS. On reset, the Z80 will fetch it from 0x0000 and set into the BIOS. On reset, the Z80 will fetch it from 0x0000 and set
its PC, then the normal map will be restored before the next its PC, then the normal map will be restored on the next
instruction fetch. Here we just set the PC to 0xf000 after the Z80 instruction fetch. */
resets, which has the same effect. */ if (!m_boot_cnt)
{
m_maincpu->set_state_int(Z80_PC, 0xf000); m_boot_cnt = true;
}
else
{
m_boot_mem.disable();
m_boot_m1.disable();
}
return m_rom[offset & 0x0fff];
} }
@ -422,6 +460,7 @@ void softbox_state::softbox(machine_config &config)
// basic machine hardware // basic machine hardware
Z80(config, m_maincpu, XTAL(8'000'000)/2); Z80(config, m_maincpu, XTAL(8'000'000)/2);
m_maincpu->set_addrmap(AS_PROGRAM, &softbox_state::softbox_mem); m_maincpu->set_addrmap(AS_PROGRAM, &softbox_state::softbox_mem);
m_maincpu->set_addrmap(AS_OPCODES, &softbox_state::softbox_m1);
m_maincpu->set_addrmap(AS_IO, &softbox_state::softbox_io); m_maincpu->set_addrmap(AS_IO, &softbox_state::softbox_io);
// devices // devices

View File

@ -112,14 +112,11 @@ void coco_state::analog_port_start(analog_input_t *analog, const char *rx_tag, c
//------------------------------------------------- //-------------------------------------------------
// device_start // machine_start
//------------------------------------------------- //-------------------------------------------------
void coco_state::device_start() void coco_state::machine_start()
{ {
// call base device_start
driver_device::device_start();
// look up analog ports // look up analog ports
analog_port_start(&m_joystick, JOYSTICK_RX_TAG, JOYSTICK_RY_TAG, analog_port_start(&m_joystick, JOYSTICK_RX_TAG, JOYSTICK_RY_TAG,
JOYSTICK_LX_TAG, JOYSTICK_LY_TAG, JOYSTICK_BUTTONS_TAG); JOYSTICK_LX_TAG, JOYSTICK_LY_TAG, JOYSTICK_BUTTONS_TAG);
@ -159,11 +156,8 @@ void coco_state::device_start()
// device_reset // device_reset
//------------------------------------------------- //-------------------------------------------------
void coco_state::device_reset() void coco_state::machine_reset()
{ {
/* call base device_start */
driver_device::device_reset();
/* reset state */ /* reset state */
m_dac_output = 0; m_dac_output = 0;
m_analog_audio_level = 0; m_analog_audio_level = 0;

View File

@ -120,9 +120,8 @@ public:
void coco_floating_map(address_map &map) ATTR_COLD; void coco_floating_map(address_map &map) ATTR_COLD;
protected: protected:
// device-level overrides virtual void machine_start() override ATTR_COLD;
virtual void device_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
// changed handlers // changed handlers
virtual void pia1_pa_changed(uint8_t data); virtual void pia1_pa_changed(uint8_t data);

View File

@ -59,7 +59,7 @@ public:
void ms1600(machine_config &config); void ms1600(machine_config &config);
protected: protected:
virtual void device_start() override ATTR_COLD; virtual void machine_start() override ATTR_COLD;
void configure_sam(); void configure_sam();
// PIA1 // PIA1
@ -100,7 +100,7 @@ public:
void ff30_write(offs_t offset, uint8_t data); void ff30_write(offs_t offset, uint8_t data);
protected: protected:
virtual void device_start() override ATTR_COLD; virtual void machine_start() override ATTR_COLD;
void configure_sam(); void configure_sam();
void deluxecoco_rom2(address_map &map) ATTR_COLD; void deluxecoco_rom2(address_map &map) ATTR_COLD;
void deluxecoco_io1(address_map &map) ATTR_COLD; void deluxecoco_io1(address_map &map) ATTR_COLD;

View File

@ -12,12 +12,12 @@
#include "coco12.h" #include "coco12.h"
//------------------------------------------------- //-------------------------------------------------
// device_start // machine_start
//------------------------------------------------- //-------------------------------------------------
void coco12_state::device_start() void coco12_state::machine_start()
{ {
coco_state::device_start(); coco_state::machine_start();
configure_sam(); configure_sam();
} }
@ -93,10 +93,10 @@ void coco12_state::pia1_pb_changed(uint8_t data)
//------------------------------------------------- //-------------------------------------------------
// deluxecoco_state::device_start // deluxecoco_state::machine_start
//------------------------------------------------- //-------------------------------------------------
void deluxecoco_state::device_start() void deluxecoco_state::machine_start()
{ {
coco12_state::device_start(); coco12_state::device_start();
configure_sam(); configure_sam();

View File

@ -45,8 +45,7 @@ public:
void coco3_mem(address_map &map) ATTR_COLD; void coco3_mem(address_map &map) ATTR_COLD;
protected: protected:
// device-level overrides virtual void machine_start() override ATTR_COLD;
virtual void device_start() override ATTR_COLD;
virtual void update_cart_base(uint8_t *cart_base) override; virtual void update_cart_base(uint8_t *cart_base) override;

View File

@ -47,13 +47,12 @@
#include "coco3.h" #include "coco3.h"
//------------------------------------------------- //-------------------------------------------------
// device_start // machine_start
//------------------------------------------------- //-------------------------------------------------
void coco3_state::device_start() void coco3_state::machine_start()
{ {
// call base device_start coco_state::machine_start();
coco_state::device_start();
// save state support // save state support
save_item(NAME(m_prev_keyboard_pressed)); save_item(NAME(m_prev_keyboard_pressed));
@ -114,7 +113,7 @@ INPUT_CHANGED_MEMBER(coco3_state::keyboard_changed)
uint8_t any_pressed = 0; uint8_t any_pressed = 0;
for (unsigned i = 0; i < m_keyboard.size(); i++) for (unsigned i = 0; i < m_keyboard.size(); i++)
{ {
any_pressed |= (~(m_keyboard[i]->read()) | poll_joystick_buttons()) & 0xFF; any_pressed |= (~(m_keyboard[i]->read()) | poll_joystick_buttons()) & 0xff;
} }
bool pressed = any_pressed != 0; bool pressed = any_pressed != 0;

View File

@ -954,10 +954,7 @@ void tandy2k_state::machine_reset()
m_hires_en = 0; m_hires_en = 0;
m_clkmouse_cnt = 0; m_clkmouse_cnt = 0;
m_clkmouse_irq = 0; m_clkmouse_irq = 0;
}
void tandy2k_state::device_reset_after_children()
{
m_pc_keyboard->enable(0); m_pc_keyboard->enable(0);
} }

View File

@ -3,29 +3,34 @@
#ifndef MAME_TRS_TANDY2K_H #ifndef MAME_TRS_TANDY2K_H
#define MAME_TRS_TANDY2K_H #define MAME_TRS_TANDY2K_H
#pragma once
#include "tandy2kb.h"
#include "bus/centronics/ctronics.h" #include "bus/centronics/ctronics.h"
#include "bus/rs232/rs232.h" #include "bus/rs232/rs232.h"
#include "cpu/i86/i186.h" #include "cpu/i86/i186.h"
#include "cpu/mcs48/mcs48.h" #include "cpu/mcs48/mcs48.h"
#include "formats/tandy2k_dsk.h"
#include "imagedev/floppy.h" #include "imagedev/floppy.h"
#include "imagedev/harddriv.h" #include "imagedev/harddriv.h"
#include "machine/i8255.h" #include "machine/bankdev.h"
#include "machine/i8251.h" #include "machine/i8251.h"
#include "machine/i8255.h"
#include "machine/pckeybrd.h" #include "machine/pckeybrd.h"
#include "machine/pit8253.h"
#include "machine/pic8259.h" #include "machine/pic8259.h"
#include "machine/pit8253.h"
#include "machine/ram.h" #include "machine/ram.h"
#include "tandy2kb.h"
#include "machine/timer.h" #include "machine/timer.h"
#include "machine/upd765.h" #include "machine/upd765.h"
#include "machine/bankdev.h"
#include "sound/spkrdev.h" #include "sound/spkrdev.h"
#include "video/crt9007.h" #include "video/crt9007.h"
#include "video/crt9021.h" #include "video/crt9021.h"
#include "video/crt9212.h" #include "video/crt9212.h"
#include "emupal.h" #include "emupal.h"
#include "formats/tandy2k_dsk.h"
#define SCREEN_TAG "screen" #define SCREEN_TAG "screen"
#define I80186_TAG "u76" #define I80186_TAG "u76"
#define I8255A_TAG "u75" #define I8255A_TAG "u75"
@ -118,7 +123,6 @@ public:
private: private:
virtual void machine_start() override ATTR_COLD; virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD;
virtual void device_reset_after_children() override;
void tandy2k_mem(address_map &map) ATTR_COLD; void tandy2k_mem(address_map &map) ATTR_COLD;
void tandy2k_io(address_map &map) ATTR_COLD; void tandy2k_io(address_map &map) ATTR_COLD;