Kenshi Posted December 11, 2022 Share Posted December 11, 2022 I've learned a bit trying to figure this out. After playing with it for a while, I got it to assemble as a cartridge and I get gibberish on the text line like you. However, if I load #$e0 into $02f4 to load the default character set, it shows up appropriately. Normally, DOS does this when loading up. The ca65 manual says to set the option byte in the cartridge header to 1 (instead of 4 like you have it) and it won't prevent the loading of DOS, but that doesn't seem to make a difference for me. Maybe someone can come along and explain better, but for now, you can manually load the character set like I did. 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted December 11, 2022 Author Share Posted December 11, 2022 8 hours ago, Kenshi said: I've learned a bit trying to figure this out. After playing with it for a while, I got it to assemble as a cartridge and I get gibberish on the text line like you. However, if I load #$e0 into $02f4 to load the default character set, it shows up appropriately. Normally, DOS does this when loading up. The ca65 manual says to set the option byte in the cartridge header to 1 (instead of 4 like you have it) and it won't prevent the loading of DOS, but that doesn't seem to make a difference for me. Maybe someone can come along and explain better, but for now, you can manually load the character set like I did. Thank you for your help! Edit: I'd be interested in seeing the modified source you made for ca65 to make a xex as well, if you are willing to share it. Quote Link to comment Share on other sites More sharing options...
Kenshi Posted December 11, 2022 Share Posted December 11, 2022 This is the version I used to compile a cartridge, but you only need to remove the CARTHDR segment and the export for it at the top to make an xex file. I also included the config files. myatari.cfg is one I made for making xex files that includes optional aligned memory segments for a character set, player-missile graphics, etc. atari-cart.cfg is the stock file that comes with the assembler except I added align parameters for data and rodata. To make a cartridge file, I ran: cl65 -C atari-cart.cfg 800test.asm -o 800test.cart -m 800test.map -vm myatari.cfg atari-cart.cfg 800test.asm 1 Quote Link to comment Share on other sites More sharing options...
Kenshi Posted December 12, 2022 Share Posted December 12, 2022 There's one thing that needs to be changed that I didn't think about until after I made my last post and it's bugging me. Nothing in the data segment needs to be initialized, so it really should be a bss segment, like this: .bss Color: .res 1 IntClock: .res 1 Clock: .res 1 When making a cartridge, ld65 will put anything in the data segment into ROM but also reserves a place in RAM for it and expects you to copy the initial values over before working with it. The details are in section 5.5 of the ld65 manual. I put the display list into rodata so it would be written to ROM and not be expected to get copied, but got away with leaving the rest in data because the initial values didn't matter. When making an xex file, you don't need to worry about copying the values in data since the operating system loads everything into RAM anyway, but it's still a good idea to use bss for uninitialized memory so it doesn't take up space in your binary file. https://cc65.github.io/doc/ld65.html#s5 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.