Previous 15994 Revisions Next

r10065 Sunday 16th January, 2011 at 23:37:56 UTC by Angelo Salese
[PC-8801]: various improvements
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r10064r10065
1414   - joystick / mouse support;
1515   - cursor is 8 x 10, not 8 x 8 as current implementation.
1616
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
1726   Notes:
1827   - BIOS disk ROM defines what kind of floppies you could load:
1928     * with 0x0800 ROM size you can load 2d floppies only;
r10064r10065
2534   - 0x5c / 0x5f - VRAM banking
2635   - 0x70 - window offset (banking)
2736   - 0x71 - extra ROM banking
28   - 0x78 - window offset (banking) + 0x100
37   - 0x78 - window offset (banking) increment (+ 0x100)
2938   - 0xe2 / 0xe3 - extra RAM banking
3039   - 0xf0 / 0xf1 = kanji banking
3140
r10064r10065
113122static UINT8 i8255_0_pc,i8255_1_pc;
114123static UINT8 fdc_irq_opcode;
115124static UINT8 ext_rom_bank,gfx_ctrl,vram_sel,misc_ctrl,device_ctrl_data;
116static UINT8 vrtc_irq_mask,sound_irq_mask;
125static UINT8 vrtc_irq_mask,rtc_irq_mask,sound_irq_mask;
117126static UINT8 window_offset_bank;
118127static UINT8 layer_mask;
119128static UINT8 i8214_irq_level,i8214_irq_state;
129static UINT16 dma_counter[4],dma_address[4];
120130
121131static void pc8801_update_irq(running_machine *machine)
122132{
r10064r10065
135145
136146static void pc8801_raise_irq(running_machine *machine, int level)
137147{
138   i8214_irq_state |= (1<<level);
148   /* TODO ... */
149   i8214_irq_state = (1<<level);
139150   pc8801_update_irq(machine);
140151}
141152
r10064r10065
244255                  int color;
245256                  UINT8 *gfx_data = screen->machine->region("gfx1")->base();
246257
247                  tile = vram[x+(y*120)+0xf3c8]; //TODO: vram base, connected to DMAC address 2
258                  tile = vram[x+(y*120)+dma_address[2]];
248259
249260                  res_x = x*8+xi;
250261                  res_y = y*8+yi;
r10064r10065
536547
537548static WRITE8_HANDLER( pc8801_irq_mask_w )
538549{
550   rtc_irq_mask = data & 1;
539551   vrtc_irq_mask = data & 2;
552
553   if(data & 4)
554      printf("IRQ mask %02x\n",data);
540555}
541556
542557static READ8_HANDLER( pc8801_window_bank_r )
r10064r10065
634649      printf("CRTC cmd %s polled\n",crtc_command[data >> 5]);
635650}
636651
652static 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
637664static ADDRESS_MAP_START( pc8801_io, ADDRESS_SPACE_IO, 8 )
638665   ADDRESS_MAP_GLOBAL_MASK(0xff)
639666   ADDRESS_MAP_UNMAP_HIGH
r10064r10065
669696   AM_RANGE(0x54, 0x5b) AM_WRITE(pc8801_palram_w)
670697   AM_RANGE(0x5c, 0x5c) AM_READ(pc8801_vram_select_r)
671698   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)
673700//  AM_RANGE(0x6e, 0x6e) AM_NOP                                     /* CPU clock info */
674701//  AM_RANGE(0x6f, 0x6f) AM_NOP                                     /* RS-232C speed ctrl */
675702   AM_RANGE(0x70, 0x70) AM_READWRITE(pc8801_window_bank_r, pc8801_window_bank_w)
r10064r10065
11331160   return level*2;
11341161}
11351162
1163static TIMER_CALLBACK( pc8801_rtc_irq )
1164{
1165   if(rtc_irq_mask)
1166      pc8801_raise_irq(machine,2);
1167}
1168
11361169static MACHINE_START( pc8801 )
11371170{
11381171   cpu_set_irq_callback(machine->device("maincpu"), pc8801_irq_callback);
1172
1173   timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, pc8801_rtc_irq);
11391174}
11401175
11411176static MACHINE_RESET( pc8801 )
r10064r10065
11861221      i8214_irq_level = 0;
11871222      i8214_irq_state = 0;
11881223   }
1224
1225   {
1226      dma_address[2] = 0xf300;
1227   }
11891228}
11901229
11911230static PALETTE_INIT( pc8801 )
r10064r10065
12051244   {FLOPPY_0, FLOPPY_1, NULL, NULL}
12061245};
12071246
1208/* TODO: it needs daisy chain */
12091247static INTERRUPT_GEN( pc8801_vrtc_irq )
12101248{
12111249   if(vrtc_irq_mask)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team