Quote:
I think you meant this for Beethead.
Yep, I did. I was tired. My bad.
Here is what I've come up with and my trial and error process that got me there...
I dispensed with
*=$0000 and switched to
.logical instead. At first, it didn't work. The
64tass documentation shows the two directives used together. That didn't work. I tried it in a few places, right after the
.logical keyword for starters, then at the end of my code. Nothing worked. The resulting file was larger than expected, but not by a ton. Even a simple
jsr [label to absolute address] wouldn't work.
This is what I tried was:
Code:
*=$0000
(cartridge header)
(chip packet)
.logical $8000
.word start ; $8000
.word nmi_reset ; $8074
.text "CBM80" ; auto-start signature
(main code)
.here
Eventually, I hit on abandoning
*=$8000 entirely, and just went with
.logical $0000 and
.logical $8000, that did work as long as I placed the
.here statements at the end of the segments.
The idea of named sections of code appealed to me. I'm reverse engineering a game after all. I have only a rough idea where the code ends and where sprite and bitmap data begin. When I figure out the dividing line, it will be nice to be able to mark it as data; if only as an aid to the reader.
What I ended up with, after some trial and error was...
Code:
cart_header=$0000
.dsection cart_header
;.cerror * > $50, "Header too large."
main=$8000
.desection main
.section cart_header
.logical cart_header
(cartridge header)
(chip packet)
.here
.section main
.logical main
.word start
.word nmi_reset
.addr start ;$8009
.addr nmi_reset ;$8074
.text "CBM80" ;auto-start signature
(program code and data)
.here
Maybe that's redundant, or I am otherwise "doing it wrong." I'm open to criticism. Eventually, I want to work out a generic macro to handle cartridge headers and chip packets. I'll add a section for data to clearly demark it from the main program when I get that far.