Skip to content

Commit

Permalink
fix slices order, match some gu funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Prakxo committed Feb 24, 2023
1 parent 861cfcb commit 5ffa013
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 42 deletions.
1 change: 1 addition & 0 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def load_from_yaml(path: str, default=None):

CFLAGS = [
"-O4",
"-char unsigned",
]
CPLFLAGS =[
"-lang=c++",
Expand Down
62 changes: 32 additions & 30 deletions config/dol_slices.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
#libultra/gfxprint/gfxprint_locate.c:
# .text: [0x8005B1EC, 0x8005B210]
#libultra/gfxprint/gfxprint_locate8x8.c:
# .text: [0x8005B210, 0x8005B238]
jaudio_NES/dummyprobe.c:
.text: [0x800083f8, 0x80008400]
#jaudio_NES/verysimple.c:
# .text: [0x80008400, 0x80008480]
# .sdata: [0x80217b80, 0x80217b88]
libforest/ReconfigBATs.c:
.text: [0x8005adac, 0x8005aed4]
#libu64/gfxprint.c: specify ranges later
libc64/aprintf.c:
.text: [0x8005cbdc, 0x8005cc14]
libultra/xldtob.c:
.text: [0x8005e918, 0x8005f2a0]
.rodata: [0x800ab110, 0x800ab158]
.sdata: [0x80217df8, 0x80217e08]
.sdata2: [0x80219210, 0x80219230]
libultra/xlitob.c:
.text: [0x8005f2a0, 0x8005f4cc]
.data: [0x800ddb60, 0x800ddb88]
libultra/xprintf.c:
.text: [0x8005f4cc, 0x8005ff74]
.rodata: [0x800ab158, 0x800ab170]
.data: [0x800ddb88, 0x800ddd20]
.sdata: [0x80217e08, 0x80217e10]
.sdata2: [0x80219230, 0x80219238]
#libultra/ultra.c: won't link
# .text: [0x8005d01c, 0x8005d15c]
# .bss: [0x80206f60, 0x80206fa0]
#libultra/gu/scale.c:
# .text: [0x8005e7d4, 0x8005e860]
# .sdata2: [0x80219208, 0x80219210]
#libultra/gu/translate.c:
# .text: [0x8005e8ac, 0x8005e918]
libultra/gu/sins.c:
.text: [0x8005e860, 0x8005e8ac]
.data: [0x800dd360, 0x800ddb60]
#libultra/xldtob.c:
# .text: [0x8005e918, 0x8005f2a0]
# .rodata: [0x800ab110, 0x800ab158]
# .sdata: [0x80217df8, 0x80217e08]
# .sdata2: [0x80219210, 0x80219230]
#libultra/xlitob.c:
# .text: [0x8005f2a0, 0x8005f4cc]
# .data: [0x800ddb60, 0x800ddb88]
#libultra/xprintf.c:
# .text: [0x8005f4cc, 0x8005ff74]
# .rodata: [0x800ab158, 0x800ab170]
# .data: [0x800ddb88, 0x800ddd20]
# .sdata: [0x80217e08, 0x80217e10]
# .sdata2: [0x80219230, 0x80219238]
JSystem/JKernel/JKRHeap.cpp:
.text: [0x80063748, 0x80064028]
.data: [0x800ddf20, 0x800ddf98]
Expand Down Expand Up @@ -47,20 +60,9 @@ dolphin/os/OSRestoreInterrupts.c:
MSL_C/rand.c:
.text: [0x8009f46c, 0x8009f494]
.sdata: [0x80218260, 0x80218268]
#libultra/ultra.c: won't link
# .text: [0x8005d01c, 0x8005d15c]
# .bss: [0x80206f60, 0x80206fa0]
libultra/gu/sins.c:
.text: [0x8005e860, 0x8005e8ac]
.data: [0x800dd360, 0x800ddb60]
dolphin/odenotstub/odenotstub.c:
.text: [0x800a9770, 0x800a9780]
dolphin/amcstubs/AmcExi2Stubs.c:
.text: [0x800a8cc0, 0x800a8cf0]
dolphin/gx/GXStubs.c:
.text: [0x800998d4, 0x800998d8]
jaudio_NES/dummyprobe.c:
.text: [0x800083f8, 0x80008400]
#jaudio_NES/verysimple.c:
# .text: [0x80008400, 0x80008480]
# .sdata: [0x80217b80, 0x80217b88]
.text: [0x800998d4, 0x800998d8]
23 changes: 12 additions & 11 deletions config/rel_slices.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ac_aprilfool_control/aPC_actor_dt.c: common_data is pure bs,
# .text: [0x805153f0, 0x8051542C]
sys_vimgr.c:
.text: [0x803703F8, 0x80370418]
m_room_type/mRmTp_FtrItemNo2FtrIdx.c:
.text: [0x803E7878, 0x803E78BC]
#zurumode/zerucheck_init.c:
# .text: [0x8040eb38, 0x8040EB50]
#zurumode/zerucheck_key_check.c:
Expand All @@ -10,16 +12,15 @@
# .text: [0x8040ef58, 0x8040efc4]
# .bss: [0x812f9670, 0x812f9680]
#zurumode/zurumode_update.c:
#.text: [0x8040EDA8, 0x8040ee74]
m_random_field/mRF_MakePerfectBit.c:
.text: [0x8050B1AC, 0x8050B1D4]
m_random_field/mRF_GetRandomStepMode.c:
.text: [0x8050B284, 0x8050B2C0]
m_room_type/mRmTp_FtrItemNo2FtrIdx.c:
.text: [0x803E7878, 0x803E78BC]
#.text: [0x8040EDA8, 0x8040ee74]
# zurumode/zurumode.c:
# .text: [0x8040eb38, 0x8040f008]
# .bss: [0x812f9670, 0x812f9680]
# .data: [0x8065F9F0, 0x8065FA20]
sys_vimgr.c:
.text: [0x803703F8, 0x80370418]
m_random_field/mRF_MakePerfectBit.c:
.text: [0x8050B1AC, 0x8050B1D4]
m_random_field/mRF_GetRandomStepMode.c:
.text: [0x8050B284, 0x8050B2C0]
# ac_aprilfool_control/aPC_actor_dt.c: common_data is pure bs,
# .text: [0x805153f0, 0x8051542C]

28 changes: 28 additions & 0 deletions include/libultra/gu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef GU_H
#define GU_H
#include "types.h"
#include "libultra/u64types.h"


inline void guTranslateF(float m[4][4], float x, float y, float z){
guMtxIdentF(m);
m[3][0] = x;
m[3][1] = y;
m[3][2] = z;
}

inline void guScaleF(float mf[4][4], float x, float y, float z) {
guMtxIdentF(mf);
mf[0][0] = x;
mf[1][1] = y;
mf[2][2] = z;
mf[3][3] = 1.0;
}

void guMtxF2L(float mf[4][4], Mtx *m);
void guMtxIdentF(float mf[4][4]);
void guTranslate(Mtx *m, float x, float y, float z);
void guScale(Mtx *m, float x, float y, float z);


#endif
4 changes: 4 additions & 0 deletions include/libultra/u64types.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ typedef union {
rgba8888_t c;
} rgba8888;

typedef struct {
float m[4][4];
} Mtx;

#endif
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions src/libultra/gu/scale.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "libultra/gu.h"

void guScale(Mtx *m, float x, float y, float z) {
float mf[4][4];
guScaleF(mf, x, y, z);
guMtxF2L(mf, m);
}
7 changes: 7 additions & 0 deletions src/libultra/gu/translate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "libultra/gu.h"

void guTranslate(Mtx *m, float x, float y, float z) {
float mf[4][4];
guTranslateF(mf, x, y, z);
guMtxF2L(mf, m);
}
2 changes: 1 addition & 1 deletion src/libultra/ultra.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "libultra/libultra.h"
#include "_mem.h"
#include <string.h>
#include "dolphin/os.h"
#include "dolphin/os/OSTime.h"

Expand Down

0 comments on commit 5ffa013

Please sign in to comment.