src/mess/drivers/fmtowns.c
| r6946 | r6947 | |
| 157 | 157 | static UINT8 towns_kb_extend; // extended key output |
| 158 | 158 | static emu_timer* towns_kb_timer; |
| 159 | 159 | static UINT8 towns_fm_irq_flag; |
| 160 | static UINT8 towns_pcm_irq_flag; |
| 161 | static UINT8 towns_pcm_channel_flag; |
| 162 | static UINT8 towns_pcm_channel_mask; |
| 160 | 163 | static UINT8 towns_pad_mask; |
| 161 | 164 | |
| 162 | 165 | static struct towns_cdrom_controller |
| r6946 | r6947 | |
| 715 | 718 | case 0x01: |
| 716 | 719 | if(towns_fm_irq_flag) |
| 717 | 720 | ret |= 0x01; |
| 721 | if(towns_pcm_irq_flag) |
| 722 | ret |= 0x08; |
| 718 | 723 | 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; |
| 719 | 730 | default: |
| 720 | 731 | logerror("FM: unimplemented port 0x%04x read\n",offset + 0x4e8); |
| 721 | 732 | } |
| r6946 | r6947 | |
| 724 | 735 | |
| 725 | 736 | static WRITE8_HANDLER(towns_sound_ctrl_w) |
| 726 | 737 | { |
| 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 | } |
| 728 | 746 | } |
| 729 | 747 | |
| 730 | 748 | // Controller ports |
| r6946 | r6947 | |
| 1571 | 1589 | return r; |
| 1572 | 1590 | } |
| 1573 | 1591 | |
| 1574 | | // YM3438 interrupt |
| 1592 | // YM3438 interrupt (IRQ 13) |
| 1575 | 1593 | void towns_fm_irq(const device_config* device, int irq) |
| 1576 | 1594 | { |
| 1577 | 1595 | const device_config* pic = devtag_get_device(device->machine,"pic8259_slave"); |
| r6946 | r6947 | |
| 1587 | 1605 | } |
| 1588 | 1606 | } |
| 1589 | 1607 | |
| 1608 | // PCM interrupt (IRQ 13) |
| 1609 | void 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 | |
| 1590 | 1619 | static PIC8259_SET_INT_LINE( towns_pic_irq ) |
| 1591 | 1620 | { |
| 1592 | 1621 | cputag_set_input_line(device->machine,"maincpu",0,interrupt ? HOLD_LINE : CLEAR_LINE); |
| r6946 | r6947 | |
| 2025 | 2054 | towns_fm_irq |
| 2026 | 2055 | }; |
| 2027 | 2056 | |
| 2057 | static const rf5c68_interface rf5c68_intf = |
| 2058 | { |
| 2059 | towns_pcm_irq |
| 2060 | }; |
| 2061 | |
| 2028 | 2062 | static const gfx_layout fnt_chars_16x16 = |
| 2029 | 2063 | { |
| 2030 | 2064 | 16,16, |
| r6946 | r6947 | |
| 2067 | 2101 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 2068 | 2102 | |
| 2069 | 2103 | 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) |
| 2072 | 2106 | MDRV_GFXDECODE(towns) |
| 2073 | 2107 | |
| 2074 | 2108 | /* sound hardware */ |
| r6946 | r6947 | |
| 2077 | 2111 | MDRV_SOUND_CONFIG(ym3438_intf) |
| 2078 | 2112 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 2079 | 2113 | MDRV_SOUND_ADD("pcm", RF5C68, 53693100 / 7) // actual clock speed unknown |
| 2114 | MDRV_SOUND_CONFIG(rf5c68_intf) |
| 2080 | 2115 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50) |
| 2081 | 2116 | MDRV_SOUND_ADD("cdda",CDDA,0) |
| 2082 | 2117 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |