Previous 15994 Revisions Next

r6947 Wednesday 6th January, 2010 at 00:57:28 UTC by Barry Rodewald
[FMTOWNS] Implemented PCM flags and IRQs.
[src/mess/drivers]fmtowns.c

src/mess/drivers/fmtowns.c
r6946r6947
157157static UINT8 towns_kb_extend;  // extended key output
158158static emu_timer* towns_kb_timer;
159159static UINT8 towns_fm_irq_flag;
160static UINT8 towns_pcm_irq_flag;
161static UINT8 towns_pcm_channel_flag;
162static UINT8 towns_pcm_channel_mask;
160163static UINT8 towns_pad_mask;
161164
162165static struct towns_cdrom_controller
r6946r6947
715718      case 0x01:
716719         if(towns_fm_irq_flag)
717720            ret |= 0x01;
721         if(towns_pcm_irq_flag)
722            ret |= 0x08;
718723         break;
724      case 0x03:
725         ret = towns_pcm_channel_flag;
726         towns_pcm_channel_flag = 0;
727         towns_pcm_irq_flag = 0;
728         pic8259_set_irq_line(devtag_get_device(space->machine,"pic8259_slave"),5,0);
729         break;
719730      default:
720731         logerror("FM: unimplemented port 0x%04x read\n",offset + 0x4e8);
721732   }
r6946r6947
724735
725736static WRITE8_HANDLER(towns_sound_ctrl_w)
726737{
727   // TODO:
738   switch(offset)
739   {
740      case 0x02:
741         towns_pcm_channel_mask = data;
742         break;
743      default:
744         logerror("FM: unimplemented port 0x%04x write %02x\n",offset + 0x4e8,data);
745   }
728746}
729747
730748// Controller ports
r6946r6947
15711589   return r;
15721590}
15731591
1574// YM3438 interrupt
1592// YM3438 interrupt (IRQ 13)
15751593void towns_fm_irq(const device_config* device, int irq)
15761594{
15771595   const device_config* pic = devtag_get_device(device->machine,"pic8259_slave");
r6946r6947
15871605   }
15881606}
15891607
1608// PCM interrupt (IRQ 13)
1609void towns_pcm_irq(const device_config* device, int channel)
1610{
1611   const device_config* pic = devtag_get_device(device->machine,"pic8259_slave");
1612
1613   towns_pcm_irq_flag = 1;
1614   towns_pcm_channel_flag |= (1 << channel);
1615   if(towns_pcm_channel_flag & (1 << channel))
1616      pic8259_set_irq_line(pic,5,1);
1617}
1618
15901619static PIC8259_SET_INT_LINE( towns_pic_irq )
15911620{
15921621   cputag_set_input_line(device->machine,"maincpu",0,interrupt ? HOLD_LINE : CLEAR_LINE);
r6946r6947
20252054   towns_fm_irq
20262055};
20272056
2057static const rf5c68_interface rf5c68_intf =
2058{
2059   towns_pcm_irq
2060};
2061
20282062static const gfx_layout fnt_chars_16x16 =
20292063{
20302064   16,16,
r6946r6947
20672101    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
20682102
20692103    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
2070    MDRV_SCREEN_SIZE(640, 400)
2071    MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
2104    MDRV_SCREEN_SIZE(768,512)
2105    MDRV_SCREEN_VISIBLE_AREA(0, 768-1, 0, 512-1)
20722106    MDRV_GFXDECODE(towns)
20732107
20742108    /* sound hardware */
r6946r6947
20772111   MDRV_SOUND_CONFIG(ym3438_intf)
20782112   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
20792113   MDRV_SOUND_ADD("pcm", RF5C68, 53693100 / 7)  // actual clock speed unknown
2114   MDRV_SOUND_CONFIG(rf5c68_intf)
20802115   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50)
20812116   MDRV_SOUND_ADD("cdda",CDDA,0)
20822117   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team