trunk/src/mess/drivers/apple2.c
| r31720 | r31721 | |
| 192 | 192 | #include "imagedev/flopdrv.h" |
| 193 | 193 | #include "imagedev/cassette.h" |
| 194 | 194 | #include "formats/ap2_dsk.h" |
| 195 | #include "formats/ap_dsk35.h" |
| 195 | 196 | #include "includes/apple2.h" |
| 196 | 197 | #include "cpu/z80/z80.h" |
| 198 | #include "machine/sonydriv.h" |
| 197 | 199 | #include "machine/appldriv.h" |
| 198 | 200 | |
| 199 | 201 | #include "bus/a2bus/a2bus.h" |
| r31720 | r31721 | |
| 1246 | 1248 | MCFG_RAM_EXTRA_OPTIONS("128K") |
| 1247 | 1249 | MACHINE_CONFIG_END |
| 1248 | 1250 | |
| 1251 | const applefdc_interface a2cp_interface = |
| 1252 | { |
| 1253 | sony_set_lines, /* set_lines */ |
| 1254 | sony_set_enable_lines, /* set_enable_lines */ |
| 1255 | |
| 1256 | sony_read_data, /* read_data */ |
| 1257 | sony_write_data, /* write_data */ |
| 1258 | sony_read_status /* read_status */ |
| 1259 | }; |
| 1260 | |
| 1261 | static const floppy_interface apple2cp_floppy35_floppy_interface = |
| 1262 | { |
| 1263 | FLOPPY_STANDARD_5_25_DSHD, |
| 1264 | LEGACY_FLOPPY_OPTIONS_NAME(apple35_iigs), |
| 1265 | "floppy_3_5" |
| 1266 | }; |
| 1267 | |
| 1249 | 1268 | static MACHINE_CONFIG_DERIVED( apple2cp, apple2c ) |
| 1250 | 1269 | MCFG_MACHINE_START_OVERRIDE(apple2_state,apple2cp) |
| 1251 | 1270 | |
| 1252 | 1271 | MCFG_A2BUS_SLOT_REMOVE("sl6") |
| 1253 | | MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_IWM_FDC, NULL) |
| 1272 | MCFG_IWM_ADD(IICP_IWM_TAG, a2cp_interface) |
| 1273 | MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(apple2cp_floppy35_floppy_interface) |
| 1254 | 1274 | MACHINE_CONFIG_END |
| 1255 | 1275 | |
| 1256 | 1276 | static MACHINE_CONFIG_DERIVED( apple2c_iwm, apple2c ) |
| r31720 | r31721 | |
| 1766 | 1786 | COMP( 1988, las128e2, apple2c, 0, laser128ex2, apple2e, driver_device, 0, "Video Technology", "Laser 128ex2 (version 6.1)", GAME_SUPPORTS_SAVE ) |
| 1767 | 1787 | COMP( 1985, apple2c0, apple2c, 0, apple2c_iwm, apple2e, driver_device, 0, "Apple Computer", "Apple //c (UniDisk 3.5)", GAME_SUPPORTS_SAVE ) |
| 1768 | 1788 | COMP( 1986, apple2c3, apple2c, 0, apple2c_iwm, apple2e, driver_device, 0, "Apple Computer", "Apple //c (Original Memory Expansion)", GAME_SUPPORTS_SAVE ) |
| 1769 | | COMP( 1986, apple2c4, apple2c, 0, apple2c_iwm, apple2e, driver_device, 0, "Apple Computer", "Apple //c (rev 4)", GAME_NOT_WORKING ) |
| 1789 | COMP( 1986, apple2c4, apple2c, 0, apple2c_iwm, apple2e, driver_device, 0, "Apple Computer", "Apple //c (rev 4)", GAME_SUPPORTS_SAVE ) |
| 1770 | 1790 | COMP( 1988, apple2cp, apple2c, 0, apple2cp, apple2e, driver_device, 0, "Apple Computer", "Apple //c Plus", GAME_SUPPORTS_SAVE ) |
| 1771 | 1791 | COMP( 1984, ivelultr, apple2, 0, apple2p, apple2p, driver_device, 0, "Ivasim", "Ivel Ultra", GAME_SUPPORTS_SAVE ) |
| 1772 | 1792 | COMP( 1983, agat7, apple2, 0, apple2p, apple2p, driver_device, 0, "Agat", "Agat-7", GAME_NOT_WORKING) // disk controller ROM JSRs to $FCA8 which is a delay on apple II, illegal instruction crash here :( |
trunk/src/mess/machine/apple2.c
| r31720 | r31721 | |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | |
| 370 | if ((m_machinetype == APPLE_IICPLUS) && (slot == 6)) |
| 371 | { |
| 372 | offset &= 0xf; |
| 373 | return m_iicpiwm->read(offset); |
| 374 | } |
| 369 | 375 | |
| 376 | if ((m_machinetype == LASER128) && (slot == 5)) |
| 377 | { |
| 378 | offset &= 0xf; |
| 379 | UINT8 retval = m_exp_regs[offset]; |
| 380 | |
| 381 | if (offset == 3) |
| 382 | { |
| 383 | retval = m_exp_ram[m_exp_liveptr&m_exp_addrmask]; |
| 384 | m_exp_liveptr++; |
| 385 | m_exp_regs[0] = m_exp_liveptr & 0xff; |
| 386 | m_exp_regs[1] = (m_exp_liveptr>>8) & 0xff; |
| 387 | m_exp_regs[2] = ((m_exp_liveptr>>16) & 0xff) | m_exp_bankhior; |
| 388 | } |
| 389 | |
| 390 | return retval; |
| 391 | } |
| 392 | |
| 370 | 393 | if ((m_machinetype == LASER128) && (slot == 6)) |
| 371 | 394 | { |
| 372 | 395 | offset &= 0xf; |
| r31720 | r31721 | |
| 417 | 440 | } |
| 418 | 441 | } |
| 419 | 442 | |
| 443 | if ((m_machinetype == APPLE_IICPLUS) && (slot == 6)) |
| 444 | { |
| 445 | offset &= 0xf; |
| 446 | m_iicpiwm->write(offset, data); |
| 447 | return; |
| 448 | } |
| 449 | |
| 450 | if ((m_machinetype == LASER128) && (slot == 5)) |
| 451 | { |
| 452 | switch (offset & 0xf) |
| 453 | { |
| 454 | case 0: |
| 455 | m_exp_wptr &= ~0xff; |
| 456 | m_exp_wptr |= data; |
| 457 | m_exp_regs[0] = m_exp_wptr & 0xff; |
| 458 | m_exp_regs[1] = (m_exp_wptr>>8) & 0xff; |
| 459 | m_exp_regs[2] = ((m_exp_wptr>>16) & 0xff) | m_exp_bankhior; |
| 460 | m_exp_liveptr = m_exp_wptr; |
| 461 | break; |
| 462 | |
| 463 | case 1: |
| 464 | m_exp_wptr &= ~0xff00; |
| 465 | m_exp_wptr |= (data<<8); |
| 466 | m_exp_regs[0] = m_exp_wptr & 0xff; |
| 467 | m_exp_regs[1] = (m_exp_wptr>>8) & 0xff; |
| 468 | m_exp_regs[2] = ((m_exp_wptr>>16) & 0xff) | m_exp_bankhior; |
| 469 | m_exp_liveptr = m_exp_wptr; |
| 470 | break; |
| 471 | |
| 472 | case 2: |
| 473 | m_exp_wptr &= ~0xff0000; |
| 474 | m_exp_wptr |= (data<<16); |
| 475 | m_exp_regs[0] = m_exp_wptr & 0xff; |
| 476 | m_exp_regs[1] = (m_exp_wptr>>8) & 0xff; |
| 477 | m_exp_regs[2] = ((m_exp_wptr>>16) & 0xff) | m_exp_bankhior; |
| 478 | m_exp_liveptr = m_exp_wptr; |
| 479 | break; |
| 480 | |
| 481 | case 3: |
| 482 | // printf("Write %02x to RAM[%x]\n", data, m_liveptr); |
| 483 | m_exp_ram[(m_exp_liveptr&m_exp_addrmask)] = data; |
| 484 | m_exp_liveptr++; |
| 485 | m_exp_regs[0] = m_exp_liveptr & 0xff; |
| 486 | m_exp_regs[1] = (m_exp_liveptr>>8) & 0xff; |
| 487 | m_exp_regs[2] = ((m_exp_liveptr>>16) & 0xff) | m_exp_bankhior; |
| 488 | break; |
| 489 | |
| 490 | default: |
| 491 | m_exp_regs[offset] = data; |
| 492 | break; |
| 493 | } |
| 494 | } |
| 495 | |
| 420 | 496 | if ((m_machinetype == LASER128) && (slot == 6)) |
| 421 | 497 | { |
| 422 | 498 | offset &= 0xf; |
| r31720 | r31721 | |
| 1218 | 1294 | |
| 1219 | 1295 | m_joystick_x1_time = m_joystick_y1_time = 0; |
| 1220 | 1296 | m_joystick_x2_time = m_joystick_y2_time = 0; |
| 1297 | |
| 1298 | memset(m_exp_regs, 0, sizeof(UINT8) * 0x10); |
| 1299 | m_exp_wptr = m_exp_liveptr = 0; |
| 1300 | |
| 1221 | 1301 | } |
| 1222 | 1302 | |
| 1223 | 1303 | int apple2_state::a2_no_ctrl_reset() |
| r31720 | r31721 | |
| 2251 | 2331 | |
| 2252 | 2332 | apple2_init_common(); |
| 2253 | 2333 | |
| 2334 | // 1 MB of expansion RAM in slot 5 |
| 2335 | m_exp_ram = auto_alloc_array(machine(), UINT8, 1024*1024); |
| 2336 | memset(m_exp_ram, 0xff, 1024*1024); |
| 2337 | |
| 2338 | m_exp_bankhior = 0xf0; |
| 2339 | m_exp_addrmask = 0xfffff; |
| 2340 | |
| 2341 | // save memory expansion vars |
| 2342 | save_item(NAME(m_exp_regs)); |
| 2343 | save_item(NAME(m_exp_wptr)); |
| 2344 | save_item(NAME(m_exp_liveptr)); |
| 2345 | save_item(NAME(m_exp_bankhior)); |
| 2346 | save_item(NAME(m_exp_addrmask)); |
| 2347 | |
| 2254 | 2348 | /* setup memory */ |
| 2255 | 2349 | memset(&mem_cfg, 0, sizeof(mem_cfg)); |
| 2256 | 2350 | mem_cfg.first_bank = 1; |
trunk/src/mess/includes/apple2.h
| r31720 | r31721 | |
| 26 | 26 | |
| 27 | 27 | #define IIC_ACIA1_TAG "acia1" |
| 28 | 28 | #define IIC_ACIA2_TAG "acia2" |
| 29 | #define IICP_IWM_TAG "iwm" |
| 29 | 30 | |
| 30 | 31 | #define LASER128_UDC_TAG "l128udc" |
| 31 | 32 | |
| r31720 | r31721 | |
| 142 | 143 | m_cassette(*this, "cassette"), |
| 143 | 144 | m_acia1(*this, IIC_ACIA1_TAG), |
| 144 | 145 | m_acia2(*this, IIC_ACIA2_TAG), |
| 145 | | m_laserudc(*this, LASER128_UDC_TAG) |
| 146 | m_laserudc(*this, LASER128_UDC_TAG), |
| 147 | m_iicpiwm(*this, IICP_IWM_TAG) |
| 146 | 148 | { } |
| 147 | 149 | |
| 148 | 150 | required_device<cpu_device> m_maincpu; |
| r31720 | r31721 | |
| 161 | 163 | |
| 162 | 164 | optional_device<mos6551_device> m_acia1, m_acia2; |
| 163 | 165 | optional_device<applefdc_base_device> m_laserudc; |
| 166 | optional_device<iwm_device> m_iicpiwm; |
| 164 | 167 | |
| 165 | 168 | UINT32 m_flags, m_flags_mask; |
| 166 | 169 | INT32 m_a2_cnxx_slot; |
| r31720 | r31721 | |
| 360 | 363 | void apple2eplus_init_common(void *apple2cp_ce00_ram); |
| 361 | 364 | INT8 apple2_slotram_r(address_space &space, int slotnum, int offset); |
| 362 | 365 | int a2_no_ctrl_reset(); |
| 366 | |
| 367 | private: |
| 368 | // Laser 128EX2 slot 5 Apple Memory Expansion emulation vars |
| 369 | UINT8 m_exp_bankhior; |
| 370 | int m_exp_addrmask; |
| 371 | UINT8 m_exp_regs[0x10]; |
| 372 | UINT8 *m_exp_ram; |
| 373 | int m_exp_wptr, m_exp_liveptr; |
| 363 | 374 | }; |
| 364 | 375 | /*----------- defined in drivers/apple2.c -----------*/ |
| 365 | 376 | INPUT_PORTS_EXTERN( apple2ep ); |