more asset preparation

This commit is contained in:
Prakxo
2023-03-14 08:36:15 +00:00
parent b3050638b2
commit bcebb21d48
14 changed files with 174 additions and 11 deletions
+12
View File
@@ -9,11 +9,23 @@ TRK/mem_TRK.c:
.init: [0x800034e0, 0x80003534]
asm/__exception.s:
.init: [0x80003534, 0x80005468]
version.c:
.data: [0x800b05e8, 0x800b0608]
jaudio_NES/dummyprobe.c:
.text: [0x800083f8, 0x80008400]
#jaudio_NES/verysimple.c:
# .text: [0x80008400, 0x80008480]
# .sdata: [0x80217b80, 0x80217b88]
#libforest/osreport.c: //see why it doesn't match
# .text: [0x8005a654, 0x8005a92c]
# .data: [0x800dc6d8, 0x800dc738]
# .bss: [0x80206f08, 0x80206f20]
# .sbss: [0x80218618, 0x80218628]
#libforest/fault.c:
# .text: [0x8005a92c, 0x8005adac]
# .data: [0x800dc738, 0x800dc7c8]
# .bss: [0x80206f20, 0x80206f30]
# .sbss: [0x80218628, 0x80218630]
libforest/ReconfigBATs.c:
.text: [0x8005adac, 0x8005aed4]
#libu64/debug.c: //not match
+6 -2
View File
@@ -256,8 +256,12 @@ class Asset:
def dump(self):
print(f"Ripping {self.path} from main.dol")
os.system(
f"{PYTHON} {c.PPCDIS}/assetrip.py {c.DOL_YML} 0x{self.start:x} {self.end:x} {c.ASSETS}/{self.path}")
f"{PYTHON} {c.PPCDIS}/assetrip.py {c.DOL_YML} 0x{self.start:x} {self.end:x} {c.ASSETS}/{self.path}"
)
print(f"Converting {self.path} from main.dol")
os.system(
f"{PYTHON} {c.PPCDIS}/assetinc.py {c.ASSETS}/{self.path} {c.ASSETS}/{self.path}.inc"
)
assets = Asset.load(c.ASSETS_YML)
+11
View File
@@ -0,0 +1,11 @@
#ifndef MSL_PRINTF_H
#define MSL_PRINTF_H
#include "types.h"
#include "va_args.h"
void vprintf(const char*, va_list);
void print(const char*, ...);
#endif
+2 -6
View File
@@ -24,15 +24,11 @@ extern void __OSCacheInit();
#define OSErrorLine(line, ...) \
OSPanic(__FILE__, line, __VA_ARGS__)
asm BOOL OSDisableInterrupts(void);
asm BOOL OSEnableInterrupts(void);
asm BOOL OSRestoreInterrupts(BOOL level);
void __RAS_OSDisableInterrupts_begin(void);
void __RAS_OSDisableInterrupts_end(void);
void OSResetSystem(u32, u32, u32); // goes in reset, but eh
void OSInit(void);
typedef void (*OSExceptionHandler)(u8, OSContext*);
OSExceptionHandler __OSSetExceptionHandler(u8, OSExceptionHandler);
+13
View File
@@ -0,0 +1,13 @@
#ifndef OS_INTERRUPT_H
#define OS_INTERRUPT_H
#include "types.h"
BOOL OSDisableInterrupts(void);
BOOL OSEnableInterrupts(void);
BOOL OSRestoreInterrupts(BOOL status);
void __RAS_OSDisableInterrupts_begin(void);
void __RAS_OSDisableInterrupts_end(void);
#endif
+9
View File
@@ -0,0 +1,9 @@
#ifndef OS_RTC_H
#define OS_RTC_H
#include "types.h"
u32 __OSSyncSram(void);
void __OSSetBootMode(u8);
#endif
+1 -1
View File
@@ -3,7 +3,7 @@
#include "types.h"
#include "dolphin/os/OSMemory.h"
#include "dolphin/os.h"
#include "dolphin/os/OSInterrupt.h"
asm void Config24MB();
asm void Config48MB();
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef FAULT_H
#define FAULT_H
#include "types.h"
#include "dolphin/OS/os.h"
#include "dolphin/os/OSInterrupt.h"
#include "libultra/libultra.h"
+19
View File
@@ -0,0 +1,19 @@
#ifndef LIB_OS_REPORT_H
#define LIB_OS_REPORT_H
#include "types.h"
#include "va_args.h"
void OSReportDisable(void);
void OSReportEnable(void);
void OSVReport(const char*, va_list);
void OSReport(const char*,...);
void OSPanic(const char*, u32, const char*,...);
void OSChangeBootMode(u32);
void OSDVDFatalError(void);
#endif
+1
View File
@@ -1,6 +1,7 @@
#include "dolphin/os/OSAlarm.h"
#include "dolphin/os/OSTime.h"
#include "dolphin/os/OSContext.h"
#include "dolphin/os/OSInterrupt.h"
static void DecrementerExceptionHandler(u8, OSContext*);
+2
View File
@@ -1,5 +1,7 @@
#include "dolphin/os/OSContext.h"
#include "dolphin/os/OSError.h"
#include "dolphin/os/OSInterrupt.h"
static asm void __OSLoadFPUContext(int unused, register OSContext* ctx){
nofralloc
lhz r5, ctx->state
+1 -1
View File
@@ -1,4 +1,4 @@
#include "dolphin/os/os.h"
#include "dolphin/os/OSInterrupt.h"
asm BOOL OSDisableInterrupts(void){
nofralloc
+88
View File
@@ -0,0 +1,88 @@
#include "libforest/osreport.h"
#include "dolphin/os/OSInterrupt.h"
#include "dolphin/os/OSThread.h"
#include "dolphin/os/OSRtc.h"
#include "dolphin/os/OSMutex.h"
#include "MSL_C/printf.h"
OSMutex print_mutex;
u8 print_mutex_initialized;
static void* __OSReport_MonopolyThread;
static s32 __OSReport_disable;
void OSReportDisable (void){
__OSReport_disable = 1;
}
void OSReportEnable (void){
__OSReport_disable = 0;
}
void OSVReport(const char* fmt, va_list list){
OSThread* cur_thread;
u32 enable;
if(__OSReport_disable == 0){
cur_thread = OSGetCurrentThread();
if((cur_thread != NULL) && (cur_thread->state !=2)) {
cur_thread = NULL;
}
if((__OSReport_MonopolyThread == NULL) || (__OSReport_MonopolyThread == cur_thread)){
enable = OSDisableInterrupts();
if(print_mutex_initialized == 0){
OSInitMutex(&print_mutex);
print_mutex_initialized = 1;
printf("*** OSVReport - OSInitMutex ***");
}
OSRestoreInterrupts(enable);
if(cur_thread != NULL){
OSLockMutex(&print_mutex);
}
vprintf(fmt, list);
if(cur_thread != NULL){
OSUnlockMutex(&print_mutex);
}
}
}
}
void OSReport(const char* fmt,...){
va_list list;
va_start(list, fmt);
OSVReport(fmt, list);
va_end(list);
}
void OSPanic(const char* file, u32 line, const char* fmt, ...){
va_list list;
u32 enable;
OSThread* thread;
enable = OSDisableInterrupts();
va_start(list, fmt);
vprintf(fmt, list);
va_end(list);
printf(" in \"%s\" on line %d.\n", file, line);
thread = OSGetCurrentThread();
OSSetThreadPriority(thread, 0x1f);
OSRestoreInterrupts(enable);
*(int*)0 = 0; //why lol
}
void OSChangeBootMode(u32 mode){
__OSSetBootMode(mode ? 0x80 : 0);
while(__OSSyncSram() == 0) { }
}
void OSDVDFatalError(void){
OSReport("OSDVDFatalError called.\nExitThread.\n");
OSExitThread(0);
}
+8
View File
@@ -0,0 +1,8 @@
#include "types.h"
u8 __Creator__[]{
#include "assets/__Creator__bin.inc"
}
u8 __DateTime__[]{
#include "assets/__DateTime__.bin.inc"
}