DTVkernal Utils -- Patching Hummer Kernal (These tools should also work for C64DTV) -------------------------------------- Why patch the kernal? 1) Kernal standard to Hummer game has a save bug. Files appear to save correctly, but contents are mangled, too large. 2) Patching kernal will "fix" video setting (NTSC or PAL) and not require the video configuration resistors on the userport. 3) Add hooks to load utilities stored on Flash: monitors, editors, etc. -------------------------------------- Why use "dtvkcmp" and "dtvkpatch" and not Daniel Kahlin's flash utility? Any number of cmp files for patched kernals can be distributed this way. The kernals themselves are not exchanged, as doing so might be a copyright violation. A dtvkcmp file is just a list of differences between an original kernal and a patched kernal. Together with an original kernal file (which the user can save themselves), the cmp file can be used to build a new kernal. Hummer users will still need Daniel's utility to save the original Kernal image :) --------------------------------------- Compiling the utils There are no make files, these are as simple as any 'C' program can be. Compile as follows: gcc -o dtvkcmp dtvkcmp.c gcc -o dtvkpatch dtvkpatch.c (if GCC is unavailable, use what every compiler you have. Try Cygwin under Windows (which should still be gcc.) --------------------------------------- Saving the Original Kernal Image (Hummer) Using the Flash Utility from Daniel Kahlin http://www.kahlin.net/daniel/dtv/flash.php NOTE: this will work even from an unmodified Hummer--the save bug doesn't effect the kernal routines used by the Flash Utility. a) set current sector to 07 (00E000 - 00FFFF) b) dump sector to buffer c) save buffer, ala: filename: ORIGKERN.PRG (any name will do..) start offs: 000000 end offs: 002000 raw data: Y If saved as non-raw, a two byte load address is added to beginning of file. In this case the address would be 0 (00 00), so it's not much help. Better to save as raw. --------------------------------------- Creating cmp (Comparison) File Syntax (save): dtvkcmp "original kernal file" "kernal patched" >patched.cmp (list) dtvkcmp "original kernal file" "kernal patched" If you don't redirect the file, it will echo to stdout (the shell.) example: dtvkcmp hummer_original_kernal.prg dmpatch_kernal.prg >dmpatch.cmp ORIGINAL KERNAL IS ALWAYS FIRST, PATCHED KERNAL TO BUILD COMPARISON IS SECOND. Partial output of cmp file: ... ... 6278 211 250 6279 169 96 6280 242 169 6281 141 2 6282 0 32 6283 211 121 6284 141 248 6285 3 169 6286 211 1 6287 169 32 6288 78 213 6289 141 248 ... ... Format: address of byte in byte in missmatch kernal1 kernal2 -------------------------------------- addr byte1 byte2 Only address and the second byte (field 3) are used by the patching prog. The first byte is retained for reference. ---------------------------------------- Patching the Kernal Syntax: ./dtvkpatch "kernal (original) file" "cmp file" "target kernal file" Example: ./dtvkpatch hummer_original_kernal.prg dmpatch.cmp newkernal.prg dtvkpatch doesn't echo to stdout, so no redirect is needed here. Once the new kernal is created, it should be checked for integrity with an md5 checksum utility. I use 'md5sum' in Linux. There are several available for other OS's. The md5 check sums for the stock hummer kernal and the David Murray patched kernal are listed here. Original Hummer Kernal ROM md5: f913e2deda40c16a35d43435807fdfc3 DM patched Kernal: md5: 5f0b0b231286d1aa85e85d597b766c58