Jump to content
IGNORED

Linking chipper music statically


LordKraken

Recommended Posts

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 :D 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 by LordKraken
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...