Coder Social home page Coder Social logo

apu: Add sound support about peanut-gb HOT 8 CLOSED

deltabeard avatar deltabeard commented on May 28, 2024
apu: Add sound support

from peanut-gb.

Comments (8)

deltabeard avatar deltabeard commented on May 28, 2024

WIP on apu branch. Currently passes dmg_sound/01-registers.gb test.
Next is length counters.

from peanut-gb.

deltabeard avatar deltabeard commented on May 28, 2024

A test build with blarrgs audio library is working. It did crash on a failed assertion though (lost three hours of gameplay because of it). It uses C++, so compiling everything and linking it all together was a pain. Not interested in using it.

from peanut-gb.

deltabeard avatar deltabeard commented on May 28, 2024

SDL2 example now uses blarrgs audio library for sound since commit 0ba5996.
As a workaround to the many asserts in blarrgs audio library, the SDL2 example now records the save file every minute.

I do not want to continue using blarrgs audio library due to the following issues:

  • It's not a single file header library like peanut_gb.h
  • It doesn't recover from certain issues, instead it uses asserts which abort the emulator.
  • It uses separate timing to the emulator. If this timing is only marginally off, then the sound will not be good. A feature like automatic sample rate change would be nice.
  • It's written in C++, and I only know C fluently.

So I'll keep this issue open.

from peanut-gb.

deltabeard avatar deltabeard commented on May 28, 2024

Got a segfault caused by blarrgs APU:

#0  0x0000557402a98ff7 in Blip_Synth<3, 210>::offset_resampled(unsigned long, int, Blip_Buffer*) const ()
#1  0x0000557402a98ed6 in Gb_Square::run(long, long) ()
#2  0x0000557402a98407 in Gb_Apu::run_until(long) ()
#3  0x0000557402a984b0 in Gb_Apu::end_frame(long) ()
#4  0x0000557402a975df in Basic_Gb_Apu::end_frame() ()
#5  0x0000557402a97123 in main (argc=2, argv=<optimized out>) at peanut_sdl.c:665

from peanut-gb.

deltabeard avatar deltabeard commented on May 28, 2024

Look at whether peanut_apu resolves this issue, or at least describe any changes required.

from peanut-gb.

deltabeard avatar deltabeard commented on May 28, 2024

Work being done on a 16-bit APU at https://github.com/deltabeard/Peanut-GB/tree/apu_s16

from peanut-gb.

deltabeard avatar deltabeard commented on May 28, 2024

Branch merged. f501adc

from peanut-gb.

deltabeard avatar deltabeard commented on May 28, 2024

The APU will remain separate to Peanut-GB. The 16-bit APU can be found in https://github.com/deltabeard/Peanut-GB/tree/master/examples/sdl2/minigb_apu .

from peanut-gb.

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.