Author Topic: Where do I patch a Rom to adjust the Checksum ? (Sorted OK)  (Read 238 times)

0 Members and 1 Guest are viewing this topic.

Online Audronic

  • 6128 Plus
  • ******
  • Posts: 1.265
  • Country: au
  • I know RST3 . I now know a little More.
  • Liked: 296
  • Likes Given: 636
Hi All


I Have a Rom file OS6128.ROM That has a checksum of 4C40 and it should be 4C00.

Where do I patch the file to restore the checksum ?.

Thanks Ray
« Last Edit: 03:59, 13 July 19 by Audronic »
Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.391
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 791
  • Likes Given: 1666
Re: Where do I patch a Rom to adjust the Checksum ?
« Reply #1 on: 12:35, 12 July 19 »
Regular expansion ROMs (NOT the lower/OS or BASIC ROM!!!) do this:

Addresses from &C000 up to &FFFE are added, and the result is put in one byte.

This means as soon as the checksum is bigger than 255 then you just subtract 256, so the result is always something between 0 and 255

Finally the Checksum is written to the ROM address &FFFF


BASIC example

w=0
for a=&4000 to &7FFE
w=w+peek(a)
if w>255 then w=w-256
next
poke &7FFF,w
end

This works for a ROM at address &4000







http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Online Audronic

  • 6128 Plus
  • ******
  • Posts: 1.265
  • Country: au
  • I know RST3 . I now know a little More.
  • Liked: 296
  • Likes Given: 636
Re: Where do I patch a Rom to adjust the Checksum ?
« Reply #2 on: 12:39, 12 July 19 »
@GUNHED


Thanks.  Ray
Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.391
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 791
  • Likes Given: 1666
Re: Where do I patch a Rom to adjust the Checksum ?
« Reply #3 on: 12:40, 12 July 19 »
Always a pleasure!  :)  Looks like a productive weekend is coming up.  :) :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Online Audronic

  • 6128 Plus
  • ******
  • Posts: 1.265
  • Country: au
  • I know RST3 . I now know a little More.
  • Liked: 296
  • Likes Given: 636
Re: Where do I patch a Rom to adjust the Checksum ?
« Reply #4 on: 13:29, 12 July 19 »
Hi Gunhed - EtAll


I have worked out a patch to the RedBox Modified OS6128 with 32 roms.


The checksum after the mods ended up being &4140 instead of &4100 I have made a patch to the file and burned a rom.
I have done a checksum of various system roms and they all look like this & xx00 h so when saw the xx40 that alerted me. (I need to be alert)
Put it in my trusty CPC464 and it BOOTS -- Yeahhhh  -- the previous version would NOT Boot (&4140).


I will continue on tomorrow and find a better place to alter the checksum in some of the Link Names Solavox AWA etc That won't get used


Ray



Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.