Skip to content

GBS audio importing #925

Closed Answered by martendo
TheEssem asked this question in Q&A
Discussion options

You must be logged in to vote

I've never really touched GBS, but this is what I think you'd need to do:

You'd need to disassemble the GBS file and replace all addresses in it with "shiftable" labels so that no variables or subroutine addresses would clash with those used in your project. Unless you don't use any of the same RST vectors as the GBS does, they need to be moved, and rsts replaced with calls as necessary. Removing the header may also be desirable.

To actually play the music, you need to look at what's in the file's header. Here's a specification of the file format: https://ocremix.org/info/GBS_Format_Specification

Call the "INIT" function (pointer at $0008 of the GBS file) with the desired song number in t…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by TheEssem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants