agbrs / agb

Library for writing Game Boy Advance games in Rust
https://agbrs.dev/
Mozilla Public License 2.0
319 stars 27 forks source link

Update tracker to support PatternBreak and PositionJump #748

Closed wysiwys closed 3 months ago

wysiwys commented 3 months ago

Hi,

This pull request adds support for pattern breaks and position jumps to the music tracker module. This PR only adds functionality for XM input files for now. However, these changes would also be applicable to other types of music modules, such as Amiga modules.

In agb-xm-core:

In agb-tracker-interop:

In agb-tracker:

Glad for any feedback or discussion on this feature!

gwilymk commented 3 months ago

From a quick look, looks really great! I'll take a proper look and test it once the GMTK game jam is over. Sorry, been a bit busy lately with the gba jam, the gmtk jam and personal things :)

wysiwys commented 3 months ago

Sounds great, and good luck with the game jams :)

gwilymk commented 3 months ago

Awesome. I've had a look through and looks great! I'm impressed you managed to understand the xm parser code, because that in an absolute mess :joy:. Definitely needs some cleaning up at some point since when I started working on it I had no idea what I was getting myself into :P.

wysiwys commented 3 months ago

Hi, thanks for the feedback - glad you liked how the feature turned out!

I actually found the xm parser code was clearly structured. I also think the unified agb tracker format is great and a smart way to deal with space and performance constraints. Maybe what you mean is that the xm parser has one long function parse_module() that contains all of the parser logic. But I think that identifying and splitting out the functionality that is shared between Amiga MOD/XM files would already naturally break up the parser into modular chunks.

I'll try to get a working Amiga parser going and add findings to #742