trunk/src/mess/drivers/apc.c
| r19084 | r19085 | |
| 53 | 53 | |
| 54 | 54 | #include "emu.h" |
| 55 | 55 | #include "cpu/i86/i86.h" |
| 56 | #include "audio/upd1771.h" |
| 56 | 57 | #include "machine/pic8259.h" |
| 57 | 58 | #include "machine/pit8253.h" |
| 58 | 59 | #include "machine/am9517a.h" |
| r19084 | r19085 | |
| 107 | 108 | |
| 108 | 109 | DECLARE_READ8_MEMBER(apc_port_28_r); |
| 109 | 110 | DECLARE_WRITE8_MEMBER(apc_port_28_w); |
| 110 | | DECLARE_READ8_MEMBER(apc_port_60_r); |
| 111 | | DECLARE_WRITE8_MEMBER(apc_port_60_w); |
| 112 | 111 | DECLARE_READ8_MEMBER(apc_gdc_r); |
| 113 | 112 | DECLARE_WRITE8_MEMBER(apc_gdc_w); |
| 114 | 113 | DECLARE_READ8_MEMBER(apc_kbd_r); |
| r19084 | r19085 | |
| 327 | 326 | } |
| 328 | 327 | |
| 329 | 328 | |
| 330 | | READ8_MEMBER(apc_state::apc_port_60_r) |
| 331 | | { |
| 332 | | UINT8 res; |
| 333 | | |
| 334 | | if(offset & 1) |
| 335 | | { |
| 336 | | printf("Read undefined port %02x\n",offset+0x60); |
| 337 | | res = 0xff; |
| 338 | | } |
| 339 | | else |
| 340 | | { |
| 341 | | //printf("Read melody port %02x\n",offset+0x60); |
| 342 | | res = 0x80; |
| 343 | | } |
| 344 | | |
| 345 | | return res; |
| 346 | | } |
| 347 | | |
| 348 | | WRITE8_MEMBER(apc_state::apc_port_60_w) |
| 349 | | { |
| 350 | | if(offset & 1) |
| 351 | | { |
| 352 | | printf("Write undefined port %02x\n",offset+0x60); |
| 353 | | } |
| 354 | | else |
| 355 | | { |
| 356 | | printf("Write melody port %02x %02x\n",offset+0x60,data); |
| 357 | | } |
| 358 | | } |
| 359 | | |
| 360 | 329 | READ8_MEMBER(apc_state::apc_gdc_r) |
| 361 | 330 | { |
| 362 | 331 | UINT8 res; |
| r19084 | r19085 | |
| 491 | 460 | AM_RANGE(0x58, 0x59) AM_READWRITE8(apc_rtc_r, apc_rtc_w, 0x00ff) |
| 492 | 461 | // 0x5a APU data (Arithmetic Processing Unit!) |
| 493 | 462 | // 0x5e APU status/command |
| 494 | | AM_RANGE(0x60, 0x67) AM_READWRITE8(apc_port_60_r, apc_port_60_w, 0xffff) |
| 495 | | // 0x60 Melody Processing Unit |
| 463 | AM_RANGE(0x60, 0x61) AM_DEVREADWRITE8_LEGACY("upd1771c", upd1771_r, upd1771_w, 0x00ff ) |
| 496 | 464 | // AM_RANGE(0x68, 0x6f) i8255 , printer port (A: status (R) B: data (W) C: command (W)) |
| 497 | 465 | // AM_DEVREADWRITE8("upd7220_btm", upd7220_device, read, write, 0x00ff) |
| 498 | 466 | // 0x92, 0x9a, 0xa2, 0xaa is for a Hard Disk (unknown type) |
| r19084 | r19085 | |
| 969 | 937 | |
| 970 | 938 | READ8_MEMBER(apc_state::fdc_r) |
| 971 | 939 | { |
| 972 | | // printf("2dd DACK R\n"); |
| 973 | | |
| 974 | 940 | return m_fdc->dma_r(); |
| 975 | 941 | } |
| 976 | 942 | |
| 977 | 943 | WRITE8_MEMBER(apc_state::fdc_w) |
| 978 | 944 | { |
| 979 | | // printf("2dd DACK W\n"); |
| 980 | 945 | m_fdc->dma_w(data); |
| 981 | 946 | } |
| 982 | 947 | |
| r19084 | r19085 | |
| 1018 | 983 | palette_set_color_rgb(machine(), i, pal1bit(0), pal1bit(0), pal1bit(0)); |
| 1019 | 984 | } |
| 1020 | 985 | |
| 986 | static const upd1771_interface upd1771c_config = { DEVCB_NULL }; |
| 987 | |
| 1021 | 988 | static MACHINE_CONFIG_START( apc, apc_state ) |
| 1022 | 989 | |
| 1023 | 990 | /* basic machine hardware */ |
| r19084 | r19085 | |
| 1055 | 1022 | |
| 1056 | 1023 | /* sound hardware */ |
| 1057 | 1024 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1058 | | // MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/4) |
| 1059 | | // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 1025 | MCFG_SOUND_ADD( "upd1771c", UPD1771C, MAIN_CLOCK ) |
| 1026 | MCFG_SOUND_CONFIG( upd1771c_config ) |
| 1027 | MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 1060 | 1028 | MACHINE_CONFIG_END |
| 1061 | 1029 | |
| 1062 | 1030 | |