mirror of
https://github.com/pmret/papermario.git
synced 2026-04-09 08:00:09 -04:00
* some * DeadUnkTexturePanFunc * DeadUnkTexturePanFunc2 * move guOrthoF to os * up * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "ae2cce951d" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "ae2cce951d" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Updating bin dir * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "5517f520e4" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "5517f520e4" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "fe48dc3b3a" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "fe48dc3b3a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * revert garbage * :OK: * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "8c86e4b95b" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "8c86e4b95b" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * data migration * 3 * .rodata migration and a buncha funcs * 2 mo * some decomp, a file boundary fix * cleanup * UnkNpaAIFunc13s * Update symbol_addrs * remove sublist * deleted asm * data fix * fix data * wtf?! * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "88ce6b44a6" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "88ce6b44a6" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * symbol_addrs update * blah * PR comments
134 lines
3.1 KiB
C
134 lines
3.1 KiB
C
#include "common.h"
|
|
#include "nu/nusys.h"
|
|
#include "nu/nualsgi.h"
|
|
#include "audio.h"
|
|
|
|
extern NUDMAState nuAuDmaState;
|
|
|
|
s32 D_80078170 = 0;
|
|
NUAuPreNMIFunc nuAuPreNMIFunc = NULL;
|
|
s32 nuAuDmaNext = 0;
|
|
u32 nuAuFrameCounter = 0;
|
|
u8 D_80078180 = 1;
|
|
u8 D_80078181 = 1;
|
|
|
|
//bss
|
|
//static u16 D_800A0F50;
|
|
|
|
INCLUDE_ASM(s32, "code_25f00_len_940", func_8004AB00);
|
|
|
|
void nuAuPreNMIFuncSet(NUAuPreNMIFunc func) {
|
|
OSIntMask mask = osSetIntMask(OS_IM_NONE);
|
|
|
|
nuAuPreNMIFunc = func;
|
|
osSetIntMask(mask);
|
|
}
|
|
|
|
INCLUDE_ASM(s32, "code_25f00_len_940", func_8004AE08);
|
|
|
|
s32 nuAuDmaCallBack(s32 addr, s32 len, void* state, s32 arg3);
|
|
INCLUDE_ASM(s32, "code_25f00_len_940", nuAuDmaCallBack, s32 addr, s32 len, void* state, s32 arg3);
|
|
|
|
ALDMAproc nuAuDmaNew(NUDMAState** state) {
|
|
if (!nuAuDmaState.initialized) {
|
|
nuAuDmaState.firstFree = &nuAuDmaBuf;
|
|
nuAuDmaState.firstUsed = NULL;
|
|
nuAuDmaState.initialized = TRUE;
|
|
}
|
|
|
|
nuAuDmaNext = 0;
|
|
*state = &nuAuDmaState;
|
|
return nuAuDmaCallBack;
|
|
}
|
|
|
|
void nuAuCleanDMABuffers(void) {
|
|
NUDMAState* state = &nuAuDmaState;
|
|
NUDMABuffer* dmaPtr = state->firstUsed;
|
|
|
|
// A bit odd, this
|
|
do {
|
|
NUDMAState* state = &nuAuDmaState;
|
|
NUDMABuffer* nextPtr;
|
|
u32* frameCounter;
|
|
|
|
while (dmaPtr != NULL) {
|
|
nextPtr = dmaPtr->node.next;
|
|
|
|
if (dmaPtr->frameCnt + 1 < nuAuFrameCounter) {
|
|
if (state->firstUsed == dmaPtr) {
|
|
state->firstUsed = nextPtr;
|
|
}
|
|
|
|
alUnlink(dmaPtr);
|
|
|
|
if (state->firstFree != 0) {
|
|
alLink(dmaPtr, state->firstFree);
|
|
} else {
|
|
state->firstFree = dmaPtr;
|
|
dmaPtr->node.next = 0;
|
|
dmaPtr->node.prev = 0;
|
|
}
|
|
}
|
|
|
|
dmaPtr = nextPtr;
|
|
}
|
|
|
|
nuAuDmaNext = 0;
|
|
frameCounter = &nuAuFrameCounter;
|
|
*frameCounter += 1;
|
|
} while (0);
|
|
}
|
|
|
|
// Nop issue
|
|
// try again when bss is figured out up until this file
|
|
#ifdef NON_MATCHING
|
|
void func_8004B328(s16 arg0, s32 arg1) {
|
|
s16 temp_a0_2;
|
|
s32 temp_s0;
|
|
|
|
switch (arg0) {
|
|
case 2:
|
|
D_800A0F50 = func_80056D50();
|
|
func_80056D34();
|
|
break;
|
|
case 1:
|
|
temp_a0_2 = D_800A0F50;
|
|
temp_s0 = temp_a0_2 - (temp_a0_2 / 20) * arg1;
|
|
|
|
if (temp_s0 < 0) {
|
|
temp_s0 = 0;
|
|
}
|
|
|
|
temp_s0 = (temp_s0 * temp_s0) >> 15;
|
|
func_80056D44(temp_s0);
|
|
|
|
if (temp_s0 == 0) {
|
|
D_80078180 = 0;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
#else
|
|
INCLUDE_ASM(s32, "code_25f00_len_940", func_8004B328);
|
|
#endif
|
|
|
|
void alLink(ALLink* element, ALLink* after) {
|
|
element->next = after->next;
|
|
element->prev = after;
|
|
|
|
if (after->next != NULL) {
|
|
after->next->prev = element;
|
|
}
|
|
after->next = element;
|
|
}
|
|
|
|
void alUnlink(ALLink* element) {
|
|
if (element->next != NULL) {
|
|
element->next->prev = element->prev;
|
|
}
|
|
|
|
if (element->prev != NULL) {
|
|
element->prev->next = element->next;
|
|
}
|
|
}
|