home *** CD-ROM | disk | FTP | other *** search
/ Rockford Magazine / Rockford_Magazine_033_19xx_-_de_Disk_3_of_5_Side_B.d64 / 15.2 < prev    next >
Text File  |  2023-02-26  |  10KB  |  168 lines

  1. spot, to see if it should autostart a cartridge or not. If the Vic20 finds 
  2. this *exact* five-byte code, *exactly* where it is supposed to be located in 
  3. memory, the Vic20 turns control over to the cartridge. If not, it gives over
  4. control to the user, via the normal, power-up Basic READY prompt screen. 
  5.        
  6.  
  7.         This 8K autostart sequence code is shown below:
  8.  
  9.         AddressHex valueDecimal valueASCII values
  10.         $A004        $41           65               Capitol "A"    
  11.         $A005        $30           48               Digit "zero"
  12.         $A006        $C3           195              Reverse "C" character
  13.         $A007        $C2           194              Reverse "B" character
  14.         $A008        $CD           205              Reverse "M" character
  15.         
  16. If the computer finds this five-byte sequence exactly as shown, it          
  17. turns control over to the machine language program in the cartridge.
  18. To do so, it needs to know where the program begins. There are four
  19. bytes which determine this, as shown below: (Also within the cart.)
  20.  
  21.         AddressWhat this byte of information contains
  22.         $A000        Low-byte of a 16-bit "hard start" address (to begin at)
  23.         $A001        High-byte of the 16-bit "hard start" address
  24.         
  25.         $A002        Low-byte of 16-bit "warm start" address (restore key)
  26.         $A003        High-byte of 16-bit "warm start" address
  27.  
  28. This is all very important when trying to archive an image of the information
  29. contained on a ROM cartridge. Altering either of the two required parts of 
  30. this sequence, causes the cartridge to not autostart, but to be mapped into 
  31. memory properly, anyway. Assuming a certain level of technical expertise, a 
  32. user can do one of two (or more?) things to achieve this. 
  33.         
  34. One is to move the cartridge's starting location temporarily, so that the 
  35. code is present, but not in the right place. This can be done by altering the 
  36. physical traces on each cartridge's circuit board. This is undesirable, 
  37. except perhaps for self-training purposes, as every single cartridge would 
  38. have to be individually modified, archived, then reassembled for normal use. 
  39. Permanently modifying the Vic20's internal wiring is also possible, but 
  40. hardly desirable, as permanent damage to the Vic20 might also result.
  41.         
  42. The best way I could recommend for this would be to have a qualified tech 
  43. build or wire a cartridge-port pass-through device, where nearly all the 
  44. traces re-connected where they are supposed to, except for a critical few. 
  45. Using a 44-position card edge connector, some wire and a junk cartridge (or
  46. etched circuit board like a cartridge's pins), this could be done. Most wires
  47. would start at the card edge, where you'd plug the device into the Vic20, and 
  48. pass-through harmlessly to the card edge connector, where carts would plug in.
  49.  
  50. This device reroutes the "BLK 5" trace, preferably by use a "normal/modified" 
  51. switch, so that even though the cartridge intends to load at $A000, it loads 
  52. to another 8K block of memory instead. Whichever one you wire it to; perhaps 
  53. Block 1 or 3. Make the switch(es) act as a simple pass-through, normally, but
  54. disconnect the "Block 5 to ground line" while at the same time connecting the 
  55. "Block X line to ground", to remap where the cartridge will temporarily go.
  56.  
  57. This device would ideally be plug-in-able and removable, like a cartridge, so 
  58. as to require no modifications to either the Vic20 or cartridges. A reset 
  59. button could also be installed in the device, as well, while you're at it. If
  60. you use an old cartridge as your plug-in on the Vic20 end, cut all traces that
  61. still go to the existing chip(s). Solder wire ends onto the portions that exit
  62. the Vic20, and route them to your external plug-in connector box. If you use
  63. ribbon cable as your wiring, you can probably even sneak the wire out the back
  64. of the existing cartridge's case, as there is a wide slot in most Vic cases!
  65.  
  66. This method will allow you to temporarily re-map where the cartridge image
  67. will appear in memory, to defeat the autostart feature. Once this is defeated
  68. the technically-inclined user who is familiar enough with Commodore computers
  69. can copy the information to tape or diskette for storage. This takes some 
  70. knowledge and expertise, but can be learned. Some help is offered; see below.
  71.  
  72. The user should understand that if this method (memory relocation) is used to
  73. defeat the autostart feature, and to thereby attempt to archive a cart's ROM,
  74. the work is not over. Once archived to disk, the hard part is done, true, but
  75. when you saved it to diskette, it was saved with a now-incorrect starting 
  76. address. Before the image can be used further, this has to be corrected.
  77.  
  78. This can be changed, fairly easily, by someone who knows how, but it requires 
  79. knowledge of using a software tool called a "disk sector editor" to change 
  80. the now-incorrect high-byte of the relocated starting address, to the correct
  81. unrelocated high byte: where it would have been, before you moved it. To do 
  82. so, you find the first disk sector of the ROM image file, and change the 
  83. fourth byte in (not byte $04!) to be $A0, resave the sector, and you're done.
  84. After this modification, your ROM image files will now load where they should,
  85. (into $A000 RAM, if you have it), and are ready for further processing. 
  86.  
  87. Even the common C64 "Fastload" utility cart has a very servicable sector 
  88. editor in it, so it isn't as bad as it may have sounded. Still, you need to 
  89. know how to use it, and what to change, so it is best left to a professional.
  90.  
  91. To actually save the block of memory to tape/disk, you either use the memory
  92. save feature of a machine language monitor program (not built in) to save the
  93. 8K block of ROM memory temporarily, or you can change certain POKE's in the 
  94. Vic20's memory, to tell it your cartridge is located in the Basic program 
  95. memory area, so that the normal SAVE command works. The beauty of the latter
  96. is that no additional programs are needed to make this work; just type in four
  97. POKE commands, then tell it to SAVE as it would normally save a Basic program.
  98.  
  99. For those of you already familiar enough with Commodore's style and memory
  100. arrangement schemes to make sense of this, bytes 43 and 44 (decimal, not hex) 
  101. are the pointers to the Start of Basic memory area, and bytes 45 and 46 are 
  102. the pointers to the Start of Variables, or in other words, the End of Basic.
  103. Follow this chart, to save a block of memory from these areas via pokes:
  104.  
  105.  
  106.    Block #Hex AddressPoke 43,xPoke 44, xPoke 45, xPoke 46, x
  107.      1       $2000-3fff      x = 0       x = 32       x = 255     x = 63   
  108.      2       $4000-5fff      x = 0       x = 64       x = 255     x = 95
  109.      3       $6000-7fff      x = 0       x = 96       x = 255     x = 127
  110.      5       $a000-bfff      x = 0       x = 160      x = 255     x = 191
  111.                                                                     
  112.  
  113. The above is only one possible way to archive an 8K block of Vic20 memory.
  114. However, a second method exists, requiring some Vic20 modifications. A truly
  115. hard-core Vic user could alter the copy of the startup code that is stored in 
  116. the Kernal ROM chip, so that no normally-correct autostart sequence code ever 
  117. matches it as long as your new Kernal is in place.
  118.         
  119. Remember, there must always be *two* copies of the start-up code; one in the 
  120. cartridge itself and one stored in the computer for comparison. If either of 
  121. these two seperate codes are altered, even slightly, it will not autostart! 
  122.  
  123. The cartridge gets mapped into memory at its correct location, but the Basic 
  124. "READY" screen comes up instead, giving the user full control. Once you've
  125. achieved this, you simply do four pokes (to change the start and end of BASIC
  126. memory to match where the cart code is), or save the info with an ML monitor.
  127.  
  128. With some work and an "MCM 68764" 8K EPROM, this can be done. It is not just
  129. a vague theory; the author has done it. It works, as does a similar technique 
  130. for doing the same general thing with the Commodore 64 computer. (With the 
  131. appropriate changes, of course, to reflect the C64's different architecture 
  132. and memory map; the C64 codes are "CBM80" instead of "A0CBM", and the Kernal 
  133. expects that code to be in a cartridge at locations $8004-$8008 instead of 
  134. $A004-$A008. Starting address is in the same exact format as the Vic's.) 
  135.         
  136. This a much more involved modification, and not for the squeemish or 
  137. those who only own one Vic20 (or C64) without any spares to fall back on! 
  138.  
  139. To do it, you need a heck of a lot of computer knowledge specific to the 
  140. computer you're working on, an eprom burner, an eprom eraser, and patience.
  141. You have to search in the Kernal's memory image, for the start-up code, and
  142. modify those bytes to be something different than they are, while leaving all
  143. the other bytes just as they are. This alone takes some serious skills, no?
  144. You also need skills and tools in desoldering and removing IC chips, as well
  145. as soldering in IC sockets, and not destroying anything in the process.
  146.  
  147. I won't go into this much, because I don't imagine many people will bother to
  148. actually attempt this method, since the other has some serious pro's to it, 
  149. and since this should be about enough info to go on; if you can't figure out
  150. how to do this modification with this info, you probably should not try it, 
  151. until you've progressed enough at a later time. Or, have someone else do it
  152. for you, with these instructions, if you really want it done badly enough.
  153.  
  154. This way may appeal to some people, but I recommend the other for most folks. 
  155. The overly-technical types might be tempted to go ballistic however, and more 
  156. power to you! A thought, in parting; one could put 2 copies of the Kernal ROM 
  157. chip, one stock and one modified, into one 16K eprom, with an external switch 
  158. to flip between the two versions. (Or just go lower tech, and just manually 
  159. swap out Kernal chips as needed; most Vic20's seem to have sockets anyway.)
  160.  
  161. Whatever you do, I hope you've enjoyed this article! Later, all!
  162.  
  163. Ward Shrake
  164. wardshrake@aol.com
  165. July 1995
  166.  
  167.  
  168.