Project: Circuit to even kill reset resistant programs Target : C64 Time : 25 min. Cost : ~2 US$ Use : No need to switch off C-64 for getting rid of reset resistant programs, thus enhancing the C-64's lifetime.
During the reset procedure the C-64 checks whether the memory locations $8004-$8008 contain the string 'CBM80', which usually indicates the presence of a module attached to the expansion port and makes the processor execute the reset routine the address of which is located in $8000/$8001. If this string is absent, the computer proceeds with the normal reset routine.
This 'module reset vector' can be changed by any program which causes the CPU to execute the program's reset routine (which does not necessarily have anything to do with a reset) instead of the kernal reset routine. That is when you hit the reset button but it does not look like a normal power on, in many cases the program continues as if you had not ever touched the reset button.
To avoid the CPU finding the string 'CBM80' if a program wrote it into the very memory location, we have to prevent the RAM at $8000 being read during the reset routine.
To accomplish that, we pull the expansion port's /EXROM pin to LOW which makes the C-64 switch off the RAM from $8000 to $9fff so that accesses to these locations are usually redirected to a module's ROM. If no module is plugged in, the data bits are floating (contain no valid values), which renders the probability of reading the string 'CBM80' at $8004 quite low :-)
The circuit below works as follows: the reset line gets a short LOW signal (independent from how long you pressed the button) until the capacitor is loaded. At the same time, /EXROM gets pulled to LOW for just a little longer than the reset line. This makes the processor start the normal reset routine (because it cannot detect the 'CBM80' string).
Although this seems to 'kill' reset resistant programs, their own code including the reset vectors and the 'CBM80' string still reside in memory, so that an NMI (activated by the RESTORE key) or a software reset (SYS 64738) restarts the program. To avoid this, simply type POKE 32772,0 to overwrite the first character of the string 'CBM80'.
If you want to implement a reset protection in your own programs, be sure to choose the right ASCII values for the string 'CBM', because there are two different values for each character, depending on the character set. The correct ones are those above $80:
Of course, this trick as well as the hard reset switch does not work with a module plugged in, which occupies memory at $8000 or at $a000 (banking out memory at $a000-$bfff (accomplished by pulling /GAME to LOW) implies banking out memory from $8000).C = 195 ($c3) 8 = 56 ($38) B = 194 ($c2) 0 = 48 ($30) M = 205 ($cd)
(Click here for ASCII version)
The easiest way to build it is the socalled 'Drahtigel' the literal translation of which would be 'Wire hedgehog'. This simply means you do not use any kind of PCB, Vector board or similar struts. But do not forget to insulate your circuit.