Previous 15994 Revisions Next

r5993 Wednesday 7th October, 2009 at 11:00:31 UTC by Barry Rodewald
[FMTOWNS] Implemented FDD head select. Implemented uPD71071 hardware DMA status registers.
[src/mess/drivers]fmtowns.c
[src/mess/machine]upd71071.c

src/mess/machine/upd71071.c
r5992r5993
152152
153153   if(state != 0)
154154   {
155      dmac->dmarq[channel] = 1;  // DMARQ line is set
156      dmac->reg.status |= (0x10 << channel);
157
155158      // start transfer
156159      if(dmac->reg.mask & (1 << channel))  // is channel masked?
157160         return;
158161     
159      dmac->dmarq[channel] = 1;  // DMARQ line is set
160     
161162      switch(dmac->reg.mode_control[channel] & 0xc0)
162163      {
163164         case 0x00:  // Demand
r5992r5993
178179   else
179180   {
180181      dmac->dmarq[channel] = 0;  // clear DMARQ line
182      dmac->reg.status &= ~(0x10 << channel);
181183   }
182184}
183185
src/mess/drivers/fmtowns.c
r5992r5993
9191static UINT32 towns_mainmem_enable;
9292static UINT32 towns_ram_enable;
9393static UINT32* towns_vram;
94static UINT32* towns_cmos;
94static UINT8* towns_cmos;
9595static UINT8* towns_gfxvram;
9696static UINT8* towns_txtvram;
9797static UINT8 towns_vram_wplane;
r5992r5993
327327               floppy_drive_set_ready_state(floppy_get_device(space->machine, towns_selected_drive-1), data & 0x10,0);
328328            }
329329         }
330         // bit 2 - HDISEL
330         wd17xx_set_side(fdc,(data & 0x04)>>2);
331331         // bit 1 - DDEN
332332         // bit 0 - IRQMSK
333333         logerror("FDC: write %02x to offset 0x08\n",data);
r5992r5993
340340               break;
341341            case 0x01:
342342               towns_selected_drive = 1;
343               wd17xx_set_drive(fdc,0);
343344               break;
344345            case 0x02:
345346               towns_selected_drive = 2;
347               wd17xx_set_drive(fdc,1);
346348               break;
347349            case 0x04:
348350               towns_selected_drive = 3;
351               wd17xx_set_drive(fdc,2);
349352               break;
350353            case 0x08:
351354               towns_selected_drive = 4;
355               wd17xx_set_drive(fdc,3);
352356               break;
353357         }
354358         logerror("FDC: drive select %02x\n",data);
r5992r5993
535539
536540static READ8_HANDLER( towns_cmos8_r )
537541{
538   UINT8* cmos = (UINT8*)towns_cmos;
539
540   return cmos[offset];
542   return towns_cmos[offset];
541543}
542544
543545static WRITE8_HANDLER( towns_cmos8_w )
544546{
545   UINT8* cmos = (UINT8*)towns_cmos;
546
547   cmos[offset] = data;
547   towns_cmos[offset] = data;
548548}
549549
550550static READ8_HANDLER( towns_cmos_low_r )
551551{
552   UINT8* cmos = (UINT8*)towns_cmos;
553
554552   if(towns_mainmem_enable != 0)
555553      return mess_ram[offset + 0xd8000];
556554
557   return cmos[offset];
555   return towns_cmos[offset];
558556}
559557
560558static WRITE8_HANDLER( towns_cmos_low_w )
561559{
562   UINT8* cmos = (UINT8*)towns_cmos;
563
564560   if(towns_mainmem_enable != 0)
565561      mess_ram[offset+0xd8000] = data;
566562   else
567      cmos[offset] = data;
563      towns_cmos[offset] = data;
568564}
569565
570static READ32_HANDLER( towns_cmos_r )
566static READ8_HANDLER( towns_cmos_r )
571567{
572568   return towns_cmos[offset];
573569}
574570
575static WRITE32_HANDLER( towns_cmos_w )
571static WRITE8_HANDLER( towns_cmos_w )
576572{
577   COMBINE_DATA(towns_cmos+offset);
573   towns_cmos[offset] = data;
578574}
579575
580576static WRITE8_HANDLER( towns_gfx_w )
r5992r5993
818814  AM_RANGE(0xc2000000, 0xc207ffff) AM_ROM AM_REGION("user",0x000000)  // OS ROM
819815  AM_RANGE(0xc2080000, 0xc20fffff) AM_ROM AM_REGION("user",0x100000)  // DIC ROM
820816  AM_RANGE(0xc2100000, 0xc213ffff) AM_ROM AM_REGION("user",0x180000)  // FONT ROM
821  AM_RANGE(0xc2140000, 0xc2141fff) AM_READWRITE(towns_cmos_r,towns_cmos_w) // CMOS (mirror?)
817  AM_RANGE(0xc2140000, 0xc2141fff) AM_READWRITE8(towns_cmos_r,towns_cmos_w,0xffffffff) // CMOS (mirror?)
822818  AM_RANGE(0xc2200000, 0xc2200fff) AM_NOP  // WAVE RAM
823819  AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("user",0x200000)  // SYSTEM ROM
824820ADDRESS_MAP_END
r5992r5993
880876static DRIVER_INIT( towns )
881877{
882878   towns_vram = auto_alloc_array(machine,UINT32,0x20000);
883   towns_cmos = auto_alloc_array(machine,UINT32,0x2000/(sizeof(UINT32)));
879   towns_cmos = auto_alloc_array(machine,UINT8,0x2000);
884880   towns_gfxvram = auto_alloc_array(machine,UINT8,0x200000);
885881   towns_txtvram = auto_alloc_array(machine,UINT8,0x8000);
886882   towns_serial_rom = auto_alloc_array(machine,UINT8,256/8);
r5992r5993
10471043   MDRV_PIC8259_ADD( "pic8259_slave", towns_pic8259_slave_config )
10481044
10491045   MDRV_MB8877_ADD("fdc",towns_mb8877a_interface)
1050   MDRV_FLOPPY_2_DRIVES_ADD(towns_floppy_config)
1046   MDRV_FLOPPY_4_DRIVES_ADD(towns_floppy_config)
10511047
10521048   MDRV_UPD71071_ADD("dma_1",towns_dma_config)
10531049   MDRV_UPD71071_ADD("dma_2",towns_dma_config)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team