Sawtooth - A Chiptune Music Player : DevLog

Progress report.

TLDR: linked 3rd party c++ library on device, reading files in c is straight forward but needs to be taken in smallish 4000 byte chunks when on device) (wrong, you need to alloc & malloc to free space on the stack)

I bumped into my fair share of sharp edges and minor setbacks the last few days trying to get my development environment linking the game-music-emu c++ library on device at runtime. Everything worked ok in the simulator, but no dice on the actual :playdate_agh:

I've never used CMakeLists before and learning the basics took me the better part of a day just to get the libraries to build and link.

I sent a desperation message to community member @MrBZapp and he graciously helped me through my CMakeLists.txt issues. (modify_target_for_playdate does something magic!)

Once I was successfully running on the device, I decided it was time to read some bytes off disk and open a file. For now, I have embedded a 40KB test NSF file into my pdx, so that's the file i'm going to read (and hopefully playback soon).

SDK API's that I've used today:

Once I read the byte array, I printed it all out to the console with pd->system->logToConsole() and compared with xxd dump from my terminal on my mac...it matches!

That's about it for a progress report, next up I'm going to send my bytes to the game music library and see if it can determine if it's a music file. :crossed_fingers:

3 Likes