Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2017-04-17 09:04:23

DevEd
New member
Registered: 2015-11-04
Posts: 9

DevSound - a Game Boy/Game Boy Color sound driver by DevEd

I've been planning on making a sound driver for quite a while, and now it's finally (mostly) done! There are still a few things I want to implement (such as vibrato), but it can theoretically be used for games and demoes at this point. It currently supports hardware and software volume envelopes (simultaneously even!), arpeggios, pulse width manipulation, and CH3 wave manipulation. DevSound is written entirely in ASM. (I'm not sure how easy it would be to convert to GBDK.)

Note that there are no tools to work with DevSound at this point in time, so I hope you like programming song data in hexadecimal! You're welcome to make tools to work with it, however.

Including DevSound in your project:
1. Get the source code from below.
2. Copy DevSound.asm, DevSound_Variables.asm, DevSound_Constants.asm, DevSound_Macros.asm, and DevSound_SongData.asm to your project folder.
3. Allocate a ROM bank for DevSound (make a note of the bank number, you may need it later). Include DevSound with the following line of code: include "DevSound.asm"
4. Add a call to DS_Play to your main loop.
5. In order to play a song, first load the desired song ID into A and then call DS_Load. Example:

Code:

ld a,3       ; song id = 3
call DS_Play ; load song

6. If you need to stop playback at any point, call DS_Stop.

Unfortunately, I do not have time to document how to write songs for DevSound. However, if you want to use DevSound for your project, I may be able to convert tunes you provide me, just let me know smile

Get the source here: https://github.com/DevEd2/DevSound
Demo ROM: http://devnet.sonicgamesdimension.net/DevSound.gb

Last edited by DevEd (2017-04-17 14:46:42)


You know, the DevSound guy.

Offline

 

#2 2017-04-17 18:31:13

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 183

Re: DevSound - a Game Boy/Game Boy Color sound driver by DevEd

You can interface asm from GBDK. Either by including source code (which has a different syntax) or by including a binary blob with fixed address entry points. Carillon uses the latter method.

You may want to look at the specification for the GBS file format to make your player easily compatible with it. The gist of it is that you should define three functions that (for example) a game can call. Init, for initial setup. Load for loading a new song. Play for playing one "tick" to be called for example at the end of VBlank.

ftp://ftp.modland.com/pub/documents/for … (.gbs).txt


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#3 2017-04-17 19:52:45

DevEd
New member
Registered: 2015-11-04
Posts: 9

Re: DevSound - a Game Boy/Game Boy Color sound driver by DevEd

Actually, the init and play routines are all that is needed in order to make a GBS file work properly. The "load" address is simply the location at which the driver+song data itself is loaded into memory.

That being said, I created a GBS file from DevSound prior to this thread, and it seems to work perfectly fine. Proof: http://devnet.sonicgamesdimension.net/D … BSTest.gbs

Note that the build script does not automatically make a GBS file at this point. It's on my todo list, however.

Last edited by DevEd (2017-04-17 19:55:02)


You know, the DevSound guy.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson