src/mess/drivers/pc8801.c
| r10064 | r10065 | |
| 14 | 14 | - joystick / mouse support; |
| 15 | 15 | - cursor is 8 x 10, not 8 x 8 as current implementation. |
| 16 | 16 | |
| 17 | per-game specific TODO: |
| 18 | - 100 Yen disk(s): reads kanji ports; |
| 19 | - Acro Jet: hangs waiting for an irq; |
| 20 | - Adrenalin Connection: seems to have an unemulated screen mode; |
| 21 | - Again: hangs waiting for something; |
| 22 | - Agress: crashes after that it shows the title screen; |
| 23 | - Tokyo Nampa Street: text garbage during gameplay; |
| 24 | - Xevious: game is too fast |
| 25 | |
| 17 | 26 | Notes: |
| 18 | 27 | - BIOS disk ROM defines what kind of floppies you could load: |
| 19 | 28 | * with 0x0800 ROM size you can load 2d floppies only; |
| r10064 | r10065 | |
| 25 | 34 | - 0x5c / 0x5f - VRAM banking |
| 26 | 35 | - 0x70 - window offset (banking) |
| 27 | 36 | - 0x71 - extra ROM banking |
| 28 | | - 0x78 - window offset (banking) + 0x100 |
| 37 | - 0x78 - window offset (banking) increment (+ 0x100) |
| 29 | 38 | - 0xe2 / 0xe3 - extra RAM banking |
| 30 | 39 | - 0xf0 / 0xf1 = kanji banking |
| 31 | 40 | |
| r10064 | r10065 | |
| 113 | 122 | static UINT8 i8255_0_pc,i8255_1_pc; |
| 114 | 123 | static UINT8 fdc_irq_opcode; |
| 115 | 124 | static UINT8 ext_rom_bank,gfx_ctrl,vram_sel,misc_ctrl,device_ctrl_data; |
| 116 | | static UINT8 vrtc_irq_mask,sound_irq_mask; |
| 125 | static UINT8 vrtc_irq_mask,rtc_irq_mask,sound_irq_mask; |
| 117 | 126 | static UINT8 window_offset_bank; |
| 118 | 127 | static UINT8 layer_mask; |
| 119 | 128 | static UINT8 i8214_irq_level,i8214_irq_state; |
| 129 | static UINT16 dma_counter[4],dma_address[4]; |
| 120 | 130 | |
| 121 | 131 | static void pc8801_update_irq(running_machine *machine) |
| 122 | 132 | { |
| r10064 | r10065 | |
| 135 | 145 | |
| 136 | 146 | static void pc8801_raise_irq(running_machine *machine, int level) |
| 137 | 147 | { |
| 138 | | i8214_irq_state |= (1<<level); |
| 148 | /* TODO ... */ |
| 149 | i8214_irq_state = (1<<level); |
| 139 | 150 | pc8801_update_irq(machine); |
| 140 | 151 | } |
| 141 | 152 | |
| r10064 | r10065 | |
| 244 | 255 | int color; |
| 245 | 256 | UINT8 *gfx_data = screen->machine->region("gfx1")->base(); |
| 246 | 257 | |
| 247 | | tile = vram[x+(y*120)+0xf3c8]; //TODO: vram base, connected to DMAC address 2 |
| 258 | tile = vram[x+(y*120)+dma_address[2]]; |
| 248 | 259 | |
| 249 | 260 | res_x = x*8+xi; |
| 250 | 261 | res_y = y*8+yi; |
| r10064 | r10065 | |
| 536 | 547 | |
| 537 | 548 | static WRITE8_HANDLER( pc8801_irq_mask_w ) |
| 538 | 549 | { |
| 550 | rtc_irq_mask = data & 1; |
| 539 | 551 | vrtc_irq_mask = data & 2; |
| 552 | |
| 553 | if(data & 4) |
| 554 | printf("IRQ mask %02x\n",data); |
| 540 | 555 | } |
| 541 | 556 | |
| 542 | 557 | static READ8_HANDLER( pc8801_window_bank_r ) |
| r10064 | r10065 | |
| 634 | 649 | printf("CRTC cmd %s polled\n",crtc_command[data >> 5]); |
| 635 | 650 | } |
| 636 | 651 | |
| 652 | static WRITE8_HANDLER( pc8801_dmac_w ) |
| 653 | { |
| 654 | static UINT8 dmac_ff; |
| 655 | |
| 656 | if(offset & 1) |
| 657 | dma_counter[offset >> 1] = (dmac_ff) ? (dma_counter[offset >> 1]&0xff)|(data<<8) : (dma_counter[offset >> 1]&0xff00)|(data&0xff); |
| 658 | else |
| 659 | dma_address[offset >> 1] = (dmac_ff) ? (dma_address[offset >> 1]&0xff)|(data<<8) : (dma_address[offset >> 1]&0xff00)|(data&0xff); |
| 660 | |
| 661 | dmac_ff ^= 1; |
| 662 | } |
| 663 | |
| 637 | 664 | static ADDRESS_MAP_START( pc8801_io, ADDRESS_SPACE_IO, 8 ) |
| 638 | 665 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 639 | 666 | ADDRESS_MAP_UNMAP_HIGH |
| r10064 | r10065 | |
| 669 | 696 | AM_RANGE(0x54, 0x5b) AM_WRITE(pc8801_palram_w) |
| 670 | 697 | AM_RANGE(0x5c, 0x5c) AM_READ(pc8801_vram_select_r) |
| 671 | 698 | AM_RANGE(0x5c, 0x5f) AM_WRITE(pc8801_vram_select_w) |
| 672 | | // AM_RANGE(0x60, 0x68) AM_READWRITE(pc88_dmac_r, pc88_dmac_w) |
| 699 | AM_RANGE(0x60, 0x67) AM_WRITE(pc8801_dmac_w) |
| 673 | 700 | // AM_RANGE(0x6e, 0x6e) AM_NOP /* CPU clock info */ |
| 674 | 701 | // AM_RANGE(0x6f, 0x6f) AM_NOP /* RS-232C speed ctrl */ |
| 675 | 702 | AM_RANGE(0x70, 0x70) AM_READWRITE(pc8801_window_bank_r, pc8801_window_bank_w) |
| r10064 | r10065 | |
| 1133 | 1160 | return level*2; |
| 1134 | 1161 | } |
| 1135 | 1162 | |
| 1163 | static TIMER_CALLBACK( pc8801_rtc_irq ) |
| 1164 | { |
| 1165 | if(rtc_irq_mask) |
| 1166 | pc8801_raise_irq(machine,2); |
| 1167 | } |
| 1168 | |
| 1136 | 1169 | static MACHINE_START( pc8801 ) |
| 1137 | 1170 | { |
| 1138 | 1171 | cpu_set_irq_callback(machine->device("maincpu"), pc8801_irq_callback); |
| 1172 | |
| 1173 | timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, pc8801_rtc_irq); |
| 1139 | 1174 | } |
| 1140 | 1175 | |
| 1141 | 1176 | static MACHINE_RESET( pc8801 ) |
| r10064 | r10065 | |
| 1186 | 1221 | i8214_irq_level = 0; |
| 1187 | 1222 | i8214_irq_state = 0; |
| 1188 | 1223 | } |
| 1224 | |
| 1225 | { |
| 1226 | dma_address[2] = 0xf300; |
| 1227 | } |
| 1189 | 1228 | } |
| 1190 | 1229 | |
| 1191 | 1230 | static PALETTE_INIT( pc8801 ) |
| r10064 | r10065 | |
| 1205 | 1244 | {FLOPPY_0, FLOPPY_1, NULL, NULL} |
| 1206 | 1245 | }; |
| 1207 | 1246 | |
| 1208 | | /* TODO: it needs daisy chain */ |
| 1209 | 1247 | static INTERRUPT_GEN( pc8801_vrtc_irq ) |
| 1210 | 1248 | { |
| 1211 | 1249 | if(vrtc_irq_mask) |