Jump to content
IGNORED

New Dev Questions


Karl G

Recommended Posts

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.

  • Thanks 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

  • Thanks 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...