Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/debug.h b/src/debug.h
- index 6e101a6..75d9502 100644
- --- a/src/debug.h
- +++ b/src/debug.h
- @@ -174,7 +174,7 @@ typedef struct
- void (*SetGraphicsDecode)(MDFN_Surface *surface, int line, int which, int xscroll, int yscroll, int pbn);
- void (*SetLogFunc)(void (*logfunc)(const char *type, const char *text));
- -
- + void (*MuteChannel)(uint8 chan);
- // Game emulation code shouldn't touch these directly.
- std::vector<AddressSpaceType> *AddressSpaces;
- std::vector<RegGroupType*> *RegGroups;
- diff --git a/src/drivers/debugger.cpp b/src/drivers/debugger.cpp
- index 1cf404c..a8da6e0 100644
- --- a/src/drivers/debugger.cpp
- +++ b/src/drivers/debugger.cpp
- @@ -1486,6 +1486,29 @@ void Debugger_GT_Event(const SDL_Event *event)
- default: break;
- }
- }
- + else if(event->key.keysym.mod & KMOD_SHIFT)
- + {
- + switch(event->key.keysym.sym)
- + {
- + if (CurGame->Debugger->MuteChannel)
- + {
- + case SDLK_1: CurGame->Debugger->MuteChannel(0);
- + break;
- + case SDLK_2: CurGame->Debugger->MuteChannel(1);
- + break;
- + case SDLK_3: CurGame->Debugger->MuteChannel(2);
- + break;
- + case SDLK_4: CurGame->Debugger->MuteChannel(3);
- + break;
- + case SDLK_5: CurGame->Debugger->MuteChannel(4);
- + break;
- + case SDLK_6: CurGame->Debugger->MuteChannel(5);
- + break;
- + }
- +
- + default: break;
- + }
- + }
- }
- if(WhichMode == 1)
- diff --git a/src/hw_sound/pce_psg/pce_psg.cpp b/src/hw_sound/pce_psg/pce_psg.cpp
- index 8217bdf..d6afcbf 100644
- --- a/src/hw_sound/pce_psg/pce_psg.cpp
- +++ b/src/hw_sound/pce_psg/pce_psg.cpp
- @@ -291,6 +291,16 @@ uint32 PCE_PSG::GetRegister(const unsigned int id, char *special, const uint32 s
- return(value);
- }
- +void PCE_PSG::MuteChannel(uint8 chan)
- +{
- + uint32 val = 0;
- + if (channel_mute & (1<<chan))
- + val = 0xFF;
- + channel[chan].balance = val & 0xFF;
- + //SetRegister(PSG_GSREG_CH0_BALANCE | (channel << 8), 0);
- + channel_mute ^= (1<<chan);
- +}
- +
- void PCE_PSG::SetRegister(const unsigned int id, const uint32 value)
- {
- @@ -333,7 +343,8 @@ void PCE_PSG::SetRegister(const unsigned int id, const uint32 value)
- break;
- case PSG_GSREG_CH0_BALANCE:
- - channel[ch].balance = value & 0xFF;
- + if (!(channel_mute & (1<<ch)))
- + channel[ch].balance = value & 0xFF;
- break;
- case PSG_GSREG_CH0_WINDEX:
- @@ -434,6 +445,8 @@ PCE_PSG::PCE_PSG(int32* hr_l, int32* hr_r, int want_revision)
- channel[ch].lastts = 0;
- }
- + channel_mute = 0;
- +
- SetVolume(1.0); // Will build dbtable in the process.
- Power(0);
- }
- @@ -531,7 +544,8 @@ void PCE_PSG::Write(int32 timestamp, uint8 A, uint8 V)
- case 0x05: /* Channel balance */
- if(select > 5) return; // no more than 6 channels, silly game.
- - ch->balance = V;
- + if (!(channel_mute & (1<<select)))
- + ch->balance = V;
- vol_pending = true;
- break;
- diff --git a/src/hw_sound/pce_psg/pce_psg.h b/src/hw_sound/pce_psg/pce_psg.h
- index 4405ac3..af471b3 100644
- --- a/src/hw_sound/pce_psg/pce_psg.h
- +++ b/src/hw_sound/pce_psg/pce_psg.h
- @@ -129,6 +129,8 @@ class PCE_PSG
- PCE_PSG(int32* hr_l, int32* hr_r, int want_revision);
- ~PCE_PSG();
- + void MuteChannel(const uint8 chan);
- +
- void StateAction(StateMem *sm, const unsigned load, const bool data_only);
- void Power(const int32 timestamp);
- @@ -166,6 +168,7 @@ class PCE_PSG
- void RecalcNoiseFreqCache(int chnum);
- void RunChannel(int chc, int32 timestamp, bool LFO_On);
- + uint8 channel_mute; /* bit flags */
- uint8 select; /* Selected channel (0-5) */
- uint8 globalbalance; /* Global sound balance */
- uint8 lfofreq; /* LFO frequency */
- diff --git a/src/pce/debug.cpp b/src/pce/debug.cpp
- index 1021b11..4f0712e 100644
- --- a/src/pce/debug.cpp
- +++ b/src/pce/debug.cpp
- @@ -1116,6 +1116,7 @@ DebuggerInfoStruct PCEDBGInfo =
- GetBranchTrace,
- SetGraphicsDecode,
- PCEDBG_SetLogFunc,
- + PCEDBG_MuteChannel,
- };
- static void Cleanup(void)
- @@ -1127,6 +1128,11 @@ static void Cleanup(void)
- }
- }
- +void PCEDBG_MuteChannel(uint8 chan)
- +{
- + psg->MuteChannel(chan);
- +}
- +
- void PCEDBG_Kill(void)
- {
- Cleanup();
- diff --git a/src/pce/debug.h b/src/pce/debug.h
- index 792b855..14bf4c1 100644
- --- a/src/pce/debug.h
- +++ b/src/pce/debug.h
- @@ -7,7 +7,7 @@
- namespace MDFN_IEN_PCE
- {
- -
- +void PCEDBG_MuteChannel(uint8 channel);
- void PCEDBG_MachineStateChanged(void);
- void PCEDBG_FlushBreakPoints(int type);
Advertisement
Add Comment
Please, Sign In to add comment