Custom Kernal ROM image not loaded if the file checksum matches known Kernal image
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
The attached modified Kernal rev3 file wont be loaded by X64sc and will instead load the normal rev3 Kernal.
The 'set kernal version' function will reload the kernal with the matching checksum so it can install the device traps.
This modified Kernal happens to have the same checksum than the original.
Reverting the 'version' byte at $E4AC back to the original value fixes the issue.
command line was: ./src/x64sc -default -verbose -kernal kernal.rom
Loading system file `/home/groepaz/Desktop/vice/vice-emu/trunk/vice/kernal.rom'.
c64rom_get_kernal_chksum_id chksum: 50954 id: 3
c64rom_get_kernal_chksum_id: rev:3
loaded known kernal revision:3 chksum: 50954
set_kernal_revision(val:3) was kernal_revision: 3
set_kernal_revision found rev:3 name: kernal-901227-03.bin
set_kernal_rom_name val:kernal-901227-03.bin.
Loading system file `/usr/games/share/vice/C64/kernal-901227-03.bin'.
c64rom_get_kernal_chksum_id chksum: 50954 id: 3
c64rom_get_kernal_chksum_id: rev:3
loaded known kernal revision:3 chksum: 50954
set_kernal_revision(val:3) was kernal_revision: 3
set_kernal_revision found rev:3 name: kernal-901227-03.bin
set_kernal_rom_name val:kernal-901227-03.bin.
set_kernal_revision new kernal_revision: 3
set_kernal_revision new kernal_revision: 3
Diff:
this seems to work now.
but... sha1 might be a bit of an overkill just for this. :)
Sure overkill - then again, its not much code (same as eg crc32 would be) and we can be pretty sure it will work for this, and pretty much everything else we might come up with that needs checksums :)