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!
Status Emulator and Crt-Files
-
- Posts: 7
- Joined: Sun Jan 31, 2021 11:02 pm
Re: Status Emulator and Crt-Files
I have been looking for a tutorial to do this exact thing, any chance you could put a tutorial together for the community?
Re: Status Emulator and Crt-Files
Currently definitely not, because of lack of time. I even had to put this project aside for a while now, but I can compile some information, when I'm done getting the CC65 code running in rom and system ram as well. But it really isn't very hard, if you go for assembler code only. Create a bin file, which has those four magic bytes upfront and have your code ready to run from $c004 then. Keep in mind, that you have to copy some code into the fixed ram, if you want to switch away from bank 32 then.
That's exactly what I'm currently working on, getting the CC65 runtime to work for cart space and fixed RAM.
But if you have specific questions, please feel free to ask, time to answer I definitely will find
That's exactly what I'm currently working on, getting the CC65 runtime to work for cart space and fixed RAM.
But if you have specific questions, please feel free to ask, time to answer I definitely will find
Last edited by SunSailor on Sat Jul 27, 2024 4:44 pm, edited 1 time in total.