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

mudlord
Senior Member
Posts: 306
Joined: Sun Feb 08, 2009 7:16 am

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

Post by mudlord »

SVN versions: from 156, previous versions worked okay

(under investigation what exactly broke this)

Notes:

  • Other emulators work just fine.
Last edited by mudlord on Thu Jan 22, 2009 4:28 am, edited 1 time in total.
mudlord
Senior Member
Posts: 306
Joined: Sun Feb 08, 2009 7:16 am

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

Post by mudlord »

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

Last edited by mudlord on Thu Mar 20, 2008 6:31 am, edited 1 time in total.
Dwedit
Junior Member
Posts: 19
Joined: Tue Mar 18, 2008 9:06 pm

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

Post by Dwedit »

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?

Last edited by Dwedit on Thu Apr 24, 2008 11:02 pm, edited 1 time in total.
mudlord
Senior Member
Posts: 306
Joined: Sun Feb 08, 2009 7:16 am

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

Post by mudlord »

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.

Dwedit
Junior Member
Posts: 19
Joined: Tue Mar 18, 2008 9:06 pm

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

Post by Dwedit »

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.

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

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

Post by Squall Leonhart »

Does that make it a protection mechanism then?

Dwedit
Junior Member
Posts: 19
Joined: Tue Mar 18, 2008 9:06 pm

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

Post by Dwedit »

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.

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

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

Post by Squall Leonhart »

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.

Dwedit
Junior Member
Posts: 19
Joined: Tue Mar 18, 2008 9:06 pm

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

Post by Dwedit »

Tried VisualBoyAdvance583.7z

Crashes within Goomba Color running Zelda Nayru.

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

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

Post by Squall Leonhart »

ok, yeah it does, i forgot to run it in Goomba lol

Post Reply