Previous 199869 Revisions Next

r21655 Wednesday 6th March, 2013 at 19:21:42 UTC by Jonathan Gevaryahu
(MESS) cat.c (Canon Cat): Got rid of the keyboard interrupt timer and hooked the keyboard interrupt to the 6ms timer instead, which is closer to hardware. The cursor blinks at a more correct but not completely correct rate now. The duart (the REAL source of the interrupts, which should fire with the transitions of the 12ms period squarewave) still does not work for interrupts properly, it needs its innards fixed. [Lord Nightmare]
[src/mess/drivers]cat.c

trunk/src/mess/drivers/cat.c
r21654r21655
236236#undef DEBUG_DUART_OUTPUT_LINES
237237#undef DEBUG_DUART_INPUT_LINES
238238#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
239240#undef DEBUG_DUART_IRQ_HANDLER
240241
241242#undef DEBUG_TEST_W
r21654r21655
804805INPUT_PORTS_END
805806
806807
807TIMER_CALLBACK_MEMBER(cat_state::keyboard_callback)
808{
809   machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1, ASSERT_LINE);
810}
811
812
813808TIMER_CALLBACK_MEMBER(cat_state::counter_6ms_callback)
814809{
815810   // This is effectively also the KTOBF line 'clock' output to the d-latch before the duart
r21654r21655
817812   // is there some way to 'strobe' the duart to tell it that its input ports just changed?
818813   m_duart_inp ^= 0x04;
819814   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)
820816}
821817
822818IRQ_CALLBACK_MEMBER(cat_state::cat_int_ack)
r21654r21655
831827   m_6ms_counter = 0;
832828   m_video_enable = 1;
833829   m_video_invert = 0;
834   m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cat_state::keyboard_callback),this));
835830   m_6ms_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cat_state::counter_6ms_callback),this));
836831   machine().device<nvram_device>("nvram")->set_base(m_svram, 0x4000);
837832}
r21654r21655
842837   m_duart_inp = 0;
843838   m_6ms_counter = 0;
844839   m_floppy_control = 0;
845   m_keyboard_timer->adjust(attotime::zero, 0, attotime::from_hz(120));
846840   m_6ms_timer->adjust(attotime::zero, 0, attotime::from_hz((XTAL_19_968MHz/2)/65536));
847841}
848842
r21654r21655
925919static void duart_irq_handler(device_t *device, int state, UINT8 vector)
926920{
927921#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);
929923#endif
924   //device->machine().device("maincpu")->execute().set_input_line_and_vector(M68K_IRQ_1, state, vector);
930925}
931926
932927static void duart_tx(device_t *device, int channel, UINT8 data)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team