VBA-M Forums

Full Version: Broken/Messy Audio core - Dwedit's GBC emulator for GBA
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
SVN versions: from 156, previous versions worked okay
(under investigation what exactly broke this)
Notes:
* Other emulators work just fine.
Hmmmz...

Dwedit, it seems from 156, Spacy changed one line in DirectSound.cpp
Secondly, from 157, we added Shay Green's updated GB sound APU emulator....
Might need to run a couple of tests...
I think I'll take a look at this. How do I grab the SVN version and compile it?

edit: Hmmm... I don't have VC2008 (I'm still a VC6 user)

Okay, how exactly is the sound timing code supposed to work?
Quote:I think I'll take a look at this. How do I grab the SVN version and compile it?

Okay, you will need:

* zlib
* libpng
* the DX9 SDK
* NASM
* the OpenAL SDK (optional)

To do a MSVC compile, you simply link against the needed dependancies when you compile with the projects. However, for a SDL build compile you need to use the main makefile "Makefile", with GNU make.

Quote:Okay, how exactly is the sound timing code supposed to work?

If you look in Sound.cpp, blargg wrote a class to handle GBA PCM audio. Which might be related to your problem, from my deductions as to where it broke.

As for the timing, blargg wrote the sample handling code class, so once I have a chat to him about his code, then we really might tackle this, as he knows exactly how his Blip_Buffer works, which is a component of his class.
I know that the Zelda oracles games write 0x80 to one of the GBC sound registers (forgot which one), then immediately reads it back to see if its value is 0x80. If it's not, it crashes.
Does that make it a protection mechanism then?
No. It just writes to a sound register (I think it's to turn on the speakers, not completely sure), then reads it back to make sure the speakers are on. It freezes if it doesn't read back 0x80.
Works on hardware, fails in the current timing nightmare of VBA's sound code.
Dwedit, can you retest this?, i've been playing the Oracles games for the past 4 days and theres been no issues, other then the fact CGB audio state isn't reloaded with a savestate.
Tried VisualBoyAdvance583.7z
Crashes within Goomba Color running Zelda Nayru.
ok, yeah it does, i forgot to run it in Goomba lol
I think this is indicating that theres a GBA audio issue?
Writes to sound register, tries to read value back, sounds like the next minor issue to be fixed. I didn't want to rip out VBA's current sound register read/write code, so I just left its mess as-is. Looks like I need to rewrite it properly.
that seems to be the unfortunate case,

Well, its not something of an emergency priority, so as always, whenever you feel like working on it.
(01-08-2009 08:54 PM)blargg Wrote: [ -> ]Writes to sound register, tries to read value back, sounds like the next minor issue to be fixed. I didn't want to rip out VBA's current sound register read/write code, so I just left its mess as-is. Looks like I need to rewrite it properly.

Ok, more issues with corrupt audio are starting to be found in games.

Some things which maybe related to the messy audio core

*Mother 3 Main menu music speedup.
*Telefang 2 write/read issues.
Reference URL's