trunk/src/mess/drivers/cat.c
| r20928 | r20929 | |
| 136 | 136 | * Canon Cat |
| 137 | 137 | - Find the mirrors for the write-only video control register and figure out |
| 138 | 138 | 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. |
| 148 | 139 | - Floppy drive (3.5", Single Sided Double Density MFM, ~400kb) |
| 149 | 140 | * Cat has very low level control of data being read or written, much like |
| 150 | 141 | the Amiga does |
| r20928 | r20929 | |
| 165 | 156 | - Centronics port |
| 166 | 157 | - RS232C port and Modem "port" connected to the DUART's two ports |
| 167 | 158 | - DTMF generator chip (connected to DUART 'user output' pins OP4,5,6,7) |
| 168 | | - Hook duart IP2 up to the 6ms timer |
| 169 | 159 | - Correctly hook the duart interrupt to the 68k, including autovector using the vector register on the duart |
| 170 | 160 | - Watchdog timer/powerfail at 0x85xxxx |
| 171 | 161 | - 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) |
| r20928 | r20929 | |
| 182 | 172 | happens inside an asic) for the SVROMS (or the svram or the code roms, for |
| 183 | 173 | that matter!) |
| 184 | 174 | - 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. |
| 186 | 176 | |
| 187 | 177 | |
| 188 | 178 | * Swyft |
| r20928 | r20929 | |
| 299 | 289 | DECLARE_READ16_MEMBER(cat_0080_r); |
| 300 | 290 | DECLARE_READ16_MEMBER(cat_0000_r); |
| 301 | 291 | |
| 302 | | UINT8 m_duart_inp;// = 0x0e; |
| 292 | UINT8 m_duart_inp; |
| 303 | 293 | /* gate array 2 has a 16-bit counter inside which counts at 10mhz and |
| 304 | 294 | rolls over at FFFF->0000; on rollover (or maybe at FFFF terminal count) |
| 305 | 295 | it triggers the KTOBF output. It does this every 6.5535ms, which causes |
| r20928 | r20929 | |
| 785 | 775 | machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1, ASSERT_LINE); |
| 786 | 776 | } |
| 787 | 777 | |
| 788 | | // This is effectively also the KTOBF line to the d-latch before the duart |
| 778 | |
| 789 | 779 | TIMER_CALLBACK_MEMBER(cat_state::counter_6ms_callback) |
| 790 | 780 | { |
| 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; |
| 792 | 785 | m_6ms_counter++; |
| 793 | 786 | } |
| 794 | 787 | |
| r20928 | r20929 | |
| 800 | 793 | |
| 801 | 794 | MACHINE_START_MEMBER(cat_state,cat) |
| 802 | 795 | { |
| 803 | | m_duart_inp = 0x0e; |
| 796 | m_duart_inp = 0; |
| 804 | 797 | m_6ms_counter = 0; |
| 805 | 798 | m_video_enable = 1; |
| 806 | 799 | m_video_invert = 0; |
| r20928 | r20929 | |
| 907 | 900 | #endif |
| 908 | 901 | } |
| 909 | 902 | |
| 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 | */ |
| 910 | 911 | static UINT8 duart_input(device_t *device) |
| 911 | 912 | { |
| 912 | 913 | cat_state *state = device->machine().driver_data<cat_state>(); |
| 913 | 914 | #ifdef DEBUG_DUART_INPUT_LINES |
| 914 | 915 | fprintf(stderr, "Duart input lines read!\n"); |
| 915 | 916 | #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; |
| 926 | 918 | } |
| 927 | 919 | |
| 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 | */ |
| 929 | 930 | static void duart_output(device_t *device, UINT8 data) |
| 930 | 931 | { |
| 931 | 932 | #ifdef DEBUG_DUART_OUTPUT_LINES |