Skip to content

Commit

Permalink
sdk linking progress
Browse files Browse the repository at this point in the history
  • Loading branch information
shibbo committed Oct 30, 2024
1 parent b5348a2 commit ac39ba1
Show file tree
Hide file tree
Showing 97 changed files with 30,026 additions and 41 deletions.
19 changes: 14 additions & 5 deletions config/RMGK01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10281,13 +10281,15 @@ RVL_SDK/base/PPCArch.c:

RVL_SDK/os/OS.c:
.text start:0x804A2CDC end:0x804A40EC
.data start:0x805EF368 end:0x805EF7E8
.data start:0x805EF368 end:0x805EF758
.bss start:0x80664DE0 end:0x80664E50
.sdata start:0x806B2A10 end:0x806B2A40
.sbss start:0x806B7628 end:0x806B7678
.sbss start:0x806B7628 end:0x806B7670

RVL_SDK/os/OSAlarm.c:
.text start:0x804A40EC end:0x804A48D0
.data start:0x805EF758 end:0x805EF768
.sbss start:0x806B7670 end:0x806B7678

RVL_SDK/os/OSAlloc.c:
.text start:0x804A48D0 end:0x804A4BD8
Expand All @@ -10301,6 +10303,7 @@ RVL_SDK/os/OSArena.c:

RVL_SDK/os/OSAudioSystem.c:
.text start:0x804A4C6C end:0x804A5120
.data start:0x805EF768 end:0x805EF7E8

RVL_SDK/os/OSCache.c:
.text start:0x804A5120 end:0x804A5720
Expand All @@ -10325,17 +10328,18 @@ RVL_SDK/os/OSExec.c:

RVL_SDK/os/OSFatal.c:
.text start:0x804A7E78 end:0x804A8AB0
.bss start:0x80665188 end:0x80665D70
.bss start:0x80665188 end:0x806651A0
.sdata start:0x806B2A68 end:0x806B2A78
.sdata2 start:0x806C2088 end:0x806C20D0

RVL_SDK/os/OSFont.c:
.text start:0x804A8AB0 end:0x804A9778
.data start:0x805F0110 end:0x805F0AE0
.data start:0x805F0110 end:0x805F0AA0
.sbss start:0x806B76A8 end:0x806B76B8

RVL_SDK/os/OSInterrupt.c:
.text start:0x804A9778 end:0x804A9EFC
.data start:0x805F0AA0 end:0x805F0AD0
.sbss start:0x806B76B8 end:0x806B76D0

RVL_SDK/os/OSLink.c:
Expand All @@ -10346,6 +10350,7 @@ RVL_SDK/os/OSMessage.c:

RVL_SDK/os/OSMemory.c:
.text start:0x804AA1E8 end:0x804AAAC4
.data start:0x805F0AD0 end:0x805F0AE0

RVL_SDK/os/OSMutex.c:
.text start:0x804AAAC4 end:0x804AADC8
Expand All @@ -10356,26 +10361,30 @@ RVL_SDK/os/OSReboot.c:

RVL_SDK/os/OSReset.c:
.text start:0x804AAE48 end:0x804AB790
.data start:0x805F0AE0 end:0x805FCC08
.data start:0x805F0AE0 end:0x805F0D68
.sdata start:0x806B2A78 end:0x806B2A80
.sbss start:0x806B76D8 end:0x806B76E8

RVL_SDK/os/OSRtc.c:
.text start:0x804AB790 end:0x804AC21C
.bss start:0x806651A0 end:0x806651F8

RVL_SDK/os/OSSync.c:
.text start:0x804AC21C end:0x804AC29C

RVL_SDK/os/OSThread.c:
.text start:0x804AC29C end:0x804AD9FC
.bss start:0x806651F8 end:0x80665C00
.sdata start:0x806B2A80 end:0x806B2A88
.sbss start:0x806B76E8 end:0x806B76F8

RVL_SDK/os/OSTime.c:
.text start:0x804AD9FC end:0x804ADE10
.data start:0x805F0D68 end:0x805F0DC8

RVL_SDK/os/OSUtf.c:
.text start:0x804ADE10 end:0x804AE048
.data start:0x805F0DC8 end:0x805FCC08

