All Projects → SuperDisk → hUGEDriver

SuperDisk / hUGEDriver

Licence: other
An easy-to-use, fast, tracker-based, public domain sound driver for Game Boy homebrew

Programming Languages

assembly
5116 projects
c
50402 projects - #5 most used programming language
pascal
1382 projects

Projects that are alternatives of or similar to hUGEDriver

Lazyboy
An EDSL implemented in Haskell for programming the Nintendo Game Boy.
Stars: ✭ 44 (+69.23%)
Mutual labels:  homebrew, gameboy
Evoland.gb
A fan-made demake of Evoland on GameBoy
Stars: ✭ 24 (-7.69%)
Mutual labels:  homebrew, gameboy
Vba M Nx
WIP full featured port of VBA-M for Nintendo Switch
Stars: ✭ 11 (-57.69%)
Mutual labels:  homebrew, gameboy
Gb303
GB303 wavetable-based TB-303 style synthesizer for the Nintendo Gameboy.
Stars: ✭ 80 (+207.69%)
Mutual labels:  homebrew, gameboy
Gbdk playground
Simplified GBDK examples
Stars: ✭ 100 (+284.62%)
Mutual labels:  homebrew, gameboy
tobutobugirl-dx
An arcade platformer homebrew game for the Game Boy, Game Boy Color and Super Game Boy
Stars: ✭ 58 (+123.08%)
Mutual labels:  homebrew, gameboy
Tobutobugirl
An arcade platformer homebrew game for the Game Boy
Stars: ✭ 243 (+834.62%)
Mutual labels:  homebrew, gameboy
libusbhsfs
USB Mass Storage Class Host + Filesystem Mounter static library for Nintendo Switch homebrew applications.
Stars: ✭ 81 (+211.54%)
Mutual labels:  homebrew, driver
boozer
Kegerator Monitoring Platform. RPi + Docker + Beer + Metrics + Slack. k3s kubernetes friendly.
Stars: ✭ 93 (+257.69%)
Mutual labels:  homebrew
dotnet-arangodb
.NET Driver for ArangoDB
Stars: ✭ 52 (+100%)
Mutual labels:  driver
libDaisy
Hardware Library for the Daisy Audio Platform
Stars: ✭ 164 (+530.77%)
Mutual labels:  sound
Goodboy
A pure OCaml Gameboy emulator
Stars: ✭ 75 (+188.46%)
Mutual labels:  gameboy
3ds
Javascript front-end to the titledb API
Stars: ✭ 12 (-53.85%)
Mutual labels:  homebrew
gimp-tilemap-gb
Tilemap GB - Console App - AND - GIMP plugin for importing & exporting Game Boy game tilemaps and tilesets (as bitmap images or .GBM/.GBR files. Related tools: GBTD, GBMB, GBDK, Zal0-ZGB)
Stars: ✭ 42 (+61.54%)
Mutual labels:  gameboy
goboy
Playing GameBoy Emulation in GoLang (ported from https://github.com/racerxdl/GameBoyEmulator)
Stars: ✭ 37 (+42.31%)
Mutual labels:  gameboy
fuerte
Low Level C++ Driver for ArangoDB
Stars: ✭ 41 (+57.69%)
Mutual labels:  driver
roboto-demo
Game Boy demo for Skrolli Party 2017.
Stars: ✭ 24 (-7.69%)
Mutual labels:  gameboy
dotfiles
~nickTD
Stars: ✭ 13 (-50%)
Mutual labels:  homebrew
dotfiles
The Dotfiles resources aggregate a collection of standalone 'dotfiles' to help you customize your system and related services into one cohesive and consistent approach.
Stars: ✭ 17 (-34.62%)
Mutual labels:  homebrew
fdb
Firebird Driver for Python
Stars: ✭ 49 (+88.46%)
Mutual labels:  driver

hUGEDriver

This is the repository for hUGEDriver, the music driver for the Game Boy which plays music created in hUGETracker.

If you want help using the tracker, driver, or just want to chat, join the hUGETracker Discord server!

Quick start (RGBDS)

  1. Export your song in "RGBDS .asm" format in hUGETracker.
  2. Choose a song descriptor name. This is what you will refer to the song as in your code. It must be a valid RGBDS symbol.
  3. Place the exported .asm file in your RGBDS project.
  4. Load hl with your song descriptor name, and call hUGE_init
  5. In your game's main loop or in a VBlank interrupt, call hUGE_dosound
  6. When assembling your game, be sure to specify your music file and hUGEDriver.asm in your call to rgbasm/rgblink!

Be sure to enable sound playback before you start!

ld a, $80
ld [rAUDENA], a
ld a, $FF
ld [rAUDTERM], a
ld a, $77
ld [rAUDVOL], a

See the rgbds_example directory for a working example!

Quick start (GBDK)

  1. Export your song in "GBDK .c" format in hUGETracker.
  2. Choose a song descriptor name. This is what you will refer to the song as in your code. It must be a valid C variable name.
  3. Place the exported .C file in your GBDK project.
  4. #include "hUGEDriver.h" in your game's main file
  5. Define extern const hUGESong_t your_song_descriptor_here in your game's main file
  6. Call hUGE_init(&your_song_descriptor_here) in your game's main file
  7. In your game's main loop or in a VBlank interrupt, call hUGE_dosound
  8. When compiling your game, be sure to specify your music file and hUGEDriver.o in your call to lcc!

Be sure to enable sound playback before you start!

NR52_REG = 0x80;
NR51_REG = 0xFF;
NR50_REG = 0x77;

See gbdk_example/gbdk_player_example.c for a working example!

Note: hUGEDriver is assembled by RGBDS into a .obj file, and then is converted to GBDK's format using rgb2sdas (in the gbdk_example folder). Be sure to assemble and link this object with your game (check gbdk_example/build.bat for the steps).

Usage

This driver is suitable for use in homebrew games. hUGETracker exports data representing the various components of a song, as well as a song descriptor which is a small block of pointers that tell the driver how to initialize and play a song.

hUGETracker can export the data and song descriptor as a .asm or .c for use in RGBDS or GBDK based projects, respectively. Playing a song is as simple as calling hUGE_init with a pointer to your song descriptor, and then calling hUGE_dosound at a regular interval (usually on VBlank, the timer interrupt, or simply in your game's main loop)

In assembly:

ld hl, SONG_DESCRIPTOR
call hUGE_init

;; Repeatedly
call hUGE_dosound

In C:

extern const hUGESong_t song;

// In your initializtion code
__critical {
    hUGE_init(&song);
    add_VBL(hUGE_dosound);
}

Check out player.asm for a full fledged example of how to use the driver in an RGBDS project, and gbdk_example/gbdk_player_example.c for usage with GBDK C likewise.

hUGE_mute_channel

Caution: As an optimization, hUGEDriver avoids loading the same wave present in wave RAM; when "muting" CH3 and loading your own wave, make sure to set hUGE_current_wave to hUGE_NO_WAVE (a dummy value) to force a refresh.

Routines

TODO

Files in this repo

File Explanation
hUGEDriver.asm The driver itself.
song.asm A template used to create a song descriptor for use by the driver.
player.asm Some example code that illustrates how to initialize and use the driver. Also used by hUGETracker to preview music.
gbs.asm Used by hUGETracker to build GBS soundtrack files.
gbdk_example/hUGEDriver.h A C header that allows for usage of hUGEDriver in GBDK projects.
include/constants.inc Some note constant values. These values are mapped to actual frequency/periods in music.inc
include/music.inc A table that maps the note constants (byte size) to periods that can be fed into the hardware registers (word size)
doc/driver-format.txt A text file explaining the layout of parts of the driver, and what formats are expected by certain routines.

License

hUGETracker and hUGEDriver are dedicated to the public domain.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].