Chuckie Egg
Found on:
"Chuckie Egg"
Loader files:
ROM Header 1
Contains only filename
ROM Data 1
Autostart and uses standard Kernal routine to load next file which it then starts
ROM Header 2
Contains only filename
ROM Data 2
Contains the turbo loader
Encoding:Contains only filename
ROM Data 1
Autostart and uses standard Kernal routine to load next file which it then starts
ROM Header 2
Contains only filename
ROM Data 2
Contains the turbo loader
Endianess:MSbF
Threshold:0x0190
Lead-in:50 x 0xff
Sync:File Id, 0x00 - 0xNN
0-bit:Long
Bytes:9 bits
Structure:Threshold:0x0190
Lead-in:50 x 0xff
Sync:File Id, 0x00 - 0xNN
0-bit:Long
Bytes:9 bits
Header:Yes
Checksum:Yes
Checksum:Yes
Data:
Each byte is 9 bits and the first bit is ignored by the loader.
Ignored bit always seems to be '0'.
Header:
00 Header checksum cancellation byte.
01-02 Data checksum
03-04 Changes a jump vector used by the loader. Triggering new code to be run after each file.
Basically displays the intro picture and after last file clears it and starts the game.
05-06 Bytes to load, High/low order.
07-08 Load start address, High/Low order.
Checksum:
There are two checksums. One for the header and one for the payload.
All nine bytes of the header should add up to 0x00.
The payload checksum is a bit more complicated and can be calculated as follows.
Code example is Java, so byte variables are signed.
byte da=0;
byte d9=0;
byte d98, da8;
for ( byte bb : payload ) {
da^=bb;
for ( int i=0; i<8; i++ ) {
da8 = 0;
d98 = 0;
if ( da < 0 ) {
da^=0x08;
d9^=0x10;
da8 = 1;
}
if ( d9 < 0 ) { d98=1; }
d9<<=1;
da<<=1;
d9|=da8;
da|=d98;
}
}
'd9' is offset 0x02 and 'da' is offset 0x01 in the header.
Each byte is 9 bits and the first bit is ignored by the loader.
Ignored bit always seems to be '0'.
Header:
00 Header checksum cancellation byte.
01-02 Data checksum
03-04 Changes a jump vector used by the loader. Triggering new code to be run after each file.
Basically displays the intro picture and after last file clears it and starts the game.
05-06 Bytes to load, High/low order.
07-08 Load start address, High/Low order.
Checksum:
There are two checksums. One for the header and one for the payload.
All nine bytes of the header should add up to 0x00.
The payload checksum is a bit more complicated and can be calculated as follows.
Code example is Java, so byte variables are signed.
byte da=0;
byte d9=0;
byte d98, da8;
for ( byte bb : payload ) {
da^=bb;
for ( int i=0; i<8; i++ ) {
da8 = 0;
d98 = 0;
if ( da < 0 ) {
da^=0x08;
d9^=0x10;
da8 = 1;
}
if ( d9 < 0 ) { d98=1; }
d9<<=1;
da<<=1;
d9|=da8;
da|=d98;
}
}
'd9' is offset 0x02 and 'da' is offset 0x01 in the header.