RVL_SDK/os/OSIpc.c:
.text start:0x804AE048 end:0x804AE070
Expand Down
10 changes: 5 additions & 5 deletions config/RMGK01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59860,7 +59860,7 @@ DSPInitCode = .data:0x805EF768; // type:object size:0x80 scope:local
@3214 = .data:0x805EFF80; // type:object size:0xB scope:local align:4 data:string
lbl_805EFF90 = .data:0x805EFF90; // type:object size:0x180
Zenkaku2Code = .data:0x805F0110; // type:object size:0x98A scope:global align:4
lbl_805F0AA0 = .data:0x805F0AA0; // type:object size:0x30 data:4byte
InterruptPrioTable = .data:0x805F0AA0; // type:object size:0x30 data:4byte
ShutdownFunctionInfo = .data:0x805F0AD0; // type:object size:0x10 scope:local
@1720 = .data:0x805F0AE0; // type:object size:0xA scope:local align:4 data:string
@1721 = .data:0x805F0AEC; // type:object size:0x29 scope:local align:4 data:string
Expand All @@ -59878,8 +59878,8 @@ ShutdownFunctionInfo = .data:0x805F0AD0; // type:object size:0x10 scope:local
@1782 = .data:0x805F0CB8; // type:object size:0x31 scope:local align:4 data:string
@1790 = .data:0x805F0CEC; // type:object size:0x3B scope:local align:4 data:string
@1792 = .data:0x805F0D28; // type:object size:0x3A scope:local align:4 data:string
lbl_805F0D68 = .data:0x805F0D68; // type:object size:0x30
lbl_805F0D98 = .data:0x805F0D98; // type:object size:0x30
YearDays = .data:0x805F0D68; // type:object size:0x30
LeapYearDays = .data:0x805F0D98; // type:object size:0x30
lbl_805F0DC8 = .data:0x805F0DC8; // type:object size:0x40 data:2byte
lbl_805F0E08 = .data:0x805F0E08; // type:object size:0x200
lbl_805F1008 = .data:0x805F1008; // type:object size:0x200
Expand Down Expand Up @@ -61274,8 +61274,8 @@ lbl_80664EC0 = .bss:0x80664EC0; // type:object size:0x2C8
FatalParam = .bss:0x80665188; // type:object size:0xC scope:global align:4 data:byte
Scb = .bss:0x806651A0; // type:object size:0x54 scope:local data:4byte
DefaultThread = .bss:0x806651F8; // type:object size:0x318 scope:local data:4byte
lbl_80665510 = .bss:0x80665510; // type:object size:0x100 data:4byte
lbl_80665610 = .bss:0x80665610; // type:object size:0x5F0
RunQueue = .bss:0x80665510; // type:object size:0x100 data:4byte
IdleContext = .bss:0x80665610; // type:object size:0x5F0
StmEhInBuf = .bss:0x80665C00; // type:object size:0x20 scope:local
StmEhOutBuf = .bss:0x80665C20; // type:object size:0x20 scope:local data:4byte
lbl_80665C40 = .bss:0x80665C40; // type:object size:0x20 data:4byte
Expand Down
34 changes: 17 additions & 17 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@

