disassembled runtime.c
This commit is contained in:
parent
2166154935
commit
4c777a43f4
14 changed files with 660 additions and 27 deletions
28
.vscode/c_cpp_properties.json
vendored
Normal file
28
.vscode/c_cpp_properties.json
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Wii",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/include",
|
||||
"${workspaceFolder}/include/**"
|
||||
],
|
||||
"compilerPath": "/home/darkkirb/.local/bin/clang",
|
||||
"cStandard": "c99",
|
||||
"cppStandard": "c++03",
|
||||
"intelliSenseMode": "${default}",
|
||||
"compilerArgs": [
|
||||
"-ffreestanding",
|
||||
"-nostdinc",
|
||||
"-nostdinc++",
|
||||
"-nostdlib",
|
||||
"-nostdlib++",
|
||||
"-mcpu=broadway",
|
||||
"-target",
|
||||
"powerpc-eabi",
|
||||
"-fms-extensions",
|
||||
"-Weverything"
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
|
@ -1,3 +1,9 @@
|
|||
{
|
||||
"editor.tabSize": 2,
|
||||
"files.associations": {
|
||||
"array": "c",
|
||||
"string_view": "c",
|
||||
"initializer_list": "c",
|
||||
"utility": "c"
|
||||
},
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
.init start,.init end,extab start,extab end,extabindex start,extabindex end,.text start,.text end,.ctors start,.ctors end,.dtors start,.dtors end,.rodata start,.rodata end,.data start,.data end,.bss start,.bss end,.sdata start,.sdata end,.sbss start,.sbss end,.sdata2 start,.sdata2 end,.sbss2 start,.sbss2 end,File
|
||||
80004000,80004380,,,,,80006a8c,80006aa8,,,,,,,,,,,,,,,,,,,sdk/msl/runtime/__mem.o
|
||||
,,,,,,80007214,8000748c,,,,,80406580,80406598,,,,,,,,,,,,,sdk/msl/runtime/runtime.o
|
||||
,,,,,,80007214,800079fc,,,,,80406580,80406598,,,,,,,,,,,,,sdk/msl/runtime/runtime.o
|
||||
80004380,800062c0,,,,,,,,,,,,,,,,,,,,,,,,,sdk/trk/__exception.o
|
||||
,,,,,,8001a0b0,8001a2c0,,,,,,,80421da0,80421dd7,,,,,,,,,,,sdk/rvl/base/PPCArch.o
|
||||
,,,,,,8001b670,8001b6c4,,,,,,,,,,,,,,,,,,,sdk/rvl/os/OS.o
|
||||
|
@ -10,4 +10,4 @@
|
|||
80006620,80006684,,,,,,,,,,,,,,,,,,,,,,,,,sdk/rvl/os/__ppc_eabi_init.o
|
||||
,,,,,,,,80406540,80406544,,,,,,,,,,,,,,,,,Linker generated symbol file
|
||||
80006684,80006728,,,,,,,8040652c,80406530,80406548,8040654c,,,,,,,,,,,,,,,Linker generated symbol file
|
||||
80006728,80006728,800068cc,800068cc,800069e4,800069e4,80406244,80406244,80406530,80406530,8040654c,8040654c,80421030,80421030,804966fc,804966fc,8055640c,8055640c,8055c6d0,8055c6d0,8055df74,8055df74,805643b0,805643b0,805643fc,805643fc,End of File
|
||||
80006728,80006728,800068cc,800068cc,800069e4,800069e4,80406244,80406244,80406530,80406530,8040654c,8040654c,80421030,80421030,804966fc,804966fc,8055640c,8055640c,8055c6d0,8055c6d0,8055df74,8055df74,805643b0,805643b0,805643fc,805643fc,End of File
|
|
7
include/defines.h
Normal file
7
include/defines.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifdef __CWCC__
|
||||
#define AT(pos) : pos
|
||||
#define SECTION(sect) __declspec(section sect)
|
||||
#else
|
||||
#define AT(pos)
|
||||
#define SECTION(sect)
|
||||
#endif
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <defines.h>
|
||||
#include <types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -39,9 +40,9 @@ typedef struct OSContext {
|
|||
|
||||
void OSDumpContext(OSContext *context);
|
||||
|
||||
static u32 __OSContextPA : 0x800000c0;
|
||||
static OSContext *__OSCurrentContext : 0x800000d4;
|
||||
static OSContext *__OSFPUContext : 0x800000d8;
|
||||
static u32 __OSContextPA AT(0x800000c0);
|
||||
static OSContext *__OSCurrentContext AT(0x800000d4);
|
||||
static OSContext *__OSFPUContext AT(0x800000d8);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -10,5 +10,5 @@ set -e
|
|||
#if [[ $OSTYPE == 'darwin' ]]; then
|
||||
# docker run -it --rm --volume $PWD/build/wine:/home/wineuser/.wine --volume $PWD:$PWD -w $PWD scottyhardy/docker-wine wine "$@"
|
||||
#else
|
||||
WINEARCH=win32 WINEPREFIX=$HOME/.wine32 wine "$@"
|
||||
#fi
|
||||
WINEDEBUG=-all WINEARCH=win32 WINEPREFIX=$HOME/.wine32 wine "$@"
|
||||
#fiex
|
|
@ -3,8 +3,10 @@
|
|||
// Decompiled by GibHaltmannKill.
|
||||
|
||||
#include <string.h>
|
||||
#include <defines.h>
|
||||
|
||||
__declspec(section ".init") asm void *memcpy(register void *dest,
|
||||
#ifdef __CWCC__
|
||||
SECTION(".init") asm void *memcpy(register void *dest,
|
||||
register const void *src,
|
||||
register size_t size) {
|
||||
// clang-format off
|
||||
|
@ -200,8 +202,9 @@ LAB_8000428c:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
__declspec(section ".init") static void __fill_mem(void *dest, int val,
|
||||
SECTION(".init") static void __fill_mem(void *dest, int val,
|
||||
size_t count) {
|
||||
char *cdest = (char *)dest;
|
||||
int cval = (unsigned char)val;
|
||||
|
@ -259,7 +262,7 @@ __declspec(section ".init") static void __fill_mem(void *dest, int val,
|
|||
}
|
||||
}
|
||||
|
||||
__declspec(section ".init") void *memset(void *dest, int val, size_t count) {
|
||||
SECTION(".init") void *memset(void *dest, int val, size_t count) {
|
||||
__fill_mem(dest, val, count);
|
||||
return dest;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const double __constants[] = {0.0, 4294967296.0, 2147483648.0};
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm unsigned int __cvt_fp2unsigned(register double v) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -30,6 +31,7 @@ LAB_80007268:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
void _savefpr_14(void);
|
||||
void _savefpr_15(void);
|
||||
|
@ -105,6 +107,7 @@ void _restgpr_29(void);
|
|||
void _restgpr_30(void);
|
||||
void _restgpr_31(void);
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __save_fpr(void) {
|
||||
// clang-format off
|
||||
|
||||
|
@ -149,7 +152,9 @@ entry _savefpr_31;
|
|||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __restore_fpr(void) {
|
||||
// clang-format off
|
||||
|
||||
|
@ -194,7 +199,9 @@ entry _restfpr_31;
|
|||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __save_gpr(void) {
|
||||
// clang-format off
|
||||
|
||||
|
@ -239,7 +246,9 @@ entry _savegpr_31;
|
|||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __restore_gpr(void) {
|
||||
// clang-format off
|
||||
|
||||
|
@ -284,7 +293,9 @@ entry _restgpr_31;
|
|||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __div2u() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -357,4 +368,466 @@ LAB_80007480:
|
|||
li r3, 0;
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __div2i() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
||||
stwu r1, -0x10(r1);
|
||||
rlwinm. r9, r3, 0, 0, 0;
|
||||
beq LAB_800074a0;
|
||||
subfic r4, r4, 0;
|
||||
subfze r3, r3;
|
||||
|
||||
LAB_800074a0:
|
||||
stw r9, 8(r1);
|
||||
rlwinm. r10, r5, 0, 0, 0;
|
||||
beq LAB_800074b4;
|
||||
subfic r6, r6, 0;
|
||||
subfze r5, r5;
|
||||
|
||||
LAB_800074b4:
|
||||
stw r10, 0x0c(r1);
|
||||
|
||||
cmpwi r3, 0;
|
||||
cntlzw r0, r3;
|
||||
cntlzw r9, r4;
|
||||
bne LAB_800074cc;
|
||||
addi r0, r9, 0x20;
|
||||
LAB_800074cc:
|
||||
cmpwi r5, 0;
|
||||
cntlzw r9, r5;
|
||||
cntlzw r10, r6;
|
||||
bne LAB_800074e0;
|
||||
addi r9, r10, 0x20;
|
||||
LAB_800074e0:
|
||||
cmpw r0, r9;
|
||||
subfic r10, r0, 0x40;
|
||||
bgt LAB_800075b4;
|
||||
addi r9, r9, 1;
|
||||
subfic r9, r9, 0x40;
|
||||
add r0, r0, r9;
|
||||
subf r9, r9, r10;
|
||||
mtctr r9;
|
||||
cmpwi r9, 0x20;
|
||||
subi r7, r9, 0x20;
|
||||
blt LAB_80007518;
|
||||
srw r8, r3, r7;
|
||||
li r7, 0;
|
||||
b LAB_8000752c;
|
||||
LAB_80007518:
|
||||
srw r8, r4, r9;
|
||||
subfic r7, r9, 0x20;
|
||||
slw r7, r3, r7;
|
||||
or r8, r8, r7;
|
||||
srw r7, r3, r9;
|
||||
LAB_8000752c:
|
||||
cmpwi r0, 0x20;
|
||||
subic r9, r0, 0x20;
|
||||
blt LAB_80007544;
|
||||
slw r3, r4, r9;
|
||||
li r4, 0;
|
||||
b LAB_80007558;
|
||||
LAB_80007544:
|
||||
slw r3, r3, r0;
|
||||
subfic r9, r0, 0x20;
|
||||
srw r9, r4, r9;
|
||||
or r3, r3, r9;
|
||||
slw r4, r4, r0;
|
||||
LAB_80007558:
|
||||
li r10, -1;
|
||||
addic r7, r7, 0;
|
||||
LAB_80007560:
|
||||
adde r4, r4, r4;
|
||||
adde r3, r3, r3;
|
||||
adde r8, r8, r8;
|
||||
adde r7, r7, r7;
|
||||
subfc r0, r6, r8;
|
||||
subfe. r9, r5, r7;
|
||||
blt LAB_80007588;
|
||||
mr r8, r0;
|
||||
mr r7, r9;
|
||||
addic r0, r10, 1;
|
||||
LAB_80007588:
|
||||
bdnz LAB_80007560;
|
||||
adde r4, r4, r4;
|
||||
adde r3, r3, r3;
|
||||
lwz r9, 0x8(r1);
|
||||
lwz r10, 0xc(r1);
|
||||
xor. r7, r9, r10;
|
||||
beq LAB_800075b0;
|
||||
cmpwi r9, 0;
|
||||
subfic r4, r4, 0;
|
||||
subfze r3, r3;
|
||||
LAB_800075b0:
|
||||
b LAB_800075bc;
|
||||
LAB_800075b4:
|
||||
li r4, 0;
|
||||
li r3, 0;
|
||||
LAB_800075bc:
|
||||
addi r1, r1, 0x10;
|
||||
blr;
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __mod2u() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
cmpwi r3, 0;
|
||||
cntlzw r0, r3;
|
||||
cntlzw r9, r4;
|
||||
bne LAB_800075d8;
|
||||
addi r0, r9, 0x20;
|
||||
LAB_800075d8:
|
||||
cmpwi r5, 0;
|
||||
cntlzw r9, r5;
|
||||
cntlzw r10, r6;
|
||||
bne LAB_800075ec;
|
||||
addi r9, r10, 0x20;
|
||||
LAB_800075ec:
|
||||
cmpw r0, r9;
|
||||
subfic r10, r0, 0x40;
|
||||
bgt LAB_800076a4;
|
||||
addi r9, r9, 1;
|
||||
subfic r9, r9, 0x40;
|
||||
add r0, r0, r9;
|
||||
subf r9, r9, r10;
|
||||
mtctr r9;
|
||||
cmpwi r9, 0x20;
|
||||
subi r7, r9, 0x20;
|
||||
blt LAB_80007624;
|
||||
srw r8, r3, r7;
|
||||
li r7, 0;
|
||||
b LAB_80007638;
|
||||
LAB_80007624:
|
||||
srw r8, r4, r9;
|
||||
subfic r7, r9, 0x20;
|
||||
slw r7, r3, r7;
|
||||
or r8, r8, r7;
|
||||
srw r7, r3, r9;
|
||||
LAB_80007638:
|
||||
cmpwi r0, 0x20;
|
||||
subic r9, r0, 0x20;
|
||||
blt LAB_80007650;
|
||||
slw r3, r4, r9;
|
||||
li r4, 0;
|
||||
b LAB_80007664;
|
||||
LAB_80007650:
|
||||
slw r3, r3, r0;
|
||||
subfic r9, r0, 0x20;
|
||||
srw r9, r4, r9;
|
||||
or r3, r3, r9;
|
||||
slw r4, r4, r0;
|
||||
LAB_80007664:
|
||||
li r10, -1;
|
||||
addic r7, r7, 0;
|
||||
LAB_8000766c:
|
||||
adde r4, r4, r4;
|
||||
adde r3, r3, r3;
|
||||
adde r8, r8, r8;
|
||||
adde r7, r7, r7;
|
||||
subfc r0, r6, r8;
|
||||
subfe. r9, r5, r7;
|
||||
blt LAB_80007694;
|
||||
mr r8, r0;
|
||||
mr r7, r9;
|
||||
addic r0, r10, 1;
|
||||
LAB_80007694:
|
||||
bdnz LAB_8000766c;
|
||||
mr r4, r8;
|
||||
mr r3, r7;
|
||||
blr;
|
||||
LAB_800076a4:
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __mod2i() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
||||
cmpwi cr7, r3, 0;
|
||||
bge cr7, LAB_800076b8;
|
||||
subfic r4, r4, 0;
|
||||
subfze r3, r3;
|
||||
|
||||
LAB_800076b8:
|
||||
cmpwi r5, 0;
|
||||
bge LAB_800076c8;
|
||||
subfic r6, r6, 0;
|
||||
subfze r5, r5;
|
||||
|
||||
LAB_800076c8:
|
||||
cmpwi r3, 0;
|
||||
cntlzw r0, r3;
|
||||
cntlzw r9, r4;
|
||||
bne LAB_800076dc;
|
||||
addi r0, r9, 0x20;
|
||||
LAB_800076dc:
|
||||
cmpwi r5, 0;
|
||||
cntlzw r9, r5;
|
||||
cntlzw r10, r6;
|
||||
bne LAB_800076f0;
|
||||
addi r9, r10, 0x20;
|
||||
LAB_800076f0:
|
||||
cmpw r0, r9;
|
||||
subfic r10, r0, 0x40;
|
||||
bgt LAB_800077a4;
|
||||
addi r9, r9, 1;
|
||||
subfic r9, r9, 0x40;
|
||||
add r0, r0, r9;
|
||||
subf r9, r9, r10;
|
||||
mtctr r9;
|
||||
cmpwi r9, 0x20;
|
||||
subi r7, r9, 0x20;
|
||||
blt LAB_80007728;
|
||||
srw r8, r3, r7;
|
||||
li r7, 0;
|
||||
b LAB_8000773c;
|
||||
LAB_80007728:
|
||||
srw r8, r4, r9;
|
||||
subfic r7, r9, 0x20;
|
||||
slw r7, r3, r7;
|
||||
or r8, r8, r7;
|
||||
srw r7, r3, r9;
|
||||
LAB_8000773c:
|
||||
cmpwi r0, 0x20;
|
||||
subic r9, r0, 0x20;
|
||||
blt LAB_80007754;
|
||||
slw r3, r4, r9;
|
||||
li r4, 0;
|
||||
b LAB_80007768;
|
||||
LAB_80007754:
|
||||
slw r3, r3, r0;
|
||||
subfic r9, r0, 0x20;
|
||||
srw r9, r4, r9;
|
||||
or r3, r3, r9;
|
||||
slw r4, r4, r0;
|
||||
LAB_80007768:
|
||||
li r10, -1;
|
||||
addic r7, r7, 0;
|
||||
LAB_80007770:
|
||||
adde r4, r4, r4;
|
||||
adde r3, r3, r3;
|
||||
adde r8, r8, r8;
|
||||
adde r7, r7, r7;
|
||||
subfc r0, r6, r8;
|
||||
subfe. r9, r5, r7;
|
||||
blt LAB_80007798;
|
||||
mr r8, r0;
|
||||
mr r7, r9;
|
||||
addic r0, r10, 1;
|
||||
LAB_80007798:
|
||||
bdnz LAB_80007770;
|
||||
mr r4, r8;
|
||||
mr r3, r7;
|
||||
LAB_800077a4:
|
||||
bge cr7, LAB_800077b0;
|
||||
subfic r4, r4, 0;
|
||||
subfze r3, r3;
|
||||
LAB_800077b0:
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __shl2i() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
subfic r8, r5, 0x20;
|
||||
subic r9, r5, 0x20;
|
||||
slw r3, r3, r5;
|
||||
srw r10, r4, r8;
|
||||
or r3, r3, r10;
|
||||
slw r10, r4, r9;
|
||||
or r3, r3, r10;
|
||||
slw r4, r4, r5;
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __cvt_sll_dbl() {
|
||||
// clang-format off
|
||||
stwu r1, -0x10(r1);
|
||||
rlwinm. r5, r3, 0, 0, 0;
|
||||
beq LAB_800077ec;
|
||||
subfic r4, r4, 0;
|
||||
subfze r3, r3;
|
||||
LAB_800077ec:
|
||||
or. r7, r3, r4;
|
||||
li r6, 0;
|
||||
beq LAB_80007874;
|
||||
cntlzw r7, r3;
|
||||
cntlzw r8, r4;
|
||||
rlwinm r9, r7, 0x1a, 0, 4;
|
||||
srawi r9, r9, 0x1f;
|
||||
and r9, r9, r8;
|
||||
add r7, r7, r9;
|
||||
subfic r8, r7, 0x20;
|
||||
subic r9, r7, 0x20;
|
||||
slw r3, r3, r7;
|
||||
srw r10, r4, r8;
|
||||
or r3, r3, r10;
|
||||
slw r10, r4, r9;
|
||||
or r3, r3, r10;
|
||||
slw r4, r4, r7;
|
||||
subf r6, r7, r6;
|
||||
rlwinm r7, r4, 0, 0x15, 0x1f;
|
||||
cmpwi r7, 0x400;
|
||||
addi r6, r6, 0x43e;
|
||||
blt LAB_8000785c;
|
||||
bgt LAB_80007850;
|
||||
rlwinm. r7, r4, 0, 0x14, 0x14;
|
||||
beq LAB_8000785c;
|
||||
LAB_80007850:
|
||||
addic r4, r4, 0x800;
|
||||
addze r3, r3;
|
||||
addze r6, r6;
|
||||
LAB_8000785c:
|
||||
rlwinm r4, r4, 0x15, 0, 0x1f;
|
||||
rlwimi r4, r3, 0x15, 0, 0xa;
|
||||
rlwinm r3, r3, 0x15, 0xc, 0x1f;
|
||||
rlwinm r6, r6, 0x14, 0, 0xb;
|
||||
or r3, r6, r3;
|
||||
or r3, r5, r3;
|
||||
LAB_80007874:
|
||||
stw r3, 0x8(r1);
|
||||
stw r4, 0xc(r1);
|
||||
lfd f1, 0x8(r1);
|
||||
addi r1, r1, 0x10;
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __cvt_dbl_usll() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
||||
stwu r1, -0x10(r1);
|
||||
stfd f1, 0x08(r1);
|
||||
lwz r3, 0x8(r1);
|
||||
lwz r4, 0xc(r1);
|
||||
rlwinm r5, r3, 0xc, 0x15, 0x1f;
|
||||
cmplwi r5, 0x3ff;
|
||||
bge LAB_800078b0;
|
||||
li r3, 0;
|
||||
li r4, 0;
|
||||
b LAB_8000794c;
|
||||
LAB_800078b0:
|
||||
mr r6, r3;
|
||||
rlwinm r3, r3, 0, 0xc, 0x1f;
|
||||
oris r3, r3, 0x10;
|
||||
subi r5, r5, 0x433;
|
||||
cmpwi r5, 0;
|
||||
bge LAB_800078f0;
|
||||
neg r5, r5;
|
||||
subfic r8, r5, 0x20;
|
||||
subic r9, r5, 0x20;
|
||||
srw r4, r4, r5;
|
||||
slw r10, r3, r8;
|
||||
or r4, r4, r10;
|
||||
srw r10, r3, r9;
|
||||
or r4, r4, r10;
|
||||
srw r3, r3, r5;
|
||||
b LAB_8000793c;
|
||||
LAB_800078f0:
|
||||
cmpwi r5, 0xa;
|
||||
ble+ LAB_8000791c;
|
||||
rlwinm. r6, r6, 0, 0, 0;
|
||||
beq LAB_8000790c;
|
||||
lis r3, 0x8000;
|
||||
li r4, 0;
|
||||
b LAB_8000794c;
|
||||
LAB_8000790c:
|
||||
lis r3, 0x7fff;
|
||||
ori r3, r3, 0xffff;
|
||||
li r4, -1;
|
||||
b LAB_8000794c;
|
||||
LAB_8000791c:
|
||||
subfic r8, r5, 0x20;
|
||||
subic r9, r5, 0x20;
|
||||
slw r3, r3, r5;
|
||||
srw r10, r4, r8;
|
||||
or r3, r3, r10;
|
||||
slw r10, r4, r9;
|
||||
or r3, r3, r10;
|
||||
slw r4, r4, r5;
|
||||
LAB_8000793c:
|
||||
rlwinm. r6, r6, 0, 0, 0;
|
||||
beq LAB_8000794c;
|
||||
subfic r4, r4, 0;
|
||||
subfze r3, r3;
|
||||
LAB_8000794c:
|
||||
addi r1, r1, 0x10;
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void __cvt_dbl_ull() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
stwu r1, -0x10(r1);
|
||||
stfd f1, 8(r1);
|
||||
lwz r3, 8(r1);
|
||||
lwz r4, 12(r1);
|
||||
rlwinm r5, r3, 0xc, 0x15, 0x1f;
|
||||
cmplwi r5, 0x3ff;
|
||||
bge LAB_8000797c;
|
||||
LAB_80007970:
|
||||
li r3, 0;
|
||||
li r4, 0;
|
||||
b LAB_800079f4;
|
||||
LAB_8000797c:
|
||||
rlwinm. r6, r3, 0, 0, 0;
|
||||
bne LAB_80007970;
|
||||
rlwinm r3, r3, 0, 0xc, 0x1f;
|
||||
oris r3, r3, 0x10;
|
||||
subi r5, r5, 0x433;
|
||||
cmpwi r5, 0;
|
||||
bge LAB_800079c0;
|
||||
neg r5, r5;
|
||||
subfic r8, r5, 0x20;
|
||||
subic r9, r5, 0x20;
|
||||
srw r4, r4, r5;
|
||||
slw r10, r3, r8;
|
||||
or r4, r4, r10;
|
||||
srw r10, r3, r9;
|
||||
or r4, r4, r10;
|
||||
srw r3, r3, r5;
|
||||
b LAB_800079f4;
|
||||
LAB_800079c0:
|
||||
cmpwi r5, 0xb;
|
||||
ble+ LAB_800079d4;
|
||||
li r3, -1;
|
||||
li r4, -1;
|
||||
b LAB_800079f4;
|
||||
LAB_800079d4:
|
||||
subfic r8, r5, 0x20;
|
||||
subic r9, r5, 0x20;
|
||||
slw r3, r3, r5;
|
||||
srw r10, r4, r8;
|
||||
or r3, r3, r10;
|
||||
slw r10, r4, r9;
|
||||
or r3, r3, r10;
|
||||
slw r4, r4, r5;
|
||||
LAB_800079f4:
|
||||
addi r1, r1, 0x10;
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
|
@ -1,6 +1,7 @@
|
|||
#include <base.h>
|
||||
#include <os.h>
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 PPCMfmsr(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -8,7 +9,9 @@ asm u32 PPCMfmsr(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtmsr(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -16,7 +19,9 @@ asm void PPCMtmsr(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 PPCMfhid0(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -24,7 +29,9 @@ asm u32 PPCMfhid0(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMthid0(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -32,7 +39,9 @@ asm void PPCMthid0(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 PPCMfl2cr(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -40,7 +49,9 @@ asm u32 PPCMfl2cr(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtl2cr(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -48,7 +59,9 @@ asm void PPCMtl2cr(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtdec(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -56,7 +69,9 @@ asm void PPCMtdec(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCSync(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -64,7 +79,9 @@ asm void PPCSync(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCHalt(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -76,7 +93,9 @@ LAB_8001a134:
|
|||
b LAB_8001a134;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtmmcr0(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -84,7 +103,9 @@ asm void PPCMtmmcr0(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtmmcr1(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -92,7 +113,9 @@ asm void PPCMtmmcr1(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtpmc1(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -100,7 +123,9 @@ asm void PPCMtpmc1(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtpmc2(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -108,7 +133,9 @@ asm void PPCMtpmc2(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtpmc3(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -124,7 +151,9 @@ asm void PPCMtpmc4(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 PPCMffpscr(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -138,7 +167,9 @@ asm u32 PPCMffpscr(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtfpscr(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -154,7 +185,9 @@ asm void PPCMtfpscr(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 PPCMfhid2(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -162,7 +195,9 @@ asm u32 PPCMfhid2(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMthid2(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -170,7 +205,9 @@ asm void PPCMthid2(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCMtwpar(register u32 val) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -178,9 +215,11 @@ asm void PPCMtwpar(register u32 val) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
void PPCDisableSpeculation(void) { PPCMthid0(PPCMfhid0() | 0x200); }
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void PPCSetFpNonIEEEMode(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -188,17 +227,21 @@ asm void PPCSetFpNonIEEEMode(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
#endif
|
||||
void PPCMthid4(register u32 val) {
|
||||
if (val & 0x80000000) {
|
||||
#ifdef __CWCC__
|
||||
asm {
|
||||
mtspr 1011, val;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
OSReport("H4A should not be cleared because of Broadway errata.\n");
|
||||
val |= 0x80000000;
|
||||
#ifdef __CWCC__
|
||||
asm {
|
||||
mtspr 1011, val;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
#include <base.h>
|
||||
#include <types.h>
|
||||
|
||||
#ifdef __CWCC__
|
||||
void __OSPSInit(void) {
|
||||
PPCMthid2(PPCMfhid2() | 0xA0000000);
|
||||
ICFlashInvalidate();
|
||||
|
@ -16,4 +17,5 @@ void __OSPSInit(void) {
|
|||
mtspr 918, r3;
|
||||
mtspr 919, r3;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -3,6 +3,7 @@
|
|||
#include <os/osContext.h>
|
||||
#include <os/osError.h>
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void DCEnable(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -13,7 +14,9 @@ asm void DCEnable(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void DCInvalidateRange(register void *addr, register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -31,7 +34,9 @@ LAB_8001c9fc:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void DCFlushRange(register void *addr, register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -50,7 +55,9 @@ LAB_8001c99c:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void DCStoreRange(register void *addr, register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -69,7 +76,9 @@ LAB_8001c9cc:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void DCFlushRangeNoSync(register void *addr, register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -87,7 +96,9 @@ LAB_8001c9fc:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void DCStoreRangeNoSync(register void *addr, register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -105,7 +116,9 @@ LAB_8001ca2c:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void DCZeroRange(register void *addr, register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -123,7 +136,9 @@ LAB_8001ca5c:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void ICInvalidateRange(register void *addr, register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -143,7 +158,9 @@ LAB_8001ca8c:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void ICFlashInvalidate(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -153,7 +170,9 @@ asm void ICFlashInvalidate(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void ICEnable(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -164,7 +183,9 @@ asm void ICEnable(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
static asm void __LCEnable(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -201,6 +222,7 @@ LAB_8001cb6c:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
void LCEnable(void) {
|
||||
BOOL enabled;
|
||||
|
@ -210,6 +232,7 @@ void LCEnable(void) {
|
|||
OSRestoreInterrupts(enabled);
|
||||
}
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void LCDisable(void) {
|
||||
// clang-format off
|
||||
|
||||
|
@ -228,7 +251,9 @@ LAB_8001cbfc:
|
|||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void LCLoadBlocks(register void *dest, register void *src,
|
||||
register u32 num) {
|
||||
// clang-format off
|
||||
|
@ -246,7 +271,9 @@ asm void LCLoadBlocks(register void *dest, register void *src,
|
|||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void LCStoreBlocks(register void *dest, register void *src,
|
||||
register u32 num) {
|
||||
// clang-format off
|
||||
|
@ -264,6 +291,7 @@ asm void LCStoreBlocks(register void *dest, register void *src,
|
|||
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 LCStoreData(void *dest, void *src, u32 n) {
|
||||
u32 num;
|
||||
|
@ -285,6 +313,7 @@ u32 LCStoreData(void *dest, void *src, u32 n) {
|
|||
return xacts;
|
||||
}
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 LCQueueLength(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -293,7 +322,9 @@ asm u32 LCQueueLength(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 LCQueueWait(register u32 len) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -304,6 +335,7 @@ asm u32 LCQueueWait(register u32 len) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
static void DMAErrorHandler(u32 unk, OSContext *context,
|
||||
... /* function has varargs prologue ??? */) {
|
||||
|
@ -339,13 +371,13 @@ void __OSCacheInit(void) {
|
|||
}
|
||||
if ((PPCMfl2cr() & 0x80000000) == 0) {
|
||||
msr = PPCMfmsr();
|
||||
asm {sync; }
|
||||
__sync();
|
||||
PPCMtmsr(0x30);
|
||||
asm {sync; sync; }
|
||||
__sync(); __sync();
|
||||
PPCMtl2cr(PPCMfl2cr() & 0x7FFFFFFF);
|
||||
asm {sync; sync; }
|
||||
__sync(); __sync();
|
||||
PPCMtl2cr(PPCMfl2cr() & 0x7FFFFFFF);
|
||||
asm {sync; }
|
||||
__sync();
|
||||
PPCMtl2cr(PPCMfl2cr() | 0x200000);
|
||||
while (PPCMfl2cr() & 1)
|
||||
;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <os/osContext.h>
|
||||
#include <os/osError.h>
|
||||
|
||||
#ifdef __CWCC__
|
||||
static asm void __OSLoadFPUContext(register u32 unk,
|
||||
register OSContext *context) {
|
||||
// clang-format off
|
||||
|
@ -83,7 +84,9 @@ LAB_8001d0b0:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
static asm void __OSSaveFPUContext(register u32 dummy, register u32 dummy2,
|
||||
register OSContext *context) {
|
||||
// clang-format off
|
||||
|
@ -165,7 +168,9 @@ LAB_8001d1e4:
|
|||
blr
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void OSSaveFPUContext(register OSContext *context) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -173,7 +178,9 @@ asm void OSSaveFPUContext(register OSContext *context) {
|
|||
b __OSSaveFPUContext;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void OSSetCurrentContext(register OSContext *context) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -203,9 +210,11 @@ LAB_8001d238:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
OSContext *OSGetCurrentContext(void) { return __OSCurrentContext; }
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm u32 OSSaveContext(register OSContext *context) {
|
||||
// clang-format off
|
||||
stmw r13, 0x034(context);
|
||||
|
@ -242,10 +251,12 @@ asm u32 OSSaveContext(register OSContext *context) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
extern u32 __RAS_OSDisableInterrupts_begin;
|
||||
extern u32 __RAS_OSDisableInterrupts_end;
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void OSLoadContext(register OSContext *context) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -311,7 +322,9 @@ LAB_8001d344:
|
|||
rfi;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void *OSGetStackPointer(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -319,7 +332,9 @@ asm void *OSGetStackPointer(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void OSSwitchFiber(register u32 code, register u32 stack) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -337,7 +352,9 @@ asm void OSSwitchFiber(register u32 code, register u32 stack) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void OSSwitchFiberEx(register u32 a0, register u32 a1, register u32 a2,
|
||||
register u32 a3, register u32 code,
|
||||
register u32 stack) {
|
||||
|
@ -357,6 +374,7 @@ asm void OSSwitchFiberEx(register u32 a0, register u32 a1, register u32 a2,
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
void OSClearContext(OSContext *context) {
|
||||
context->mode = 0;
|
||||
|
@ -365,6 +383,7 @@ void OSClearContext(OSContext *context) {
|
|||
__OSFPUContext = NULL;
|
||||
}
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void OSInitContext(register OSContext *context, register u32 code,
|
||||
register u32 stack) {
|
||||
// clang-format off
|
||||
|
@ -418,6 +437,7 @@ asm void OSInitContext(register OSContext *context, register u32 code,
|
|||
b OSClearContext
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
void OSDumpContext(OSContext *context) {
|
||||
u32 i;
|
||||
|
@ -475,6 +495,7 @@ void OSDumpContext(OSContext *context) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __CWCC__
|
||||
static asm void OSSwitchFPUContext(register u32 unk,
|
||||
register OSContext *context) {
|
||||
// clang-format off
|
||||
|
@ -516,12 +537,17 @@ LAB_8001d7d0:
|
|||
rfi
|
||||
// clang-format on
|
||||
}
|
||||
#else
|
||||
void OSSwitchFPUContext(register u32 unk,
|
||||
register OSContext *context);
|
||||
#endif
|
||||
|
||||
void __OSContextInit(void) {
|
||||
__OSSetExceptionHandler(7, OSSwitchFPUContext);
|
||||
__OSFPUContext = NULL;
|
||||
}
|
||||
|
||||
#ifdef __CWCC__
|
||||
asm void OSFillFPUContext(register OSContext *context) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -602,4 +628,5 @@ asm void OSFillFPUContext(register OSContext *context) {
|
|||
LAB_8001d988:
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -4,6 +4,7 @@ void __OSPSInit(void);
|
|||
void __OSFPRInit(void);
|
||||
void __OSCacheInit(void);
|
||||
|
||||
#ifdef __CWCC__
|
||||
__declspec(section ".init") asm void __init_hardware(void) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -18,7 +19,9 @@ __declspec(section ".init") asm void __init_hardware(void) {
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __CWCC__
|
||||
__declspec(section ".init") asm void __flush_cache(register void *dst,
|
||||
register size_t size) {
|
||||
// clang-format off
|
||||
|
@ -38,4 +41,5 @@ LAB_80006664:
|
|||
isync;
|
||||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -1,4 +1,5 @@
|
|||
#include <string.h>
|
||||
#include <defines.h>
|
||||
|
||||
void __init_registers(void);
|
||||
void __init_data(void);
|
||||
|
@ -33,19 +34,20 @@ extern __rom_copy_info _rom_copy_info[];
|
|||
extern __bss_init_info _bss_init_info[];
|
||||
|
||||
static char Debug_BBA;
|
||||
unsigned short Pad3 : 0x800030e4;
|
||||
unsigned short Pad3 AT(0x800030e4);
|
||||
|
||||
__declspec(section ".init") void __check_pad3(void) {
|
||||
SECTION(".init") void __check_pad3(void) {
|
||||
if ((Pad3 & 0xEEF) != 0xEEF)
|
||||
return;
|
||||
OSResetSystem(0, 0, 0);
|
||||
}
|
||||
|
||||
__declspec(section ".init") void __set_debug_bba() { Debug_BBA = 1; }
|
||||
SECTION(".init") void __set_debug_bba() { Debug_BBA = 1; }
|
||||
|
||||
__declspec(section ".init") char __get_debug_bba() { return Debug_BBA; }
|
||||
SECTION(".init") char __get_debug_bba() { return Debug_BBA; }
|
||||
|
||||
__declspec(section ".init") asm void __start() {
|
||||
#ifdef __CWCC__
|
||||
SECTION(".init") asm void __start() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
bl __init_registers;
|
||||
|
@ -150,8 +152,10 @@ LAB_80006464:
|
|||
b exit
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
__declspec(section ".init") asm void __my_flush_cache(void *dst,
|
||||
#ifdef __CWCC__
|
||||
SECTION(".init") asm void __my_flush_cache(void *dst,
|
||||
unsigned long size) {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
|
@ -175,8 +179,10 @@ LAB_8000649c:
|
|||
blr;
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
__declspec(section ".init") asm void __init_registers() {
|
||||
#ifdef __CWCC__
|
||||
SECTION(".init") asm void __init_registers() {
|
||||
// clang-format off
|
||||
nofralloc;
|
||||
li r0, 0x0;
|
||||
|
@ -217,6 +223,7 @@ __declspec(section ".init") asm void __init_registers() {
|
|||
blr
|
||||
// clang-format on
|
||||
}
|
||||
#endif
|
||||
|
||||
static void rom_copy_section(void *dst, void *src, size_t size) {
|
||||
if ((size != 0) && (dst != src)) {
|
||||
|
@ -232,7 +239,7 @@ static void bss_init_section(void *dst, size_t size) {
|
|||
}
|
||||
}
|
||||
|
||||
__declspec(section ".init") void __init_data() {
|
||||
SECTION(".init") void __init_data() {
|
||||
__rom_copy_info *rci;
|
||||
__bss_init_info *bii;
|
||||
|
||||
|
|
Loading…
Reference in a new issue