home *** CD-ROM | disk | FTP | other *** search
/ ftp.elysium.pl / ftp.elysium.pl.tar / ftp.elysium.pl / docs / other-commodores / vic20.doc.gz / vic20.doc
Text File  |  1999-01-14  |  32KB  |  573 lines

  1. Article 40640 of comp.sys.cbm:
  2. Xref: undergrad.math.uwaterloo.ca comp.sys.cbm:40640
  3. Path: undergrad.math.uwaterloo.ca!watserv2.uwaterloo.ca!torn!howland.reston.ans.net!nntp.crl.com!crl2.crl.com!not-for-mail
  4. From: ceejack@crl.com (Jack Vander White)
  5. Newsgroups: comp.sys.cbm
  6. Subject: VIC-20 Info
  7. Date: 31 Jul 1995 11:11:36 -0700
  8. Organization: Humanity Against Late-Night Infomercials
  9. Lines: 557
  10. Message-ID: <3vj6co$7d4@crl2.crl.com>
  11. NNTP-Posting-Host: crl2.crl.com
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14.  
  15. Posted to comp.sys.cbm by request of the author.
  16.  
  17.                         ======================
  18.                        =                      =
  19.                       =   Inside your Vic 20   =
  20.                       =     By Ward Shrake     =
  21.                        =                      =
  22.                         ======================
  23.  
  24.  
  25. This document is a collection of pinout diagrams and technical notes, meant
  26. to assist anyone who wishes to experiment electronically with the "obsolete" 
  27. Commodore Vic20 computer. Specifically, this document addresses the cartridge
  28. or Memory Expansion port and related items, such as ROM & EPROM memory chips. 
  29.  
  30. This is a very preliminary version of a document which could be expanded, if
  31. I decide to go even more ballistic, later on. All this text was written out in
  32. one day, with no prior planning, so if its a little jumpy, that's why. Later
  33. versions should be better. Right now, probably anything helps, so here it is.
  34. (Additions, corrections or whatever can be sent via email to the author.)
  35.  
  36. Ward Shrake, July 1995
  37. email: wardshrake@aol.com
  38.  
  39.  
  40. ----------------------------------------------------------------------------
  41.   Pinout diagram #1: Memory Expansion port connector of the Vic20 computer
  42. ----------------------------------------------------------------------------
  43.  
  44. Below is the pinout diagram of the Vic20 cartridge port, or Memory Expansion
  45. Connector. Please note that this is NOT the pinout for a cartridge that might
  46. fit into any port, nor is it a pinout of the User Port, which is something 
  47. completely different. This diagram shows the cartridge port's pinout, as you 
  48. face the rear of the Vic 20 computer. (The port is on the Vic20's left side.)
  49.        
  50. Bottom side of expansion port.       Top side of expansion port.
  51. (This half is on bottom.)            (This half is towards the keyboard.)
  52.  
  53.           (This edge of the connector faces left,
  54.           where the power switch and the LED are.)
  55.  
  56.                         _________    
  57.                         |  ___  |
  58.          GND         A  |  | |  |   1       GND                   
  59.          CA0         B  |  | |  |   2       CD0
  60.          CA1         C  |  | |  |   3       CD1
  61.          CA2         D  |  | |  |   4       CD2
  62.          CA3         E  |  | |  |   5       CD3
  63.          CA4         F  |  | |  |   6       CD4
  64.          CA5         H  |  | |  |   7       CD5          
  65.          CA6         J  |  | |  |   8       CD6 
  66.          CA7         K  |  | |  |   9       CD7       (Memory Location:)
  67.          CA8         L  |  | |  |   10      BLK 1       ($2000 - $3fff) 
  68.          CA9         M  |  | |  |   11      BLK 2       ($4000 - $5fff)
  69.          CA10        N  |  | |  |   12      BLK 3       ($6000 - $7fff)
  70.          CA11        P  |  | |  |   13      BLK 5       ($a000 - $bfff)
  71.          CA12        R  |  | |  |   14      RAM 1       ($0400 - $07ff)
  72.          CA13        S  |  | |  |   15      RAM 2       ($0800 - $0bff)
  73.          I/O 2       T  |  | |  |   16      RAM 3       ($0c00 - $0fff)
  74.          I/O 3       U  |  | |  |   17      V R/W 
  75.          S02         V  |  | |  |   18      C R/W 
  76.          NMI         W  |  | |  |   19      IRQ 
  77.          RESET       X  |  | |  |   20      NC 
  78.          NC          Y  |  | |  |   21      +5 Volts 
  79.          GND         Z  |  | |  |   22      GND 
  80.                         |  ---  |
  81.                         ---------     
  82.  
  83.           (This edge of the connector is on the
  84.           right, where all the other ports are.)
  85.  
  86.  
  87. Pinout Notes:
  88. -------------
  89. BLKxx =  8K decoded RAM/ROM block xx, active low. See chart above for area.
  90. CAxx  =  Address bus line xx
  91. CDxx  =  Data bus line xx
  92. C R/W =  Read/Write line from CPU. (Read = high, Write = low)
  93. GND   =  System ground
  94. I/O 2 =  Decoded I/O block 2, starting at $9130
  95. I/O 3 =  Decoded I/O block 3, starting at $9140
  96. IRQ   =  6502 Interrupt Request line (active low)
  97. NC    =  No connection
  98. NMI   =  6502 Non-Maskable Interrupt line (active low)
  99. RAMxx =  1K decoded RAM blockxx, active low. See chart above for memory area.
  100. RESET =  6502 reset line (active low) 
  101. S02   =  Phase 2 system clock
  102. V R/W =  Read/Write line from Vic chip. (Read = high, Write = low)
  103.  
  104.  
  105.  
  106. -----------------------------------------------------------------------
  107.   Pinout diagram #2: A standard Vic20 cartridge's card edge connector
  108. -----------------------------------------------------------------------
  109.  
  110. Below is a pinout diagram of a standard Vic20 cartridge, seen facing its card
  111. edge connector. Please note that this is NOT the pinout of the port it plugs 
  112. into, which is shown above. The two pinouts are exact opposites, because you 
  113. are facing the port head-on as is, but you have to flip a cartridge around
  114. 180 degrees to be able to look at it head-on, facing its card edge connector.
  115.  
  116.  
  117.  Bottom side of cartridge      Top (label or component) side of cartridge
  118.  
  119.                          _-_    
  120.          GND         Z   | |   22    GND    
  121.          NC          Y   | |   21    +5 Volts
  122.          RESET       X   | |   20    NC
  123.          NMI         W   | |   19    IRQ
  124.          S02         V   | |   18    C R/W
  125.          I/O 3       U   | |   17    V R/W     (Memory location:)
  126.          I/O 2       T   | |   16    RAM 3       ($0c00 - $0fff)
  127.          CA13        S   | |   15    RAM 2       ($0800 - $0bff)
  128.          CA12        R   | |   14    RAM 1       ($0400 - $07ff)
  129.          CA11        P   | |   13    BLK 5       ($a000 - $bfff)
  130.          CA10        N   | |   12    BLK 3       ($6000 - $7fff)
  131.          CA9         M   | |   11    BLK 2       ($4000 - $5fff)
  132.          CA8         L   | |   10    BLK 1       ($2000 - $3fff)
  133.          CA7         K   | |   9     CD7
  134.          CA6         J   | |   8     CD6
  135.          CA5         H   | |   7     CD5
  136.          CA4         F   | |   6     CD4
  137.          CA3         E   | |   5     CD3
  138.          CA2         D   | |   4     CD2
  139.          CA1         C   | |   3     CD1
  140.          CA0         B   | |   2     CD0
  141.          GND         A   | |   1     GND
  142.                          -_-
  143.  
  144.  
  145. --------------------------------------------------
  146.    Pinout diagram #3: EPROM # 2764A 
  147.    (This is a standard, 8K x 8 bit memory chip)
  148. --------------------------------------------------
  149.  
  150.             ____    ____
  151.             |   !__!   |
  152.         Vpp | 1     28 | Vcc  (+5 Volts)
  153.         A12 | 2     27 | PGM  (Active low) 
  154.         A7  | 3     26 | N.C. (No connection)
  155.         A6  | 4     25 | A8
  156.         A5  | 5     24 | A9
  157.         A4  | 6     23 | A11
  158.         A3  | 7     22 | OE  (Output Enable; Active low)
  159.         A2  | 8     21 | A10
  160.         A1  | 9     20 | CE  (Chip Enable; Active low)
  161.         A0  | 10    19 | D7
  162.         D0  | 11    18 | D6
  163.         D1  | 12    17 | D5
  164.         D2  | 13    16 | D4
  165.         GND | 14    15 | D3
  166.             |__________|
  167.  
  168.  See Note 6 below, for some tips on using this as a replacement memory 
  169.  chip, on a modified cartridge body, for experimentation purposes. Note
  170.  that there are differences between it and the standard Vic20 chip below, 
  171.  that will have to be accounted for before it can be wired to the boards.
  172.  
  173.  
  174. --------------------------------------------------------
  175.     Pinout diagram #4: "MPS 2364" ROM chip
  176.     (Commodore-standard, 24-pin ROM chip, 8K x 8 bit.) 
  177. --------------------------------------------------------
  178.  
  179.             ____    ____
  180.             |   !__!   |
  181.        CA7  | 1     24 | +5 Volts 
  182.        CA6  | 2     23 | CA8
  183.        CA5  | 3     22 | CA9
  184.        CA4  | 4     21 | CA12
  185.        CA3  | 5     20 | CS (Chip select, active low)
  186.        CA2  | 6     19 | CA10
  187.        CA1  | 7     18 | CA11
  188.        CA0  | 8     17 | CD7
  189.        CD0  | 9     16 | CD6
  190.        CD1  | 10    15 | CD5
  191.        CD2  | 11    14 | CD4
  192.        GND  | 12    13 | CD3
  193.             |__________|
  194.  
  195.  
  196. This pinout was derived from a Vic20 schematic, found in the book the 
  197. "Vic20 Programmer's Reference Guide". (Great book!) Please note that while
  198. this is an 8k-by-8-bit Commodore memory chip (its actually the Kernal chip, 
  199. located at $E000-$FFFF), and that while it could normally be assumed safely 
  200. that a company would standardize and use the same chips in their cartridges 
  201. that they used in their computer's motherboards, this is Commodore we're 
  202. talking about. A bit of paranoia might be in order. Having said that, I'll 
  203. note that as of this writing, the author has not compared this diagram and 
  204. an actual memory chip from a Commodore-produced Vic20 cartridge. 'Nuff said!
  205.  
  206.  
  207. ---------------------------------------------------------------------------
  208.   Assorted notes on the diagrams above, and related subjects. (No order.)
  209. ---------------------------------------------------------------------------
  210.  
  211.  
  212. Note 1: Information for the diagrams above was taken from the Vic20 reference
  213.         book "The Vic Revealed" by Nick Hampshire, 1982, Hayden Book Co, Inc.
  214.         That info was verified by checking it against information found in 
  215.         the "Vic20 Programmer's Reference Guide," 1982, by Commodore Business
  216.         Machines, Inc. and Howard W. Sams & Company, Inc.
  217.  
  218. Note 2: You are looking at the cart pinout as if you were holding an unopened 
  219.         cartridge, label-side up (or right, in these diagrams) with the gold 
  220.         fingers pointing at you. If you are looking at a bare circuit board 
  221.         once it has been taken out of its outer plastic case, the chip is on 
  222.         top (or right, as shown here) again with the gold fingers facing you. 
  223.         (The diagrams were drawn sideways, as the ASCII drawings are somewhat
  224.         clearer this way, believe it or not. There is less confusion this way
  225.         over which pin is which. Horizontally, each name takes up more space.)
  226.  
  227. Note 3: Radio Shack currently (as of July 1995) carries a part that works as
  228.         a Memory Expansion Port connector for the Vic20. However, they are
  229.         discontinuing it, and are selling off all remaining stock. Their part
  230.         number is 276-1551 for their "44-position card-edge connector." Once 
  231.         these are gone, you'll have to find another source for them. ($1.27) 
  232.         This part is useful for experimenting with this port on the Vic20, as 
  233.         it is a perfect fit, as is, to accept standard plug-in Vic cartridges.
  234.  
  235. Note 4: A perhaps useful experimenter's tip: If you plan to take the circuit 
  236.         board out of the cartridge case, then remove the ROM chip(s) from the
  237.         circuit board, mark the two sides of the board first, or you may no
  238.         longer be able to tell which is the top, and which is the bottom! 
  239.         This is especially true if one is removing chips to install sockets.
  240.         (Any magic marker will do; just write "Bottom" on the "green stuff".
  241.         Do not write on top of any exposed metal surfaces or the gold pins!)
  242.  
  243. Note 5: For experimenting purposes, it might be handy to find a cartridge you
  244.         no longer care about, desolder the existing ROM chip from the circuit
  245.         board inside the cartridge and install an IC socket to make it easier
  246.         to change chips, later. However, note two things about this. One, the
  247.         socket makes the whole thing taller, and it may no longer fit into a
  248.         standard case. You can either (carefully!) use the new circuit board
  249.         without using its outer case, at least for in-house testing, or you
  250.         may be able to cut a "window" in the top of the case to clear it all.
  251.         Second, some cartridges don't use standard IC ROM's, so try another 
  252.         cartridge, until you find one that does use a standard DIP package.
  253.  
  254. Note 6: On all the Vic20 carts the author has opened and seen so far, the ROM
  255.         chip inside has 24-pins. Standard replacement EPROM's have 28-pins. 
  256.         This creates problems, but not insurmountable ones. It is a bit of a 
  257.         nuisance, but the dedicated experimenter can modify a 24-pin circuit
  258.         board, to accept any 28-pin standard EPROM, such as the 2764 package.
  259.         If one did not want the hassle of doing this, one other method exists
  260.         to be able to put your own 8K eprom chips inside; however, it is not 
  261.         cheap. Motorola makes an 8K EPROM that is completely compatible with 
  262.         Commodore's "standard" 24-pin ROM chips. It even works as a direct 
  263.         pin-for-pin replacement for the 8K Kernal and Basic ROM's inside your
  264.         Vic20 or your C64; the author has replaced both types in the past.
  265.         The part number for this EPROM is MCM 68764. It is about $18.00 each.
  266.         (Yes, it is programmable via the C64's "Promenade" eprom burner too!)
  267.         I think I got my 68764 years ago, from Jameco Electronics; try them.
  268.         (A 2764 adapter circuit board can be made to adapt the differences in 
  269.         24-to-28 pin sockets, but it will likely be too tall to fit inside.)
  270.  
  271. Note 7: A reset button can be wired into the Vic20 fairly simply. This might
  272.         be a good idea, if one plans to experiment much. The Vic20, or any
  273.         computer, might lock up when you've told it to do something odd while
  274.         experimenting. Simply use a momentary-contact, normally-open switch, 
  275.         wired between the RESET line and any port GND line. When you press 
  276.         the new button for a second and let go, the computer will reset. This 
  277.         is because the RESET line is active low, and your switch grounds that 
  278.         line. If you decide to do this *inside* your Vic20, remember you are 
  279.         now looking at the *back* of the port, NOT the front. Therefore, use 
  280.         the pinout diagram for a cartridge, not the port, to find the lines.
  281.         Radio Shack switch part number 275-1547 or equivalent will 
  282.         work fine.  
  283.  
  284. Note 8: The memory area located at $A000-BFFF ("Block 5") is normally 
  285.         considered to be a ROM-only block of memory. RAM can be mapped into
  286.         that space if you modify the cartridge's internal wires or jumpers, 
  287.         to redirect a standard RAM cartridge to load higher up in memory. 
  288.         However, BASIC cannot normally access that area, as it is meant to
  289.         be for ROM's only. This is important, if one wishes to archive an
  290.         8K autostart ROM cartridge (normally located in block 5), and run the
  291.         resulting ROM image from within RAM. It can be done, but you have to
  292.         modify a standard 8K RAM cartridge to do it. (Ground BLK 5, and cut
  293.         any trace or jumper that tells the cart to load in a different area.)
  294.         
  295.         Note also that some carts may be copy-protected, and will not run in
  296.         RAM without modification or "training," to alter the copy protection.
  297.  
  298.         It may be possible to get around this copy-protection (but the author
  299.         hasn't tried it yet) by modifying the read/write lines, so that after
  300.         loading the program's ROM image into RAM memory, you flip a switch 
  301.         first, then type in the SYS command to start the program up. If this
  302.         idea works, it would emulate ROM by not being able to be written to, 
  303.         when the copy protection tries to determine if the copy is in RAM or 
  304.         ROM. Of course, when reprogrammed into an EPROM, it will act as if it
  305.         were ROM anyway, so this may no longer matter in that case.
  306.  
  307. Note 9: Trying to relocate a machine language program from the memory area
  308.         where it was written in and intended to be, and to have it actually
  309.         work afterwards, is not advised. It won't work, without doing so
  310.         many modifications to the machine language object code that you may
  311.         as well just start over and reprogram it all. Don't bother trying. 
  312.         It seems the idea is to get the real, actual code as written, anyway.
  313.  
  314.         Similar problems confront the user who wishes to archive a tape or a
  315.         diskette-based original. Trying to make a cartridge out of it, isn't
  316.         worth the huge headaches. You are better off, in this case, trying to
  317.         archive tape-based programs to floppy disk (which will still require 
  318.         a little modification, but not as much), and floppies to floppies.
  319.         
  320. Note 10: Some FTP archives exist on the Internet for the Vic20 enthusiast. 
  321.         ("ftp.funet.fi" in Finland, and "ftp.hrz.uni-kassel.de" in Denmark.)
  322.  
  323.         When downloading archived ROM images from these places, one should
  324.         be aware that they are missing two bytes that the Commodore Vic20 and
  325.         the Commodore 64 computers consider absolutely critical to load and
  326.         use files with. These are the first two bytes of any Commodore file,
  327.         which tells the computer a program's "Starting address," or where to 
  328.         load it into memory. If its not in the right place, it will not work. 
  329.         Period. Even one byte off, and it will not work. These raw image 
  330.         files include only the ROM's internal codes, and no starting address.
  331.  
  332.         The FTP site in Denmark has some instructions on how to add these two
  333.         bytes to a file, using a Commodore Vic20 compatible disk drive. The
  334.         author made an executable program that does this on the IBM, but it
  335.         isn't very user-friendly at this point. It does work, however, and as
  336.         soon as it will pass muster publicly, I plan to upload it to both FTP
  337.         sites. This program, when available to the public, is meant to be used
  338.         after a ROM image file has been downloaded onto an IBM computer, but 
  339.         before the user transfers it to a Commodore-compatible diskette, using
  340.         whatever process the user likes most. (The "X-1541" user-built cable 
  341.         which connects the IBM printer port to the CBM serial port, is the 
  342.         author's favorite way of transferring files from IBM to CBM and back.)
  343.  
  344. Note 11: On all the NTSC Vic20 motherboards I looked at (4 or 5), the BASIC
  345.         memory chip is labeled "UE11", while the Kernal chip is labeled as
  346.         "UE12". My PAL schematic lists these two as UD5 and UD6, respectively.
  347.         The Basic memory map area is at $C000-DFFF. Kernal is at $E000-FFFF.
  348.         The only other 24-pin chip is the Character Generator; its 4K, not 8K.
  349.  
  350. Ward Shrake
  351. email: wardshrake@aol.com
  352. July 1995
  353.  
  354.  
  355. -------------------------------------------------------------------------
  356.     Short technical tutorial on Vic20 ROM cartridges, including notes 
  357.     on cartridge archiving methods, and the Vic autostart process.
  358. -------------------------------------------------------------------------
  359.  
  360. A Vic20 cartridge is approximately 5.5 inches wide, 3 and 3/8ths inches deep,
  361. and 5/8ths inches tall, when viewed as if ready to be installed. Standard
  362. configurations are 8K and 16K of 8-bit ROM memory, using one or two chips of 
  363. ROM memory onboard. If other standard cartridge memory configurations exist, 
  364. the author is currently unaware of them. (But would like to hear of any, if 
  365. they do/did exist, and especially if they were once made commercially.)
  366.  
  367. Inside a typical Vic20 cartridge is one double-sided, etched circuit board, 
  368. with some form of memory chip installed. This may be a "standard" IC chip as 
  369. we are used to seeing (24 or 28 pin ROM, in a DIP package), or it could be 
  370. a blank circuit board, with a tiny blob of black epoxy material on it, under 
  371. which are presumably the internal components of a typical, normal ROM chip. 
  372.  
  373. The standard circuit board size is approximately 3 and 9/16ths inches wide, 
  374. and 1 and 3/4 inches deep. A cart fits into a 44-position, double-sided card 
  375. edge connector, which is a permanent part of the Vic20 itself, in the back.
  376.  
  377. On the cart circuit board itself may (or may not) be several wire traces or 
  378. jumpers, which if there, are meant to configure the cartridge to a certain
  379. memory arrangement. These jumpers are meant to connect the BLK or RAM lines
  380. to the system ground. These lines, when connected, tell the Vic20 where to 
  381. place the cartridge within the Vic20's internal memory map scheme. 
  382.  
  383. While all "normal," autostart game cartridge are located in one fixed area
  384. of memory, this is not true with all cartridges, game or not. Some of the 
  385. earliest cartridges did not use the autostart procedure for whatever reason,
  386. (presumably because they did not know it existed, at that early stage?) and 
  387. those are located in "non-standard" memory locations. The Vic20 was built
  388. and designed when memory was expensive, and computers were designed to be 
  389. bare-bones memory-wise, but with the capability to expand on later. This may
  390. take some getting used to at first, but understanding it gets easier in time.
  391.  
  392. 16K cartridges, for example, generally have one 8K ROM block located from 
  393. $A000-$BFFF, and another 8K ROM block located at $6000-7FFF. If a cartridge 
  394. was factory-made not to autostart; in other words, if it needs you to type in 
  395. a "SYS" number to start it, its memory could be located in any block. 
  396.  
  397. The "normal" spot for an 8K cartridge to be located in memory is in "Block 5" 
  398. (which is located at $A000 to $BFFF). Again, this is not the only possible 
  399. spot in memory for a cartridge to be located, but it is the only spot where 
  400. the Vic20 will look for a cartridge that automatically starts on power-up.
  401.         
  402. This is because (at power up) the Vic20 looks for a precise code in a precise 
  403. spot, to see if it should autostart a cartridge or not. If the Vic20 finds 
  404. this *exact* five-byte code, *exactly* where it is supposed to be located in 
  405. memory, the Vic20 turns control over to the cartridge. If not, it gives over
  406. control to the user, via the normal, power-up Basic READY prompt screen. 
  407.        
  408.  
  409.         This 8K autostart sequence code is shown below:
  410.  
  411.         Address______Hex value_____Decimal value____ASCII values
  412.         $A004        $41           65               Capitol "A"    
  413.         $A005        $30           48               Digit "zero"
  414.         $A006        $C3           195              Reverse "C" character
  415.         $A007        $C2           194              Reverse "B" character
  416.         $A008        $CD           205              Reverse "M" character
  417.         
  418. If the computer finds this five-byte sequence exactly as shown, it          
  419. turns control over to the machine language program in the cartridge.
  420. To do so, it needs to know where the program begins. There are four
  421. bytes which determine this, as shown below: (Also within the cart.)
  422.  
  423.         Address______What this byte of information contains__________
  424.         $A000        Low-byte of a 16-bit "hard start" address (to begin at)
  425.         $A001        High-byte of the 16-bit "hard start" address
  426.         
  427.         $A002        Low-byte of 16-bit "warm start" address (restore key)
  428.         $A003        High-byte of 16-bit "warm start" address
  429.  
  430. This is all very important when trying to archive an image of the information
  431. contained on a ROM cartridge. Altering either of the two required parts of 
  432. this sequence, causes the cartridge to not autostart, but to be mapped into 
  433. memory properly, anyway. Assuming a certain level of technical expertise, a 
  434. user can do one of two (or more?) things to achieve this. 
  435.         
  436. One is to move the cartridge's starting location temporarily, so that the 
  437. code is present, but not in the right place. This can be done by altering the 
  438. physical traces on each cartridge's circuit board. This is undesirable, 
  439. except perhaps for self-training purposes, as every single cartridge would 
  440. have to be individually modified, archived, then reassembled for normal use. 
  441. Permanently modifying the Vic20's internal wiring is also possible, but 
  442. hardly desirable, as permanent damage to the Vic20 might also result.
  443.         
  444. The best way I could recommend for this would be to have a qualified tech 
  445. build or wire a cartridge-port pass-through device, where nearly all the 
  446. traces re-connected where they are supposed to, except for a critical few. 
  447. Using a 44-position card edge connector, some wire and a junk cartridge (or
  448. etched circuit board like a cartridge's pins), this could be done. Most wires
  449. would start at the card edge, where you'd plug the device into the Vic20, and 
  450. pass-through harmlessly to the card edge connector, where carts would plug in.
  451.  
  452. This device reroutes the "BLK 5" trace, preferably by use a "normal/modified" 
  453. switch, so that even though the cartridge intends to load at $A000, it loads 
  454. to another 8K block of memory instead. Whichever one you wire it to; perhaps 
  455. Block 1 or 3. Make the switch(es) act as a simple pass-through, normally, but
  456. disconnect the "Block 5 to ground line" while at the same time connecting the 
  457. "Block X line to ground", to remap where the cartridge will temporarily go.
  458.  
  459. This device would ideally be plug-in-able and removable, like a cartridge, so 
  460. as to require no modifications to either the Vic20 or cartridges. A reset 
  461. button could also be installed in the device, as well, while you're at it. If
  462. you use an old cartridge as your plug-in on the Vic20 end, cut all traces that
  463. still go to the existing chip(s). Solder wire ends onto the portions that exit
  464. the Vic20, and route them to your external plug-in connector box. If you use
  465. ribbon cable as your wiring, you can probably even sneak the wire out the back
  466. of the existing cartridge's case, as there is a wide slot in most Vic cases!
  467.  
  468. This method will allow you to temporarily re-map where the cartridge image
  469. will appear in memory, to defeat the autostart feature. Once this is defeated
  470. the technically-inclined user who is familiar enough with Commodore computers
  471. can copy the information to tape or diskette for storage. This takes some 
  472. knowledge and expertise, but can be learned. Some help is offered; see below.
  473.  
  474. The user should understand that if this method (memory relocation) is used to
  475. defeat the autostart feature, and to thereby attempt to archive a cart's ROM,
  476. the work is not over. Once archived to disk, the hard part is done, true, but
  477. when you saved it to diskette, it was saved with a now-incorrect starting 
  478. address. Before the image can be used further, this has to be corrected.
  479.  
  480. This can be changed, fairly easily, by someone who knows how, but it requires 
  481. knowledge of using a software tool called a "disk sector editor" to change 
  482. the now-incorrect high-byte of the relocated starting address, to the correct
  483. unrelocated high byte: where it would have been, before you moved it. To do 
  484. so, you find the first disk sector of the ROM image file, and change the 
  485. fourth byte in (not byte $04!) to be $A0, resave the sector, and you're done.
  486. After this modification, your ROM image files will now load where they should,
  487. (into $A000 RAM, if you have it), and are ready for further processing. 
  488.  
  489. Even the common C64 "Fastload" utility cart has a very servicable sector 
  490. editor in it, so it isn't as bad as it may have sounded. Still, you need to 
  491. know how to use it, and what to change, so it is best left to a professional.
  492.  
  493. To actually save the block of memory to tape/disk, you either use the memory
  494. save feature of a machine language monitor program (not built in) to save the
  495. 8K block of ROM memory temporarily, or you can change certain POKE's in the 
  496. Vic20's memory, to tell it your cartridge is located in the Basic program 
  497. memory area, so that the normal SAVE command works. The beauty of the latter
  498. is that no additional programs are needed to make this work; just type in four
  499. POKE commands, then tell it to SAVE as it would normally save a Basic program.
  500.  
  501. For those of you already familiar enough with Commodore's style and memory
  502. arrangement schemes to make sense of this, bytes 43 and 44 (decimal, not hex) 
  503. are the pointers to the Start of Basic memory area, and bytes 45 and 46 are 
  504. the pointers to the Start of Variables, or in other words, the End of Basic.
  505. Follow this chart, to save a block of memory from these areas via pokes:
  506.  
  507.  
  508.    Block #___Hex Address____Poke 43,x___Poke 44, x___Poke 45, x__Poke 46, x
  509.      1       $2000-3fff      x = 0       x = 32       x = 255     x = 63   
  510.      2       $4000-5fff      x = 0       x = 64       x = 255     x = 95
  511.      3       $6000-7fff      x = 0       x = 96       x = 255     x = 127
  512.      5       $a000-bfff      x = 0       x = 160      x = 255     x = 191
  513.                                                                     
  514.  
  515. The above is only one possible way to archive an 8K block of Vic20 memory.
  516. However, a second method exists, requiring some Vic20 modifications. A truly
  517. hard-core Vic user could alter the copy of the startup code that is stored in 
  518. the Kernal ROM chip, so that no normally-correct autostart sequence code ever 
  519. matches it as long as your new Kernal is in place.
  520.         
  521. Remember, there must always be *two* copies of the start-up code; one in the 
  522. cartridge itself and one stored in the computer for comparison. If either of 
  523. these two seperate codes are altered, even slightly, it will not autostart! 
  524.  
  525. The cartridge gets mapped into memory at its correct location, but the Basic 
  526. "READY" screen comes up instead, giving the user full control. Once you've
  527. achieved this, you simply do four pokes (to change the start and end of BASIC
  528. memory to match where the cart code is), or save the info with an ML monitor.
  529.  
  530. With some work and an "MCM 68764" 8K EPROM, this can be done. It is not just
  531. a vague theory; the author has done it. It works, as does a similar technique 
  532. for doing the same general thing with the Commodore 64 computer. (With the 
  533. appropriate changes, of course, to reflect the C64's different architecture 
  534. and memory map; the C64 codes are "CBM80" instead of "A0CBM", and the Kernal 
  535. expects that code to be in a cartridge at locations $8004-$8008 instead of 
  536. $A004-$A008. Starting address is in the same exact format as the Vic's.) 
  537.         
  538. This a much more involved modification, and not for the squeemish or 
  539. those who only own one Vic20 (or C64) without any spares to fall back on! 
  540.  
  541. To do it, you need a heck of a lot of computer knowledge specific to the 
  542. computer you're working on, an eprom burner, an eprom eraser, and patience.
  543. You have to search in the Kernal's memory image, for the start-up code, and
  544. modify those bytes to be something different than they are, while leaving all
  545. the other bytes just as they are. This alone takes some serious skills, no?
  546. You also need skills and tools in desoldering and removing IC chips, as well
  547. as soldering in IC sockets, and not destroying anything in the process.
  548.  
  549. I won't go into this much, because I don't imagine many people will bother to
  550. actually attempt this method, since the other has some serious pro's to it, 
  551. and since this should be about enough info to go on; if you can't figure out
  552. how to do this modification with this info, you probably should not try it, 
  553. until you've progressed enough at a later time. Or, have someone else do it
  554. for you, with these instructions, if you really want it done badly enough.
  555.  
  556. This way may appeal to some people, but I recommend the other for most folks. 
  557. The overly-technical types might be tempted to go ballistic however, and more 
  558. power to you! A thought, in parting; one could put 2 copies of the Kernal ROM 
  559. chip, one stock and one modified, into one 16K eprom, with an external switch 
  560. to flip between the two versions. (Or just go lower tech, and just manually 
  561. swap out Kernal chips as needed; most Vic20's seem to have sockets anyway.)
  562.  
  563. Whatever you do, I hope you've enjoyed this article! Later, all!
  564.  
  565. Ward Shrake
  566. wardshrake@aol.com
  567. July 1995
  568.  
  569.  
  570.  
  571.  
  572.  
  573.