Status Emulator and Crt-Files
Posted: Sun Jul 14, 2024 5:20 pm
Hi,
I'm fiddling around with building a toolchain to create crts with CC65. I got quite far, where I'm now able to create a bin file with a simple program (Changes system font, sets screen mode and ouputs some text) to be embedded in a cart file. From here, I ran into troubles, as the produced cart file didn't do anything for the emulator.
- Can anybody confirm, that the current emulator (R47) already supports auto starting cart files?
- By examining the crt file produced by makecart, I found that the payload for bank 32 starts at byte 480 instead of 512, like the documentation says. Which of both are correct?
- Can anybody confirm, that at $c000, where the "CX16" magic bytes are expected, are represented by $c3 $d8 $31 $36 or is the wrong charmap used here anyway?
Help would be greatly appreaciated, thank you advance!
Edit: Did some peek into the cart tool, and as it uses the same types as the emulator to save and load, the error is not to be found there, it is the documentation, which is false here. The field for the program version is 32 bytes, but the location is given as 128-191. As 128+32 is 160 instead, the issue starts here. Fields add up to 480 until the payload, not 512, which is exactly, what my hex editor shows in the actual file.
Edit2: Ok, figured it out myself by cramping into the ROM file, then correct magic number is $43, $58, $31, $36. At least now the emulator does something. Hope these findings can help somebody else and maybe someone could update the makecart docs. Or tell me how to do it, always happy to contribute
Edit3: Just successfully started CC65 code from a cart file, great success!
I'm fiddling around with building a toolchain to create crts with CC65. I got quite far, where I'm now able to create a bin file with a simple program (Changes system font, sets screen mode and ouputs some text) to be embedded in a cart file. From here, I ran into troubles, as the produced cart file didn't do anything for the emulator.
- Can anybody confirm, that the current emulator (R47) already supports auto starting cart files?
- By examining the crt file produced by makecart, I found that the payload for bank 32 starts at byte 480 instead of 512, like the documentation says. Which of both are correct?
- Can anybody confirm, that at $c000, where the "CX16" magic bytes are expected, are represented by $c3 $d8 $31 $36 or is the wrong charmap used here anyway?
Help would be greatly appreaciated, thank you advance!
Edit: Did some peek into the cart tool, and as it uses the same types as the emulator to save and load, the error is not to be found there, it is the documentation, which is false here. The field for the program version is 32 bytes, but the location is given as 128-191. As 128+32 is 160 instead, the issue starts here. Fields add up to 480 until the payload, not 512, which is exactly, what my hex editor shows in the actual file.
Edit2: Ok, figured it out myself by cramping into the ROM file, then correct magic number is $43, $58, $31, $36. At least now the emulator does something. Hope these findings can help somebody else and maybe someone could update the makecart docs. Or tell me how to do it, always happy to contribute
Edit3: Just successfully started CC65 code from a cart file, great success!