mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-27 15:42:46 -04:00
work on libc64
This commit is contained in:
@@ -297,6 +297,7 @@ REL_SDATA2_SIZE = 0
|
||||
CFLAGS = [
|
||||
"-O4",
|
||||
"-char unsigned",
|
||||
"-fp hard"
|
||||
]
|
||||
CPLFLAGS =[
|
||||
"-lang=c++",
|
||||
@@ -357,7 +358,6 @@ EXTERNAL_DOL_CFLAGS = ' '.join(BASE_DOL_CFLAGS)
|
||||
EXTERNAL_REL_CFLAGS = ' '.join(BASE_REL_CFLAGS)
|
||||
|
||||
LDFLAGS = ' '.join([
|
||||
"-fp hard",
|
||||
"-maxerrors 1",
|
||||
"-mapunused"
|
||||
])
|
||||
|
||||
@@ -2,8 +2,8 @@ blocked_pointers:
|
||||
- 0x800A8440
|
||||
- 0x800A8514
|
||||
forced_types:
|
||||
0x80003534: ENTRY
|
||||
0x80005468: ENTRY
|
||||
0x80003534: FUNCTION
|
||||
0x80005468: FUNCTION
|
||||
0x8003ab3c: ENTRY
|
||||
0x8003ab70: ENTRY
|
||||
0x8003ab70: ENTRY
|
||||
|
||||
@@ -7,6 +7,8 @@ runtime/__mem.c:
|
||||
.init: [0x800033a8, 0x800034e0]
|
||||
#TRK/mem_TRK.c:
|
||||
# .init: [0x800034e0, 0x80003510]
|
||||
#TRK/__exception.c:
|
||||
# .init: [0x80003534, 0x8000556C]
|
||||
jaudio_NES/dummyprobe.c:
|
||||
.text: [0x800083f8, 0x80008400]
|
||||
#jaudio_NES/verysimple.c:
|
||||
@@ -14,9 +16,20 @@ jaudio_NES/dummyprobe.c:
|
||||
# .sdata: [0x80217b80, 0x80217b88]
|
||||
libforest/ReconfigBATs.c:
|
||||
.text: [0x8005adac, 0x8005aed4]
|
||||
#libu64/debug.c: //not match
|
||||
# .text: [0x8005aed4, 0x8005af30]
|
||||
# .data: [0x800dc7c8, 0x800dc7f0]
|
||||
#libu64/gfxprint.c: specify ranges later
|
||||
libc64/aprintf.c:
|
||||
.text: [0x8005cbdc, 0x8005cc14]
|
||||
#libc64/math64.c: //not match
|
||||
# .text: [0x8005cc14, 0x8005cccc]
|
||||
# .sdata2: [0x80219118, 0x80219130]
|
||||
libc64/qrand.c:
|
||||
.text: [0x8005cccc, 0x8005cd64]
|
||||
.sdata: [0x80217de8, 0x80217df0]
|
||||
.sbss: [0x80218640, 0x80218648]
|
||||
.sdata2: [0x80219130, 0x80219138]
|
||||
#libultra/ultra.c: won't link
|
||||
# .text: [0x8005d01c, 0x8005d15c]
|
||||
# .bss: [0x80206f60, 0x80206fa0]
|
||||
|
||||
@@ -4,7 +4,7 @@ m_room_type/mRmTp_FtrItemNo2FtrIdx.c:
|
||||
.text: [0x803E7878, 0x803E78BC]
|
||||
#m_skin_matrix.c:
|
||||
# .text: [0x803f1528, 0x803f1bb4]
|
||||
# .rodata: [0x80643310, 0x80643318]
|
||||
# .rodata: [0x80643310, 0x80643318]
|
||||
#zurumode/zerucheck_init.c:
|
||||
# .text: [0x8040eb38, 0x8040EB50]
|
||||
#zurumode/zerucheck_key_check.c:
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef W_MATH_H
|
||||
#define W_MATH_H
|
||||
#include "types.h"
|
||||
|
||||
inline float sqrtf(float x)
|
||||
{
|
||||
static const double _half=.5;
|
||||
static const double _three=3.0;
|
||||
volatile float y;
|
||||
if(x > 0.0f)
|
||||
{
|
||||
double guess = __frsqrte((double)x); // returns an approximation to
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 12 sig bits
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 24 sig bits
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits
|
||||
y=(float)(x*guess);
|
||||
return y;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
f64 atan2(f64, f64);
|
||||
f64 acos(f32);
|
||||
|
||||
#endif
|
||||
@@ -4,4 +4,9 @@
|
||||
#include "types.h"
|
||||
s16 sins(u16);
|
||||
|
||||
f32 fatan2(f32, f32);
|
||||
|
||||
f64 fsqrt(f32);
|
||||
|
||||
f32 facos(f32);
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef LQRAND_H
|
||||
#define LQRAND_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
u32 qrand(void);
|
||||
void sqrand(u32);
|
||||
f32 fqrand(void);
|
||||
f64 fqrand2(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef LDEBUG_H
|
||||
#define LDEBUG_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
void _dbg_hungup(const char*, s32);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef LOS_THREAD_H
|
||||
#define LOS_THREAD_H
|
||||
|
||||
#include "types.h"
|
||||
#include "dolphin/OSThread.h"
|
||||
typedef s32 OSPri;
|
||||
typedef s32 OSId;
|
||||
|
||||
|
||||
|
||||
OSId osGetThreadId(OSThread*);
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "m_skin_matrix.h"
|
||||
#include "m_lib.h"
|
||||
|
||||
#include "orderfloats/80643310_80643318.inc"
|
||||
|
||||
void Skin_Matrix_PrjMulVector(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDest) {
|
||||
xyzDest->x = mf->xw + ((src->x * mf->xx) + (src->y * mf->xy) + (src->z * mf->xz));
|
||||
xyzDest->y = mf->yw + ((src->x * mf->yx) + (src->y * mf->yy) + (src->z * mf->yz));
|
||||
@@ -210,4 +213,23 @@ void Skin_Matrix_SetRotateXyz_s(MtxF* mf, s16 x, s16 y, s16 z) {
|
||||
} else {
|
||||
mf->zy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Skin_Matrix_SetTranslate(MtxF* mf, f32 x, f32 y, f32 z) {
|
||||
mf->yx = 0.0f;
|
||||
mf->zx = 0.0f;
|
||||
mf->wx = 0.0f;
|
||||
mf->xy = 0.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->wy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->wz = 0.0f;
|
||||
mf->xx = 1.0f;
|
||||
mf->yy = 1.0f;
|
||||
mf->zz = 1.0f;
|
||||
mf->ww = 1.0f;
|
||||
mf->xw = x;
|
||||
mf->yw = y;
|
||||
mf->zw = z;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#include "rand.h"
|
||||
#include "MSL_C/rand.h"
|
||||
|
||||
static u32 next = 1;
|
||||
|
||||
|
||||
+15
-6
@@ -1,9 +1,18 @@
|
||||
/*I will bother with fill/skip later, and I forgor how to .ascii (it's not that)*/
|
||||
#include "types.h"
|
||||
|
||||
__declspec(section ".init")asm void gTRKInterruptVectorTable(void){
|
||||
nofralloc
|
||||
|
||||
.ascii "Metrowerks Target Resident Kernel for PowerP"
|
||||
__declspec(section ".init") asm void gTRKInterruptVectorTable(void){
|
||||
nofralloc
|
||||
/* 80003534 4D657472 */ .4byte 0x4d657472
|
||||
/* 80003538 6F776572 */ xoris r23, r27, 0x6572
|
||||
/* 8000353C 6B732054 */ xori r19, r27, 0x2054
|
||||
/* 80003540 61726765 */ ori r18, r11, 0x6765
|
||||
/* 80003544 74205265 */ andis. r0, r1, 0x5265
|
||||
/* 80003548 73696465 */ andi. r9, r27, 0x6465
|
||||
/* 8000354C 6E74204B */ xoris r20, r19, 0x204b
|
||||
/* 80003550 65726E65 */ oris r18, r11, 0x6e65
|
||||
/* 80003554 6C20666F */ xoris r0, r1, 0x666f
|
||||
/* 80003558 7220506F */ andi. r0, r17, 0x506f
|
||||
/* 8000355C 77657250 */ andis. r5, r27, 0x7250
|
||||
/* 80003560 43000000 */ .4byte 0x43000000
|
||||
/* 80003564 00000000 */ .4byte 0x00000000
|
||||
/* 80003568 00000000 */ .4byte 0x00000000
|
||||
@@ -1998,7 +2007,7 @@ lbl_80004764:
|
||||
|
||||
__declspec(section ".init") asm void __TRK_reset(void){
|
||||
nofralloc
|
||||
/* 80005468 9421FFE0 */ stwu r1, -0x20(r1)
|
||||
/* 80005468 9421FFE0 */ stwu r1, -0x20(r1)
|
||||
/* 8000546C 7C0802A6 */ mflr r0
|
||||
/* 80005470 3C608021 */ lis r3, lc_base@ha
|
||||
/* 80005474 90010024 */ stw r0, 0x24(r1)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "libc/math.h"
|
||||
#include "MSL_C/w_math.h"
|
||||
f32 fatan2(f32 x, f32 y){
|
||||
return atan2(x, y);
|
||||
}
|
||||
f64 fsqrt(f32 x){
|
||||
return sqrtf(x);
|
||||
}
|
||||
|
||||
f32 facos(f32 x){
|
||||
return acos(x);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "libc64/qrand.h"
|
||||
|
||||
static u32 __qrand_idum = 1;
|
||||
static u32 __qrand_itemp;
|
||||
|
||||
u32 qrand(void){
|
||||
__qrand_idum = __qrand_idum * 0x19660D + 0x3C6EF35F;
|
||||
return __qrand_idum;
|
||||
}
|
||||
|
||||
void sqrand(u32 seed){
|
||||
__qrand_idum = seed;
|
||||
}
|
||||
|
||||
float fqrand(void){
|
||||
__qrand_idum = __qrand_idum * 0x19660D + 0x3C6EF35F;
|
||||
__qrand_itemp = __qrand_idum >> 9 | 0x3F800000;
|
||||
__qrand_itemp = __qrand_itemp;
|
||||
return *(float*)&__qrand_itemp - 1.0f;
|
||||
}
|
||||
|
||||
double fqrand2(void){
|
||||
__qrand_idum = __qrand_idum * 0x19660D + 0x3C6EF35F;
|
||||
__qrand_itemp = __qrand_idum >> 9 | 0x3F800000;
|
||||
return *(float*)&__qrand_itemp - 1.5f;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "libu64/debug.h"
|
||||
#include "libultra/osThread.h"
|
||||
|
||||
void _dbg_hungup(const char* name, s32 line) {
|
||||
char dbg_tbuf[0x100];
|
||||
|
||||
sprintf(dbg_tbuf, "*** HungUp in thread %d, [%s:%d] ***\n",osGetThreadId(0), name, line);
|
||||
}
|
||||
+1
-1
Submodule tools/ppcdis updated: 83260829c5...eca3f3015a
Reference in New Issue
Block a user