Previous 199869 Revisions Next

r20929 Monday 11th February, 2013 at 08:23:37 UTC by Jonathan Gevaryahu
(MESS) cat.c (Canon Cat): Fixed the v2.40 bioses thinking the phone is constantly ringing; Documented what all the DUART IO pins are connected to, and correctly hooked DUART IP2 up to invert when the 6ms timer expires, removing the previous hack (and fixing the ringing bug). [Lord Nightmare]
[src/mess/drivers]cat.c

trunk/src/mess/drivers/cat.c
r20928r20929
136136* Canon Cat
137137- Find the mirrors for the write-only video control register and figure out
138138  what the writes actually do; hook these up properly to screen timing etc
139- The 2.40 firmwares both get annoyed and think they have a phone call at
140  random.
141  (hit shift or usefront a few times to make it shut up for a bit or go into
142  forth mode); The 1.74 firmware doesn't have this issue.
143  Figure out what causes it and make it stop. May be OFFHOOK or more likely
144  the DUART thinks the phone is ringing constantly due to incomplete duart or
145  an ip bit hooked up wrong.
146  You can alsp make it stop by going to SETUP and change the serial port from
147  'alternate printer' to SEND.
148139- Floppy drive (3.5", Single Sided Double Density MFM, ~400kb)
149140  * Cat has very low level control of data being read or written, much like
150141    the Amiga does
r20928r20929
165156- Centronics port
166157- RS232C port and Modem "port" connected to the DUART's two ports
167158- DTMF generator chip (connected to DUART 'user output' pins OP4,5,6,7)
168- Hook duart IP2 up to the 6ms timer
169159- Correctly hook the duart interrupt to the 68k, including autovector using the vector register on the duart
170160- Watchdog timer/powerfail at 0x85xxxx
171161- Canon Cat released versions known: 1.74 US (dumped), 2.40 US (dumped; is this actually original, or compiled from the released source code?), 2.42 (NEED DUMP)
r20928r20929
182172  happens inside an asic) for the SVROMS (or the svram or the code roms, for
183173  that matter!)
184174- Hook Battery Low input to a dipswitch.
185- Document what every IPx and OPx bit on the DUART connects to.
175- Hook the floppy control register readback up properly, things seem to get confused.
186176
187177
188178* Swyft
r20928r20929
299289   DECLARE_READ16_MEMBER(cat_0080_r);
300290   DECLARE_READ16_MEMBER(cat_0000_r);
301291
302   UINT8 m_duart_inp;// = 0x0e;
292   UINT8 m_duart_inp;
303293   /* gate array 2 has a 16-bit counter inside which counts at 10mhz and
304294      rolls over at FFFF->0000; on rollover (or maybe at FFFF terminal count)
305295      it triggers the KTOBF output. It does this every 6.5535ms, which causes
r20928r20929
785775   machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1, ASSERT_LINE);
786776}
787777
788// This is effectively also the KTOBF line to the d-latch before the duart
778
789779TIMER_CALLBACK_MEMBER(cat_state::counter_6ms_callback)
790780{
791   // TODO: emulate the d-latch here and poke the duart's input ports
781   // This is effectively also the KTOBF line 'clock' output to the d-latch before the duart
782   // Hence, invert the d-latch on the duart's input ports.
783   // is there some way to 'strobe' the duart to tell it that its input ports just changed?
784   m_duart_inp ^= 0x04;
792785   m_6ms_counter++;
793786}
794787
r20928r20929
800793
801794MACHINE_START_MEMBER(cat_state,cat)
802795{
803   m_duart_inp = 0x0e;
796   m_duart_inp = 0;
804797   m_6ms_counter = 0;
805798   m_video_enable = 1;
806799   m_video_invert = 0;
r20928r20929
907900#endif
908901}
909902
903/* mc68681 DUART Input pins:
904 * IP0: CTS [using the hardware-CTS feature?]
905 * IP1: Centronics ACK (IP1 changes state 0->1 or 1->0 on the falling edge of /ACK using a d-latch)
906 * IP2: KTOBF (IP2 changes state 0->1 or 1->0 on the rising edge of KTOBF using a d-latch; KTOBF is a 6.5536ms-period squarewave generated by one of the gate arrays, i need to check with a scope to see whether it is a single spike/pulse every 6.5536ms or if from the gate array it inverts every 6.5536ms, documentation isn't 100% clear but I suspect the former) [uses the Delta IP2 state change detection feature to generate an interrupt; I'm not sure if IP2 is used as a counter clock source but given the beep frequency of the real unit i very much doubt it, 6.5536ms is too slow]
907 * IP3: RG ("ring" input)
908 * IP4: Centronics BUSY
909 * IP5: DSR
910 */
910911static UINT8 duart_input(device_t *device)
911912{
912913   cat_state *state = device->machine().driver_data<cat_state>();
913914#ifdef DEBUG_DUART_INPUT_LINES
914915   fprintf(stderr, "Duart input lines read!\n");
915916#endif
916   if (state->m_duart_inp != 0)
917   {
918      state->m_duart_inp = 0;
919      return 0x0e;
920   }
921   else
922   {
923      state->m_duart_inp = 0x0e;
924      return 0x00;
925   }
917   return state->m_duart_inp;
926918}
927919
928// TODO: hook to speaker and dtmf generator
920/* mc68681 DUART Output pins:
921 * OP0: RTS [using the hardware-RTS feature?]
922 * OP1: DTR
923 * OP2: /TDCS (select/enable the S2579 DTMF tone generator chip)
924 * OP3: speaker out [using the 'channel b 1X tx or rx clock output' or more likely the 'timer output' feature to generate a squarewave]
925 * OP4: TD03 (data bus for the S2579 DTMF tone generator chip)
926 * OP5: TD02 "
927 * OP6: TD01 "
928 * OP7: TD00 "
929 */
929930static void duart_output(device_t *device, UINT8 data)
930931{
931932#ifdef DEBUG_DUART_OUTPUT_LINES

Previous 199869 Revisions Next


© 1997-2024 The MAME Team