mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-04 01:02:54 -04:00
General Cleanup 2 (#1538)
* Cleanup * Cleanup variables.h * Cleanup fault headers * Some includes/headers cleanup * Libultra btn wrappers * Mark differences to original libultra headers * Remove duplicate include in fault * format * Update include/PR/os_voice.h Co-authored-by: Tom Overton <tom-overton@users.noreply.github.com> * align --------- Co-authored-by: Tom Overton <tom-overton@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "CIC6105.h"
|
||||
|
||||
#include "build.h"
|
||||
#include "fault.h"
|
||||
|
||||
|
||||
@@ -7,9 +7,13 @@ void MtxConv_F2L(Mtx* mtx, MtxF* mf) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
s32 value = (mf->mf[i][j] * 0x10000);
|
||||
struct {
|
||||
u16 intPart[4][4];
|
||||
u16 fracPart[4][4];
|
||||
}* mu = (void*)mtx;
|
||||
|
||||
mtx->intPart[i][j] = value >> 16;
|
||||
mtx->fracPart[i][j] = value;
|
||||
mu->intPart[i][j] = value >> 16;
|
||||
mu->fracPart[i][j] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "carthandle.h"
|
||||
#include "CIC6105.h"
|
||||
#include "idle.h"
|
||||
#include "stack.h"
|
||||
#include "stackcheck.h"
|
||||
#include "CIC6105.h"
|
||||
#include "z64thread.h"
|
||||
|
||||
StackEntry sBootStackInfo;
|
||||
|
||||
+7
-9
@@ -39,19 +39,18 @@
|
||||
* DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen.
|
||||
* DPad-Down disables sending fault pages over osSyncPrintf.
|
||||
*/
|
||||
|
||||
#include "fault_internal.h"
|
||||
#include "fault.h"
|
||||
#include "fault_internal.h"
|
||||
|
||||
#include "libc64/sprintf.h"
|
||||
#include "libc64/sleep.h"
|
||||
#include "vt.h"
|
||||
#include "libc64/sprintf.h"
|
||||
#include "PR/osint.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "main.h"
|
||||
#include "vt.h"
|
||||
#include "stackcheck.h"
|
||||
#include "z64thread.h"
|
||||
#include "main.h"
|
||||
#include "macros.h"
|
||||
#include "global.h"
|
||||
|
||||
FaultMgr* sFaultInstance;
|
||||
f32 sFaultTimeTotal; // read but not set anywhere
|
||||
@@ -547,7 +546,7 @@ void Fault_Wait5Seconds(void) {
|
||||
|
||||
do {
|
||||
Fault_Sleep(1000 / 60);
|
||||
} while ((osGetTime() - start) <= OS_SEC_TO_CYCLES(5));
|
||||
} while ((osGetTime() - start) <= OS_USEC_TO_CYCLES(5 * 1000 * 1000));
|
||||
|
||||
sFaultInstance->autoScroll = true;
|
||||
}
|
||||
@@ -931,7 +930,6 @@ void Fault_SetOptions(void) {
|
||||
uintptr_t ra;
|
||||
uintptr_t sp;
|
||||
|
||||
// BTN_RESET is the "neutral reset". Corresponds to holding L+R and pressing S
|
||||
if (CHECK_BTN_ALL(input3->press.button, BTN_RESET)) {
|
||||
faultCustomOptions = !faultCustomOptions;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
#include "fault.h"
|
||||
#include "fault_internal.h"
|
||||
#include "global.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "vt.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
+5
-3
@@ -35,7 +35,9 @@
|
||||
#include "irqmgr.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "scheduler.h"
|
||||
#include "stackcheck.h"
|
||||
#include "z64thread.h"
|
||||
|
||||
@@ -145,7 +147,7 @@ void IrqMgr_HandlePreNMI(IrqMgr* irqMgr) {
|
||||
sIrqMgrResetTime = irqMgr->resetTime = osGetTime();
|
||||
|
||||
// Wait .45 seconds then generate a stage 2 prenmi interrupt
|
||||
osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(450), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG);
|
||||
osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(450 * 1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG);
|
||||
|
||||
IrqMgr_JamMesgToClients(irqMgr, (OSMesg)&irqMgr->prenmiMsg);
|
||||
}
|
||||
@@ -159,14 +161,14 @@ void IrqMgr_HandlePRENMI450(IrqMgr* irqMgr) {
|
||||
irqMgr->resetStatus = IRQ_RESET_STATUS_NMI;
|
||||
|
||||
// Wait .03 seconds then generate a stage 3 prenmi interrupt
|
||||
osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(30), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG);
|
||||
osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(30 * 1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG);
|
||||
|
||||
IrqMgr_SendMesgToClients(irqMgr, (OSMesg)&irqMgr->nmiMsg);
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePRENMI480(IrqMgr* irqMgr) {
|
||||
// Wait .52 seconds. After this we will have waited an entire second
|
||||
osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(520), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG);
|
||||
osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(520 * 1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG);
|
||||
|
||||
osAfterPreNMI();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user