Skip to content

Commit

Permalink
actually free spu ram
Browse files Browse the repository at this point in the history
  • Loading branch information
UNSTOP4BLE committed Dec 26, 2022
1 parent 7894f3e commit 0c53596
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <stdlib.h>
#include <stdbool.h>
#include <sys/types.h>
#include <psxetc.h>
#include <psxgte.h>
Expand Down Expand Up @@ -225,6 +226,7 @@ int main(int argc, const char *argv[])
{
initDisplay();
SpuInit();
freeSpuRAM();

initInput();
gameInit();
Expand Down
7 changes: 6 additions & 1 deletion src/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,9 @@ void enableReverbOnCDAudio(int enable) {
SPU_CTRL |= 1 << 2;
else
SPU_CTRL &= ~(1 << 2);
}
}

void freeSpuRAM(void)
{
SpuWrite((const uint32_t *)NULL, 0x1010 + (((13 << 11) * 4) * 2)) + 64;
}
1 change: 1 addition & 0 deletions src/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ int upload_sample(const void *data, int size);
int play_sample(int addr, int sample_rate);
void setupReverb(int volume, int bufferSize, const ReverbPreset *preset);
void enableReverbOnChannels(uint32_t bits);
void freeSpuRAM(void);

0 comments on commit 0c53596

Please sign in to comment.