diff options
author | arbee <rb6502@users.noreply.github.com> | 2018-07-28 20:25:25 -0400 |
---|---|---|
committer | arbee <rb6502@users.noreply.github.com> | 2018-07-28 20:25:25 -0400 |
commit | 7bd14bedf6fd824853c406248dd4a36db17ecb7b (patch) | |
tree | 906606c0a26c1a1b082a4de021d905f97a288876 /src/mame/drivers/apple2e.cpp | |
parent | b1c5b7c40d15a515c7bb12a3cffb7f0d4b5f713c (diff) |
apple2cp: 5.25" disks are now supported too (nw)
Diffstat (limited to 'src/mame/drivers/apple2e.cpp')
-rw-r--r-- | src/mame/drivers/apple2e.cpp | 87 |
1 files changed, 75 insertions, 12 deletions
diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index 6dec2fa1d70..72e0a243d07 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -4216,6 +4216,20 @@ MACHINE_CONFIG_START(apple2e_state::apple2c) MCFG_RAM_EXTRA_OPTIONS("128K") MACHINE_CONFIG_END +static void apple2cp_set_lines(device_t *device, uint8_t lines) +{ + apple2e_state *state = device->machine().driver_data<apple2e_state>(); + + if (state->m_35sel) + { + sony_set_lines(device, lines); + } + else + { + apple525_set_lines(device, lines); + } +} + static void apple2cp_set_enable_lines(device_t *device,int enable_mask) { apple2e_state *state = device->machine().driver_data<apple2e_state>(); @@ -4226,20 +4240,68 @@ static void apple2cp_set_enable_lines(device_t *device,int enable_mask) { sony_set_enable_lines(device, 1); } + else if (!state->m_35sel) + { + apple525_set_enable_lines(device, enable_mask); + } else { sony_set_enable_lines(device, 0); } } +static uint8_t apple2cp_read_data(device_t *device) +{ + apple2e_state *state = device->machine().driver_data<apple2e_state>(); + + if (state->m_35sel) + { + return sony_read_data(device); + } + else + { + return apple525_read_data(device); + } + + return 0; +} + +static void apple2cp_write_data(device_t *device, uint8_t data) +{ + apple2e_state *state = device->machine().driver_data<apple2e_state>(); + + if (state->m_35sel) + { + sony_write_data(device, data); + } + else + { + apple525_write_data(device, data); + } +} + +static int apple2cp_read_status(device_t *device) +{ + apple2e_state *state = device->machine().driver_data<apple2e_state>(); + + if (state->m_35sel) + { + return sony_read_status(device); + } + else + { + return apple525_read_status(device); + } +} + const applefdc_interface a2cp_interface = { - sony_set_lines, /* set_lines */ + apple2cp_set_lines, /* set_lines */ apple2cp_set_enable_lines, /* set_enable_lines */ - sony_read_data, /* read_data */ - sony_write_data, /* write_data */ - sony_read_status /* read_status */ + apple2cp_read_data, /* read_data */ + apple2cp_write_data, /* write_data */ + apple2cp_read_status /* read_status */ }; static const floppy_interface apple2cp_floppy35_floppy_interface = @@ -4249,6 +4311,13 @@ static const floppy_interface apple2cp_floppy35_floppy_interface = "floppy_3_5" }; +static const floppy_interface floppy_interface = +{ + FLOPPY_STANDARD_5_25_DSHD, + LEGACY_FLOPPY_OPTIONS_NAME(apple2), + "floppy_5_25" +}; + MACHINE_CONFIG_START(apple2e_state::apple2cp) apple2c(config); MCFG_DEVICE_REPLACE("maincpu", M65C02, 1021800) /* close to actual CPU frequency of 1.020484 MHz */ @@ -4257,7 +4326,8 @@ MACHINE_CONFIG_START(apple2e_state::apple2cp) MCFG_DEVICE_REMOVE("sl4") MCFG_DEVICE_REMOVE("sl6") MCFG_IWM_ADD(IICP_IWM_TAG, a2cp_interface) - MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(apple2cp_floppy35_floppy_interface) + MCFG_LEGACY_FLOPPY_APPLE_2_DRIVES_ADD(floppy_interface,15,16) + MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADDITIONAL_ADD(apple2cp_floppy35_floppy_interface) MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("128K") @@ -4294,13 +4364,6 @@ const applefdc_interface fdc_interface = apple525_read_status /* read_status */ }; -static const floppy_interface floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(apple2), - "floppy_5_25" -}; - MACHINE_CONFIG_START(apple2e_state::laser128) apple2c(config); MCFG_DEVICE_REPLACE("maincpu", M65C02, 1021800) /* close to actual CPU frequency of 1.020484 MHz */ |