Wii/GameCube: Fix memory corruption when playing music

This commit is contained in:
UnknownShadow200 2024-04-12 08:03:21 +10:00
parent ff9ef2285e
commit 361859cd09
2 changed files with 4 additions and 3 deletions

View File

@ -1285,7 +1285,7 @@ cc_bool Audio_DescribeError(cc_result res, cc_string* dst) {
cc_result Audio_AllocChunks(cc_uint32 size, void** chunks, int numChunks) {
size = (size + 0x1F) & ~0x1F; // round up to nearest multiple of 0x20
void* dst = memalign(0x20, size);
void* dst = memalign(0x20, size * numChunks);
if (!dst) return ERR_OUT_OF_MEMORY;
for (int i = 0; i < numChunks; i++) {

View File

@ -15,6 +15,7 @@
#include <gx2/surface.h>
#include <gx2/swap.h>
#include <gx2/temp.h>
#include <gx2/utils.h>
#include <gx2r/draw.h>
#include <gx2r/mem.h>
#include <gx2r/buffer.h>
@ -473,9 +474,9 @@ void Gfx_GetApiInfo(cc_string* info) {
void Gfx_OnWindowResize(void) {
}
void Gfx_3DS_SetRenderScreen(enum Screen3DS screen) {
void Gfx_3DS_SetRenderScreen1(enum Screen3DS screen) {
GX2ContextState* tv_state = WHBGfxGetTVContextState();
GX2ContextState* drc_state = WHBGfxGetDRCContextState();
GX2ContextState* drc_state = WHBGfxGetDRCContextState(); // TODO
GX2SetContextState(screen == TOP_SCREEN ? tv_state : drc_state);
}