.function char2ascii(c) { .return c + [c < $20 ? $60 : $00] } .macro ascii(str) { .fill str.size(), char2ascii(str.charAt(i)) } .macro sid_b(v) { .byte v } .macro sid_w(v) { .byte >v,<v } .macro sid_l(v) { .byte v>>24, [v>>16]&$ff, [v>>8]&$ff, v&$ff } .macro sid_str(str) { /* conversion necessary because KickAssembler doesn't seem to support ascii output, only a loosly defined conversion to petscii/screencodes. */ :ascii(str) .fill $20 - str.size(), 0 } .if (cmdLineVars.get("RSID") == true) { .pc = start_addr-$7c /************************************************************************** * * RSID header * ******/ .text "PSID" :sid_w(2) // version 2 :sid_w($7c) :sid_w(pl_startcode) :sid_w(pl_init) :sid_w(pl_play) :sid_w(1) // 1 song :sid_w(1) // start with song 1 :sid_l(0) // raster speed :sid_str("Crackpot") // song name :sid_str("Daniel Kahlin (TLR)") // author :sid_str("2013 Daniel Kahlin") // released :sid_w(%100110) // 8580/PAL/C64 :sid_b(0) // start page :sid_b(0) // page length :sid_w(0) // reserved }