cflags_sdk = [
"-nodefaults",
"-lang c++",
"-lang c",
"-proc gekko",
"-align powerpc",
"-enum int",
Expand Down Expand Up @@ -2304,7 +2304,7 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
SDKLib(
"base",
[
Object(NonMatching, "RVL_SDK/base/PPCArch.c")
Object(Matching, "RVL_SDK/base/PPCArch.c")
]
),

Expand Down Expand Up @@ -2565,27 +2565,27 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
"os",
[
Object(NonMatching, "RVL_SDK/os/OS.c"),
Object(NonMatching, "RVL_SDK/os/OSAlarm.c"),
Object(NonMatching, "RVL_SDK/os/OSAlloc.c"),
Object(NonMatching, "RVL_SDK/os/OSArena.c"),
Object(NonMatching, "RVL_SDK/os/OSAudioSystem.c"),
Object(Matching, "RVL_SDK/os/OSAlarm.c"),
Object(Matching, "RVL_SDK/os/OSAlloc.c"),
Object(Matching, "RVL_SDK/os/OSArena.c"),
Object(Matching, "RVL_SDK/os/OSAudioSystem.c"),
Object(NonMatching, "RVL_SDK/os/OSCache.c"),
Object(NonMatching, "RVL_SDK/os/OSContext.c"),
Object(NonMatching, "RVL_SDK/os/OSError.c"),
Object(NonMatching, "RVL_SDK/os/OSExec.c"),
Object(NonMatching, "RVL_SDK/os/OSFatal.c"),
Object(NonMatching, "RVL_SDK/os/OSFont.c"),
Object(NonMatching, "RVL_SDK/os/OSInterrupt.c"),
Object(NonMatching, "RVL_SDK/os/OSLink.c"),
Object(NonMatching, "RVL_SDK/os/OSMessage.c"),
Object(NonMatching, "RVL_SDK/os/OSMemory.c"),
Object(NonMatching, "RVL_SDK/os/OSMutex.c"),
Object(NonMatching, "RVL_SDK/os/OSReboot.c"),
Object(Matching, "RVL_SDK/os/OSInterrupt.c"),
Object(Matching, "RVL_SDK/os/OSLink.c"),
Object(Matching, "RVL_SDK/os/OSMessage.c"),
Object(Matching, "RVL_SDK/os/OSMemory.c"),
Object(Matching, "RVL_SDK/os/OSMutex.c"),
Object(Matching, "RVL_SDK/os/OSReboot.c"),
Object(NonMatching, "RVL_SDK/os/OSReset.c"),
Object(NonMatching, "RVL_SDK/os/OSRtc.c"),
Object(NonMatching, "RVL_SDK/os/OSSync.c"),
Object(NonMatching, "RVL_SDK/os/OSThread.c"),
Object(NonMatching, "RVL_SDK/os/OSTime.c"),
Object(Matching, "RVL_SDK/os/OSRtc.c"),
Object(Matching, "RVL_SDK/os/OSSync.c"),
Object(Matching, "RVL_SDK/os/OSThread.c"),
Object(Matching, "RVL_SDK/os/OSTime.c"),
Object(NonMatching, "RVL_SDK/os/OSUtf.c"),
Object(NonMatching, "RVL_SDK/os/OSIpc.c"),
Object(NonMatching, "RVL_SDK/os/OSStateTM.c"),
Expand Down Expand Up @@ -2641,7 +2641,7 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
SDKLib(
"tpl",
[
Object(NonMatching, "RVL_SDK/tpl/TPL.c")
Object(Matching, "RVL_SDK/tpl/TPL.c")
]
),

Expand Down
2 changes: 1 addition & 1 deletion src/RVLFaceLib/RFL_Format.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <RVLFaceLibInternal.h>
#include <cstdio>
#include <mem.h>

#define MAGIC_OFFICIAL_DB 'RNOD'
#define MAGIC_HIDDEN_DB 'RNHD'
Expand Down
26 changes: 13 additions & 13 deletions src/RVLFaceLib/RFL_System.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#define RFLGetLastReason_() \
(RFLAvailable() ? RFLiGetLastReason_() : sRFLLastReason)

const char* __RFLVersion =
static char* __RFLVersion =
"<< RVL_SDK - RFL \trelease build: Mar 6 2008 17:40:04 (0x4199_60831) >>";

static const RFLiCoordinateData scCoordinate = {1, 2, 0, FALSE, FALSE, FALSE};
const RFLiCoordinateData scCoordinate = {1, 2, 0, FALSE, FALSE, FALSE};

static RFLiManager* sRFLiManager = NULL;
static RFLiManager* sRFLManager = NULL;
static RFLErrcode sRFLLastErrCode = RFLErrcode_NotAvailable;
static u8 sRFLiFileBrokenType;
static s32 sRFLLastReason;
Expand All @@ -49,11 +49,11 @@ RFLErrcode RFLInitResAsync(void* workBuffer, void* resBuffer, u32 resSize,
workSize = deluxeTex ? RFL_DELUXE_WORK_SIZE : RFL_WORK_SIZE;
memset(workBuffer, 0, workSize);

sRFLiManager = (RFLiManager*)workBuffer;
sRFLManager = (RFLiManager*)workBuffer;
sRFLLastErrCode = RFLErrcode_NotAvailable;
sRFLLastReason = NAND_RESULT_OK;
sRFLiFileBrokenType = RFLiFileBrokenType_DBNotFound;
sRFLiManager->workBuffer = (u8*)workBuffer + sizeof(RFLiManager);
sRFLManager->workBuffer = (u8*)workBuffer + sizeof(RFLiManager);

heapSize = deluxeTex ? RFL_DELUXE_WORK_SIZE - sizeof(RFLiManager)
: RFL_WORK_SIZE - sizeof(RFLiManager);
Expand Down Expand Up @@ -100,7 +100,7 @@ RFLErrcode RFLInitResAsync(void* workBuffer, void* resBuffer, u32 resSize,
return error;
}

RFLErrcode RFLInitRes(void* workBuffer, void* resBuffer, u32 resSize,
static RFLErrcode RFLInitRes(void* workBuffer, void* resBuffer, u32 resSize,
BOOL deluxeTex) {
RFLInitResAsync(workBuffer, resBuffer, resSize, deluxeTex);
return RFLWaitAsync();
Expand All @@ -127,7 +127,7 @@ void RFLExit(void) {
MEMDestroyExpHeap(RFLiGetManager()->systemHeap);
MEMDestroyExpHeap(RFLiGetManager()->rootHeap);

sRFLiManager = NULL;
sRFLManager = NULL;
}

static void bootloadDB2Res_(void) {
Expand All @@ -143,19 +143,19 @@ static void bootloadDB2Res_(void) {
}
}

RFLErrcode RFLiBootLoadAsync(void) {
static RFLErrcode RFLiBootLoadAsync(void) {
return RFLiBootLoadDatabaseAsync(bootloadDB2Res_);
}

BOOL RFLAvailable(void) {
return sRFLiManager != NULL;
return sRFLManager != NULL;
}

static void* allocal_(u32 size, s32 align) {
return MEMAllocFromExpHeapEx(RFLiGetManager()->tmpHeap, size, align);
}

void* RFLiAlloc(u32 size) {
static void* RFLiAlloc(u32 size) {
return allocal_(size, 8);
}

Expand Down Expand Up @@ -188,7 +188,7 @@ void RFLiSetWorking(BOOL working) {
}

RFLiManager* RFLiGetManager(void) {
return sRFLiManager;
return sRFLManager;
}

RFLErrcode RFLGetAsyncStatus(void) {
Expand All @@ -211,7 +211,7 @@ s32 RFLGetLastReason(void) {
return !RFLAvailable() ? sRFLLastReason : RFLiGetLastReason_();
}

RFLErrcode RFLWaitAsync(void) {
static RFLErrcode RFLWaitAsync(void) {
volatile RFLErrcode status;

do {
Expand Down Expand Up @@ -263,7 +263,7 @@ BOOL RFLiNeedRepairError(void) {
return *broken >> RFLiFileBrokenType_DBBroken & 1;
}

BOOL RFLiCriticalError(void) {
static BOOL RFLiCriticalError(void) {
u8* broken = &sRFLiFileBrokenType;

if (RFLAvailable()) {
Expand Down
33 changes: 33 additions & 0 deletions src/RVL_SDK/aralt/aralt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <revolution/aralt.h>
#include <revolution/os.h>
#include <cstring>

static u32 __ARH_BaseAdr;

static ARCallback __AR_Callback;

#ifndef NON_MATCHING
// for some reason has _savegpr
void ARStartDMA(u32 type, u32 ram_addr, u32 aram_addr, u32 len) {
OSDisableScheduler();

if (type == 0) {
aram_addr += __ARH_BaseAdr;
DCInvalidateRange((u32*)ram_addr, len);
memcpy((u32*)aram_addr, (u32*)ram_addr, len);
DCFlushRange((u32*)aram_addr, len);
}
else if (type == 1) {
ram_addr += __ARH_BaseAdr;
DCFlushRange((u32*)ram_addr, len);
memcpy((u32*)aram_addr, (u32*)ram_addr, len);
DCFlushRange((u32*)aram_addr, len);
}

OSEnableScheduler();

if (__AR_Callback) {
(*__AR_Callback)();
}
}
#endif
Loading

0 comments on commit ac39ba1

Please sign in to comment.