Giter Site home page Giter Site logo

Support LSDj 9.2.0+ about lsdpack HOT 4 OPEN

jkotlinski avatar jkotlinski commented on June 18, 2024 3
Support LSDj 9.2.0+

from lsdpack.

Comments (4)

binarycounter avatar binarycounter commented on June 18, 2024

Heyo! Thanks for making LSDj and this tool!
I'd love to get 9.2.0+ support working to include music in a SGB demo.

I made a quick change to lsdpack.cpp and some libgambatte files to basically replace the LCD Interrupt handler with a Timer interrupt handler, changing otherwise nothing.

I've then recorded a 9.3.3 tune in DMG mode (because CGB has double speed timers, halving the song tempo in the player) and built the example boot.s.

Sample / wavetable playback is a bit scratchy (player.s probably needs to be updated with improved wave swap routine) but otherwise the song seems to play fine. If i can get the wave channel playing nicely, would you be interested in a pull request?

from lsdpack.

jkotlinski avatar jkotlinski commented on June 18, 2024

from lsdpack.

binarycounter avatar binarycounter commented on June 18, 2024

Awesome, thank you. I have forked the repository and pushed my changes of lsdpack. Will pull request later once i think it's finished.

The way I am currently handling compatibility with older versions is to check the version number in the GB header of the ROM and decide which interrupts to capture based on that, with optional command-line flags to override the auto-detection.
I have not tested v4 specifically, but compatibility should remain identical with previous lsdpack versions, unless someone edited the ROM header (then they would need to use the command-line flag to force <9.1.C mode).
Note: I moved setting the interrupt handler inside load_gb to be able to do it on a per-ROM basis, so you could mix old and new versions.

Sample playback is actually not that bad, I'm just noticing more crackling as the player swaps out the wave. Looking at recordings it seems like newer LSDj versions have a much more graceful way of swapping waves, which doesn't cause such a noticable audio spike. Definitely seeing some differences stepping through the code. It seems faster overall (putting the data on the stack and then pop-sliding it). I will investigate later. If you have any pointers of where I should be looking at, please let me know.

The test file i'm currently using ends up being 328k big, so I'd love to also look into compression like you mentioned. A few days ago I've experimented with implementing a LZ77/78 style compression scheme (for another playback routine) that works on a command basis rather than byte basis . Rather than needing to compress and decompress the data, it relies on the routine's loop and referencing commands to deduplicate data, so other than some pointer manipulation it's fairly light on the CPU. I got decent results there, and will look into getting it working for this too.

Sorry for the long read :)

from lsdpack.

jkotlinski avatar jkotlinski commented on June 18, 2024

from lsdpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.