LordKraken Posted December 13, 2020 Share Posted December 13, 2020 (edited) Hello, I guess this message is essentially targeted at asm expert but we'll see So unlike most participants to the lynXmas 2020, I just don't have time to create a nice ABCtune for my game. I started looking at free ABC songs online, but I'm reluctant to put any time into learning about the conversion process to abcmusic (yep I'm a lazy programmer but we all already know that but here it's really just about time constraint) So, since I have "plenty" of space left, I just thought the easiest way would be to link chipper data statically to the binary and this should be all right shouldn't it... Well well well, it's not that simple it seems... So what I did was simply to open the .o that you usually put into your .mak file and put the binary into an array... something like that: char music[] = { 0xfd, 0xfd, 0x0b, 0x00, 0xd7, 0x02, 0xee, 0x02, 0x01, 0x00, 0x04, 0x5f, 0x62, 0x75, 0x67, 0x00, 0x00, 0x07, 0x00, 0x00, 0x80, 0x08, 0xa0, 0x30, 0x02, 0xd7, 0x42, 0x53, 0x39, 0x33, 0x32, 0xa0, 0x86, 0x60, 0xa0, 0x86, 0xb8, 0xa0, 0x86, 0x01, 0xa1, 0x86, 0x4a, 0xa1, 0x86, 0xb8, 0xa0, 0x86, 0x01, 0xa1, 0x86, 0x4a, 0x00, 0xa1, 0x86, 0x59, 0xa1, 0x86, 0xb6, 0xa1, 0x86, 0x59, 0xa1, 0x86, 0xb6, 0xa1, 0x86, 0x0b, 0xa2, 0x86, 0x88, 0xa2, 0x86, 0x0b, 0xa2, 0x86, 0x88, 0xa2, 0x00, 0x91, 0x9d, 0x81, 0x88, 0x01, 0x82, 0x00, 0xa0, 0x88, 0x02, 0x88, 0xa0, 0x88, 0x03, 0x90, 0xa0, 0x8c, ... }; Guess what, it crashes I tried then to use the tool call bin2obj to create a valid object, but here again it crashes... So here is the real question... what is the loading library (I'm talking about file_bs3.c here) actually loading into the buffer? Is there some sort of "conversion" (big <-> little endian?) some header? I tried to look at the code but it is definitely beyond my capacities... I think this is your code @42bs so you're probably the best person to answer that thanks in advance! Edited December 13, 2020 by LordKraken Quote Link to comment Share on other sites More sharing options...
LordKraken Posted December 13, 2020 Author Share Posted December 13, 2020 Just realized i could load a chipper song from the file directory and dump the data using handy debug.. might work Quote Link to comment Share on other sites More sharing options...
sage Posted December 13, 2020 Share Posted December 13, 2020 unlikely. the file in the rom contains the same data, just without header. even so i am not sure which "rom" and "o" you refer to. Quote Link to comment Share on other sites More sharing options...
42bs Posted December 13, 2020 Share Posted December 13, 2020 Not sure what you want to achieve. Do you have a standalone chipper song and want this to call during your game? Combing lyxass exe and cc65 exe? You can create .o files w/o header by using "-d" (for data). But you main routine has to copy the chipper exe to the right place in RAM. Quote Link to comment Share on other sites More sharing options...
LordKraken Posted December 13, 2020 Author Share Posted December 13, 2020 The -d option sounds like something to explore Quote Link to comment Share on other sites More sharing options...
LordKraken Posted December 13, 2020 Author Share Posted December 13, 2020 Quote the file in the rom contains the same data, just without header. Quote You can create .o files w/o header by using "-d" (for data). Which I did and yes it works now, the problem was really only the header, which I was unaware of. Thanks! I'll have music 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.