[cc65] Unable to include binaries at a particular address

Date view Thread view Subject view

From: Game 64 - Benjamin Bahnsen (bb_at_game64.de)
Date: 2003-11-16 23:20:56


Hello!

I know that this topic has been discussed before, but i didn't find a
solution to my problem in previous threads. I want to include a binary file,
which has to be located at a particular address ($5000). First i tried the
.org - command, but it did not work.

.rodata
.org $5000
.incbin "sound.bin"
.reloc

After compiling and linking with cl65 main.c sound.s, my sound isn't located
at $5000. It is not even included in the compiled file. I read in the manual
that there are better ways to put binaries at a particular address. But my
first question is: why does this piece of code don't work?

Then i tried the solutions with segments. I modified the c64 memory
configuration file by inserting

 MEMORY {
            .
            .
            sound: start = $5000, size = $1000, define = yes, file = %O;
        }
 SEGMENTS {
            .
            .
            SOUND: load = sound, type = rw;
  }

Now my sound.s - file looks the following way:

.segment "SOUND"
.incbin "sound.bin"
.code


The resulting file after compiling with
ld65 main.o sound.o c64.lib -C memory.cfg
does not contain any data at $5000. The strange thing is, that the main
program now starts at $5ADE. My sound.bin-file has a length of $ADE...
I have no explanation for that. Can anyone help me?

Thanks,
 Benjamin Bahnsen



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-11-16 23:19:36 CET