Wow, thanks for your very quick reply! Ullrich von Bassewitz <uz@musoftware.de> writes: > There are several problems: The linker does not prepend the load address in > the resulting binary. You have to do this by adding a word in the source and > adjusting the load&run addresses in the config. > [...] > > In addition to that, the memory areas are written to the output file in the > order in which they're defined in the config. And the segments are also > written in this order. So a (hopefully correct) config would be: > [...] I modified my code but it still isn't working. Here are the modified sources: ,----[ sid_player_ca65.s ] | .export _main | .segment "PRG" | | .addr _main | | _main: lda #$00 | tax | tay | jsr song ; Initialize music | | mainloop: | lda $d012 ; Load $d012 | cmp #$80 ; Is it equal to #$80? | bne mainloop ; If not, keep checking | | inc $d020 ; Inc border colour | jsr song+3 ; Jump to music play routine | dec $d020 ; Dec border colour | jmp mainloop ; Keep looping | | | .segment "SID" | song: .incbin "example2.bin" `---- ,----[ c64.cfg ] | MEMORY { | ZP: start = $0002, size = $001A, type = rw, define = yes; | RAM: start = $07FF, size = $C801, file = %O, define = yes; | PRGDATA: start = $07FE, size = $0B02, file = %O, fill = yes, define = yes; | SIDDATA: start = $1000, size = $1000, file = %O, define = yes; | } | SEGMENTS { | STARTUP: load = RAM, type = ro; | LOWCODE: load = RAM, type = ro, optional = yes; | INIT: load = RAM, type = ro, define = yes, optional = yes; | CODE: load = RAM, type = ro; | RODATA: load = RAM, type = ro; | DATA: load = RAM, type = rw; | BSS: load = RAM, type = bss, define = yes; | HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack | ZEROPAGE: load = ZP, type = zp; | PRG: load = PRGDATA, type = ro, define = yes; | SID: load = SIDDATA, type = ro, define = yes; | } | FEATURES { | CONDES: segment = INIT, | type = constructor, | label = __CONSTRUCTOR_TABLE__, | count = __CONSTRUCTOR_COUNT__; | CONDES: segment = RODATA, | type = destructor, | label = __DESTRUCTOR_TABLE__, | count = __DESTRUCTOR_COUNT__; | CONDES: segment = RODATA, | type = interruptor, | label = __INTERRUPTOR_TABLE__, | count = __INTERRUPTOR_COUNT__; | } | SYMBOLS { | __STACKSIZE__ = $800; # 2K stack | } `---- I don't know if attachements work in this list, but I attached the example2.bin song. It is one of the examples included in goattracker (http://cadaver.homeftp.net/tools/goattrk2.zip) at goattracker/examples/src/example2.bin. I just wanted a little sid player, playing a tune on 2 channels, so one can play randomly generated tones on the third channel, controlled via paddles or something like this. The little assembler sid player should be called from the C program, but I already fail at implementing the sid player :-( regards, Sebastian ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo@musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.8 : 2006-11-02 13:49:56 CET