trunk/src/mess/drivers/cat.c
| r21654 | r21655 | |
| 236 | 236 | #undef DEBUG_DUART_OUTPUT_LINES |
| 237 | 237 | #undef DEBUG_DUART_INPUT_LINES |
| 238 | 238 | #undef DEBUG_DUART_TXD |
| 239 | // TODO: the duart irq handler doesn't work becuase there is no easy way to strobe the duart to force it to check its inputs yet |
| 239 | 240 | #undef DEBUG_DUART_IRQ_HANDLER |
| 240 | 241 | |
| 241 | 242 | #undef DEBUG_TEST_W |
| r21654 | r21655 | |
| 804 | 805 | INPUT_PORTS_END |
| 805 | 806 | |
| 806 | 807 | |
| 807 | | TIMER_CALLBACK_MEMBER(cat_state::keyboard_callback) |
| 808 | | { |
| 809 | | machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1, ASSERT_LINE); |
| 810 | | } |
| 811 | | |
| 812 | | |
| 813 | 808 | TIMER_CALLBACK_MEMBER(cat_state::counter_6ms_callback) |
| 814 | 809 | { |
| 815 | 810 | // This is effectively also the KTOBF line 'clock' output to the d-latch before the duart |
| r21654 | r21655 | |
| 817 | 812 | // is there some way to 'strobe' the duart to tell it that its input ports just changed? |
| 818 | 813 | m_duart_inp ^= 0x04; |
| 819 | 814 | m_6ms_counter++; |
| 815 | machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1, ASSERT_LINE); // hack until duart ints work; as of march 2013 they do not work correctly here (they fire at the wrong rate) |
| 820 | 816 | } |
| 821 | 817 | |
| 822 | 818 | IRQ_CALLBACK_MEMBER(cat_state::cat_int_ack) |
| r21654 | r21655 | |
| 831 | 827 | m_6ms_counter = 0; |
| 832 | 828 | m_video_enable = 1; |
| 833 | 829 | m_video_invert = 0; |
| 834 | | m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cat_state::keyboard_callback),this)); |
| 835 | 830 | m_6ms_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cat_state::counter_6ms_callback),this)); |
| 836 | 831 | machine().device<nvram_device>("nvram")->set_base(m_svram, 0x4000); |
| 837 | 832 | } |
| r21654 | r21655 | |
| 842 | 837 | m_duart_inp = 0; |
| 843 | 838 | m_6ms_counter = 0; |
| 844 | 839 | m_floppy_control = 0; |
| 845 | | m_keyboard_timer->adjust(attotime::zero, 0, attotime::from_hz(120)); |
| 846 | 840 | m_6ms_timer->adjust(attotime::zero, 0, attotime::from_hz((XTAL_19_968MHz/2)/65536)); |
| 847 | 841 | } |
| 848 | 842 | |
| r21654 | r21655 | |
| 925 | 919 | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 926 | 920 | { |
| 927 | 921 | #ifdef DEBUG_DUART_IRQ_HANDLER |
| 928 | | fprintf(stderr, "Duart IRQ handler called; vector: %06X\n", vector); |
| 922 | fprintf(stderr, "Duart IRQ handler called: state: %02X, vector: %06X\n", state, vector); |
| 929 | 923 | #endif |
| 924 | //device->machine().device("maincpu")->execute().set_input_line_and_vector(M68K_IRQ_1, state, vector); |
| 930 | 925 | } |
| 931 | 926 | |
| 932 | 927 | static void duart_tx(device_t *device, int channel, UINT8 data) |