trunk/src/mess/drivers/apc.c
| r20921 | r20922 | |
| 6 | 6 | |
| 7 | 7 | TODO: |
| 8 | 8 | - video emulation (bitmap part) |
| 9 | | - Understand interrupt sources |
| 10 | 9 | - NMI seems valid, dumps a x86 stack to vram? |
| 11 | | - Unknown RTC device type (upd1990a?); |
| 12 | 10 | - What are exactly APU and MPU devices? They sounds scary ... |
| 13 | 11 | - DMA hook-ups |
| 14 | 12 | - serial ports |
| r20921 | r20922 | |
| 16 | 14 | - Extract info regarding Hard Disk functionality |
| 17 | 15 | - Various unknown ports |
| 18 | 16 | - What kind of external ROM actually maps at 0xa****? |
| 17 | - Jumper settings (comms settings and display select) |
| 19 | 18 | |
| 20 | 19 | ============================================================================ |
| 21 | 20 | front ^ |
| r20921 | r20922 | |
| 148 | 147 | |
| 149 | 148 | int m_dack; |
| 150 | 149 | UINT8 m_dma_offset[4]; |
| 151 | | |
| 150 | |
| 152 | 151 | IRQ_CALLBACK_MEMBER(irq_callback); |
| 153 | 152 | |
| 154 | 153 | protected: |
| r20921 | r20922 | |
| 229 | 228 | { |
| 230 | 229 | int res_x,res_y; |
| 231 | 230 | |
| 232 | | // res_x = (x*8+xi) * (state->m_video_ff[WIDTH40_REG]+1); |
| 233 | | res_x = (x*8+xi) * (1); |
| 231 | res_x = (x*8+xi); |
| 234 | 232 | res_y = y*lr+yi; |
| 235 | 233 | |
| 236 | 234 | if(!device->machine().primary_screen->visible_area().contains(res_x, res_y)) |
| r20921 | r20922 | |
| 278 | 276 | |
| 279 | 277 | if(pen) |
| 280 | 278 | bitmap.pix32(res_y, res_x) = palette[pen]; |
| 281 | | |
| 282 | | // if(state->m_video_ff[WIDTH40_REG]) |
| 283 | | // { |
| 284 | | // if(res_x+1 > 640 || res_y > char_size*25) //TODO |
| 285 | | // continue; |
| 286 | | |
| 287 | | // bitmap.pix16(res_y, res_x+1) = pen; |
| 288 | | // } |
| 289 | 279 | } |
| 290 | 280 | } |
| 291 | 281 | } |
| r20921 | r20922 | |
| 412 | 402 | |
| 413 | 403 | WRITE8_MEMBER(apc_state::apc_irq_ack_w) |
| 414 | 404 | { |
| 405 | /* |
| 406 | x--- GDC |
| 407 | -x-- TM |
| 408 | --x- APU |
| 409 | ---x CRT |
| 410 | */ |
| 415 | 411 | if(data & 4) |
| 416 | 412 | pic8259_ir3_w(machine().device("pic8259_master"), 0); |
| 417 | 413 | |
| r20921 | r20922 | |
| 419 | 415 | logerror("IRQ ACK %02x\n",data); |
| 420 | 416 | } |
| 421 | 417 | |
| 422 | | /* TODO: bit arrangement is completely wrong */ |
| 423 | 418 | READ8_MEMBER(apc_state::apc_rtc_r) |
| 424 | 419 | { |
| 420 | /* |
| 421 | bit 1 high: low battery. |
| 422 | */ |
| 425 | 423 | //fprintf(stderr, "RTC Read: %d\n", m_rtc->data_out_r()); |
| 426 | 424 | return m_rtc->data_out_r(); |
| 427 | 425 | } |
| r20921 | r20922 | |
| 444 | 442 | ... |
| 445 | 443 | |
| 446 | 444 | RTC write bits: 76543210 |
| 447 | | |||||||\- c0 (or OE?) |
| 445 | |||||||\- c0 |
| 448 | 446 | ||||||\-- c1 |
| 449 | 447 | |||||\--- c2 |
| 450 | 448 | ||||\---- STB |
| 451 | 449 | |||\----- CLK |
| 452 | 450 | ||\------ DATA_IN |
| 453 | | |\------- ? |
| 454 | | \-------- ? |
| 451 | |\------- "don't care" |
| 452 | \-------- /// |
| 455 | 453 | */ |
| 456 | | if (data&0xE0) fprintf(stderr,"RTC write: 0x%02x\n", data); |
| 454 | if (data&0xc0) fprintf(stderr,"RTC write: 0x%02x\n", data); |
| 457 | 455 | m_rtc->c0_w(BIT(data, 0)); // correct assuming theres a delay for changing command lines before stb |
| 458 | 456 | m_rtc->c1_w(BIT(data, 1)); // " |
| 459 | 457 | m_rtc->c2_w(BIT(data, 2)); // " |
| r20921 | r20922 | |
| 466 | 464 | static ADDRESS_MAP_START( apc_map, AS_PROGRAM, 16, apc_state ) |
| 467 | 465 | AM_RANGE(0x00000, 0x9ffff) AM_RAM |
| 468 | 466 | AM_RANGE(0xa0000, 0xa0fff) AM_RAM AM_SHARE("cmos") |
| 467 | // AM_RANGE(0xa1000, 0xbffff) mirror CMOS |
| 469 | 468 | // AM_RANGE(0xc0000, 0xcffff) standard character ROM |
| 470 | 469 | AM_RANGE(0xd8000, 0xd9fff) AM_RAM AM_REGION("aux_pcg", 0) // AUX character RAM |
| 471 | 470 | // AM_RANGE(0xe0000, 0xeffff) Special Character RAM |
| r20921 | r20922 | |
| 484 | 483 | AM_RANGE(0x48, 0x4f) AM_READWRITE8(apc_kbd_r, apc_kbd_w, 0x00ff) |
| 485 | 484 | AM_RANGE(0x50, 0x53) AM_DEVICE8("upd765", upd765a_device, map, 0x00ff ) // upd765 |
| 486 | 485 | AM_RANGE(0x58, 0x59) AM_READWRITE8(apc_rtc_r, apc_rtc_w, 0x00ff) |
| 486 | // 0x59 CMOS enable |
| 487 | 487 | // 0x5a APU data (Arithmetic Processing Unit!) |
| 488 | // 0x5b, Power Off |
| 488 | 489 | // 0x5e APU status/command |
| 489 | 490 | AM_RANGE(0x60, 0x61) AM_DEVREADWRITE8_LEGACY("upd1771c", upd1771_r, upd1771_w, 0x00ff ) |
| 490 | | // AM_RANGE(0x68, 0x6f) i8255 , printer port (A: status (R) B: data (W) C: command (W)) |
| 491 | | // AM_DEVREADWRITE8("upd7220_btm", upd7220_device, read, write, 0x00ff) |
| 492 | | // 0x92, 0x9a, 0xa2, 0xaa is for a Hard Disk (unknown type) |
| 491 | // AM_RANGE(0x68, 0x6f) i8255 , ODA printer port (A: status (R) B: data (W) C: command (W)) |
| 492 | // 0x70, 0x76 AM_DEVREADWRITE8("upd7220_btm", upd7220_device, read, write, 0x00ff) |
| 493 | // 0x71, 0x77 IDA Controller |
| 494 | // 0x80, 0x90 Communication Adapter |
| 495 | // 0xf0, 0xf6 ASOP Controller |
| 493 | 496 | ADDRESS_MAP_END |
| 494 | 497 | |
| 495 | 498 | /* TODO: key repeat, remove port impulse! */ |
| r20921 | r20922 | |
| 973 | 976 | m_fdc->dma_w(data); |
| 974 | 977 | } |
| 975 | 978 | |
| 979 | /* |
| 980 | CH0: CRT |
| 981 | CH1: FDC |
| 982 | CH2: ("reserved for future graphics expansion") |
| 983 | CH3: AUX |
| 984 | */ |
| 976 | 985 | static I8237_INTERFACE( dmac_intf ) |
| 977 | 986 | { |
| 978 | 987 | DEVCB_DRIVER_LINE_MEMBER(apc_state, apc_dma_hrq_changed), |
| r20921 | r20922 | |
| 1051 | 1060 | |
| 1052 | 1061 | /* sound hardware */ |
| 1053 | 1062 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1054 | | MCFG_SOUND_ADD( "upd1771c", UPD1771C, MAIN_CLOCK ) |
| 1063 | MCFG_SOUND_ADD( "upd1771c", UPD1771C, MAIN_CLOCK ) //uPD1771C-006 |
| 1055 | 1064 | MCFG_SOUND_CONFIG( upd1771c_config ) |
| 1056 | 1065 | MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 1057 | 1066 | MACHINE_CONFIG_END |