libultra organization

This commit is contained in:
Ethan Roseman 2020-11-13 01:17:53 -05:00
parent d2bd96e127
commit f6f56a8a5f
14 changed files with 42 additions and 41 deletions

View File

@ -1,10 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80149600
/* DFD00 80149600 3C018015 */ lui $at, %hi(gCurrentDoorSoundsSet)
/* DFD04 80149604 A4201340 */ sh $zero, %lo(gCurrentDoorSoundsSet)($at)
/* DFD08 80149608 3C018015 */ lui $at, %hi(D_80151308)
/* DFD0C 8014960C A4201308 */ sh $zero, %lo(D_80151308)($at)
/* DFD10 80149610 03E00008 */ jr $ra
/* DFD14 80149614 00000000 */ nop

View File

@ -4,19 +4,19 @@
glabel ldiv
/* 48A20 8006D620 00A6001A */ div $zero, $a1, $a2
/* 48A24 8006D624 14C00002 */ bnez $a2, .L8006D630
/* 48A28 8006D628 00000000 */ nop
/* 48A28 8006D628 00000000 */ nop
/* 48A2C 8006D62C 0007000D */ break 7
.L8006D630:
/* 48A30 8006D630 2401FFFF */ addiu $at, $zero, -1
/* 48A34 8006D634 14C10004 */ bne $a2, $at, .L8006D648
/* 48A38 8006D638 3C018000 */ lui $at, 0x8000
/* 48A3C 8006D63C 14A10002 */ bne $a1, $at, .L8006D648
/* 48A40 8006D640 00000000 */ nop
/* 48A40 8006D640 00000000 */ nop
/* 48A44 8006D644 0006000D */ break 6
.L8006D648:
/* 48A48 8006D648 00001812 */ mflo $v1
/* 48A4C 8006D64C 00000000 */ nop
/* 48A50 8006D650 00000000 */ nop
/* 48A4C 8006D64C 00000000 */ nop
/* 48A50 8006D650 00000000 */ nop
/* 48A54 8006D654 00C30018 */ mult $a2, $v1
/* 48A58 8006D658 00001012 */ mflo $v0
/* 48A5C 8006D65C 27BDFFF8 */ addiu $sp, $sp, -8

View File

@ -24,5 +24,5 @@ glabel osEPiReadIo
/* 3C20C 80060E0C 8FB00010 */ lw $s0, 0x10($sp)
/* 3C210 80060E10 03E00008 */ jr $ra
/* 3C214 80060E14 27BD0020 */ addiu $sp, $sp, 0x20
/* 3C218 80060E18 00000000 */ nop
/* 3C21C 80060E1C 00000000 */ nop
/* 3C218 80060E18 00000000 */ nop
/* 3C21C 80060E1C 00000000 */ nop

View File

@ -1,5 +1,11 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .text, "ax"
glabel __osDisableInt
/* 46760 8006B360 3C0A8009 */ lui $t2, 0x8009
@ -26,8 +32,8 @@ glabel __osDisableInt
/* 467B4 8006B3B4 2401FFFE */ addiu $at, $zero, -2
/* 467B8 8006B3B8 01214824 */ and $t1, $t1, $at
/* 467BC 8006B3BC 40896000 */ mtc0 $t1, $12
/* 467C0 8006B3C0 00000000 */ nop
/* 467C4 8006B3C4 00000000 */ nop
/* 467C0 8006B3C0 00000000 */ nop
/* 467C4 8006B3C4 00000000 */ nop
.L8006B3C8:
/* 467C8 8006B3C8 03E00008 */ jr $ra
/* 467CC 8006B3CC 00000000 */ nop
/* 467CC 8006B3CC 00000000 */ nop

View File

@ -1,12 +1,18 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .text, "ax"
glabel __osRestoreInt
/* 467D0 8006B3D0 40086000 */ mfc0 $t0, $12
/* 467D4 8006B3D4 01044025 */ or $t0, $t0, $a0
/* 467D8 8006B3D8 40886000 */ mtc0 $t0, $12
/* 467DC 8006B3DC 00000000 */ nop
/* 467E0 8006B3E0 00000000 */ nop
/* 467DC 8006B3DC 00000000 */ nop
/* 467E0 8006B3E0 00000000 */ nop
/* 467E4 8006B3E4 03E00008 */ jr $ra
/* 467E8 8006B3E8 00000000 */ nop
/* 467EC 8006B3EC 00000000 */ nop
/* 467E8 8006B3E8 00000000 */ nop
/* 467EC 8006B3EC 00000000 */ nop

View File

@ -25,7 +25,7 @@ void func_80147264(void) {
case 1: // fading out
if (temp->fadeFlags & 1) {
s32 phi_v0;
if (temp->fadeOutTime < 0xFA) {
if (temp->fadeOutTime < 250) {
phi_v0 = func_800554A4(0, temp->fadeOutTime);
} else {
phi_v0 = func_800554E8(0, temp->fadeOutTime);

View File

@ -14,7 +14,10 @@ INCLUDE_ASM(s32, "code_de740_len_23f0", func_801491E4);
INCLUDE_ASM(s32, "code_de740_len_23f0", func_80149250);
INCLUDE_ASM(s32, "code_de740_len_23f0", func_80149600);
void func_80149600(void) {
gCurrentDoorSoundsSet = 0;
D_80151308 = 0;
}
INCLUDE_ASM(s32, "code_de740_len_23f0", func_80149618);

View File

@ -1,3 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "os/code_3c1c0_len_60", osEPiReadIo, OSPiHandle* handle, u32 size, u32* out);

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "os/code_46760_len_90", __osDisableInt);
INCLUDE_ASM(s32, "os/code_46760_len_90", __osRestoreInt);

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "os/code_48a20_len_1c0", ldiv);
INCLUDE_ASM(s32, "os/code_48a20_len_1c0", lldiv);

5
src/os/ldiv.c Normal file
View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(s32, "os/ldiv", ldiv);
INCLUDE_ASM(s32, "os/ldiv", lldiv);

3
src/os/osEPiReadIo.c Normal file
View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(s32, "os/osEPiReadIo", osEPiReadIo, OSPiHandle* handle, u32 size, u32* out);

View File

@ -91,7 +91,7 @@ segments:
- [0x3BD40, hasm, os/osSetIntMask]
- [0x3bde0, c, "os/code_3bde0_len_3e0"]
- [0x3C160, c, os/osEPiWriteIo]
- [0x3c1c0, c, "os/code_3c1c0_len_60"]
- [0x3c1c0, c, os/osEPiReadIo]
- [0x3c220, c, "os/code_3c220_len_a0"]
- [0x3c2c0, c, "os/code_3c2c0_len_50"]
- [0x3c310, c, "os/code_3c310_len_180"]
@ -171,7 +171,8 @@ segments:
- [0x45a30, c, "os/code_45a30_len_20"]
- [0x45a50, c, "os/code_45a50_len_3a0"]
- [0x45df0, hasm, "os/code_45df0_len_970"]
- [0x46760, c, "os/code_46760_len_90"]
- [0x46760, hasm, os/__osDisableInt]
- [0x467D0, hasm, os/__osRestoreInt]
- [0x467f0, c, "os/code_467f0_len_90"]
- [0x46880, c, "os/code_46880_len_260"]
- [0x46ae0, c, "os/code_46ae0_len_170"]
@ -190,7 +191,7 @@ segments:
- [0x47fa0, c, "os/code_47fa0_len_20"]
- [0x47fc0, c, "os/code_47fc0_len_60"]
- [0x48020, c, "os/code_48020_len_a00"]
- [0x48a20, c, "os/code_48a20_len_1c0"]
- [0x48a20, c, "os/ldiv"]
- [0x48be0, c, "os/code_48be0_len_20"]
- [0x48c00, c, "os/code_48c00_len_5c0"]
- [0x491c0, c, "os/code_491c0_len_f80"]