From a73dd21ee983862388d6eeafb260da4694472873 Mon Sep 17 00:00:00 2001 From: omegadox Date: Wed, 15 Jul 2009 21:26:49 +0000 Subject: [PATCH] Some minor changes to VideoCommon, improved SawWave sound, the denied sound in ZWW sounds better (compared it to real HW to be sure). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3810 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/BPMemory.h | 10 +++++----- Source/Core/VideoCommon/Src/BPStructs.cpp | 13 ++++++++----- Source/Core/VideoCommon/Src/OpcodeDecoding.cpp | 1 + .../Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp | 7 +++++-- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Source/Core/VideoCommon/Src/BPMemory.h b/Source/Core/VideoCommon/Src/BPMemory.h index f58962f1d2..7478d3579c 100644 --- a/Source/Core/VideoCommon/Src/BPMemory.h +++ b/Source/Core/VideoCommon/Src/BPMemory.h @@ -62,13 +62,13 @@ #define BPMEM_COPYFILTER1 0x54 #define BPMEM_CLEARBBOX1 0x55 #define BPMEM_CLEARBBOX2 0x56 -// what about 0x57? +#define BPMEM_UNKOWN_57 0x57 #define BPMEM_UNKNOWN 0x58 #define BPMEM_SCISSOROFFSET 0x59 -#define BPMEM_UNKNOWN1 0x60 -#define BPMEM_UNKNOWN2 0x61 -#define BPMEM_UNKNOWN3 0x62 -#define BPMEM_UNKNOWN4 0x63 +#define BPMEM_UNKNOWN_60 0x60 +#define BPMEM_UNKNOWN_61 0x61 +#define BPMEM_UNKNOWN_62 0x62 +#define BPMEM_UNKNOWN_63 0x63 #define BPMEM_LOADTLUT0 0x64 #define BPMEM_LOADTLUT1 0x65 #define BPMEM_TEXINVALIDATE 0x66 diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index c9c2cfc2ab..4b2df5d4a9 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -379,10 +379,13 @@ void BPWritten(const Bypass& bp) PanicAlert("Unknown is not 0xF! val = 0x%08x", bp.newvalue); break; - case BPMEM_UNKNOWN1: - case BPMEM_UNKNOWN2: - case BPMEM_UNKNOWN3: - case BPMEM_UNKNOWN4: + case BPMEM_UNKOWN_57: // Sunshine uses this: 0xAAA, 0x000, over and over, copy filter related? + break; + + case BPMEM_UNKNOWN_60: + case BPMEM_UNKNOWN_61: + case BPMEM_UNKNOWN_62: + case BPMEM_UNKNOWN_63: // Cases added due to: http://code.google.com/p/dolphin-emu/issues/detail?id=360#c90 // Are these related to BBox? break; @@ -588,7 +591,7 @@ void BPWritten(const Bypass& bp) case BPMEM_TEV_ALPHA_ENV+32: break; default: - WARN_LOG(VIDEO, "Unknown Bypass opcode: address = 0x%08x value = 0x%08x", bp.address, bp.newvalue); + WARN_LOG(VIDEO, "Unknown BP opcode: address = 0x%08x value = 0x%08x", bp.address, bp.newvalue); break; } diff --git a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp index 9342c3e7df..d0b8bb7ece 100644 --- a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp @@ -257,6 +257,7 @@ static void Decode() break; case 0x44: + DEBUG_LOG(VIDEO, "GX 0x44: %08x", Cmd); // zelda 4 swords calls it and checks the metrics registers after that break; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp index 7c7dc96587..e20cb38c04 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp @@ -15,6 +15,8 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ +#include + #include "../Globals.h" #include "UCodes.h" #include "UCode_Zelda.h" @@ -95,10 +97,11 @@ _lRestart: void CUCode_Zelda::RenderSynth_SawWave(ZeldaVoicePB &PB, s32* _Buffer, int _Size) { - s32 ratio = PB.RatioInt * 2; + s32 ratio = (s32)ceil((float)PB.RatioInt / 3); s64 pos = PB.CurSampleFrac; - for (int i = 0; i < 0x50; i++) { + for (int i = 0; i < _Size; i++) + { pos += ratio; _Buffer[i] = pos & 0xFFFF; }