Commits

spencercw committed cd9a53a

#25 Update the sound channel 3 output volume on demand.

This fixes the bug with the 'Pikachu' sound not playing in Pokemon Yellow.

  • Participants
  • Parent commits f54c749

Comments (0)

Files changed (2)

File gb_emulator/include/gb_emulator/gb_sound.hpp

 #include <boost/shared_ptr.hpp>
 
 class Gb;
+class GbMemory;
 class GbSoundData;
 class SndfileHandle;
 
 //! GameBoy sound output emulator.
 class GbSound
 {
+	friend class GbMemory;
+
 public:
 	//! Constructor; sets the associated emulator container.
 	GbSound(Gb &gb);

File gb_emulator/src/gb_memory.cpp

 		ioPorts[ptr] = val & 0xc7;
 		break;
 
+	// Sound mode 3
+	case NR32:
+		ioPorts[ptr] = val & 0x60;
+		gb_.sound_.outLevel3_ = ioPorts[ptr] >> 5;
+		break;
+
 	// Sound mode 5; sound on/off
 	case NR52:
 		ioPorts[ptr] |= val & 0x80;