From 3092c34681495ec027905ec6f8deb35a34440060 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Tue, 30 Jun 2020 18:26:44 +0200 Subject: [PATCH 1/4] src: Add `#include ` where appropriate in order to have `NULL`/`size_t` and others from the proper header Signed-off-by: Gabriel Ravier --- src/BossFrog.cpp | 2 ++ src/BossIronH.cpp | 2 ++ src/BossPress.cpp | 2 ++ src/BossTwinD.cpp | 2 ++ src/BulHit.cpp | 2 ++ src/Bullet.cpp | 1 + src/Ending.cpp | 1 + src/MyChar.cpp | 1 + src/MycParam.cpp | 1 + src/NpcAct120.cpp | 1 + src/NpcAct240.cpp | 2 ++ src/Sound.cpp | 1 + src/TextScr.cpp | 1 + 13 files changed, 19 insertions(+) diff --git a/src/BossFrog.cpp b/src/BossFrog.cpp index 24f1f41e..2a8dc8e4 100644 --- a/src/BossFrog.cpp +++ b/src/BossFrog.cpp @@ -1,5 +1,7 @@ #include "BossFrog.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" diff --git a/src/BossIronH.cpp b/src/BossIronH.cpp index e1cc4998..d845a9db 100644 --- a/src/BossIronH.cpp +++ b/src/BossIronH.cpp @@ -1,5 +1,7 @@ #include "BossIronH.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" diff --git a/src/BossPress.cpp b/src/BossPress.cpp index 63edd596..1636d009 100644 --- a/src/BossPress.cpp +++ b/src/BossPress.cpp @@ -1,5 +1,7 @@ #include "BossPress.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" diff --git a/src/BossTwinD.cpp b/src/BossTwinD.cpp index 5e9cac15..849093d0 100644 --- a/src/BossTwinD.cpp +++ b/src/BossTwinD.cpp @@ -1,5 +1,7 @@ #include "BossTwinD.h" +#include + #include "WindowsWrapper.h" #include "Boss.h" diff --git a/src/BulHit.cpp b/src/BulHit.cpp index 065d8659..e9524af0 100644 --- a/src/BulHit.cpp +++ b/src/BulHit.cpp @@ -1,5 +1,7 @@ #include "BulHit.h" +#include + #include "Bullet.h" #include "Caret.h" #include "Game.h" diff --git a/src/Bullet.cpp b/src/Bullet.cpp index c7157f85..c6d3fb4d 100644 --- a/src/Bullet.cpp +++ b/src/Bullet.cpp @@ -1,5 +1,6 @@ #include "Bullet.h" +#include #include #include "WindowsWrapper.h" diff --git a/src/Ending.cpp b/src/Ending.cpp index 0d3dfe7e..ac7cec78 100644 --- a/src/Ending.cpp +++ b/src/Ending.cpp @@ -1,5 +1,6 @@ #include "Ending.h" +#include #include #include #include diff --git a/src/MyChar.cpp b/src/MyChar.cpp index 035f9407..b477006f 100644 --- a/src/MyChar.cpp +++ b/src/MyChar.cpp @@ -1,5 +1,6 @@ #include "MyChar.h" +#include #include #include "WindowsWrapper.h" diff --git a/src/MycParam.cpp b/src/MycParam.cpp index fbc032b3..76f8f55a 100644 --- a/src/MycParam.cpp +++ b/src/MycParam.cpp @@ -1,5 +1,6 @@ #include "MycParam.h" +#include #include #include "WindowsWrapper.h" diff --git a/src/NpcAct120.cpp b/src/NpcAct120.cpp index 68e37bf5..df019784 100644 --- a/src/NpcAct120.cpp +++ b/src/NpcAct120.cpp @@ -1,5 +1,6 @@ #include "NpcAct.h" +#include #include #include "WindowsWrapper.h" diff --git a/src/NpcAct240.cpp b/src/NpcAct240.cpp index 902f1d8d..3d3120f4 100644 --- a/src/NpcAct240.cpp +++ b/src/NpcAct240.cpp @@ -1,5 +1,7 @@ #include "NpcAct.h" +#include + #include "WindowsWrapper.h" #include "Caret.h" diff --git a/src/Sound.cpp b/src/Sound.cpp index c98a3606..40f1ff93 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -13,6 +13,7 @@ equivalents. #include "Sound.h" #include +#include #include #include #include diff --git a/src/TextScr.cpp b/src/TextScr.cpp index 0a434fe8..d7d6fe00 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -1,5 +1,6 @@ #include "TextScr.h" +#include #include #include #include From bede1a16f55a76b37085bbbc008ef62128b1402b Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Tue, 30 Jun 2020 23:48:34 +0200 Subject: [PATCH 2/4] src/Sound.cpp: Remove duplicate stddef.h include Signed-off-by: Gabriel Ravier --- src/Sound.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Sound.cpp b/src/Sound.cpp index 43be7281..1ea8e196 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -12,7 +12,6 @@ equivalents. #include "Sound.h" -#include #include #include #include From 5983b8e2341196cd55b9dfb6411d7fdec95dd731 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Wed, 1 Jul 2020 21:57:57 +0100 Subject: [PATCH 3/4] Don't mark `out` as static Causes it to be put in the wrong part of the EXE for some reason, even though we know from the Mac port that it *was* static. --- src/Draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Draw.cpp b/src/Draw.cpp index 4c30e934..4261ba1e 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -732,7 +732,7 @@ void CortBox2(const RECT *rect, unsigned long col, SurfaceID surf_no) // Dummied-out log function // According to the Mac port, its name really is just "out". -static BOOL out(int unknown) +BOOL out(int unknown) { char unknown2[0x100]; int unknown3; From 6cc976d4d625baaf549c28f7a8f205bbd8202fba Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 2 Jul 2020 02:31:55 +0100 Subject: [PATCH 4/4] Wii U audio tweaks Clean-up better, and neaten-up some code --- src/Backends/Audio/WiiU-Software.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Backends/Audio/WiiU-Software.cpp b/src/Backends/Audio/WiiU-Software.cpp index fa973492..fe6e7915 100644 --- a/src/Backends/Audio/WiiU-Software.cpp +++ b/src/Backends/Audio/WiiU-Software.cpp @@ -192,8 +192,7 @@ bool AudioBackend_Init(void) AXVoiceDeviceMixData mix_data[6]; memset(mix_data, 0, sizeof(mix_data)); - mix_data[0].bus[0].volume = i == 0 ? 0x8000 : 0; // Channel 1 goes on the left speaker - mix_data[1].bus[0].volume = i == 1 ? 0x8000 : 0; // Channel 2 goes on the right speaker + mix_data[i].bus[0].volume = 0x8000; // Voice 1 goes on the left speaker - voice 2 goes on the right speaker AXSetVoiceDeviceMix(voices[i], AX_DEVICE_TYPE_DRC, 0, mix_data); AXSetVoiceDeviceMix(voices[i], AX_DEVICE_TYPE_TV, 0, mix_data); @@ -243,11 +242,13 @@ bool AudioBackend_Init(void) void AudioBackend_Deinit(void) { - for (unsigned int i = 0; i < 2; ++i) - { - AXFreeVoice(voices[i]); - free(stream_buffers[i]); - } + AXRegisterAppFrameCallback(NULL); + + AXFreeVoice(voices[1]); + AXFreeVoice(voices[0]); + + free(stream_buffers[1]); + free(stream_buffers[0]); free(stream_buffer_long);