Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RANDOMIZE USR issue
#16
LukeBord1 Wrote:
Quote:The safe way is to use INCBIN "filename.bin" within an ASM context
Ok! It's the first ZXB menu I'm going to include in an AGD game (and probably the first attempt ever). Just a thought... so I cannot include a not-relocatable file.
An AGD project isn't relocatable; the AGD saved block starts always below 32000 but it needs to be called exactly at 32000 to run. So I'll have something like...
Code:
...
RANDOMIZE USR @agd_block
...
agd_block:
ASM
#incbin "31018,26806_game.bin"
END ASM
...and two problems rise: how can I tell ZXB to start the bin from 32000, and can it work if it isn't relocatable?!

Probably something like

Code:
ORG <low address>
GOTO start_of_program
ORG 32000
ASM
incbin "file"
END ASM
:start_of_program

Assuming you want your zxb code after the binary. Before will take some juggling to be sure it all works. I'd love to have a better memory map feature (I'd kill for an emulator with a live zoom in of memory accesses, so I can see where code is hanging out most...)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)