More Jsystem stuff (#395)

* JASProbe OK

* JASRegisterParam OK

* Import JASReport

* JASDvdThread OK
This commit is contained in:
hatal175
2023-08-02 11:30:52 +03:00
committed by GitHub
parent 75e4b2ac20
commit 22ec4eee84
23 changed files with 230 additions and 603 deletions
+23 -21
View File
@@ -4,57 +4,59 @@
//
#include "JSystem/JAudio2/JASReport.h"
#include "dol2asm.h"
#include "JSystem/JAudio2/JASMutex.h"
#include "dolphin/types.h"
#include "dolphin/os/OSMutex.h"
#include "MSL_C/stdio.h"
//
// Forward References:
//
extern "C" void JASReport__FPCce();
extern "C" extern u8 struct_80451230[8];
//
// External References:
//
extern "C" void OSLockMutex();
extern "C" void OSUnlockMutex();
extern "C" void vsnprintf();
//
// Declarations:
//
/* ############################################################################################## */
/* 80431660-80431678 05E380 0018+00 1/1 0/0 0/0 .bss sMutex */
static u8 sMutex[24];
static OSMutex sMutex;
/* 80451220-80451224 000720 0004+00 1/1 0/0 0/0 .sbss sBuffer */
static u8 sBuffer[4];
static char* sBuffer;
/* 80451224-80451228 000724 0004+00 1/1 0/0 0/0 .sbss sLineMax */
static u8 sLineMax[4];
static int sLineMax;
/* 80451228-8045122C 000728 0004+00 1/1 0/0 0/0 .sbss sLineCount */
static u8 sLineCount[4];
static int sLineCount;
/* 8045122C-80451230 00072C 0004+00 1/1 0/0 0/0 .sbss sTop */
static u8 sTop[4];
static int sTop;
/* 80290F64-80291060 28B8A4 00FC+00 0/0 5/5 0/0 .text JASReport__FPCce */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASReport(char const* param_0, ...) {
nofralloc
#include "asm/JSystem/JAudio2/JASReport/JASReport__FPCce.s"
void JASReport(const char * str, ...) {
if(sBuffer) {
va_list vl;
va_start(vl, str);
JASMutexLock mutexLock(&sMutex);
vsnprintf(sBuffer + (sTop * 64), 64, str, vl);
va_end(vl);
sTop++;
if (sTop >= sLineMax)
sTop = 0;
if (sLineCount < sLineMax)
sLineCount++;
}
}
#pragma pop
/* ############################################################################################## */
/* 80451230-80451238 -00001 0008+00 0/0 6/6 0/0 .sbss None */
/* 80451230 0001+00 data_80451230 None */
/* 80451231 0007+00 data_80451231 None */
extern u8 struct_80451230[8];
u8 struct_80451230[8];