Previous 199869 Revisions Next

r21354 Friday 22nd February, 2013 at 22:39:22 UTC by Jonathan Gevaryahu
cat.c: (Canon Cat) Fixed a mistake in the memory map mirroring due to an error during testing; added proper readback of the floppy control register, and corrected the floppy status readback so it thinks that no floppy is inserted. [Lord Nightmare]
[src/mess/drivers]cat.c

trunk/src/mess/drivers/cat.c
r21353r21354
7676
7777If ever in forth mode you can return to the editor with the forth word (without quotes) "re"
7878
79Canon cat gate array ASIC markings:
80GA1 (prototype): D65013CW276 [same as final]
81GA1 (final): NH4-5001 276 [schematic: upD65013CW-276]
82GA2 (prototype): D65013CW208 [DIFFERENT FROM FINAL! larger asic used here, shrank for final?]
83GA2 (final): NH4-5002 191 [schematic: upD65012CW-191]
84GA3 (prototype): D65013CW141 [same as final? typo 65013 vs 65012?]
85GA3 (final): NH4-5003 141 [schematic: upD65012CW-141]
7986
8087Canon cat credits easter egg:
8188* hold either leap key, then simultaneously hold shift, then type Q W E R A S D F Z X C V and release all the keys
r21353r21354
8390
8491Canon Cat credits details: (WIP)
8592Scott Kim - responsible for fonts on swyft and cat
93Ralph Voorhees - Model construction and mockups (swyft 'flat cat')
8694
95Cat HLSL stuff:
96*scanlines:
97the cat has somewhat visible and fairly close scanlines with very little fuzziness
98try hlsl options:
99hlsl_prescale_x           4
100hlsl_prescale_y           4
101scanline_alpha            0.3
102scanline_size             1.0
103scanline_height           0.7
104scanline_bright_scale     1.0
105scanline_bright_offset    0.6
106*phosphor persistence of the original cat CRT is VERY LONG and fades to a greenish-yellow color, though the main color itself is white
107try hlsl option:
108phosphor_life             0.93,0.95,0.87
109which is fairly close but may actually be too SHORT compared to the real thing.
87110
111
88112Swyft versions:
89113There are at least 4 variants of machines called 'swyft':
90114* The earliest desktop units which use plexi or rubber-tooled case and an
91115  angled monitor; about a dozen were made and at least two of clear plexi.
92  These are sometimes called "wrinkled" swyfts. 5.25" drive, may be able to
93  read Apple2 Swyftware and Swyftcard-created disks.
94 It is possible no prototypes of this type got beyond the 'runs forth console only' stage.
116  These are sometimes called "wrinkled" swyfts. 5.25" drive, they may be able
117  to read Apple2 Swyftware/Swyftdisk and Swyftcard-created disks.
118  It is possible no prototypes of this type got beyond the 'runs forth console only' stage.
95119  http://archive.computerhistory.org/resources/access/physical-object/2011/09/102746929.01.01.lg.JPG
96120  http://www.digibarn.com/collections/systems/swyft/Swyft-No2-05-1271.jpg
97121  http://www.digibarn.com/friends/jef-raskin/slides/iai/A%20-687%20SWYFTPRO.JPG
r21353r21354
99123  case and just a keyboard. Model SP0001
100124  http://www.digibarn.com/collections/systems/swyft/Image82.jpg
101125* The later "ur-cat" desktop units which use a machine tooled case and look
102  more or less like the canon cat. about 100-200 were made. 3.5" drive.
103  These have a fully functional EDDE editor as the cat does, and can even compile forth programs.
126  more or less like the canon cat. Around 100-200 were made. 3.5" drive.
127  These have a fully functional EDDE editor as the cat does, and can even compile
128  forth programs.
104129  (the 'swyft' driver is based on one of these)
105130* The very late portable LCD units with a dark grey case and a row of hotkey
106  buttons below the screen.
131  buttons below the screen. Not dumped yet. At least one functional prototype exists.
132  At least one plastic mockup exists with no innards.
107133  http://www.digibarn.com/collections/systems/swyft/swyft.jpg
108134
109135Canon Cat versions:
r21353r21354
115141As for prototypes/dev cat machines, a few minor variants exist:
116142* Prototype cat motherboards used 16k*4bit drams instead of 64k*4bit as the
117143  final system did and hence max out at 128k of dram instead of 512k.
144  One of the gate arrays is also different, and the motherboard is arranged
145  differently. The IC9 "buserr" PAL is not used, even on the prototype.
118146  The final system included 256k of dram and can be upgraded to 512k.
119147* At least some developer units were modified to have an external BNC
120148  connector, ostensibly to display the internal screen's video externally.
r21353r21354
302330   UINT8 m_video_invert;
303331   UINT16 m_pr_cont;
304332   UINT8 m_keyboard_line;
333   UINT8 m_floppy_control;
305334
306335   TIMER_CALLBACK_MEMBER(keyboard_callback);
307336   TIMER_CALLBACK_MEMBER(counter_6ms_callback);
r21353r21354
371400}
372401
373402// Floppy control register (called fd.cont in the cat source code)
374   /* FEDCBA98 (76543210 is ignored)
375    * |||||||\-- ?always low? (may be some sort of 'reset' or debug bit? the cat code explicitly clears this bit but never sets it)
403   /* FEDCBA98 (76543210 is open bus)
404    * |||||||\-- unknown[1] (may be some sort of 'reset' or debug bit? the cat code explicitly clears this bit but never sets it)
376405    * ||||||\--- WRITE GATE: 0 = write head disabled, 1 = write head enabled (verified from cat source code)
377    * |||||\---- ?always high? (leftover debug bit? unused by cat code)
406    * |||||\---- unknown[2] (leftover debug bit? unused by cat code)
378407    * ||||\----- /DIRECTION: 1 = in, 0 = out (verified from forth cmd)
379408    * |||\------ /SIDESEL: 1 = side1, 0 = side0 (verified from forth cmd)
380409    * ||\------- STEP: 1 = STEP active, 0 = STEP inactive (verified from cat source code)
381410    * |\-------- MOTOR ON: 1 = on, 0 = off (verified)
382411    * \--------- /DRIVESELECT: 1 = drive 0, 0 = drive 1 (verified from forth cmd)
412    * all 8 bits 'stick' on write and are readable at this register as well
413    * [1] writing this bit as high seems to 'freeze' floppy acquisition so
414    *   the value at the floppy_data_r register is held rather than updated
415    *   with new data from the shifter/mfm clock/data separator
416    * [2] this bit's function is unknown. it could possibly be an FM vs MFM selector bit, where high = MFM, low = FM ? or MFM vs GCR?
383417    */
384418// 0x800000-0x800001 read
385419READ16_MEMBER( cat_state::cat_floppy_control_r )
r21353r21354
387421#ifdef DEBUG_FLOPPY_CONTROL_R
388422   fprintf(stderr,"Read from Floppy Status address %06X\n", 0x800000+(offset<<1));
389423#endif
390   return 0x0480;
424   return (m_floppy_control << 8)|0x80; // LOW 8 BITS ARE OPEN BUS
391425}
392426// 0x800000-0x800001 write
393427WRITE16_MEMBER( cat_state::cat_floppy_control_w )
r21353r21354
395429#ifdef DEBUG_FLOPPY_CONTROL_W
396430   fprintf(stderr,"Write to Floppy Control address %06X, data %04X\n", 0x800000+(offset<<1), data);
397431#endif
432   m_floppy_control = (data >> 8)&0xFF;
398433}
399434
400435// 0x800002-0x800003 read = 0x0080, see open bus
r21353r21354
427462}
428463
429464// 0x800008-0x800009: Floppy status register (called fd.status in the cat source code)
430   /* FEDCBA98 (76543210 is ignored)
465   /* FEDCBA98 (76543210 is open bus)
431466    * |||||||\-- ? always low
432467    * ||||||\--- ? always low
433468    * |||||\---- READY: 1 = ready, 0 = not ready (verified from cat source code)
r21353r21354
443478#ifdef DEBUG_FLOPPY_STATUS_R
444479   fprintf(stderr,"Read from Floppy Status address %06X\n", 0x800008+(offset<<1));
445480#endif
446   return 0x0080;
481   return 0x2480;
447482}
448483
449484// 0x80000a-0x80000b
r21353r21354
488523{
489524   /*
490525    * FEDCBA98 (76543210 is ignored)
491    * |||||||\-- CC line enable (verified from cat source code)
492    * ||||||\--- LEDE line enable (verified from cat source code)
493    * |||||\---- ?
526    * |||||||\-- CC line enable (pin 34) (verified from cat source code)
527    * ||||||\--- LEDE line enable (pin 33) (verified from cat source code)
528    * |||||\---- ? May control pin 32?
494529    * ||||\----- ? always seems to be written as high?
495530    * |||\------ ?
496531    * ||\------- ?
r21353r21354
58562068k address map:
586621a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 a13 a12 a11 a10 a9  a8  a7  a6  a5  a4  a3  a2  a1  (a0 via UDS/LDS)
587622*i  *i  *   x   x   *   *   *   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x       *GATE ARRAY 2 DECODES THESE LINES TO ENABLE THIS AREA* (a23 and a22 are indirectly decoded via the /RAMROMCS and /IOCS lines from gate array 1)
5880   0   0   0   x   0   a   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   b       R   ROM (ab: 00=ic4 01=ic2 10=ic5 11=ic3) (EPROM 27C512 x 4) [controlled via GA2 /ROMCS]
5890   0   0   0   x   1   0   0   x   x   *   *   *   *   *   *   *   *   *   *   *   *   *   0       RW  SVRAM ic11 d4364 (battery backed) [controlled via GA2 /RAMCS]
5900   0   0   0   x   1   x   1   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   0       O   OPEN BUS (reads as 0x2e) [may be controlled via GA2 /RAMCS?]
5910   0   0   0   x   1   1   0   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   0       O   OPEN BUS (reads as 0x2e) [may be controlled via GA2 /RAMCS?]
5920   0   0   0   x   1   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   1       O   OPEN BUS (reads as 0x80) [may be controlled via GA2 /RAMCS?]
5930   0   0   1   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x       O   BUS CONFLICT (reads as random garbage, corrupted copy based on when a20 is 0, some sort of bus collision? note GA2 can't see a20 so /ROMCS and /RAMCS lines are probably active here as above)
6230   0   0   x   x   0   a   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   b       R   ROM (ab: 00=ic4 01=ic2 10=ic5 11=ic3) (EPROM 27C512 x 4) [controlled via GA2 /ROMCS]
6240   0   0   x   x   1   0   0   x   x   *   *   *   *   *   *   *   *   *   *   *   *   *   0       RW  SVRAM ic11 d4364 (battery backed) [controlled via GA2 /RAMCS]
6250   0   0   x   x   1   x   1   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   0       O   OPEN BUS (reads as 0x2e) [may be controlled via GA2 /RAMCS?]
6260   0   0   x   x   1   1   0   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   0       O   OPEN BUS (reads as 0x2e) [may be controlled via GA2 /RAMCS?]
6270   0   0   x   x   1   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   1       O   OPEN BUS (reads as 0x80) [may be controlled via GA2 /RAMCS?]
5946280   0   1   x   x   0   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   0       R   SVROM 2 ic7 (not present on cat as sold, open bus reads as 0x2e) [controlled via GA2 /SVCS0]
5956290   0   1   x   x   0   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   1       R   SVROM 0 ic6 (MASK ROM tc531000) [controlled via GA2 /SVCS0]
5966300   0   1   x   x   1   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   0       O   OPEN BUS (reads as 0x2e) [controlled via GA2 /SVCS1] *SEE BELOW*
r21353r21354
627661
628662static ADDRESS_MAP_START(cat_mem, AS_PROGRAM, 16, cat_state)
629663   ADDRESS_MAP_UNMAP_HIGH
630   AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_MIRROR(0x080000) // 256 KB ROM
631   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("svram") AM_MIRROR(0x08C000)// SRAM powered by battery
664   AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_MIRROR(0x180000) // 256 KB ROM
665   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("svram") AM_MIRROR(0x18C000)// SRAM powered by battery
632666   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("svrom",0x0000) AM_MIRROR(0x180000) // SV ROM
633667   AM_RANGE(0x400000, 0x47ffff) AM_RAM AM_SHARE("p_videoram") AM_MIRROR(0x180000) // 512 KB RAM
634668   AM_RANGE(0x600000, 0x67ffff) AM_READWRITE(cat_2e80_r,cat_video_control_w) AM_MIRROR(0x180000) // Gate Array #1: Video
r21353r21354
805839MACHINE_RESET_MEMBER(cat_state,cat)
806840{
807841   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(cat_state::cat_int_ack),this));
842   m_duart_inp = 0;
808843   m_6ms_counter = 0;
844   m_floppy_control = 0;
809845   m_keyboard_timer->adjust(attotime::zero, 0, attotime::from_hz(120));
810846   m_6ms_timer->adjust(attotime::zero, 0, attotime::from_hz((XTAL_19_968MHz/2)/65536));
811847}
r21353r21354
10431079   /* Romspace here is a little strange: there are 3 rom sockets on the board:
10441080    * svrom-0 maps to 200000-21ffff every ODD byte (d8-d0)
10451081    * svrom-1 maps to 200000-21ffff every EVEN byte (d15-d7)
1046    *  (since no rom is in the socket; it reads as open bus 0x2E)
1082    *  (since no rom is in the socket; it reads as open bus, sometimes 0x2E)
10471083    * svrom-2 maps to 240000-25ffff every ODD byte (d8-d0)
1048    *  (since no rom is in the socket; it reads as open bus 0x80)
1084    *  (since no rom is in the socket; it reads as open bus, sometimes 0x80)
10491085    * there is no svrom-3; 240000-25ffff EVEN always reads as 0x2E
10501086    * since ROM_FILL16BE(0x0, 0x80000, 0x2e80) doesn't exist, the
10511087    * even bytes and latter chunk of the svrom space need to be filled in
r21353r21354
10601096    */
10611097   ROMX_LOAD( "uv1__nh7-0684__hn62301apc11__7h1.ic6", 0x00000, 0x20000, CRC(229ca210) SHA1(564b57647a34acdd82159993a3990a412233da14), ROM_SKIP(1)) // this is a 28pin tc531000 mask rom, 128KB long; "US" SVROM
10621098
1099   /* There is an unpopulated PAL16L8 at IC9 whose original purpose (based
1100    * on the schematics) was probably to cause a 68k bus error when
1101    * memory in certain ranges when accessed (likely so 'forth gone insane'
1102    * won't destroy the contents of ram and svram).
1103    * Its connections are (where Ix = inp on pin x, Ox = out on pin x):
1104    * I1 = A23, I2 = A22, I3 = A2, I4 = R/W, I5 = A5, I6 = FC2, I7 = gnd,
1105    * I8 = A1, I9 = gnd, I11 = gnd, O16 = /BERR,
1106    * I14 = REMAP (connects to emulator 'shadow rom' board or to gnd when unused)
1107    * Based on the inputs and outputs of this pal, almost if not the entire
1108    * open bus and mirrored areas of the cat address space could be made
1109    * to cause bus errors. REMAP was probably used to 'open up' the A00000-A7ffff
1110    * shadow rom/ram area and make it writable without erroring.
1111    */
10631112ROM_END
10641113
10651114/* Driver */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team