Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on the structure of lsdj.s #3

Open
merumerutho opened this issue Jul 2, 2019 · 3 comments
Open

on the structure of lsdj.s #3

merumerutho opened this issue Jul 2, 2019 · 3 comments

Comments

@merumerutho
Copy link

This is not an actual issue, more of a request of documentation.
I would like to try to port the lsdj player to GBA.
AFAIK, GBA has the same audio registers of GB/GBC plus some additional ones.

From my understanding, lsdpack translated lsdj music into cpu registers read from an emulator, those values are saved and the player on a ROM proceeds to play back the values copying them to the register.
It should be possible to play back the registers on GBA rewriting a routine for ARM (maybe even C could be suitable, if it's not too slow?), maybe even adding the compression, but I'm trying to figure out the starting register address, the order and the correspondance of the register values written in the "lsdj.s" file.

If there could be some kind of documentation on the structure of the lsdj.s file, or how many and which the addresses are I would be glad since I can't figure them out neither from the player routines (I'm not familiar with assembly, at least for now), nor from the writer.cpp file (I clearly see where it writes, I just don't understand from which addresses).

@merumerutho merumerutho changed the title Registers writing order on the structure of lsdj.s Jul 2, 2019
@jkotlinski
Copy link
Owner

Hi! Great idea!
lsdpack records writes to the sound addresses ($ff10-$ff3f) plus some special events, when LYC happens (for timing), and when a song starts or stops. Samples are encoded also specially. The actual waveforms are written first and later those samples are refered to.
I am struggling how to document in a way that is easier than just reading the code in writer.cpp , if you have specific questions I can try to answer.

A reference of Game Boy sound can be found if you search internet for "gbspec.txt"

@cyberic99
Copy link
Contributor

What I find hard is how to handle timing in the replayer code. It is hard to sync to the LYC if you try to replay on a platform where there is no LYC ;-)

@jkotlinski, would it be possible to include timing information, by adding comments to the .s file?

@merutochan I think you should alter writer.cpp to output in another format, for instance a C-array

@jkotlinski
Copy link
Owner

jkotlinski commented Jul 5, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants