RepositoryC++SESweden
JK

jkotlinski/lsdpack

Standalone LSDj recorder+player

149stars
20forks
8issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: gbs

#1 Repository of the week

1
TINIX TRENDING·Topic: lsdj

#1 Repository of the week

3
TINIX TRENDING·Topic: game-boy

#3 Repository of the week

lsdpack

Records LSDj songs for .gbs conversion or use in stand-alone Game Boy ROMs. (E.g. your own music albums, demos, games...)

Building

Requires CMake, RGBDS and a C++ compiler. Exact build steps are platform dependent - see Running CMake

C++ CI with CMake C++ CI with CMake

Recording Songs

All songs must first be prepared so that they eventually stop with the HFF command. Place your .sav and .gb file in the same directory and run e.g. ./lsdpack.exe lsdj.gb to record the songs to lsdj.s. To record songs from several .gb files, add them all to the command line, like ./lsdpack.exe 1.gb 2.gb 3.gb.

Game Boy Sound System (GBS)

Create .gbs files using the commands below. For compatibility reasons, .gbs files should be below 512 kB, so each .gbs file will contain one song only.

# dump songs
./lsdpack.exe -g lsdj.gb

# assemble player
rgbasm -o player.o player.s

# assemble songs individually
rgbasm -o lsdj-1.o lsdj-1.s
rgbasm -o lsdj-2.o lsdj-2.s
...

# make one .gb file for each song
rgblink -o player-1.gb player.o lsdj-1.o
rgblink -o player-2.gb player.o lsdj-2.o
...

# create the final .gbs files, one by one
./makegbs.exe -t "Better Off Alone" -a "Alice Deejay" -c "(C) Violent Music 1997" player-1.gb
...

Playing Songs from Your Own Code

An example Game Boy player ROM can be built using RGBDS:

rgbasm -o boot.o boot.s
rgbasm -o player.o player.s
rgbasm -o lsdj.o lsdj.s
rgblink -o player.gb boot.o player.o lsdj.o
rgbfix -v -m 0x19 -p 0xff player.gb

player.s

Contains the player code. Following symbols are exported:

; IN: a = song number
; OUT: -
; SIDE EFFECTS: trashes af
;
; Starts playing a song. If a song is already playing,
; make sure interrupts are disabled when calling this.
;
LsdjPlaySong::

; IN: -
; OUT: -
; SIDE EFFECTS: changes ROM bank, trashes af
;
; Call this six times per screen update,
; evenly spread out over the screen.
;
LsdjTick::

; A table that holds the ROM position for each song.
; Each entry is 4 bytes big.
SongLocations::
SongLocationsEnd::

boot.s

An example for how to use the player. Displays CPU usage using raster bars. Pressing A skips to the next song.

Screenshot

How Does It Work?

lsdpack plays back LSDj songs using an emulated Game Boy Color and records direct writes to the sound chip. This recording can be played back from another ROM using a custom player.

The included player is very fast and can easily play songs that would choke LSDj on a Game Boy Classic. Since recordings take a lot of ROM, an MBC5 cartridge is recommended.

ROM+CPU consumption varies with song contents. Features like sample playback or FAST/DRUM P and V commands are especially demanding, since they update the sound chip 360 times/second.

To reduce CPU consumption and interfere less with game logic and graphics, it can help to batch up player calls. Examples:

  • Full speed (default): Call player six times/frame, evenly spaced out. Allows ~11 kHz sample playback ("1x" sample speed).
  • Half speed: Make two player calls in a row, three times/frame. Allows ~6 kHz sample playback ("0.5x" sample speed).
  • Normal speed: Make six player calls in a row, once a frame from VBL interrupt. Useful if sample playback is not needed.

Similar Projects

Discover other similar projects and AI models.

RepositoryC
mmitch/gbsplay

Game Boy sound player

124
Nov 9, 2026
RepositoryC++
gbdev/rgbds

Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color

1.7k
Nov 29, 2026
RepositoryC++
drhelius/Gearboy

Game Boy / Game Boy Color / Super Game Boy emulator and debugger with embedded MCP server for macOS, Windows, Linux, BSD and RetroArch.

1.2k
Nov 27, 2026
RepositoryC++
Zal0/ZGB

Game Boy / Color engine with lots of features

794
Aug 1, 2024
RepositoryC++
drhelius/arduinogameboy

Arduino based Game Boy cartridge reader and writer. It can dump ROM and RAM to SD card.

171
Dec 13, 2023
RepositoryC++
adwuard/TrackerKB

Tracker Keyboard. A Dirtywave M8 Headless Build

129
Jan 3, 2025
RepositoryC
mgba-emu/mgba

mGBA Game Boy Advance Emulator

7.6k
Nov 30, 2026
RepositoryKotlin
Swordfish90/Lemuroid

All in one emulator on Android!

4.6k
Nov 24, 2026
RepositoryRust
Gekkio/mooneye-gb

A Game Boy research project and emulator written in Rust

967
Mar 16, 2023