trunk/src/mess/drivers/apc.c
| r18968 | r18969 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | NEC APC |
| 3 | Advanced Personal Computer (c) 1982 NEC |
| 4 | 4 | |
| 5 | preliminary driver by Angelo Salese |
| 6 | |
| 7 | TODO: |
| 8 | - Bogus DMA check, patched out for now |
| 9 | - video emulation |
| 10 | - Floppy device and IMD support |
| 11 | - keyboard |
| 12 | - Understand interrupt sources |
| 13 | - NMI seems valid, dumps a x86 stack to vram? |
| 14 | - Unknown RTC device type; |
| 15 | - What are exactly APU and MPU devices? They sounds scary ... |
| 16 | - DMA hook-ups |
| 17 | - serial ports |
| 18 | - parallel ports |
| 19 | - Extract info regarding Hard Disk functionality |
| 20 | - Various unknown ports |
| 21 | - What kind of external ROM actually maps at 0xa****? |
| 22 | |
| 23 | ============================================================================ |
| 5 | 24 | front ^ |
| 6 | 25 | | |
| 7 | 26 | card |
| r18968 | r18969 | |
| 12 | 31 | 69PFB2 8086/8087 DFBU2J PFBU2L 2732 |
| 13 | 32 | 69SNB RAM |
| 14 | 33 | |
| 15 | | i/o memory map: |
| 34 | ---------------------------------------------------------------------------- |
| 35 | i/o memory map (preliminary): |
| 16 | 36 | 0x00 - 0x1f DMA |
| 17 | 37 | 0x20 - 0x23 i8259 master |
| 18 | 38 | 0x28 - 0x2f i8259 slave (even), pit8253 (odd) |
| r18968 | r18969 | |
| 72 | 92 | DECLARE_WRITE8_MEMBER(apc_port_60_w); |
| 73 | 93 | DECLARE_READ8_MEMBER(apc_gdc_r); |
| 74 | 94 | DECLARE_WRITE8_MEMBER(apc_gdc_w); |
| 75 | | DECLARE_READ8_MEMBER(apc_dma_r); |
| 76 | | DECLARE_WRITE8_MEMBER(apc_dma_w); |
| 95 | DECLARE_READ8_MEMBER(apc_kbd_r); |
| 96 | DECLARE_WRITE8_MEMBER(apc_kbd_w); |
| 77 | 97 | |
| 78 | 98 | DECLARE_WRITE_LINE_MEMBER(apc_master_set_int_line); |
| 79 | 99 | DECLARE_READ8_MEMBER(get_slave_ack); |
| r18968 | r18969 | |
| 213 | 233 | m_hgdc1->write(space, (offset & 2) >> 1,data); // upd7220 character port |
| 214 | 234 | } |
| 215 | 235 | |
| 216 | | |
| 217 | | READ8_MEMBER(apc_state::apc_dma_r) |
| 236 | READ8_MEMBER(apc_state::apc_kbd_r) |
| 218 | 237 | { |
| 219 | | return i8237_r(machine().device("8237dma"), space, offset & 0xf); |
| 238 | //printf("%08x\n",offset); |
| 239 | return 0; |
| 220 | 240 | } |
| 221 | 241 | |
| 222 | | WRITE8_MEMBER(apc_state::apc_dma_w) |
| 242 | WRITE8_MEMBER(apc_state::apc_kbd_w) |
| 223 | 243 | { |
| 224 | | //printf("%08x %02x\n",m_maincpu->pc(),data); |
| 225 | | i8237_w(machine().device("8237dma"), space, offset & 0xf, data); |
| 244 | printf("%08x %02x\n",offset,data); |
| 226 | 245 | } |
| 227 | 246 | |
| 228 | | |
| 229 | 247 | static ADDRESS_MAP_START( apc_map, AS_PROGRAM, 16, apc_state ) |
| 230 | 248 | AM_RANGE(0x00000, 0x1ffff) AM_RAM |
| 231 | 249 | // AM_RANGE(0xa0000, 0xaffff) space for an external ROM |
| r18968 | r18969 | |
| 234 | 252 | |
| 235 | 253 | static ADDRESS_MAP_START( apc_io, AS_IO, 16, apc_state ) |
| 236 | 254 | // ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 237 | | AM_RANGE(0x00, 0x1f) AM_READWRITE8(apc_dma_r, apc_dma_w, 0x00ff) |
| 255 | AM_RANGE(0x00, 0x1f) AM_DEVREADWRITE8_LEGACY("8237dma", i8237_r, i8237_w, 0x00ff) |
| 238 | 256 | AM_RANGE(0x20, 0x23) AM_DEVREADWRITE8_LEGACY("pic8259_master", pic8259_r, pic8259_w, 0x00ff) // i8259 |
| 239 | 257 | AM_RANGE(0x28, 0x2f) AM_READWRITE8(apc_port_28_r, apc_port_28_w, 0xffff) |
| 240 | 258 | // 0x30, 0x37 serial port 0/1 (i8251) (even/odd) |
| 241 | 259 | // 0x38, 0x3f DMA extended address |
| 242 | 260 | AM_RANGE(0x40, 0x43) AM_READWRITE8(apc_gdc_r, apc_gdc_w, 0xffff) |
| 243 | 261 | // 0x46 UPD7220 reset interrupt |
| 244 | | // 0x48, 0x4f keyboard controller |
| 262 | AM_RANGE(0x48, 0x4f) AM_READWRITE8(apc_kbd_r, apc_kbd_w, 0x00ff) |
| 245 | 263 | AM_RANGE(0x50, 0x53) AM_DEVICE8("upd765", upd765a_device, map, 0x00ff ) // upd765 |
| 246 | 264 | // 0x5a APU data (Arithmetic Processing Unit!) |
| 247 | 265 | // 0x5e APU status/command |
| r18968 | r18969 | |
| 355 | 373 | |
| 356 | 374 | |
| 357 | 375 | static GFXDECODE_START( apc ) |
| 376 | GFXDECODE_ENTRY( "ipl", 0x0000, charset_8x16, 0, 8 ) |
| 358 | 377 | GFXDECODE_ENTRY( "gfx", 0x0000, charset_8x16, 0, 8 ) |
| 359 | 378 | GFXDECODE_END |
| 360 | 379 | |
| r18968 | r18969 | |
| 393 | 412 | ir1 |
| 394 | 413 | ir2 |
| 395 | 414 | ir3 |
| 396 | | ir4 |
| 415 | ir4 keyboard (almost trusted, check code at fe64a) |
| 397 | 416 | ir5 |
| 398 | 417 | ir6 |
| 399 | 418 | ir7 |
| r18968 | r18969 | |
| 402 | 421 | ir0 |
| 403 | 422 | ir1 |
| 404 | 423 | ir2 |
| 405 | | ir3 |
| 424 | ir3 fdd irq? |
| 406 | 425 | ir4 |
| 407 | 426 | ir5 |
| 408 | 427 | ir6 |
| r18968 | r18969 | |
| 511 | 530 | }; |
| 512 | 531 | |
| 513 | 532 | static SLOT_INTERFACE_START( apc_floppies ) |
| 514 | | SLOT_INTERFACE( "525hd", FLOPPY_525_HD ) // TODO: 8" |
| 533 | SLOT_INTERFACE( "8sd", FLOPPY_8_SSSD ) // TODO: Ok? |
| 515 | 534 | SLOT_INTERFACE_END |
| 516 | 535 | |
| 517 | 536 | |
| r18968 | r18969 | |
| 530 | 549 | MCFG_I8237_ADD("8237dma", MAIN_CLOCK, dma8237_config) |
| 531 | 550 | |
| 532 | 551 | MCFG_UPD765A_ADD("upd765", true, true) |
| 533 | | MCFG_FLOPPY_DRIVE_ADD("upd765:0", apc_floppies, "525hd", 0, apc_floppy_formats) |
| 534 | | MCFG_FLOPPY_DRIVE_ADD("upd765:1", apc_floppies, "525hd", 0, apc_floppy_formats) |
| 552 | MCFG_FLOPPY_DRIVE_ADD("upd765:0", apc_floppies, "8sd", 0, apc_floppy_formats) |
| 553 | MCFG_FLOPPY_DRIVE_ADD("upd765:1", apc_floppies, "8sd", 0, apc_floppy_formats) |
| 535 | 554 | |
| 536 | 555 | /* video hardware */ |
| 537 | 556 | MCFG_SCREEN_ADD("screen", RASTER) |
| r18968 | r18969 | |
| 585 | 604 | |
| 586 | 605 | } |
| 587 | 606 | |
| 588 | | GAME( 198?, apc, 0, apc, apc, apc_state, apc, ROT0, "NEC", "APC", GAME_IS_SKELETON ) |
| 607 | GAME( 1982, apc, 0, apc, apc, apc_state, apc, ROT0, "NEC", "APC", GAME_NOT_WORKING | GAME_NO_SOUND ) |