MainHELP Glossary Hardware SAL Workshop Companies FTP ToolsBackAbout

"Hard" Reset

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.


Summary

Pull /RESET and /EXROM to LOW simultaneously, thus let $8004 point to an address of an inexistent module.

Details

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:

   C = 195 ($c3)      8 = 56 ($38)
   B = 194 ($c2)      0 = 48 ($30)
   M = 205 ($cd)
 
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).

Ingredients

Instructions

  1. Pull off all cables and open case.
  2. Build the following circuit:

    ['Hard reset' circuit]
    (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.

  3. Now solder the circuit according to the above picture to /EXROM, /RESET and GND. You can find all three signals on the expansion port and above that, /RESET and GND on the user port.
  4. For testing, switch on your C-64 and hit [SHIFT]-[CLR]. Press the hard reset switch very shortly, hit [SHIFT]-[CLR], then press it again and hold it down for a few seconds. If in both cases the power up screen appears, the hard reset switch basically works correctly.
  5. Now load a reset resistant program and try to kill it using the hard reset switch. If that works, you can attach the switch to the case and close it again.

Possible failures


Updated: September 23rd, 1997
Created: January 29th, 1997
Status : Verified on September 23rd, 1997

Site copyright © 1997 by Marc-Jano Knopp
This document is part of MJK's Commodore 64 & LCD Page
Brought back to life by Peter Schepers, Dec 10, 2005 because I really liked this site!