Jump to content
Visual Boy Advance-M
mudlord

Broken/Messy Audio core - Dwedit's GBC emulator for GBA

Recommended Posts

SVN versions: from 156, previous versions worked okay

(under investigation what exactly broke this)

Notes:

* Other emulators work just fine.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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.

 

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×