LSDJ is a popular music tracker for Gameboy, and lsdpack allows playing lsdj songs from a custom application.
The project is developed in assembler using RGBDS while I used another Gameboy SDK for my project, GBDK.
Unfortunately, both SDK are incompatible, they use a different assembler syntax and a different obj file format...
So I tried a quick hack :
- Using assembler directives in lsdpack I forced the code to be at located at higher addresses, leaving the bottom of the memory map empty
SECTION "setup",ROM0[$3000]
- Then I compiled the lsdpack example and kept only the upper part of the binary
- And I compiled my alarm clock project and cut the end of the file
- Then I merged both files
dd if=alarm_clock.gb of=alarm_bottom.bin count=24
dd if=lsdpack_test.gb of=lsdpack_top.bin skip=24
cat alarm_bottom.bin > fullrom.gb
cat lsdpack_top.bin >> fullrom.gb
- In my code, I use inline assembly to call the addresses of lsdjpack functions I need
void play_lsdj_song() { __asm call 0x3D07 __endasm; }
So far, it doesn't work yet, I will insist a bit more to get my hack working and if it doesn't, I will probably convert my code from C to assembly, it will give me more control for the tight timings lsdpack requires.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.