mirror of https://github.com/zeldaret/tp.git
MSL_C cleanup (#238)
* clean up MSL_C files according to prime decomp * remove asm
This commit is contained in:
parent
f6a9947c6c
commit
e1114ebcf9
14
Progress.md
14
Progress.md
|
@ -7,22 +7,22 @@ Section | Percentage | Decompiled (bytes) | Total (bytes)
|
|||
.init | 97.972973% | 9280 | 9472
|
||||
.extab | 100.000000% | 96 | 96
|
||||
.extabindex | 100.000000% | 96 | 96
|
||||
.text | 21.344157% | 767652 | 3596544
|
||||
.text | 21.473726% | 772312 | 3596544
|
||||
.ctors | 100.000000% | 448 | 448
|
||||
.dtors | 100.000000% | 32 | 32
|
||||
.rodata | 100.000000% | 193856 | 193856
|
||||
.data | 100.000000% | 197632 | 197632
|
||||
.sdata | 100.000000% | 1408 | 1408
|
||||
.sdata2 | 100.000000% | 20832 | 20832
|
||||
Total | 29.636538% | 1191588 | 4020672
|
||||
Total | 29.752439% | 1196248 | 4020672
|
||||
|
||||
## Total
|
||||
|
||||
Section | Percentage | Decompiled (bytes) | Total (bytes)
|
||||
---|---|---|---
|
||||
main.dol | 29.636538% | 1191588 | 4020672
|
||||
RELs | 33.290749% | 3828544 | 11500324
|
||||
Total | 32.344136% | 5020132 | 15520996
|
||||
main.dol | 29.752439% | 1196248 | 4020672
|
||||
RELs | 33.301114% | 3829736 | 11500324
|
||||
Total | 32.381839% | 5025984 | 15520996
|
||||
|
||||
## RELs
|
||||
|
||||
|
@ -529,7 +529,7 @@ d_a_obj_lv2candle | 100.000000% | 6960 | 6960
|
|||
d_a_obj_wood_pendulum | 44.455748% | 1748 | 3932
|
||||
d_a_obj_onsen | 49.239281% | 1424 | 2892
|
||||
d_a_obj_hasu2 | 41.190476% | 1384 | 3360
|
||||
d_a_obj_catdoor | 46.041413% | 1512 | 3284
|
||||
d_a_obj_catdoor | 82.338611% | 2704 | 3284
|
||||
d_a_obj_bkdoor | 45.847554% | 1612 | 3516
|
||||
d_a_obj_mgate | 47.398844% | 1968 | 4152
|
||||
d_a_obj_ganonwall2 | 41.938675% | 1696 | 4044
|
||||
|
@ -785,4 +785,4 @@ d_a_b_oh2 | 37.960954% | 2100 | 5532
|
|||
d_a_b_bq | 28.033347% | 11164 | 39824
|
||||
d_a_b_zant_sima | 40.995025% | 1648 | 4020
|
||||
d_a_b_gm | 30.376176% | 11628 | 38280
|
||||
Total | 33.290749% | 3828544 | 11500324
|
||||
Total | 33.301114% | 3829736 | 11500324
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
lbl_803650D0:
|
||||
/* 803650D0 7C 64 FE 70 */ srawi r4, r3, 0x1f
|
||||
/* 803650D4 7C 80 1A 78 */ xor r0, r4, r3
|
||||
/* 803650D8 7C 64 00 50 */ subf r3, r4, r0
|
||||
/* 803650DC 4E 80 00 20 */ blr
|
|
@ -1,54 +0,0 @@
|
|||
lbl_803650E0:
|
||||
/* 803650E0 94 21 FF F0 */ stwu r1, -0x10(r1)
|
||||
/* 803650E4 7C 08 02 A6 */ mflr r0
|
||||
/* 803650E8 90 01 00 14 */ stw r0, 0x14(r1)
|
||||
/* 803650EC 93 E1 00 0C */ stw r31, 0xc(r1)
|
||||
/* 803650F0 7C 7F 1B 78 */ mr r31, r3
|
||||
/* 803650F4 93 C1 00 08 */ stw r30, 8(r1)
|
||||
/* 803650F8 7C 9E 23 78 */ mr r30, r4
|
||||
/* 803650FC 80 63 00 1C */ lwz r3, 0x1c(r3)
|
||||
/* 80365100 80 1F 00 24 */ lwz r0, 0x24(r31)
|
||||
/* 80365104 7C 03 00 51 */ subf. r0, r3, r0
|
||||
/* 80365108 41 82 00 50 */ beq lbl_80365158
|
||||
/* 8036510C 90 1F 00 28 */ stw r0, 0x28(r31)
|
||||
/* 80365110 38 BF 00 28 */ addi r5, r31, 0x28
|
||||
/* 80365114 81 9F 00 40 */ lwz r12, 0x40(r31)
|
||||
/* 80365118 80 7F 00 00 */ lwz r3, 0(r31)
|
||||
/* 8036511C 80 9F 00 1C */ lwz r4, 0x1c(r31)
|
||||
/* 80365120 80 DF 00 48 */ lwz r6, 0x48(r31)
|
||||
/* 80365124 7D 89 03 A6 */ mtctr r12
|
||||
/* 80365128 4E 80 04 21 */ bctrl
|
||||
/* 8036512C 28 1E 00 00 */ cmplwi r30, 0
|
||||
/* 80365130 41 82 00 0C */ beq lbl_8036513C
|
||||
/* 80365134 80 1F 00 28 */ lwz r0, 0x28(r31)
|
||||
/* 80365138 90 1E 00 00 */ stw r0, 0(r30)
|
||||
lbl_8036513C:
|
||||
/* 8036513C 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 80365140 41 82 00 08 */ beq lbl_80365148
|
||||
/* 80365144 48 00 00 48 */ b lbl_8036518C
|
||||
lbl_80365148:
|
||||
/* 80365148 80 7F 00 18 */ lwz r3, 0x18(r31)
|
||||
/* 8036514C 80 1F 00 28 */ lwz r0, 0x28(r31)
|
||||
/* 80365150 7C 03 02 14 */ add r0, r3, r0
|
||||
/* 80365154 90 1F 00 18 */ stw r0, 0x18(r31)
|
||||
lbl_80365158:
|
||||
/* 80365158 80 1F 00 1C */ lwz r0, 0x1c(r31)
|
||||
/* 8036515C 38 60 00 00 */ li r3, 0
|
||||
/* 80365160 90 1F 00 24 */ stw r0, 0x24(r31)
|
||||
/* 80365164 80 1F 00 20 */ lwz r0, 0x20(r31)
|
||||
/* 80365168 90 1F 00 28 */ stw r0, 0x28(r31)
|
||||
/* 8036516C 80 BF 00 18 */ lwz r5, 0x18(r31)
|
||||
/* 80365170 80 9F 00 2C */ lwz r4, 0x2c(r31)
|
||||
/* 80365174 80 1F 00 28 */ lwz r0, 0x28(r31)
|
||||
/* 80365178 7C A4 20 38 */ and r4, r5, r4
|
||||
/* 8036517C 7C 04 00 50 */ subf r0, r4, r0
|
||||
/* 80365180 90 1F 00 28 */ stw r0, 0x28(r31)
|
||||
/* 80365184 80 1F 00 18 */ lwz r0, 0x18(r31)
|
||||
/* 80365188 90 1F 00 34 */ stw r0, 0x34(r31)
|
||||
lbl_8036518C:
|
||||
/* 8036518C 80 01 00 14 */ lwz r0, 0x14(r1)
|
||||
/* 80365190 83 E1 00 0C */ lwz r31, 0xc(r1)
|
||||
/* 80365194 83 C1 00 08 */ lwz r30, 8(r1)
|
||||
/* 80365198 7C 08 03 A6 */ mtlr r0
|
||||
/* 8036519C 38 21 00 10 */ addi r1, r1, 0x10
|
||||
/* 803651A0 4E 80 00 20 */ blr
|
|
@ -1,14 +0,0 @@
|
|||
lbl_803651A4:
|
||||
/* 803651A4 80 03 00 1C */ lwz r0, 0x1c(r3)
|
||||
/* 803651A8 90 03 00 24 */ stw r0, 0x24(r3)
|
||||
/* 803651AC 80 03 00 20 */ lwz r0, 0x20(r3)
|
||||
/* 803651B0 90 03 00 28 */ stw r0, 0x28(r3)
|
||||
/* 803651B4 80 A3 00 18 */ lwz r5, 0x18(r3)
|
||||
/* 803651B8 80 83 00 2C */ lwz r4, 0x2c(r3)
|
||||
/* 803651BC 80 03 00 28 */ lwz r0, 0x28(r3)
|
||||
/* 803651C0 7C A4 20 38 */ and r4, r5, r4
|
||||
/* 803651C4 7C 04 00 50 */ subf r0, r4, r0
|
||||
/* 803651C8 90 03 00 28 */ stw r0, 0x28(r3)
|
||||
/* 803651CC 80 03 00 18 */ lwz r0, 0x18(r3)
|
||||
/* 803651D0 90 03 00 34 */ stw r0, 0x34(r3)
|
||||
/* 803651D4 4E 80 00 20 */ blr
|
|
@ -1,218 +0,0 @@
|
|||
lbl_80365494:
|
||||
/* 80365494 94 21 FF D0 */ stwu r1, -0x30(r1)
|
||||
/* 80365498 7C 08 02 A6 */ mflr r0
|
||||
/* 8036549C 90 01 00 34 */ stw r0, 0x34(r1)
|
||||
/* 803654A0 BF 21 00 14 */ stmw r25, 0x14(r1)
|
||||
/* 803654A4 7C 99 23 78 */ mr r25, r4
|
||||
/* 803654A8 7C DA 33 78 */ mr r26, r6
|
||||
/* 803654AC 7C 7B 1B 78 */ mr r27, r3
|
||||
/* 803654B0 7C BC 2B 78 */ mr r28, r5
|
||||
/* 803654B4 38 80 00 00 */ li r4, 0
|
||||
/* 803654B8 7F 43 D3 78 */ mr r3, r26
|
||||
/* 803654BC 48 00 3C 59 */ bl fwide
|
||||
/* 803654C0 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 803654C4 40 82 00 10 */ bne lbl_803654D4
|
||||
/* 803654C8 7F 43 D3 78 */ mr r3, r26
|
||||
/* 803654CC 38 80 FF FF */ li r4, -1
|
||||
/* 803654D0 48 00 3C 45 */ bl fwide
|
||||
lbl_803654D4:
|
||||
/* 803654D4 7F B9 E1 D7 */ mullw. r29, r25, r28
|
||||
/* 803654D8 41 82 00 1C */ beq lbl_803654F4
|
||||
/* 803654DC 88 1A 00 0A */ lbz r0, 0xa(r26)
|
||||
/* 803654E0 28 00 00 00 */ cmplwi r0, 0
|
||||
/* 803654E4 40 82 00 10 */ bne lbl_803654F4
|
||||
/* 803654E8 A0 1A 00 04 */ lhz r0, 4(r26)
|
||||
/* 803654EC 54 00 D7 7F */ rlwinm. r0, r0, 0x1a, 0x1d, 0x1f
|
||||
/* 803654F0 40 82 00 0C */ bne lbl_803654FC
|
||||
lbl_803654F4:
|
||||
/* 803654F4 38 60 00 00 */ li r3, 0
|
||||
/* 803654F8 48 00 02 94 */ b lbl_8036578C
|
||||
lbl_803654FC:
|
||||
/* 803654FC 28 00 00 02 */ cmplwi r0, 2
|
||||
/* 80365500 40 82 00 08 */ bne lbl_80365508
|
||||
/* 80365504 48 00 0F C9 */ bl __stdio_atexit
|
||||
lbl_80365508:
|
||||
/* 80365508 88 1A 00 05 */ lbz r0, 5(r26)
|
||||
/* 8036550C 3B E0 00 01 */ li r31, 1
|
||||
/* 80365510 38 60 00 00 */ li r3, 0
|
||||
/* 80365514 54 00 EF FF */ rlwinm. r0, r0, 0x1d, 0x1f, 0x1f
|
||||
/* 80365518 41 82 00 14 */ beq lbl_8036552C
|
||||
/* 8036551C 88 1A 00 04 */ lbz r0, 4(r26)
|
||||
/* 80365520 54 00 FF BE */ rlwinm r0, r0, 0x1f, 0x1e, 0x1f
|
||||
/* 80365524 28 00 00 02 */ cmplwi r0, 2
|
||||
/* 80365528 40 82 00 08 */ bne lbl_80365530
|
||||
lbl_8036552C:
|
||||
/* 8036552C 38 60 00 01 */ li r3, 1
|
||||
lbl_80365530:
|
||||
/* 80365530 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 80365534 40 82 00 18 */ bne lbl_8036554C
|
||||
/* 80365538 88 1A 00 04 */ lbz r0, 4(r26)
|
||||
/* 8036553C 54 00 FF BE */ rlwinm r0, r0, 0x1f, 0x1e, 0x1f
|
||||
/* 80365540 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 80365544 41 82 00 08 */ beq lbl_8036554C
|
||||
/* 80365548 3B E0 00 00 */ li r31, 0
|
||||
lbl_8036554C:
|
||||
/* 8036554C 88 1A 00 08 */ lbz r0, 8(r26)
|
||||
/* 80365550 54 00 DF 7F */ rlwinm. r0, r0, 0x1b, 0x1d, 0x1f
|
||||
/* 80365554 40 82 00 54 */ bne lbl_803655A8
|
||||
/* 80365558 88 7A 00 04 */ lbz r3, 4(r26)
|
||||
/* 8036555C 54 60 EF BD */ rlwinm. r0, r3, 0x1d, 0x1e, 0x1e
|
||||
/* 80365560 54 63 EF 7E */ rlwinm r3, r3, 0x1d, 0x1d, 0x1f
|
||||
/* 80365564 41 82 00 44 */ beq lbl_803655A8
|
||||
/* 80365568 54 60 07 7B */ rlwinm. r0, r3, 0, 0x1d, 0x1d
|
||||
/* 8036556C 41 82 00 24 */ beq lbl_80365590
|
||||
/* 80365570 7F 43 D3 78 */ mr r3, r26
|
||||
/* 80365574 38 80 00 00 */ li r4, 0
|
||||
/* 80365578 38 A0 00 02 */ li r5, 2
|
||||
/* 8036557C 48 00 06 39 */ bl fseek
|
||||
/* 80365580 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 80365584 41 82 00 0C */ beq lbl_80365590
|
||||
/* 80365588 38 60 00 00 */ li r3, 0
|
||||
/* 8036558C 48 00 02 00 */ b lbl_8036578C
|
||||
lbl_80365590:
|
||||
/* 80365590 88 1A 00 08 */ lbz r0, 8(r26)
|
||||
/* 80365594 38 60 00 01 */ li r3, 1
|
||||
/* 80365598 50 60 2E 34 */ rlwimi r0, r3, 5, 0x18, 0x1a
|
||||
/* 8036559C 7F 43 D3 78 */ mr r3, r26
|
||||
/* 803655A0 98 1A 00 08 */ stb r0, 8(r26)
|
||||
/* 803655A4 4B FF FC 01 */ bl __prep_buffer
|
||||
lbl_803655A8:
|
||||
/* 803655A8 88 1A 00 08 */ lbz r0, 8(r26)
|
||||
/* 803655AC 54 00 DF 7E */ rlwinm r0, r0, 0x1b, 0x1d, 0x1f
|
||||
/* 803655B0 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 803655B4 41 82 00 1C */ beq lbl_803655D0
|
||||
/* 803655B8 38 60 00 01 */ li r3, 1
|
||||
/* 803655BC 38 00 00 00 */ li r0, 0
|
||||
/* 803655C0 98 7A 00 0A */ stb r3, 0xa(r26)
|
||||
/* 803655C4 38 60 00 00 */ li r3, 0
|
||||
/* 803655C8 90 1A 00 28 */ stw r0, 0x28(r26)
|
||||
/* 803655CC 48 00 01 C0 */ b lbl_8036578C
|
||||
lbl_803655D0:
|
||||
/* 803655D0 28 1D 00 00 */ cmplwi r29, 0
|
||||
/* 803655D4 7F 7E DB 78 */ mr r30, r27
|
||||
/* 803655D8 3B 80 00 00 */ li r28, 0
|
||||
/* 803655DC 41 82 01 20 */ beq lbl_803656FC
|
||||
/* 803655E0 80 9A 00 24 */ lwz r4, 0x24(r26)
|
||||
/* 803655E4 80 7A 00 1C */ lwz r3, 0x1c(r26)
|
||||
/* 803655E8 7C 04 18 40 */ cmplw r4, r3
|
||||
/* 803655EC 40 82 00 0C */ bne lbl_803655F8
|
||||
/* 803655F0 2C 1F 00 00 */ cmpwi r31, 0
|
||||
/* 803655F4 41 82 01 08 */ beq lbl_803656FC
|
||||
lbl_803655F8:
|
||||
/* 803655F8 80 1A 00 20 */ lwz r0, 0x20(r26)
|
||||
/* 803655FC 7C 63 20 50 */ subf r3, r3, r4
|
||||
/* 80365600 7C 03 00 50 */ subf r0, r3, r0
|
||||
/* 80365604 90 1A 00 28 */ stw r0, 0x28(r26)
|
||||
lbl_80365608:
|
||||
/* 80365608 80 1A 00 28 */ lwz r0, 0x28(r26)
|
||||
/* 8036560C 3B 60 00 00 */ li r27, 0
|
||||
/* 80365610 7C 00 E8 40 */ cmplw r0, r29
|
||||
/* 80365614 90 01 00 08 */ stw r0, 8(r1)
|
||||
/* 80365618 40 81 00 08 */ ble lbl_80365620
|
||||
/* 8036561C 93 A1 00 08 */ stw r29, 8(r1)
|
||||
lbl_80365620:
|
||||
/* 80365620 88 1A 00 04 */ lbz r0, 4(r26)
|
||||
/* 80365624 54 00 FF BE */ rlwinm r0, r0, 0x1f, 0x1e, 0x1f
|
||||
/* 80365628 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 8036562C 40 82 00 30 */ bne lbl_8036565C
|
||||
/* 80365630 80 A1 00 08 */ lwz r5, 8(r1)
|
||||
/* 80365634 28 05 00 00 */ cmplwi r5, 0
|
||||
/* 80365638 41 82 00 24 */ beq lbl_8036565C
|
||||
/* 8036563C 7F C3 F3 78 */ mr r3, r30
|
||||
/* 80365640 38 80 00 0A */ li r4, 0xa
|
||||
/* 80365644 48 00 0A 95 */ bl __memrchr
|
||||
/* 80365648 7C 7B 1B 79 */ or. r27, r3, r3
|
||||
/* 8036564C 41 82 00 10 */ beq lbl_8036565C
|
||||
/* 80365650 38 1B 00 01 */ addi r0, r27, 1
|
||||
/* 80365654 7C 1E 00 50 */ subf r0, r30, r0
|
||||
/* 80365658 90 01 00 08 */ stw r0, 8(r1)
|
||||
lbl_8036565C:
|
||||
/* 8036565C 80 A1 00 08 */ lwz r5, 8(r1)
|
||||
/* 80365660 28 05 00 00 */ cmplwi r5, 0
|
||||
/* 80365664 41 82 00 3C */ beq lbl_803656A0
|
||||
/* 80365668 80 7A 00 24 */ lwz r3, 0x24(r26)
|
||||
/* 8036566C 7F C4 F3 78 */ mr r4, r30
|
||||
/* 80365670 4B C9 DE D1 */ bl memcpy
|
||||
/* 80365674 80 61 00 08 */ lwz r3, 8(r1)
|
||||
/* 80365678 80 1A 00 24 */ lwz r0, 0x24(r26)
|
||||
/* 8036567C 7F DE 1A 14 */ add r30, r30, r3
|
||||
/* 80365680 7F 9C 1A 14 */ add r28, r28, r3
|
||||
/* 80365684 7C 00 1A 14 */ add r0, r0, r3
|
||||
/* 80365688 7F A3 E8 50 */ subf r29, r3, r29
|
||||
/* 8036568C 90 1A 00 24 */ stw r0, 0x24(r26)
|
||||
/* 80365690 80 61 00 08 */ lwz r3, 8(r1)
|
||||
/* 80365694 80 1A 00 28 */ lwz r0, 0x28(r26)
|
||||
/* 80365698 7C 03 00 50 */ subf r0, r3, r0
|
||||
/* 8036569C 90 1A 00 28 */ stw r0, 0x28(r26)
|
||||
lbl_803656A0:
|
||||
/* 803656A0 80 1A 00 28 */ lwz r0, 0x28(r26)
|
||||
/* 803656A4 28 00 00 00 */ cmplwi r0, 0
|
||||
/* 803656A8 41 82 00 18 */ beq lbl_803656C0
|
||||
/* 803656AC 28 1B 00 00 */ cmplwi r27, 0
|
||||
/* 803656B0 40 82 00 10 */ bne lbl_803656C0
|
||||
/* 803656B4 88 1A 00 04 */ lbz r0, 4(r26)
|
||||
/* 803656B8 54 00 FF BF */ rlwinm. r0, r0, 0x1f, 0x1e, 0x1f
|
||||
/* 803656BC 40 82 00 30 */ bne lbl_803656EC
|
||||
lbl_803656C0:
|
||||
/* 803656C0 7F 43 D3 78 */ mr r3, r26
|
||||
/* 803656C4 38 80 00 00 */ li r4, 0
|
||||
/* 803656C8 4B FF FA 19 */ bl __flush_buffer
|
||||
/* 803656CC 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 803656D0 41 82 00 1C */ beq lbl_803656EC
|
||||
/* 803656D4 38 60 00 01 */ li r3, 1
|
||||
/* 803656D8 38 00 00 00 */ li r0, 0
|
||||
/* 803656DC 98 7A 00 0A */ stb r3, 0xa(r26)
|
||||
/* 803656E0 3B A0 00 00 */ li r29, 0
|
||||
/* 803656E4 90 1A 00 28 */ stw r0, 0x28(r26)
|
||||
/* 803656E8 48 00 00 14 */ b lbl_803656FC
|
||||
lbl_803656EC:
|
||||
/* 803656EC 28 1D 00 00 */ cmplwi r29, 0
|
||||
/* 803656F0 41 82 00 0C */ beq lbl_803656FC
|
||||
/* 803656F4 2C 1F 00 00 */ cmpwi r31, 0
|
||||
/* 803656F8 40 82 FF 10 */ bne lbl_80365608
|
||||
lbl_803656FC:
|
||||
/* 803656FC 28 1D 00 00 */ cmplwi r29, 0
|
||||
/* 80365700 41 82 00 68 */ beq lbl_80365768
|
||||
/* 80365704 2C 1F 00 00 */ cmpwi r31, 0
|
||||
/* 80365708 40 82 00 60 */ bne lbl_80365768
|
||||
/* 8036570C 83 7A 00 1C */ lwz r27, 0x1c(r26)
|
||||
/* 80365710 7C 1E EA 14 */ add r0, r30, r29
|
||||
/* 80365714 83 FA 00 20 */ lwz r31, 0x20(r26)
|
||||
/* 80365718 7F 43 D3 78 */ mr r3, r26
|
||||
/* 8036571C 38 81 00 08 */ addi r4, r1, 8
|
||||
/* 80365720 93 DA 00 1C */ stw r30, 0x1c(r26)
|
||||
/* 80365724 93 BA 00 20 */ stw r29, 0x20(r26)
|
||||
/* 80365728 90 1A 00 24 */ stw r0, 0x24(r26)
|
||||
/* 8036572C 4B FF F9 B5 */ bl __flush_buffer
|
||||
/* 80365730 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 80365734 41 82 00 14 */ beq lbl_80365748
|
||||
/* 80365738 38 60 00 01 */ li r3, 1
|
||||
/* 8036573C 38 00 00 00 */ li r0, 0
|
||||
/* 80365740 98 7A 00 0A */ stb r3, 0xa(r26)
|
||||
/* 80365744 90 1A 00 28 */ stw r0, 0x28(r26)
|
||||
lbl_80365748:
|
||||
/* 80365748 80 01 00 08 */ lwz r0, 8(r1)
|
||||
/* 8036574C 7F 43 D3 78 */ mr r3, r26
|
||||
/* 80365750 93 7A 00 1C */ stw r27, 0x1c(r26)
|
||||
/* 80365754 7F 9C 02 14 */ add r28, r28, r0
|
||||
/* 80365758 93 FA 00 20 */ stw r31, 0x20(r26)
|
||||
/* 8036575C 4B FF FA 49 */ bl __prep_buffer
|
||||
/* 80365760 38 00 00 00 */ li r0, 0
|
||||
/* 80365764 90 1A 00 28 */ stw r0, 0x28(r26)
|
||||
lbl_80365768:
|
||||
/* 80365768 88 1A 00 04 */ lbz r0, 4(r26)
|
||||
/* 8036576C 54 00 FF BE */ rlwinm r0, r0, 0x1f, 0x1e, 0x1f
|
||||
/* 80365770 28 00 00 02 */ cmplwi r0, 2
|
||||
/* 80365774 41 82 00 0C */ beq lbl_80365780
|
||||
/* 80365778 38 00 00 00 */ li r0, 0
|
||||
/* 8036577C 90 1A 00 28 */ stw r0, 0x28(r26)
|
||||
lbl_80365780:
|
||||
/* 80365780 38 19 FF FF */ addi r0, r25, -1
|
||||
/* 80365784 7C 1C 02 14 */ add r0, r28, r0
|
||||
/* 80365788 7C 60 CB 96 */ divwu r3, r0, r25
|
||||
lbl_8036578C:
|
||||
/* 8036578C BB 21 00 14 */ lmw r25, 0x14(r1)
|
||||
/* 80365790 80 01 00 34 */ lwz r0, 0x34(r1)
|
||||
/* 80365794 7C 08 03 A6 */ mtlr r0
|
||||
/* 80365798 38 21 00 30 */ addi r1, r1, 0x30
|
||||
/* 8036579C 4E 80 00 20 */ blr
|
|
@ -1,32 +0,0 @@
|
|||
lbl_803657A0:
|
||||
/* 803657A0 94 21 FF E0 */ stwu r1, -0x20(r1)
|
||||
/* 803657A4 7C 08 02 A6 */ mflr r0
|
||||
/* 803657A8 90 01 00 24 */ stw r0, 0x24(r1)
|
||||
/* 803657AC 93 E1 00 1C */ stw r31, 0x1c(r1)
|
||||
/* 803657B0 7C DF 33 78 */ mr r31, r6
|
||||
/* 803657B4 93 C1 00 18 */ stw r30, 0x18(r1)
|
||||
/* 803657B8 7C BE 2B 78 */ mr r30, r5
|
||||
/* 803657BC 93 A1 00 14 */ stw r29, 0x14(r1)
|
||||
/* 803657C0 7C 9D 23 78 */ mr r29, r4
|
||||
/* 803657C4 93 81 00 10 */ stw r28, 0x10(r1)
|
||||
/* 803657C8 7C 7C 1B 78 */ mr r28, r3
|
||||
/* 803657CC 38 60 00 02 */ li r3, 2
|
||||
/* 803657D0 4B FF FC 99 */ bl __begin_critical_region
|
||||
/* 803657D4 7F 83 E3 78 */ mr r3, r28
|
||||
/* 803657D8 7F A4 EB 78 */ mr r4, r29
|
||||
/* 803657DC 7F C5 F3 78 */ mr r5, r30
|
||||
/* 803657E0 7F E6 FB 78 */ mr r6, r31
|
||||
/* 803657E4 4B FF FC B1 */ bl __fwrite
|
||||
/* 803657E8 7C 60 1B 78 */ mr r0, r3
|
||||
/* 803657EC 38 60 00 02 */ li r3, 2
|
||||
/* 803657F0 7C 1F 03 78 */ mr r31, r0
|
||||
/* 803657F4 4B FF FC 71 */ bl __end_critical_region
|
||||
/* 803657F8 80 01 00 24 */ lwz r0, 0x24(r1)
|
||||
/* 803657FC 7F E3 FB 78 */ mr r3, r31
|
||||
/* 80365800 83 E1 00 1C */ lwz r31, 0x1c(r1)
|
||||
/* 80365804 83 C1 00 18 */ lwz r30, 0x18(r1)
|
||||
/* 80365808 83 A1 00 14 */ lwz r29, 0x14(r1)
|
||||
/* 8036580C 83 81 00 10 */ lwz r28, 0x10(r1)
|
||||
/* 80365810 7C 08 03 A6 */ mtlr r0
|
||||
/* 80365814 38 21 00 20 */ addi r1, r1, 0x20
|
||||
/* 80365818 4E 80 00 20 */ blr
|
|
@ -1,129 +0,0 @@
|
|||
lbl_803659F8:
|
||||
/* 803659F8 94 21 FF E0 */ stwu r1, -0x20(r1)
|
||||
/* 803659FC 7C 08 02 A6 */ mflr r0
|
||||
/* 80365A00 90 01 00 24 */ stw r0, 0x24(r1)
|
||||
/* 80365A04 93 E1 00 1C */ stw r31, 0x1c(r1)
|
||||
/* 80365A08 7C 7F 1B 79 */ or. r31, r3, r3
|
||||
/* 80365A0C 93 C1 00 18 */ stw r30, 0x18(r1)
|
||||
/* 80365A10 93 A1 00 14 */ stw r29, 0x14(r1)
|
||||
/* 80365A14 40 82 00 0C */ bne lbl_80365A20
|
||||
/* 80365A18 38 60 FF FF */ li r3, -1
|
||||
/* 80365A1C 48 00 01 7C */ b lbl_80365B98
|
||||
lbl_80365A20:
|
||||
/* 80365A20 A0 1F 00 04 */ lhz r0, 4(r31)
|
||||
/* 80365A24 54 03 D7 7F */ rlwinm. r3, r0, 0x1a, 0x1d, 0x1f
|
||||
/* 80365A28 40 82 00 0C */ bne lbl_80365A34
|
||||
/* 80365A2C 38 60 00 00 */ li r3, 0
|
||||
/* 80365A30 48 00 01 68 */ b lbl_80365B98
|
||||
lbl_80365A34:
|
||||
/* 80365A34 28 1F 00 00 */ cmplwi r31, 0
|
||||
/* 80365A38 40 82 00 10 */ bne lbl_80365A48
|
||||
/* 80365A3C 4B FF D5 D1 */ bl __flush_all
|
||||
/* 80365A40 7C 7D 1B 78 */ mr r29, r3
|
||||
/* 80365A44 48 00 00 F4 */ b lbl_80365B38
|
||||
lbl_80365A48:
|
||||
/* 80365A48 88 1F 00 0A */ lbz r0, 0xa(r31)
|
||||
/* 80365A4C 28 00 00 00 */ cmplwi r0, 0
|
||||
/* 80365A50 40 82 00 0C */ bne lbl_80365A5C
|
||||
/* 80365A54 28 03 00 00 */ cmplwi r3, 0
|
||||
/* 80365A58 40 82 00 0C */ bne lbl_80365A64
|
||||
lbl_80365A5C:
|
||||
/* 80365A5C 3B A0 FF FF */ li r29, -1
|
||||
/* 80365A60 48 00 00 D8 */ b lbl_80365B38
|
||||
lbl_80365A64:
|
||||
/* 80365A64 88 1F 00 04 */ lbz r0, 4(r31)
|
||||
/* 80365A68 54 00 EF 7E */ rlwinm r0, r0, 0x1d, 0x1d, 0x1f
|
||||
/* 80365A6C 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 80365A70 40 82 00 0C */ bne lbl_80365A7C
|
||||
/* 80365A74 3B A0 00 00 */ li r29, 0
|
||||
/* 80365A78 48 00 00 C0 */ b lbl_80365B38
|
||||
lbl_80365A7C:
|
||||
/* 80365A7C 88 7F 00 08 */ lbz r3, 8(r31)
|
||||
/* 80365A80 54 60 DF 7E */ rlwinm r0, r3, 0x1b, 0x1d, 0x1f
|
||||
/* 80365A84 28 00 00 03 */ cmplwi r0, 3
|
||||
/* 80365A88 41 80 00 10 */ blt lbl_80365A98
|
||||
/* 80365A8C 38 00 00 02 */ li r0, 2
|
||||
/* 80365A90 50 03 2E 34 */ rlwimi r3, r0, 5, 0x18, 0x1a
|
||||
/* 80365A94 98 7F 00 08 */ stb r3, 8(r31)
|
||||
lbl_80365A98:
|
||||
/* 80365A98 88 1F 00 08 */ lbz r0, 8(r31)
|
||||
/* 80365A9C 54 00 DF 7E */ rlwinm r0, r0, 0x1b, 0x1d, 0x1f
|
||||
/* 80365AA0 28 00 00 02 */ cmplwi r0, 2
|
||||
/* 80365AA4 40 82 00 0C */ bne lbl_80365AB0
|
||||
/* 80365AA8 38 00 00 00 */ li r0, 0
|
||||
/* 80365AAC 90 1F 00 28 */ stw r0, 0x28(r31)
|
||||
lbl_80365AB0:
|
||||
/* 80365AB0 88 7F 00 08 */ lbz r3, 8(r31)
|
||||
/* 80365AB4 54 60 DF 7E */ rlwinm r0, r3, 0x1b, 0x1d, 0x1f
|
||||
/* 80365AB8 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 80365ABC 41 82 00 14 */ beq lbl_80365AD0
|
||||
/* 80365AC0 3B A0 00 00 */ li r29, 0
|
||||
/* 80365AC4 53 A3 2E 34 */ rlwimi r3, r29, 5, 0x18, 0x1a
|
||||
/* 80365AC8 98 7F 00 08 */ stb r3, 8(r31)
|
||||
/* 80365ACC 48 00 00 6C */ b lbl_80365B38
|
||||
lbl_80365AD0:
|
||||
/* 80365AD0 A0 1F 00 04 */ lhz r0, 4(r31)
|
||||
/* 80365AD4 54 00 D7 7E */ rlwinm r0, r0, 0x1a, 0x1d, 0x1f
|
||||
/* 80365AD8 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 80365ADC 41 82 00 0C */ beq lbl_80365AE8
|
||||
/* 80365AE0 3B C0 00 00 */ li r30, 0
|
||||
/* 80365AE4 48 00 00 10 */ b lbl_80365AF4
|
||||
lbl_80365AE8:
|
||||
/* 80365AE8 7F E3 FB 78 */ mr r3, r31
|
||||
/* 80365AEC 48 00 03 A5 */ bl ftell
|
||||
/* 80365AF0 7C 7E 1B 78 */ mr r30, r3
|
||||
lbl_80365AF4:
|
||||
/* 80365AF4 7F E3 FB 78 */ mr r3, r31
|
||||
/* 80365AF8 38 80 00 00 */ li r4, 0
|
||||
/* 80365AFC 4B FF F5 E5 */ bl __flush_buffer
|
||||
/* 80365B00 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 80365B04 41 82 00 1C */ beq lbl_80365B20
|
||||
/* 80365B08 38 60 00 01 */ li r3, 1
|
||||
/* 80365B0C 38 00 00 00 */ li r0, 0
|
||||
/* 80365B10 98 7F 00 0A */ stb r3, 0xa(r31)
|
||||
/* 80365B14 3B A0 FF FF */ li r29, -1
|
||||
/* 80365B18 90 1F 00 28 */ stw r0, 0x28(r31)
|
||||
/* 80365B1C 48 00 00 1C */ b lbl_80365B38
|
||||
lbl_80365B20:
|
||||
/* 80365B20 3B A0 00 00 */ li r29, 0
|
||||
/* 80365B24 88 1F 00 08 */ lbz r0, 8(r31)
|
||||
/* 80365B28 53 A0 2E 34 */ rlwimi r0, r29, 5, 0x18, 0x1a
|
||||
/* 80365B2C 98 1F 00 08 */ stb r0, 8(r31)
|
||||
/* 80365B30 93 DF 00 18 */ stw r30, 0x18(r31)
|
||||
/* 80365B34 93 BF 00 28 */ stw r29, 0x28(r31)
|
||||
lbl_80365B38:
|
||||
/* 80365B38 81 9F 00 44 */ lwz r12, 0x44(r31)
|
||||
/* 80365B3C 80 7F 00 00 */ lwz r3, 0(r31)
|
||||
/* 80365B40 7D 89 03 A6 */ mtctr r12
|
||||
/* 80365B44 4E 80 04 21 */ bctrl
|
||||
/* 80365B48 A0 1F 00 04 */ lhz r0, 4(r31)
|
||||
/* 80365B4C 38 80 00 00 */ li r4, 0
|
||||
/* 80365B50 50 80 35 F2 */ rlwimi r0, r4, 6, 0x17, 0x19
|
||||
/* 80365B54 7C 7E 1B 78 */ mr r30, r3
|
||||
/* 80365B58 B0 1F 00 04 */ sth r0, 4(r31)
|
||||
/* 80365B5C 90 9F 00 00 */ stw r4, 0(r31)
|
||||
/* 80365B60 88 1F 00 08 */ lbz r0, 8(r31)
|
||||
/* 80365B64 54 00 E7 FF */ rlwinm. r0, r0, 0x1c, 0x1f, 0x1f
|
||||
/* 80365B68 41 82 00 0C */ beq lbl_80365B74
|
||||
/* 80365B6C 80 7F 00 1C */ lwz r3, 0x1c(r31)
|
||||
/* 80365B70 4B FF CF E9 */ bl free
|
||||
lbl_80365B74:
|
||||
/* 80365B74 2C 1D 00 00 */ cmpwi r29, 0
|
||||
/* 80365B78 38 60 00 00 */ li r3, 0
|
||||
/* 80365B7C 40 82 00 0C */ bne lbl_80365B88
|
||||
/* 80365B80 2C 1E 00 00 */ cmpwi r30, 0
|
||||
/* 80365B84 41 82 00 08 */ beq lbl_80365B8C
|
||||
lbl_80365B88:
|
||||
/* 80365B88 38 60 00 01 */ li r3, 1
|
||||
lbl_80365B8C:
|
||||
/* 80365B8C 7C 03 00 D0 */ neg r0, r3
|
||||
/* 80365B90 7C 00 1B 78 */ or r0, r0, r3
|
||||
/* 80365B94 7C 03 FE 70 */ srawi r3, r0, 0x1f
|
||||
lbl_80365B98:
|
||||
/* 80365B98 80 01 00 24 */ lwz r0, 0x24(r1)
|
||||
/* 80365B9C 83 E1 00 1C */ lwz r31, 0x1c(r1)
|
||||
/* 80365BA0 83 C1 00 18 */ lwz r30, 0x18(r1)
|
||||
/* 80365BA4 83 A1 00 14 */ lwz r29, 0x14(r1)
|
||||
/* 80365BA8 7C 08 03 A6 */ mtlr r0
|
||||
/* 80365BAC 38 21 00 20 */ addi r1, r1, 0x20
|
||||
/* 80365BB0 4E 80 00 20 */ blr
|
|
@ -1,90 +0,0 @@
|
|||
lbl_803658C0:
|
||||
/* 803658C0 94 21 FF F0 */ stwu r1, -0x10(r1)
|
||||
/* 803658C4 7C 08 02 A6 */ mflr r0
|
||||
/* 803658C8 90 01 00 14 */ stw r0, 0x14(r1)
|
||||
/* 803658CC 93 E1 00 0C */ stw r31, 0xc(r1)
|
||||
/* 803658D0 7C 7F 1B 79 */ or. r31, r3, r3
|
||||
/* 803658D4 93 C1 00 08 */ stw r30, 8(r1)
|
||||
/* 803658D8 40 82 00 0C */ bne lbl_803658E4
|
||||
/* 803658DC 4B FF D7 31 */ bl __flush_all
|
||||
/* 803658E0 48 00 01 00 */ b lbl_803659E0
|
||||
lbl_803658E4:
|
||||
/* 803658E4 88 1F 00 0A */ lbz r0, 0xa(r31)
|
||||
/* 803658E8 28 00 00 00 */ cmplwi r0, 0
|
||||
/* 803658EC 40 82 00 10 */ bne lbl_803658FC
|
||||
/* 803658F0 A0 1F 00 04 */ lhz r0, 4(r31)
|
||||
/* 803658F4 54 00 D7 7F */ rlwinm. r0, r0, 0x1a, 0x1d, 0x1f
|
||||
/* 803658F8 40 82 00 0C */ bne lbl_80365904
|
||||
lbl_803658FC:
|
||||
/* 803658FC 38 60 FF FF */ li r3, -1
|
||||
/* 80365900 48 00 00 E0 */ b lbl_803659E0
|
||||
lbl_80365904:
|
||||
/* 80365904 88 1F 00 04 */ lbz r0, 4(r31)
|
||||
/* 80365908 54 00 EF 7E */ rlwinm r0, r0, 0x1d, 0x1d, 0x1f
|
||||
/* 8036590C 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 80365910 40 82 00 0C */ bne lbl_8036591C
|
||||
/* 80365914 38 60 00 00 */ li r3, 0
|
||||
/* 80365918 48 00 00 C8 */ b lbl_803659E0
|
||||
lbl_8036591C:
|
||||
/* 8036591C 88 7F 00 08 */ lbz r3, 8(r31)
|
||||
/* 80365920 54 60 DF 7E */ rlwinm r0, r3, 0x1b, 0x1d, 0x1f
|
||||
/* 80365924 28 00 00 03 */ cmplwi r0, 3
|
||||
/* 80365928 41 80 00 10 */ blt lbl_80365938
|
||||
/* 8036592C 38 00 00 02 */ li r0, 2
|
||||
/* 80365930 50 03 2E 34 */ rlwimi r3, r0, 5, 0x18, 0x1a
|
||||
/* 80365934 98 7F 00 08 */ stb r3, 8(r31)
|
||||
lbl_80365938:
|
||||
/* 80365938 88 1F 00 08 */ lbz r0, 8(r31)
|
||||
/* 8036593C 54 00 DF 7E */ rlwinm r0, r0, 0x1b, 0x1d, 0x1f
|
||||
/* 80365940 28 00 00 02 */ cmplwi r0, 2
|
||||
/* 80365944 40 82 00 0C */ bne lbl_80365950
|
||||
/* 80365948 38 00 00 00 */ li r0, 0
|
||||
/* 8036594C 90 1F 00 28 */ stw r0, 0x28(r31)
|
||||
lbl_80365950:
|
||||
/* 80365950 88 9F 00 08 */ lbz r4, 8(r31)
|
||||
/* 80365954 54 80 DF 7E */ rlwinm r0, r4, 0x1b, 0x1d, 0x1f
|
||||
/* 80365958 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 8036595C 41 82 00 18 */ beq lbl_80365974
|
||||
/* 80365960 38 00 00 00 */ li r0, 0
|
||||
/* 80365964 38 60 00 00 */ li r3, 0
|
||||
/* 80365968 50 04 2E 34 */ rlwimi r4, r0, 5, 0x18, 0x1a
|
||||
/* 8036596C 98 9F 00 08 */ stb r4, 8(r31)
|
||||
/* 80365970 48 00 00 70 */ b lbl_803659E0
|
||||
lbl_80365974:
|
||||
/* 80365974 A0 1F 00 04 */ lhz r0, 4(r31)
|
||||
/* 80365978 54 00 D7 7E */ rlwinm r0, r0, 0x1a, 0x1d, 0x1f
|
||||
/* 8036597C 28 00 00 01 */ cmplwi r0, 1
|
||||
/* 80365980 41 82 00 0C */ beq lbl_8036598C
|
||||
/* 80365984 3B C0 00 00 */ li r30, 0
|
||||
/* 80365988 48 00 00 10 */ b lbl_80365998
|
||||
lbl_8036598C:
|
||||
/* 8036598C 7F E3 FB 78 */ mr r3, r31
|
||||
/* 80365990 48 00 05 01 */ bl ftell
|
||||
/* 80365994 7C 7E 1B 78 */ mr r30, r3
|
||||
lbl_80365998:
|
||||
/* 80365998 7F E3 FB 78 */ mr r3, r31
|
||||
/* 8036599C 38 80 00 00 */ li r4, 0
|
||||
/* 803659A0 4B FF F7 41 */ bl __flush_buffer
|
||||
/* 803659A4 2C 03 00 00 */ cmpwi r3, 0
|
||||
/* 803659A8 41 82 00 1C */ beq lbl_803659C4
|
||||
/* 803659AC 38 60 00 01 */ li r3, 1
|
||||
/* 803659B0 38 00 00 00 */ li r0, 0
|
||||
/* 803659B4 98 7F 00 0A */ stb r3, 0xa(r31)
|
||||
/* 803659B8 38 60 FF FF */ li r3, -1
|
||||
/* 803659BC 90 1F 00 28 */ stw r0, 0x28(r31)
|
||||
/* 803659C0 48 00 00 20 */ b lbl_803659E0
|
||||
lbl_803659C4:
|
||||
/* 803659C4 88 1F 00 08 */ lbz r0, 8(r31)
|
||||
/* 803659C8 38 80 00 00 */ li r4, 0
|
||||
/* 803659CC 50 80 2E 34 */ rlwimi r0, r4, 5, 0x18, 0x1a
|
||||
/* 803659D0 38 60 00 00 */ li r3, 0
|
||||
/* 803659D4 98 1F 00 08 */ stb r0, 8(r31)
|
||||
/* 803659D8 93 DF 00 18 */ stw r30, 0x18(r31)
|
||||
/* 803659DC 90 9F 00 28 */ stw r4, 0x28(r31)
|
||||
lbl_803659E0:
|
||||
/* 803659E0 80 01 00 14 */ lwz r0, 0x14(r1)
|
||||
/* 803659E4 83 E1 00 0C */ lwz r31, 0xc(r1)
|
||||
/* 803659E8 83 C1 00 08 */ lwz r30, 8(r1)
|
||||
/* 803659EC 7C 08 03 A6 */ mtlr r0
|
||||
/* 803659F0 38 21 00 10 */ addi r1, r1, 0x10
|
||||
/* 803659F4 4E 80 00 20 */ blr
|
|
@ -1,55 +0,0 @@
|
|||
lbl_80366410:
|
||||
/* 80366410 7C 03 00 D0 */ neg r0, r3
|
||||
/* 80366414 38 84 FF FF */ addi r4, r4, -1
|
||||
/* 80366418 54 06 07 BF */ clrlwi. r6, r0, 0x1e
|
||||
/* 8036641C 38 63 FF FF */ addi r3, r3, -1
|
||||
/* 80366420 41 82 00 18 */ beq lbl_80366438
|
||||
/* 80366424 7C A6 28 50 */ subf r5, r6, r5
|
||||
lbl_80366428:
|
||||
/* 80366428 8C 04 00 01 */ lbzu r0, 1(r4)
|
||||
/* 8036642C 34 C6 FF FF */ addic. r6, r6, -1
|
||||
/* 80366430 9C 03 00 01 */ stbu r0, 1(r3)
|
||||
/* 80366434 40 82 FF F4 */ bne lbl_80366428
|
||||
lbl_80366438:
|
||||
/* 80366438 54 A6 D9 7F */ rlwinm. r6, r5, 0x1b, 5, 0x1f
|
||||
/* 8036643C 38 E4 FF FD */ addi r7, r4, -3
|
||||
/* 80366440 38 83 FF FD */ addi r4, r3, -3
|
||||
/* 80366444 41 82 00 4C */ beq lbl_80366490
|
||||
lbl_80366448:
|
||||
/* 80366448 80 67 00 04 */ lwz r3, 4(r7)
|
||||
/* 8036644C 34 C6 FF FF */ addic. r6, r6, -1
|
||||
/* 80366450 80 07 00 08 */ lwz r0, 8(r7)
|
||||
/* 80366454 90 64 00 04 */ stw r3, 4(r4)
|
||||
/* 80366458 80 67 00 0C */ lwz r3, 0xc(r7)
|
||||
/* 8036645C 90 04 00 08 */ stw r0, 8(r4)
|
||||
/* 80366460 80 07 00 10 */ lwz r0, 0x10(r7)
|
||||
/* 80366464 90 64 00 0C */ stw r3, 0xc(r4)
|
||||
/* 80366468 80 67 00 14 */ lwz r3, 0x14(r7)
|
||||
/* 8036646C 90 04 00 10 */ stw r0, 0x10(r4)
|
||||
/* 80366470 80 07 00 18 */ lwz r0, 0x18(r7)
|
||||
/* 80366474 90 64 00 14 */ stw r3, 0x14(r4)
|
||||
/* 80366478 80 67 00 1C */ lwz r3, 0x1c(r7)
|
||||
/* 8036647C 90 04 00 18 */ stw r0, 0x18(r4)
|
||||
/* 80366480 84 07 00 20 */ lwzu r0, 0x20(r7)
|
||||
/* 80366484 90 64 00 1C */ stw r3, 0x1c(r4)
|
||||
/* 80366488 94 04 00 20 */ stwu r0, 0x20(r4)
|
||||
/* 8036648C 40 82 FF BC */ bne lbl_80366448
|
||||
lbl_80366490:
|
||||
/* 80366490 54 A3 F7 7F */ rlwinm. r3, r5, 0x1e, 0x1d, 0x1f
|
||||
/* 80366494 41 82 00 14 */ beq lbl_803664A8
|
||||
lbl_80366498:
|
||||
/* 80366498 84 07 00 04 */ lwzu r0, 4(r7)
|
||||
/* 8036649C 34 63 FF FF */ addic. r3, r3, -1
|
||||
/* 803664A0 94 04 00 04 */ stwu r0, 4(r4)
|
||||
/* 803664A4 40 82 FF F4 */ bne lbl_80366498
|
||||
lbl_803664A8:
|
||||
/* 803664A8 54 A5 07 BF */ clrlwi. r5, r5, 0x1e
|
||||
/* 803664AC 38 C7 00 03 */ addi r6, r7, 3
|
||||
/* 803664B0 38 64 00 03 */ addi r3, r4, 3
|
||||
/* 803664B4 4D 82 00 20 */ beqlr
|
||||
lbl_803664B8:
|
||||
/* 803664B8 8C 06 00 01 */ lbzu r0, 1(r6)
|
||||
/* 803664BC 34 A5 FF FF */ addic. r5, r5, -1
|
||||
/* 803664C0 9C 03 00 01 */ stbu r0, 1(r3)
|
||||
/* 803664C4 40 82 FF F4 */ bne lbl_803664B8
|
||||
/* 803664C8 4E 80 00 20 */ blr
|
|
@ -1,50 +0,0 @@
|
|||
lbl_80366368:
|
||||
/* 80366368 7C E3 2A 14 */ add r7, r3, r5
|
||||
/* 8036636C 7C C4 2A 14 */ add r6, r4, r5
|
||||
/* 80366370 54 E3 07 BF */ clrlwi. r3, r7, 0x1e
|
||||
/* 80366374 41 82 00 18 */ beq lbl_8036638C
|
||||
/* 80366378 7C A3 28 50 */ subf r5, r3, r5
|
||||
lbl_8036637C:
|
||||
/* 8036637C 8C 06 FF FF */ lbzu r0, -1(r6)
|
||||
/* 80366380 34 63 FF FF */ addic. r3, r3, -1
|
||||
/* 80366384 9C 07 FF FF */ stbu r0, -1(r7)
|
||||
/* 80366388 40 82 FF F4 */ bne lbl_8036637C
|
||||
lbl_8036638C:
|
||||
/* 8036638C 54 A4 D9 7F */ rlwinm. r4, r5, 0x1b, 5, 0x1f
|
||||
/* 80366390 41 82 00 4C */ beq lbl_803663DC
|
||||
lbl_80366394:
|
||||
/* 80366394 80 66 FF FC */ lwz r3, -4(r6)
|
||||
/* 80366398 34 84 FF FF */ addic. r4, r4, -1
|
||||
/* 8036639C 80 06 FF F8 */ lwz r0, -8(r6)
|
||||
/* 803663A0 90 67 FF FC */ stw r3, -4(r7)
|
||||
/* 803663A4 80 66 FF F4 */ lwz r3, -0xc(r6)
|
||||
/* 803663A8 90 07 FF F8 */ stw r0, -8(r7)
|
||||
/* 803663AC 80 06 FF F0 */ lwz r0, -0x10(r6)
|
||||
/* 803663B0 90 67 FF F4 */ stw r3, -0xc(r7)
|
||||
/* 803663B4 80 66 FF EC */ lwz r3, -0x14(r6)
|
||||
/* 803663B8 90 07 FF F0 */ stw r0, -0x10(r7)
|
||||
/* 803663BC 80 06 FF E8 */ lwz r0, -0x18(r6)
|
||||
/* 803663C0 90 67 FF EC */ stw r3, -0x14(r7)
|
||||
/* 803663C4 80 66 FF E4 */ lwz r3, -0x1c(r6)
|
||||
/* 803663C8 90 07 FF E8 */ stw r0, -0x18(r7)
|
||||
/* 803663CC 84 06 FF E0 */ lwzu r0, -0x20(r6)
|
||||
/* 803663D0 90 67 FF E4 */ stw r3, -0x1c(r7)
|
||||
/* 803663D4 94 07 FF E0 */ stwu r0, -0x20(r7)
|
||||
/* 803663D8 40 82 FF BC */ bne lbl_80366394
|
||||
lbl_803663DC:
|
||||
/* 803663DC 54 A3 F7 7F */ rlwinm. r3, r5, 0x1e, 0x1d, 0x1f
|
||||
/* 803663E0 41 82 00 14 */ beq lbl_803663F4
|
||||
lbl_803663E4:
|
||||
/* 803663E4 84 06 FF FC */ lwzu r0, -4(r6)
|
||||
/* 803663E8 34 63 FF FF */ addic. r3, r3, -1
|
||||
/* 803663EC 94 07 FF FC */ stwu r0, -4(r7)
|
||||
/* 803663F0 40 82 FF F4 */ bne lbl_803663E4
|
||||
lbl_803663F4:
|
||||
/* 803663F4 54 A5 07 BF */ clrlwi. r5, r5, 0x1e
|
||||
/* 803663F8 4D 82 00 20 */ beqlr
|
||||
lbl_803663FC:
|
||||
/* 803663FC 8C 06 FF FF */ lbzu r0, -1(r6)
|
||||
/* 80366400 34 A5 FF FF */ addic. r5, r5, -1
|
||||
/* 80366404 9C 07 FF FF */ stbu r0, -1(r7)
|
||||
/* 80366408 40 82 FF F4 */ bne lbl_803663FC
|
||||
/* 8036640C 4E 80 00 20 */ blr
|
|
@ -1,49 +0,0 @@
|
|||
lbl_803661FC:
|
||||
/* 803661FC 7D 63 2A 14 */ add r11, r3, r5
|
||||
/* 80366200 7D 44 2A 14 */ add r10, r4, r5
|
||||
/* 80366204 55 63 07 BF */ clrlwi. r3, r11, 0x1e
|
||||
/* 80366208 41 82 00 18 */ beq lbl_80366220
|
||||
/* 8036620C 7C A3 28 50 */ subf r5, r3, r5
|
||||
lbl_80366210:
|
||||
/* 80366210 8C 0A FF FF */ lbzu r0, -1(r10)
|
||||
/* 80366214 34 63 FF FF */ addic. r3, r3, -1
|
||||
/* 80366218 9C 0B FF FF */ stbu r0, -1(r11)
|
||||
/* 8036621C 40 82 FF F4 */ bne lbl_80366210
|
||||
lbl_80366220:
|
||||
/* 80366220 55 48 1E F8 */ rlwinm r8, r10, 3, 0x1b, 0x1c
|
||||
/* 80366224 55 47 07 BE */ clrlwi r7, r10, 0x1e
|
||||
/* 80366228 21 28 00 20 */ subfic r9, r8, 0x20
|
||||
/* 8036622C 54 A6 E8 FE */ srwi r6, r5, 3
|
||||
/* 80366230 20 07 00 04 */ subfic r0, r7, 4
|
||||
/* 80366234 7D 4A 02 14 */ add r10, r10, r0
|
||||
/* 80366238 84 8A FF FC */ lwzu r4, -4(r10)
|
||||
lbl_8036623C:
|
||||
/* 8036623C 80 0A FF FC */ lwz r0, -4(r10)
|
||||
/* 80366240 7C 83 4C 30 */ srw r3, r4, r9
|
||||
/* 80366244 34 C6 FF FF */ addic. r6, r6, -1
|
||||
/* 80366248 7C 04 40 30 */ slw r4, r0, r8
|
||||
/* 8036624C 7C 00 4C 30 */ srw r0, r0, r9
|
||||
/* 80366250 7C 83 1B 78 */ or r3, r4, r3
|
||||
/* 80366254 90 6B FF FC */ stw r3, -4(r11)
|
||||
/* 80366258 84 8A FF F8 */ lwzu r4, -8(r10)
|
||||
/* 8036625C 7C 83 40 30 */ slw r3, r4, r8
|
||||
/* 80366260 7C 60 03 78 */ or r0, r3, r0
|
||||
/* 80366264 94 0B FF F8 */ stwu r0, -8(r11)
|
||||
/* 80366268 40 82 FF D4 */ bne lbl_8036623C
|
||||
/* 8036626C 54 A0 07 7B */ rlwinm. r0, r5, 0, 0x1d, 0x1d
|
||||
/* 80366270 41 82 00 18 */ beq lbl_80366288
|
||||
/* 80366274 84 6A FF FC */ lwzu r3, -4(r10)
|
||||
/* 80366278 7C 80 4C 30 */ srw r0, r4, r9
|
||||
/* 8036627C 7C 63 40 30 */ slw r3, r3, r8
|
||||
/* 80366280 7C 60 03 78 */ or r0, r3, r0
|
||||
/* 80366284 94 0B FF FC */ stwu r0, -4(r11)
|
||||
lbl_80366288:
|
||||
/* 80366288 54 A5 07 BF */ clrlwi. r5, r5, 0x1e
|
||||
/* 8036628C 4D 82 00 20 */ beqlr
|
||||
/* 80366290 7D 4A 3A 14 */ add r10, r10, r7
|
||||
lbl_80366294:
|
||||
/* 80366294 8C 0A FF FF */ lbzu r0, -1(r10)
|
||||
/* 80366298 34 A5 FF FF */ addic. r5, r5, -1
|
||||
/* 8036629C 9C 0B FF FF */ stbu r0, -1(r11)
|
||||
/* 803662A0 40 82 FF F4 */ bne lbl_80366294
|
||||
/* 803662A4 4E 80 00 20 */ blr
|
|
@ -1,54 +0,0 @@
|
|||
lbl_803662A8:
|
||||
/* 803662A8 7C 03 00 D0 */ neg r0, r3
|
||||
/* 803662AC 39 04 FF FF */ addi r8, r4, -1
|
||||
/* 803662B0 54 06 07 BF */ clrlwi. r6, r0, 0x1e
|
||||
/* 803662B4 38 63 FF FF */ addi r3, r3, -1
|
||||
/* 803662B8 41 82 00 18 */ beq lbl_803662D0
|
||||
/* 803662BC 7C A6 28 50 */ subf r5, r6, r5
|
||||
lbl_803662C0:
|
||||
/* 803662C0 8C 08 00 01 */ lbzu r0, 1(r8)
|
||||
/* 803662C4 34 C6 FF FF */ addic. r6, r6, -1
|
||||
/* 803662C8 9C 03 00 01 */ stbu r0, 1(r3)
|
||||
/* 803662CC 40 82 FF F4 */ bne lbl_803662C0
|
||||
lbl_803662D0:
|
||||
/* 803662D0 38 08 00 01 */ addi r0, r8, 1
|
||||
/* 803662D4 38 C3 FF FD */ addi r6, r3, -3
|
||||
/* 803662D8 54 09 07 BE */ clrlwi r9, r0, 0x1e
|
||||
/* 803662DC 54 A7 E8 FE */ srwi r7, r5, 3
|
||||
/* 803662E0 7D 09 40 50 */ subf r8, r9, r8
|
||||
/* 803662E4 54 0A 1E F8 */ rlwinm r10, r0, 3, 0x1b, 0x1c
|
||||
/* 803662E8 84 88 00 01 */ lwzu r4, 1(r8)
|
||||
/* 803662EC 21 6A 00 20 */ subfic r11, r10, 0x20
|
||||
lbl_803662F0:
|
||||
/* 803662F0 80 68 00 04 */ lwz r3, 4(r8)
|
||||
/* 803662F4 7C 84 50 30 */ slw r4, r4, r10
|
||||
/* 803662F8 34 E7 FF FF */ addic. r7, r7, -1
|
||||
/* 803662FC 7C 60 5C 30 */ srw r0, r3, r11
|
||||
/* 80366300 7C 63 50 30 */ slw r3, r3, r10
|
||||
/* 80366304 7C 80 03 78 */ or r0, r4, r0
|
||||
/* 80366308 90 06 00 04 */ stw r0, 4(r6)
|
||||
/* 8036630C 84 88 00 08 */ lwzu r4, 8(r8)
|
||||
/* 80366310 7C 80 5C 30 */ srw r0, r4, r11
|
||||
/* 80366314 7C 60 03 78 */ or r0, r3, r0
|
||||
/* 80366318 94 06 00 08 */ stwu r0, 8(r6)
|
||||
/* 8036631C 40 82 FF D4 */ bne lbl_803662F0
|
||||
/* 80366320 54 A0 07 7B */ rlwinm. r0, r5, 0, 0x1d, 0x1d
|
||||
/* 80366324 41 82 00 18 */ beq lbl_8036633C
|
||||
/* 80366328 84 08 00 04 */ lwzu r0, 4(r8)
|
||||
/* 8036632C 7C 83 50 30 */ slw r3, r4, r10
|
||||
/* 80366330 7C 00 5C 30 */ srw r0, r0, r11
|
||||
/* 80366334 7C 60 03 78 */ or r0, r3, r0
|
||||
/* 80366338 94 06 00 04 */ stwu r0, 4(r6)
|
||||
lbl_8036633C:
|
||||
/* 8036633C 54 A5 07 BF */ clrlwi. r5, r5, 0x1e
|
||||
/* 80366340 38 88 00 03 */ addi r4, r8, 3
|
||||
/* 80366344 38 66 00 03 */ addi r3, r6, 3
|
||||
/* 80366348 4D 82 00 20 */ beqlr
|
||||
/* 8036634C 20 09 00 04 */ subfic r0, r9, 4
|
||||
/* 80366350 7C 80 20 50 */ subf r4, r0, r4
|
||||
lbl_80366354:
|
||||
/* 80366354 8C 04 00 01 */ lbzu r0, 1(r4)
|
||||
/* 80366358 34 A5 FF FF */ addic. r5, r5, -1
|
||||
/* 8036635C 9C 03 00 01 */ stbu r0, 1(r3)
|
||||
/* 80366360 40 82 FF F4 */ bne lbl_80366354
|
||||
/* 80366364 4E 80 00 20 */ blr
|
|
@ -1,6 +1,18 @@
|
|||
#ifndef MSL_COMMON_SRC_FILE_POS_H
|
||||
#define MSL_COMMON_SRC_FILE_POS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int fseek(FILE* file, long offset, int mode);
|
||||
int _fseek(FILE* file, fpos_t offset, int mode);
|
||||
long ftell(FILE* file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_FILE_POS_H */
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
#ifndef MSL_COMMON_SRC_ABORT_EXIT_H
|
||||
#define MSL_COMMON_SRC_ABORT_EXIT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void exit(int status);
|
||||
void abort(void);
|
||||
|
||||
extern void (*__stdio_exit)(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ABORT_EXIT_H */
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
#ifndef MSL_COMMON_SRC_ALLOC_H
|
||||
#define MSL_COMMON_SRC_ALLOC_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void free(FILE* file);
|
||||
void __pool_free();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ALLOC_H */
|
||||
|
|
|
@ -1,11 +1,33 @@
|
|||
#ifndef MSL_COMMON_SRC_ANSI_FILES_H
|
||||
#define MSL_COMMON_SRC_ANSI_FILES_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
typedef unsigned long __file_handle;
|
||||
typedef unsigned long fpos_t;
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
|
||||
#define set_error(file) \
|
||||
do { \
|
||||
(file)->file_state.error = 1; \
|
||||
(file)->buffer_length = 0; \
|
||||
} while (0)
|
||||
|
||||
enum __file_kinds {
|
||||
/* 0x0 */ CLOSED_FILE,
|
||||
/* 0x1 */ DISK_FILE,
|
||||
/* 0x2 */ CONSOLE_FILE,
|
||||
/* 0x3 */ UNAVAILABLE_FILE,
|
||||
__closed_file,
|
||||
__disk_file,
|
||||
__console_file,
|
||||
__unavailable_file,
|
||||
};
|
||||
|
||||
enum __file_orientation {
|
||||
|
@ -23,6 +45,26 @@ typedef struct _file_modes {
|
|||
unsigned int binary_io : 1;
|
||||
} file_modes;
|
||||
|
||||
enum __io_modes {
|
||||
__read = 1,
|
||||
__write = 2,
|
||||
__read_write = 3,
|
||||
__append = 4,
|
||||
};
|
||||
|
||||
enum __io_states {
|
||||
__neutral,
|
||||
__writing,
|
||||
__reading,
|
||||
__rereading,
|
||||
};
|
||||
|
||||
enum __io_results {
|
||||
__no_io_error,
|
||||
__io_error,
|
||||
__io_EOF,
|
||||
};
|
||||
|
||||
typedef struct _file_states {
|
||||
unsigned int io_state : 3;
|
||||
unsigned int free_buffer : 1;
|
||||
|
@ -30,28 +72,34 @@ typedef struct _file_states {
|
|||
unsigned char error;
|
||||
} file_states;
|
||||
|
||||
typedef void (*__idle_proc)(void);
|
||||
typedef int (*__pos_proc)(__file_handle file, fpos_t* position, int mode, __idle_proc idle_proc);
|
||||
typedef int (*__io_proc)(__file_handle file, unsigned char* buff, size_t* count,
|
||||
__idle_proc idle_proc);
|
||||
typedef int (*__close_proc)(__file_handle file);
|
||||
|
||||
typedef struct _FILE {
|
||||
/* 0x00 */ unsigned int handle;
|
||||
/* 0x00 */ __file_handle handle;
|
||||
/* 0x04 */ file_modes file_mode;
|
||||
/* 0x08 */ file_states file_state;
|
||||
/* 0x0C */ unsigned char flag;
|
||||
/* 0x0C */ unsigned char is_dynamically_allocated;
|
||||
/* 0x0D */ char char_buffer;
|
||||
/* 0x0E */ char char_buffer_2;
|
||||
/* 0x0E */ char char_buffer_overflow;
|
||||
/* 0x0F */ char ungetc_buffer[2];
|
||||
/* 0x12 */ unsigned short ungetc_wide_buffer[2];
|
||||
/* 0x18 */ unsigned int position;
|
||||
/* 0x12 */ wchar_t ungetc_wide_buffer[2];
|
||||
/* 0x18 */ unsigned long position;
|
||||
/* 0x1C */ unsigned char* buffer;
|
||||
/* 0x20 */ unsigned int buffer_size;
|
||||
/* 0x20 */ unsigned long buffer_size;
|
||||
/* 0x24 */ unsigned char* buffer_ptr;
|
||||
/* 0x28 */ unsigned int buffer_length;
|
||||
/* 0x2C */ unsigned int buffer_alignment;
|
||||
/* 0x30 */ unsigned int buffer_length2;
|
||||
/* 0x34 */ unsigned int buffer_position;
|
||||
/* 0x38 */ void* position_fn;
|
||||
/* 0x3C */ void* read_fn;
|
||||
/* 0x40 */ void* write_fn;
|
||||
/* 0x44 */ void* close_fn;
|
||||
/* 0x48 */ void* unknown;
|
||||
/* 0x28 */ unsigned long buffer_length;
|
||||
/* 0x2C */ unsigned long buffer_alignment;
|
||||
/* 0x30 */ unsigned long save_buffer_length;
|
||||
/* 0x34 */ unsigned long buffer_position;
|
||||
/* 0x38 */ __pos_proc position_fn;
|
||||
/* 0x3C */ __io_proc read_fn;
|
||||
/* 0x40 */ __io_proc write_fn;
|
||||
/* 0x44 */ __close_proc close_fn;
|
||||
/* 0x48 */ __idle_proc idle_fn;
|
||||
/* 0x4C */ struct _FILE* next_file;
|
||||
} FILE;
|
||||
|
||||
|
@ -62,6 +110,20 @@ typedef struct _files {
|
|||
FILE empty;
|
||||
} files;
|
||||
|
||||
#define _IONBF 0
|
||||
#define _IOLBF 1
|
||||
#define _IOFBF 2
|
||||
|
||||
extern files __files;
|
||||
extern int __close_console(__file_handle file);
|
||||
extern int __write_console(__file_handle file, unsigned char* buf, size_t* count, __idle_proc idle_fn);
|
||||
extern int __read_console(__file_handle file, unsigned char* buf, size_t* count, __idle_proc idle_fn);
|
||||
|
||||
unsigned int __flush_all(void);
|
||||
void __close_all(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ANSI_FILES_H */
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
#ifndef MSL_COMMON_SRC_ARITH_H
|
||||
#define MSL_COMMON_SRC_ARITH_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int quot; /* quotient */
|
||||
int rem; /* remainder */
|
||||
} div_t;
|
||||
|
||||
div_t div(int numerator, int denominator);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ARITH_H */
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
#ifndef MSL_COMMON_SRC_BUFFER_IO_H
|
||||
#define MSL_COMMON_SRC_BUFFER_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
enum { __align_buffer, __dont_align_buffer };
|
||||
|
||||
void __prep_buffer(FILE* file);
|
||||
int __flush_buffer(FILE* file, size_t* bytes_flushed);
|
||||
|
||||
#endif /* MSL_COMMON_SRC_BUFFER_IO_H */
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
#define MSL_COMMON_SRC_CHAR_IO_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int fputs(const char*, FILE*);
|
||||
int fputs(const char* str, FILE* stream);
|
||||
int __put_char(int c, FILE* stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,12 +1,33 @@
|
|||
#ifndef MSL_COMMON_SRC_CTYPE_H
|
||||
#define MSL_COMMON_SRC_CTYPE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define EOF -1L
|
||||
|
||||
extern unsigned char __ctype_map[];
|
||||
extern unsigned char __lower_map[];
|
||||
extern unsigned char __upper_map[];
|
||||
|
||||
#define __control_char 0x01
|
||||
#define __motion_char 0x02
|
||||
#define __space_char 0x04
|
||||
#define __punctuation 0x08
|
||||
#define __digit 0x10
|
||||
#define __hex_digit 0x20
|
||||
#define __lower_case 0x40
|
||||
#define __upper_case 0x80
|
||||
|
||||
#define __letter (__lower_case | __upper_case)
|
||||
#define __alphanumeric (__letter | __digit)
|
||||
#define __graphic (__alphanumeric | __punctuation)
|
||||
#define __printable (__graphic | __space_char)
|
||||
#define __whitespace (__motion_char | __space_char)
|
||||
#define __control (__motion_char | __control_char)
|
||||
#define __zero_fill(c) ((int)(unsigned char)(c))
|
||||
|
||||
int tolower(int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
#ifndef MSL_COMMON_SRC_DIRECT_IO_H
|
||||
#define MSL_COMMON_SRC_DIRECT_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t __fwrite(const void* buffer, size_t size, size_t count, FILE* stream);
|
||||
size_t fwrite(const void* buffer, size_t size, size_t count, FILE* stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_DIRECT_IO_H */
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
#ifndef MSL_COMMON_SRC_EXTRAS_H
|
||||
#define MSL_COMMON_SRC_EXTRAS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int strnicmp(const char* str1, const char* str2, int n);
|
||||
int stricmp(const char* str1, const char* str2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_EXTRAS_H */
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
#ifndef MSL_COMMON_SRC_FILE_IO_H
|
||||
#define MSL_COMMON_SRC_FILE_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int __msl_strnicmp(const char* str1, const char* str2, size_t n);
|
||||
int fflush(FILE* file);
|
||||
int fclose(FILE* file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_FILE_IO_H */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef MSL_COMMON_SRC_FLOAT_H
|
||||
#define MSL_COMMON_SRC_FLOAT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "fdlibm.h"
|
||||
|
||||
#define FP_SNAN 0
|
||||
|
@ -17,13 +16,13 @@
|
|||
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x))
|
||||
#define isfinite(x) ((fpclassify(x) > 2))
|
||||
|
||||
#define __signbitf(x) ((*(u8*)&(x)) & 0x80)
|
||||
#define __signbitf(x) ((*(unsigned char*)&(x)) & 0x80)
|
||||
|
||||
// TODO: OK?
|
||||
#define __signbitd(x) ((*(u8*)&(x)) & 0x80)
|
||||
#define __signbitd(x) ((*(unsigned char*)&(x)) & 0x80)
|
||||
|
||||
inline int __fpclassifyf(float __value) {
|
||||
u32 integer = *(u32*)&__value;
|
||||
unsigned long integer = *(unsigned long*)&__value;
|
||||
|
||||
switch (integer & 0x7f800000) {
|
||||
case 0x7f800000:
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
#ifndef MSL_COMMON_SRC_MBSTRING_H
|
||||
#define MSL_COMMON_SRC_MBSTRING_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/wchar_io.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t wcstombs(char* dst, const wchar_t* src, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_MBSTRING_H */
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
#ifndef MSL_COMMON_SRC_MEM_H
|
||||
#define MSL_COMMON_SRC_MEM_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int memcmp(const void*, const void*, size_t);
|
||||
int memcmp(const void* lhs, const void* rhs, size_t count);
|
||||
void* __memrchr(const void* ptr, int ch, size_t count);
|
||||
void* memchr(const void* ptr, int ch, size_t count);
|
||||
void* memmove(void* dst, const void* src, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
#ifndef MSL_COMMON_SRC_MEM_FUNCS_H
|
||||
#define MSL_COMMON_SRC_MEM_FUNCS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __copy_longs_rev_unaligned(void* dst, const void* src, size_t n);
|
||||
void __copy_longs_unaligned(void* dst, const void* src, size_t n);
|
||||
void __copy_longs_rev_aligned(void* dst, const void* src, size_t n);
|
||||
void __copy_longs_aligned(void* dst, const void* src, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_MEM_FUNCS_H */
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
#ifndef MSL_COMMON_SRC_MISC_IO_H
|
||||
#define MSL_COMMON_SRC_MISC_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __stdio_atexit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_MISC_IO_H */
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
#ifndef MSL_COMMON_SRC_PRINTF_H
|
||||
#define MSL_COMMON_SRC_PRINTF_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t sprintf(const char*, const char*, ...);
|
||||
size_t snprintf(const char*, size_t, const char*, ...);
|
||||
size_t vsnprintf(char*, size_t, const char*, va_list);
|
||||
size_t vprintf(const char*, va_list);
|
||||
size_t printf(const char*, ...);
|
||||
int fprintf(FILE* stream, const char* format, ...);
|
||||
int printf(const char* format, ...);
|
||||
int sprintf(const char* str, const char* format, ...);
|
||||
int snprintf(const char* str, size_t n, const char* format, ...);
|
||||
int vsnprintf(char* str, size_t n, const char* format, va_list arg);
|
||||
int vprintf(const char* format, va_list arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
#ifndef MSL_COMMON_SRC_SCANF_H
|
||||
#define MSL_COMMON_SRC_SCANF_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int __StringRead(char* str, int ch, int behavior);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_SCANF_H */
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
#ifndef MSL_COMMON_SRC_SIGNAL_H
|
||||
#define MSL_COMMON_SRC_SIGNAL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int raise(int sig);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_SIGNAL_H */
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef _STDDEF_H_
|
||||
#define _STDDEF_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef long ptrdiff_t;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,24 +1,23 @@
|
|||
#ifndef MSL_COMMON_SRC_STRING_H
|
||||
#define MSL_COMMON_SRC_STRING_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void* memcpy(void*, const void*, size_t);
|
||||
void* memset(void*, int, u32);
|
||||
char* strrchr(const char*, int);
|
||||
char* strchr(const char*, int);
|
||||
int strncmp(const char*, const char*, u32);
|
||||
int strcmp(const char*, const char*);
|
||||
char* strcat(char*, const char*);
|
||||
char* strncpy(char*, const char*, u32);
|
||||
char* strcpy(char*, const char*);
|
||||
u32 strlen(const char*);
|
||||
void* memcpy(void* dst, const void* src, size_t n);
|
||||
void* memset(void* dst, int val, size_t n);
|
||||
|
||||
int stricmp(const char*, const char*);
|
||||
char* strrchr(const char* str, int c);
|
||||
char* strchr(const char* str, int c);
|
||||
int strncmp(const char* str1, const char* str2, size_t n);
|
||||
int strcmp(const char* str1, const char* str2);
|
||||
char* strcat(char* dst, const char* src);
|
||||
char* strncpy(char* dst, const char* src, size_t n);
|
||||
char* strcpy(char* dst, const char* src);
|
||||
size_t strlen(const char* str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
#ifndef MSL_COMMON_SRC_STRTOUL_H
|
||||
#define MSL_COMMON_SRC_STRTOUL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
long strtol(const char* str, char** endptr, int base);
|
||||
unsigned long strtoul(const char* str, char** endptr, int base);
|
||||
unsigned long __strtoul(const char* str, char** endptr, int base);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_STRTOUL_H */
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#ifndef MSL_COMMON_SRC_WCHAR_IO_H
|
||||
#define MSL_COMMON_SRC_WCHAR_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
typedef unsigned short wchar_t;
|
||||
|
||||
int fwide(FILE* file, int mode);
|
||||
|
||||
#endif /* MSL_COMMON_SRC_WCHAR_IO_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MSL_COMMON_EMBEDDED_SRC_ANSI_FP_H
|
||||
#define MSL_COMMON_EMBEDDED_SRC_ANSI_FP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MSL_COMMON_EMBEDDED_SRC_ANSI_FP_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_ACOS_H
|
||||
#define MATH_DOUBLE_PRECISION_E_ACOS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_ACOS_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_ASIN_H
|
||||
#define MATH_DOUBLE_PRECISION_E_ASIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_ASIN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_ATAN2_H
|
||||
#define MATH_DOUBLE_PRECISION_E_ATAN2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_ATAN2_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_EXP_H
|
||||
#define MATH_DOUBLE_PRECISION_E_EXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_EXP_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_FMOD_H
|
||||
#define MATH_DOUBLE_PRECISION_E_FMOD_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_FMOD_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_POW_H
|
||||
#define MATH_DOUBLE_PRECISION_E_POW_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_POW_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_REM_PIO2_H
|
||||
#define MATH_DOUBLE_PRECISION_E_REM_PIO2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_REM_PIO2_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_E_SQRT_H
|
||||
#define MATH_DOUBLE_PRECISION_E_SQRT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_SQRT_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_K_COS_H
|
||||
#define MATH_DOUBLE_PRECISION_K_COS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_COS_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_K_REM_PIO2_H
|
||||
#define MATH_DOUBLE_PRECISION_K_REM_PIO2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_REM_PIO2_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_K_SIN_H
|
||||
#define MATH_DOUBLE_PRECISION_K_SIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_SIN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_K_TAN_H
|
||||
#define MATH_DOUBLE_PRECISION_K_TAN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_TAN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_ATAN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_ATAN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_ATAN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_CEIL_H
|
||||
#define MATH_DOUBLE_PRECISION_S_CEIL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_CEIL_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_COPYSIGN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_COPYSIGN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_COPYSIGN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_COS_H
|
||||
#define MATH_DOUBLE_PRECISION_S_COS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_COS_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_FLOOR_H
|
||||
#define MATH_DOUBLE_PRECISION_S_FLOOR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_FLOOR_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_FREXP_H
|
||||
#define MATH_DOUBLE_PRECISION_S_FREXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_FREXP_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_LDEXP_H
|
||||
#define MATH_DOUBLE_PRECISION_S_LDEXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_LDEXP_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_MODF_H
|
||||
#define MATH_DOUBLE_PRECISION_S_MODF_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_MODF_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_SIN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_SIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_SIN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_S_TAN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_TAN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_TAN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_W_ACOS_H
|
||||
#define MATH_DOUBLE_PRECISION_W_ACOS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_ACOS_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_W_ASIN_H
|
||||
#define MATH_DOUBLE_PRECISION_W_ASIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_ASIN_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_W_ATAN2_H
|
||||
#define MATH_DOUBLE_PRECISION_W_ATAN2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_ATAN2_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_W_EXP_H
|
||||
#define MATH_DOUBLE_PRECISION_W_EXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_EXP_H */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_W_FMOD_H
|
||||
#define MATH_DOUBLE_PRECISION_W_FMOD_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
double fmod(double, double);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_W_POW_H
|
||||
#define MATH_DOUBLE_PRECISION_W_POW_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_POW_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MATH_DOUBLE_PRECISION_W_SQRT_H
|
||||
#define MATH_DOUBLE_PRECISION_W_SQRT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_SQRT_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef PPC_EABI_SRC_CRITICAL_REGIONSGAMECUBE_H
|
||||
#define PPC_EABI_SRC_CRITICAL_REGIONSGAMECUBE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* PPC_EABI_SRC_CRITICAL_REGIONSGAMECUBE_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef PPC_EABI_SRC_MATH_PPC_H
|
||||
#define PPC_EABI_SRC_MATH_PPC_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* PPC_EABI_SRC_MATH_PPC_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef PPC_EABI_SRC_UART_CONSOLE_IO_GCN_H
|
||||
#define PPC_EABI_SRC_UART_CONSOLE_IO_GCN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#endif /* PPC_EABI_SRC_UART_CONSOLE_IO_GCN_H */
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define MSL_MATH_H_
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/float.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#define M_PI 3.14159265358979323846f
|
||||
|
||||
|
@ -76,7 +75,7 @@ inline float sqrtf(float mag) {
|
|||
}
|
||||
|
||||
inline float atan2f(float y, float x) {
|
||||
return (f32)atan2(y, x);
|
||||
return (float)atan2(y, x);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define MSL_STRING_H_
|
||||
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
// TODO: move to MSL_C/
|
||||
extern "C" {
|
||||
|
|
|
@ -26,12 +26,10 @@ typedef volatile f64 vf64;
|
|||
|
||||
typedef int BOOL;
|
||||
|
||||
typedef unsigned long size_t;
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define NULL (0)
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#define INT32_MAX (0x7fffffff)
|
||||
#define UINT32_MAX (0xffffffff)
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
#ifndef MSL_COMMON_SRC_ERRNO_H
|
||||
#define MSL_COMMON_SRC_ERRNO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ENOERR 0
|
||||
#define EDOM 33
|
||||
#define ERANGE 34
|
||||
#define EFPOS 40
|
||||
#define ESIGPARM 36
|
||||
|
||||
extern int errno;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ERRNO_H */
|
||||
|
|
|
@ -4,25 +4,15 @@
|
|||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/FILE_POS.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void fseek();
|
||||
static void _fseek();
|
||||
void ftell();
|
||||
#include "MSL_C/MSL_Common/Src/buffer_io.h"
|
||||
#include "errno.h"
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void __flush_buffer();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
extern u8 errno[4 + 4 /* padding */];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
|
@ -32,7 +22,7 @@ extern u8 errno[4 + 4 /* padding */];
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fseek() {
|
||||
asm int fseek(FILE* file, long offset, int mode) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/FILE_POS/fseek.s"
|
||||
}
|
||||
|
@ -42,7 +32,7 @@ asm void fseek() {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void _fseek() {
|
||||
asm int _fseek(FILE* file, fpos_t offset, int mode) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/FILE_POS/_fseek.s"
|
||||
}
|
||||
|
@ -52,7 +42,7 @@ static asm void _fseek() {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void ftell() {
|
||||
asm long ftell(FILE* file) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/FILE_POS/ftell.s"
|
||||
}
|
||||
|
|
|
@ -1,19 +1,8 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/abort_exit
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/abort_exit.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/signal.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void exit();
|
||||
void abort();
|
||||
extern u8 data_804519A0[8];
|
||||
extern unsigned char data_804519A0[8];
|
||||
|
||||
//
|
||||
// External References:
|
||||
|
@ -24,12 +13,7 @@ void __destroy_global_chain();
|
|||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
void __kill_critical_regions();
|
||||
void raise(int);
|
||||
SECTION_DTORS10 extern void (*__destroy_global_chain_reference[])(void);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
extern void (*__destroy_global_chain_reference[])(void);
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 8044D440-8044D540 07A160 0100+00 2/2 0/0 0/0 .bss __atexit_funcs */
|
||||
|
@ -37,14 +21,13 @@ static void (*__atexit_funcs[64])(void);
|
|||
|
||||
/* ############################################################################################## */
|
||||
/* 804519A0-804519A8 000EA0 0008+00 0/0 1/1 0/0 .sbss None */
|
||||
extern u8 data_804519A0[8];
|
||||
u8 data_804519A0[8];
|
||||
extern unsigned char data_804519A0[8];
|
||||
unsigned char data_804519A0[8];
|
||||
|
||||
/* 8045199C-804519A0 000E9C 0004+00 2/2 0/0 0/0 .sbss __console_exit */
|
||||
static void (*__console_exit)(void);
|
||||
|
||||
/* 80451998-8045199C 000E98 0004+00 1/1 1/1 0/0 .sbss __stdio_exit */
|
||||
extern void (*__stdio_exit)(void);
|
||||
void (*__stdio_exit)(void);
|
||||
|
||||
/* 80451994-80451998 000E94 0004+00 2/2 0/0 0/0 .sbss __atexit_curr_func */
|
||||
|
@ -53,43 +36,6 @@ static int __atexit_curr_func;
|
|||
/* 80451990-80451994 000E90 0004+00 2/2 0/0 0/0 .sbss __aborting */
|
||||
static int __aborting;
|
||||
|
||||
/* 803629CC-80362ABC 35D30C 00F0+00 0/0 2/2 0/0 .text exit */
|
||||
void exit(int status) {
|
||||
int i;
|
||||
void (**dtor)(void);
|
||||
|
||||
if (!__aborting) {
|
||||
__begin_critical_region(0);
|
||||
__end_critical_region(0);
|
||||
__destroy_global_chain();
|
||||
|
||||
dtor = __destroy_global_chain_reference;
|
||||
while (*dtor != NULL) {
|
||||
(*dtor)();
|
||||
dtor++;
|
||||
}
|
||||
|
||||
if (__stdio_exit != NULL) {
|
||||
__stdio_exit();
|
||||
__stdio_exit = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
__begin_critical_region(0);
|
||||
while (__atexit_curr_func > 0)
|
||||
__atexit_funcs[--__atexit_curr_func]();
|
||||
|
||||
__end_critical_region(0);
|
||||
__kill_critical_regions();
|
||||
|
||||
if (__console_exit != NULL) {
|
||||
__console_exit();
|
||||
__console_exit = NULL;
|
||||
}
|
||||
|
||||
_ExitProcess();
|
||||
}
|
||||
|
||||
/* 80362ABC-80362B58 35D3FC 009C+00 0/0 9/9 0/0 .text abort */
|
||||
void abort(void) {
|
||||
raise(1);
|
||||
|
@ -97,15 +43,52 @@ void abort(void) {
|
|||
__begin_critical_region(0);
|
||||
|
||||
while (__atexit_curr_func > 0)
|
||||
__atexit_funcs[--__atexit_curr_func]();
|
||||
|
||||
__atexit_funcs[--__atexit_curr_func]();
|
||||
|
||||
__end_critical_region(0);
|
||||
__kill_critical_regions();
|
||||
|
||||
if (__console_exit != NULL) {
|
||||
__console_exit();
|
||||
__console_exit = NULL;
|
||||
}
|
||||
__console_exit();
|
||||
__console_exit = NULL;
|
||||
}
|
||||
|
||||
_ExitProcess();
|
||||
_ExitProcess();
|
||||
}
|
||||
|
||||
/* 803629CC-80362ABC 35D30C 00F0+00 0/0 2/2 0/0 .text exit */
|
||||
void exit(int status) {
|
||||
int i;
|
||||
void (**dtor)(void);
|
||||
|
||||
if (!__aborting) {
|
||||
__begin_critical_region(0);
|
||||
__end_critical_region(0);
|
||||
__destroy_global_chain();
|
||||
|
||||
dtor = __destroy_global_chain_reference;
|
||||
while (*dtor != NULL) {
|
||||
(*dtor)();
|
||||
dtor++;
|
||||
}
|
||||
|
||||
if (__stdio_exit != NULL) {
|
||||
__stdio_exit();
|
||||
__stdio_exit = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
__begin_critical_region(0);
|
||||
while (__atexit_curr_func > 0)
|
||||
__atexit_funcs[--__atexit_curr_func]();
|
||||
|
||||
__end_critical_region(0);
|
||||
__kill_critical_regions();
|
||||
|
||||
if (__console_exit != NULL) {
|
||||
__console_exit();
|
||||
__console_exit = NULL;
|
||||
}
|
||||
|
||||
_ExitProcess();
|
||||
}
|
||||
|
|
|
@ -1,18 +1,6 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/alloc
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/alloc.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void free();
|
||||
void __pool_free();
|
||||
static void deallocate_from_fixed_pools();
|
||||
static void deallocate_from_var_pools();
|
||||
|
||||
|
@ -20,11 +8,10 @@ static void deallocate_from_var_pools();
|
|||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memset();
|
||||
void __sys_free();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
extern u8 data_804519A0[8];
|
||||
extern unsigned char data_804519A0[8];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
|
@ -32,13 +19,13 @@ extern u8 data_804519A0[8];
|
|||
|
||||
/* ############################################################################################## */
|
||||
/* 8044D540-8044D578 07A260 0038+00 1/1 0/0 0/0 .bss protopool$192 */
|
||||
static u8 protopool[56];
|
||||
static unsigned char protopool[56];
|
||||
|
||||
/* 80362B58-80362BC8 35D498 0070+00 0/0 2/2 0/0 .text free */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void free() {
|
||||
asm void free(FILE* file) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/alloc/free.s"
|
||||
}
|
||||
|
@ -56,11 +43,10 @@ asm void __pool_free() {
|
|||
|
||||
/* ############################################################################################## */
|
||||
/* 803A2220-803A2238 02E880 0018+00 1/1 0/0 0/0 .rodata fix_pool_sizes */
|
||||
SECTION_RODATA static u8 const fix_pool_sizes[24] = {
|
||||
static unsigned char const fix_pool_sizes[24] = {
|
||||
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x14,
|
||||
0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x44,
|
||||
};
|
||||
COMPILER_STRIP_GATE(0x803A2220, &fix_pool_sizes);
|
||||
|
||||
/* 80362C20-80362D78 35D560 0158+00 1/1 0/0 0/0 .text deallocate_from_fixed_pools */
|
||||
#pragma push
|
||||
|
|
|
@ -1,142 +1,152 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/ansi_files
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/alloc.h"
|
||||
#include "MSL_C/MSL_Common/Src/file_io.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
unsigned int __flush_all();
|
||||
void __close_all();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void free(FILE*);
|
||||
void __end_critical_region(int);
|
||||
void __begin_critical_region(int);
|
||||
int fflush(FILE*);
|
||||
void fclose(FILE*);
|
||||
int __close_console(unsigned int);
|
||||
int __write_console(int, int, int*, int);
|
||||
int __read_console(unsigned int, unsigned int, unsigned int*);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 8044D778-8044D878 07A498 0100+00 1/0 0/0 0/0 .bss stdin_buff */
|
||||
static u8 stdin_buff[0x100];
|
||||
static unsigned char stdin_buff[0x100];
|
||||
|
||||
/* 8044D678-8044D778 07A398 0100+00 1/0 0/0 0/0 .bss stdout_buff */
|
||||
static u8 stdout_buff[0x100];
|
||||
static unsigned char stdout_buff[0x100];
|
||||
|
||||
/* 8044D578-8044D678 07A298 0100+00 1/0 0/0 0/0 .bss stderr_buff */
|
||||
static u8 stderr_buff[0x100];
|
||||
static unsigned char stderr_buff[0x100];
|
||||
|
||||
/* 803D29B0-803D2AF0 -00001 0140+00 3/2 15/15 0/0 .data __files */
|
||||
SECTION_DATA extern files __files = {
|
||||
{0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdin_buff,
|
||||
0x00000100,
|
||||
stdin_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stdout},
|
||||
{1,
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdout_buff,
|
||||
0x00000100,
|
||||
stdout_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stderr},
|
||||
{2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stderr_buff,
|
||||
0x00000100,
|
||||
stderr_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.empty},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0},
|
||||
{0, 0}, 0, NULL, 0x00000000, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL},
|
||||
extern files __files = {
|
||||
{
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdin_buff,
|
||||
0x00000100,
|
||||
stdin_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stdout,
|
||||
},
|
||||
{
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdout_buff,
|
||||
0x00000100,
|
||||
stdout_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stderr,
|
||||
},
|
||||
{
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stderr_buff,
|
||||
0x00000100,
|
||||
stderr_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.empty,
|
||||
},
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0},
|
||||
{0, 0}, 0, NULL, 0x00000000, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
},
|
||||
};
|
||||
|
||||
/* 8036307C-80363124 35D9BC 00A8+00 0/0 1/1 0/0 .text __close_all */
|
||||
void __close_all(void) {
|
||||
FILE* file = &__files.stdin;
|
||||
FILE* last_file;
|
||||
|
||||
__begin_critical_region(2);
|
||||
|
||||
while (file != NULL) {
|
||||
if (file->file_mode.file_kind != __closed_file) {
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
last_file = file;
|
||||
file = file->next_file;
|
||||
|
||||
if (last_file->is_dynamically_allocated) {
|
||||
free(last_file);
|
||||
} else {
|
||||
last_file->file_mode.file_kind = __unavailable_file;
|
||||
if (file != NULL && file->is_dynamically_allocated) {
|
||||
last_file->next_file = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__end_critical_region(2);
|
||||
}
|
||||
|
||||
/* 8036300C-8036307C 35D94C 0070+00 0/0 2/2 0/0 .text __flush_all */
|
||||
unsigned int __flush_all(void) {
|
||||
unsigned int ret = 0;
|
||||
|
@ -151,31 +161,3 @@ unsigned int __flush_all(void) {
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 8036307C-80363124 35D9BC 00A8+00 0/0 1/1 0/0 .text __close_all */
|
||||
void __close_all(void) {
|
||||
FILE* file = &__files.stdin;
|
||||
FILE* last_file;
|
||||
|
||||
__begin_critical_region(2);
|
||||
|
||||
while (file != NULL) {
|
||||
if (file->file_mode.file_kind != CLOSED_FILE) {
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
last_file = file;
|
||||
file = file->next_file;
|
||||
|
||||
if (last_file->flag) {
|
||||
free(last_file);
|
||||
} else {
|
||||
last_file->file_mode.file_kind = UNAVAILABLE_FILE;
|
||||
if (file != NULL && file->flag) {
|
||||
last_file->next_file = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__end_critical_region(2);
|
||||
}
|
||||
|
|
|
@ -1,43 +1,20 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/arith
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/arith.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void div();
|
||||
void abs();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
#include "MSL_C/math.h"
|
||||
|
||||
/* 80365078-803650D0 35F9B8 0058+00 0/0 1/1 0/0 .text div */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void div() {
|
||||
asm div_t div(int numerator, int denominator) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/arith/div.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 803650D0-803650E0 35FA10 0010+00 0/0 66/66 225/225 .text abs */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void abs() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/arith/abs.s"
|
||||
int abs(int n) {
|
||||
if (n < 0)
|
||||
return (-n);
|
||||
else
|
||||
return (n);
|
||||
}
|
||||
#pragma pop
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/buffer_io
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/buffer_io.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
void __convert_from_newlines(unsigned char* buf, size_t* n) {}
|
||||
|
||||
void __flush_buffer();
|
||||
void __prep_buffer();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 803650E0-803651A4 35FA20 00C4+00 0/0 5/5 0/0 .text __flush_buffer */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __flush_buffer() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/buffer_io/__flush_buffer.s"
|
||||
}
|
||||
#pragma pop
|
||||
void __convert_to_newlines(unsigned char* buf, size_t* n) {}
|
||||
|
||||
/* 803651A4-803651D8 35FAE4 0034+00 0/0 2/2 0/0 .text __prep_buffer */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __prep_buffer() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/buffer_io/__prep_buffer.s"
|
||||
void __prep_buffer(FILE* file) {
|
||||
file->buffer_ptr = file->buffer;
|
||||
file->buffer_length = file->buffer_size;
|
||||
file->buffer_length -= file->position & file->buffer_alignment;
|
||||
file->buffer_position = file->position;
|
||||
}
|
||||
|
||||
/* 803650E0-803651A4 35FA20 00C4+00 0/0 5/5 0/0 .text __flush_buffer */
|
||||
int __flush_buffer(FILE* file, size_t* bytes_flushed) {
|
||||
size_t buffer_len;
|
||||
int ioresult;
|
||||
|
||||
buffer_len = file->buffer_ptr - file->buffer;
|
||||
|
||||
if (buffer_len) {
|
||||
file->buffer_length = buffer_len;
|
||||
|
||||
if (!file->file_mode.binary_io)
|
||||
__convert_from_newlines(file->buffer, (size_t*)&file->buffer_length);
|
||||
|
||||
ioresult = (*file->write_fn)(file->handle, file->buffer, (size_t*)&file->buffer_length,
|
||||
file->idle_fn);
|
||||
|
||||
if (bytes_flushed)
|
||||
*bytes_flushed = file->buffer_length;
|
||||
|
||||
if (ioresult)
|
||||
return (ioresult);
|
||||
|
||||
file->position += file->buffer_length;
|
||||
}
|
||||
|
||||
__prep_buffer(file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#pragma pop
|
||||
|
|
|
@ -1,39 +1,17 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/char_io
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/char_io.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/FILE_POS.h"
|
||||
#include "MSL_C/MSL_Common/Src/buffer_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/misc_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/wchar_io.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void __put_char();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void __flush_buffer();
|
||||
void __prep_buffer();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
void fseek();
|
||||
void __stdio_atexit();
|
||||
void fwide();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 803651D8-803652AC 35FB18 00D4+00 0/0 1/1 0/0 .text fputs */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm int fputs(const char*, FILE*) {
|
||||
asm int fputs(const char* str, FILE* stream) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/char_io/fputs.s"
|
||||
}
|
||||
|
@ -43,7 +21,7 @@ asm int fputs(const char*, FILE*) {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __put_char() {
|
||||
asm int __put_char(int c, FILE* stream) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/char_io/__put_char.s"
|
||||
}
|
||||
|
|
|
@ -1,57 +1,43 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/ctype
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ctype.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern unsigned char __upper_map[256];
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
#define ctrl __control_char
|
||||
#define motn __motion_char
|
||||
#define spac __space_char
|
||||
#define punc __punctuation
|
||||
#define digi __digit
|
||||
#define hexd __hex_digit
|
||||
#define lowc __lower_case
|
||||
#define uppc __upper_case
|
||||
#define dhex (hexd | digi)
|
||||
#define uhex (hexd | uppc)
|
||||
#define lhex (hexd | lowc)
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803D2C18-803D2D18 02FD38 0100+00 0/0 3/3 0/0 .data __ctype_map */
|
||||
SECTION_DATA extern unsigned char __ctype_map[256] = {
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||
0x08, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
|
||||
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||
0x08, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
|
||||
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x08, 0x08, 0x08, 0x08, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
unsigned char __ctype_map[256] = {
|
||||
// clang-format off
|
||||
ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, motn, motn, motn, motn, motn, ctrl, ctrl,
|
||||
ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl, ctrl,
|
||||
spac, punc, punc, punc, punc, punc, punc, punc, punc, punc, punc, punc, punc, punc, punc, punc,
|
||||
dhex, dhex, dhex, dhex, dhex, dhex, dhex, dhex, dhex, dhex, punc, punc, punc, punc, punc, punc,
|
||||
punc, uhex, uhex, uhex, uhex, uhex, uhex, uppc, uppc, uppc, uppc, uppc, uppc, uppc, uppc, uppc,
|
||||
uppc, uppc, uppc, uppc, uppc, uppc, uppc, uppc, uppc, uppc, uppc, punc, punc, punc, punc, punc,
|
||||
punc, lhex, lhex, lhex, lhex, lhex, lhex, lowc, lowc, lowc, lowc, lowc, lowc, lowc, lowc, lowc,
|
||||
lowc, lowc, lowc, lowc, lowc, lowc, lowc, lowc, lowc, lowc, lowc, punc, punc, punc, punc, ctrl,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
/* 803D2D18-803D2E18 02FE38 0100+00 1/1 3/3 0/0 .data __lower_map */
|
||||
SECTION_DATA extern unsigned char __lower_map[256] = {
|
||||
unsigned char __lower_map[256] = {
|
||||
// clang-format off
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
|
||||
0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
|
||||
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
|
||||
' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
|
||||
'@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
|
||||
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\\', ']', '^', '_',
|
||||
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
|
||||
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 0x7F,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
|
||||
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
|
||||
|
@ -60,6 +46,7 @@ SECTION_DATA extern unsigned char __lower_map[256] = {
|
|||
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
|
||||
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
|
||||
0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
/* 80365470-80365494 35FDB0 0024+00 0/0 4/4 0/0 .text tolower */
|
||||
|
@ -75,15 +62,15 @@ int tolower(int __c) {
|
|||
|
||||
/* ############################################################################################## */
|
||||
/* 803D2E18-803D2F18 02FF38 0100+00 0/0 1/1 0/0 .data __upper_map */
|
||||
SECTION_DATA extern unsigned char __upper_map[256] = {
|
||||
unsigned char __upper_map[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
|
||||
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
|
||||
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
|
||||
0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
|
||||
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
|
||||
' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
|
||||
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
|
||||
'`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', 0x7F,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
|
||||
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
|
||||
|
@ -92,4 +79,5 @@ SECTION_DATA extern unsigned char __upper_map[256] = {
|
|||
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
|
||||
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
|
||||
0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
|
||||
// clang-format on
|
||||
};
|
||||
|
|
|
@ -1,53 +1,129 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/direct_io
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/direct_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/FILE_POS.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "MSL_C/MSL_Common/Src/buffer_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/mem.h"
|
||||
#include "MSL_C/MSL_Common/Src/misc_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "MSL_C/MSL_Common/Src/wchar_io.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void __fwrite();
|
||||
void fwrite();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memcpy();
|
||||
void __flush_buffer();
|
||||
void __prep_buffer();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
void fseek();
|
||||
void __memrchr();
|
||||
void __stdio_atexit();
|
||||
void fwide();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 80365494-803657A0 35FDD4 030C+00 1/1 0/0 0/0 .text __fwrite */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __fwrite() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/direct_io/__fwrite.s"
|
||||
size_t fwrite(const void* buffer, size_t size, size_t count, FILE* stream) {
|
||||
size_t retval;
|
||||
|
||||
__begin_critical_region(2);
|
||||
retval = __fwrite(buffer, size, count, stream);
|
||||
__end_critical_region(2);
|
||||
|
||||
return (retval);
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 803657A0-8036581C 3600E0 007C+00 0/0 1/1 0/0 .text fwrite */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fwrite() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/direct_io/fwrite.s"
|
||||
size_t __fwrite(const void* buffer, size_t size, size_t count, FILE* stream) {
|
||||
unsigned char* write_ptr;
|
||||
size_t num_bytes, bytes_to_go, bytes_written;
|
||||
int ioresult, always_buffer;
|
||||
|
||||
#ifndef __NO_WIDE_CHAR
|
||||
if (fwide(stream, 0) == 0)
|
||||
fwide(stream, -1);
|
||||
#endif
|
||||
|
||||
bytes_to_go = size * count;
|
||||
|
||||
if (!bytes_to_go || stream->file_state.error || stream->file_mode.file_kind == __closed_file)
|
||||
return 0;
|
||||
|
||||
if (stream->file_mode.file_kind == __console_file)
|
||||
__stdio_atexit();
|
||||
|
||||
always_buffer = !stream->file_mode.binary_io || stream->file_mode.buffer_mode == _IOFBF ||
|
||||
stream->file_mode.buffer_mode == _IOLBF;
|
||||
|
||||
if (stream->file_state.io_state == __neutral) {
|
||||
if (stream->file_mode.io_mode & __write) {
|
||||
if (stream->file_mode.io_mode & __append) {
|
||||
if (fseek(stream, 0, SEEK_END))
|
||||
return 0;
|
||||
}
|
||||
stream->file_state.io_state = __writing;
|
||||
|
||||
__prep_buffer(stream);
|
||||
}
|
||||
}
|
||||
|
||||
if (stream->file_state.io_state != __writing) {
|
||||
set_error(stream);
|
||||
return 0;
|
||||
}
|
||||
|
||||
write_ptr = (unsigned char*)buffer;
|
||||
bytes_written = 0;
|
||||
|
||||
if (bytes_to_go && (stream->buffer_ptr != stream->buffer || always_buffer)) {
|
||||
stream->buffer_length = stream->buffer_size - (stream->buffer_ptr - stream->buffer);
|
||||
|
||||
do {
|
||||
unsigned char* newline = NULL;
|
||||
|
||||
num_bytes = stream->buffer_length;
|
||||
|
||||
if (num_bytes > bytes_to_go)
|
||||
num_bytes = bytes_to_go;
|
||||
if (stream->file_mode.buffer_mode == _IOLBF && num_bytes)
|
||||
if ((newline = (unsigned char*)__memrchr(write_ptr, '\n', num_bytes)) != NULL)
|
||||
num_bytes = newline + 1 - write_ptr;
|
||||
|
||||
if (num_bytes) {
|
||||
memcpy(stream->buffer_ptr, write_ptr, num_bytes);
|
||||
|
||||
write_ptr += num_bytes;
|
||||
bytes_written += num_bytes;
|
||||
bytes_to_go -= num_bytes;
|
||||
|
||||
stream->buffer_ptr += num_bytes;
|
||||
stream->buffer_length -= num_bytes;
|
||||
}
|
||||
if (!stream->buffer_length || newline != NULL ||
|
||||
(stream->file_mode.buffer_mode == _IONBF)) {
|
||||
ioresult = __flush_buffer(stream, NULL);
|
||||
|
||||
if (ioresult) {
|
||||
set_error(stream);
|
||||
bytes_to_go = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (bytes_to_go && always_buffer);
|
||||
}
|
||||
|
||||
if (bytes_to_go && !always_buffer) {
|
||||
unsigned char* save_buffer = stream->buffer;
|
||||
size_t save_size = stream->buffer_size;
|
||||
|
||||
stream->buffer = write_ptr;
|
||||
stream->buffer_size = bytes_to_go;
|
||||
stream->buffer_ptr = write_ptr + bytes_to_go;
|
||||
|
||||
if (__flush_buffer(stream, &num_bytes) != __no_io_error)
|
||||
set_error(stream);
|
||||
|
||||
bytes_written += num_bytes;
|
||||
|
||||
stream->buffer = save_buffer;
|
||||
stream->buffer_size = save_size;
|
||||
|
||||
__prep_buffer(stream);
|
||||
|
||||
stream->buffer_length = 0;
|
||||
}
|
||||
|
||||
if (stream->file_mode.buffer_mode != _IOFBF)
|
||||
stream->buffer_length = 0;
|
||||
|
||||
return ((bytes_written + size - 1) / size);
|
||||
}
|
||||
#pragma pop
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/errno
|
||||
//
|
||||
|
||||
#include "errno.h"
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804519A8-804519B0 000EA8 0004+04 0/0 6/6 0/0 .sbss errno */
|
||||
int errno;
|
||||
|
|
|
@ -1,35 +1,12 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/extras
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/extras.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void strnicmp();
|
||||
void stricmp();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void __msl_strnicmp();
|
||||
extern u8 __lower_map[256];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
#include "MSL_C/MSL_Common/Src/ctype.h"
|
||||
#include "MSL_C/MSL_Common/Src/file_io.h"
|
||||
|
||||
/* 8036CA74-8036CA94 3673B4 0020+00 0/0 1/1 0/0 .text strnicmp */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void strnicmp() {
|
||||
asm int strnicmp(const char* str1, const char* str2, int n) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/extras/strnicmp.s"
|
||||
}
|
||||
|
@ -39,7 +16,7 @@ asm void strnicmp() {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void stricmp() {
|
||||
asm int stricmp(const char* str1, const char* str2) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/extras/stricmp.s"
|
||||
}
|
||||
|
|
|
@ -1,60 +1,83 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/file_io
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/file_io.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void __msl_strnicmp();
|
||||
void fflush();
|
||||
void fclose();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void free();
|
||||
void __flush_all();
|
||||
void __flush_buffer();
|
||||
void ftell();
|
||||
extern u8 __lower_map[256];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
#include "MSL_C/MSL_Common/Src/FILE_POS.h"
|
||||
#include "MSL_C/MSL_Common/Src/alloc.h"
|
||||
#include "MSL_C/MSL_Common/Src/buffer_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/ctype.h"
|
||||
|
||||
/* 8036581C-803658C0 36015C 00A4+00 0/0 1/1 0/0 .text __msl_strnicmp */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __msl_strnicmp() {
|
||||
asm int __msl_strnicmp(const char* str1, const char* str2, size_t n) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/file_io/__msl_strnicmp.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 803658C0-803659F8 360200 0138+00 0/0 4/4 0/0 .text fflush */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fflush() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/file_io/fflush.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 803659F8-80365BB4 360338 01BC+00 0/0 1/1 0/0 .text fclose */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fclose() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/file_io/fclose.s"
|
||||
int fclose(FILE* file) {
|
||||
int flush_result, close_result;
|
||||
|
||||
if (file == NULL)
|
||||
return (-1);
|
||||
if (file->file_mode.file_kind == __closed_file)
|
||||
return (0);
|
||||
|
||||
flush_result = fflush(file);
|
||||
|
||||
close_result = (*file->close_fn)(file->handle);
|
||||
|
||||
file->file_mode.file_kind = __closed_file;
|
||||
file->handle = NULL;
|
||||
|
||||
if (file->file_state.free_buffer)
|
||||
free((FILE*)file->buffer);
|
||||
return ((flush_result || close_result) ? -1 : 0);
|
||||
}
|
||||
|
||||
/* 803658C0-803659F8 360200 0138+00 0/0 4/4 0/0 .text fflush */
|
||||
int fflush(FILE* file) {
|
||||
int pos;
|
||||
|
||||
if (file == NULL) {
|
||||
return __flush_all();
|
||||
}
|
||||
|
||||
if (file->file_state.error != 0 || file->file_mode.file_kind == __closed_file) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (file->file_mode.io_mode == 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (file->file_state.io_state >= 3) {
|
||||
file->file_state.io_state = 2;
|
||||
}
|
||||
|
||||
if (file->file_state.io_state == 2) {
|
||||
file->buffer_length = 0;
|
||||
}
|
||||
|
||||
if (file->file_state.io_state != 1) {
|
||||
file->file_state.io_state = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (file->file_mode.file_kind != __disk_file) {
|
||||
pos = 0;
|
||||
} else {
|
||||
pos = ftell(file);
|
||||
}
|
||||
|
||||
if (__flush_buffer(file, 0) != 0) {
|
||||
file->file_state.error = 1;
|
||||
file->buffer_length = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
file->file_state.io_state = 0;
|
||||
file->position = pos;
|
||||
file->buffer_length = 0;
|
||||
return 0;
|
||||
}
|
||||
#pragma pop
|
||||
|
|
|
@ -1,43 +1,17 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/float
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/float.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern u32 __float_nan;
|
||||
extern u32 __float_huge;
|
||||
extern u32 __float_max;
|
||||
extern u32 __float_epsilon;
|
||||
extern f32 data_80450AF0;
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80450AE0-80450AE4 000560 0004+00 0/0 204/204 1060/1060 .sdata __float_nan */
|
||||
SECTION_SDATA extern u32 __float_nan = 0x7FFFFFFF;
|
||||
extern unsigned long __float_nan = 0x7FFFFFFF;
|
||||
|
||||
/* 80450AE4-80450AE8 000564 0004+00 0/0 1/1 0/0 .sdata __float_huge */
|
||||
SECTION_SDATA extern u32 __float_huge = 0x7F800000;
|
||||
extern unsigned long __float_huge = 0x7F800000;
|
||||
|
||||
/* 80450AE8-80450AEC 000568 0004+00 0/0 18/18 14/14 .sdata __float_max */
|
||||
SECTION_SDATA extern u32 __float_max = 0x7F7FFFFF;
|
||||
extern unsigned long __float_max = 0x7F7FFFFF;
|
||||
|
||||
/* 80450AEC-80450AF0 00056C 0004+00 0/0 28/28 0/0 .sdata __float_epsilon */
|
||||
SECTION_SDATA extern u32 __float_epsilon = 0x34000000;
|
||||
extern unsigned long __float_epsilon = 0x34000000;
|
||||
|
||||
/* 80450AF0-80450AF4 000570 0004+00 0/0 1/1 0/0 .sdata None */
|
||||
SECTION_SDATA extern f32 data_80450AF0;
|
||||
SECTION_SDATA f32 data_80450AF0 = -0.0f;
|
||||
extern float data_80450AF0;
|
||||
float data_80450AF0 = -0.0f;
|
||||
|
|
|
@ -1,41 +1,16 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/mbstring
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/mbstring.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void wcstombs();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void strncpy();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80456668-80456670 004C68 0004+04 1/1 0/0 0/0 .sdata2 @74 */
|
||||
SECTION_SDATA2 static u32 lit_74[1 + 1 /* padding */] = {
|
||||
0x0000C0E0,
|
||||
/* padding */
|
||||
0x00000000,
|
||||
};
|
||||
SECTION_SDATA2 static unsigned long lit_74 = 0x0000C0E0;
|
||||
|
||||
/* 80365F74-8036608C 3608B4 0118+00 0/0 1/1 0/0 .text wcstombs */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void wcstombs() {
|
||||
asm size_t wcstombs(char* dst, const wchar_t* src, size_t n) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mbstring/wcstombs.s"
|
||||
}
|
||||
|
|
|
@ -1,101 +1,25 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/mem
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/mem.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
unsigned char* __memrchr(unsigned char*, unsigned char, size_t);
|
||||
void* memchr(unsigned char*, int, size_t);
|
||||
void* memmove(void* dst, const void* src, size_t len);
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void __copy_longs_rev_unaligned(void* dst, const void* src, size_t len);
|
||||
void __copy_longs_unaligned(void* dst, const void* src, size_t len);
|
||||
void __copy_longs_rev_aligned(void* dst, const void* src, size_t len);
|
||||
void __copy_longs_aligned(void* dst, const void* src, size_t len);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8036608C-803660D8 3609CC 004C+00 0/0 19/19 5/5 .text memcmp */
|
||||
int memcmp(const void* __s1, const void* __s2, size_t __n) {
|
||||
const unsigned char* val1 = ((const unsigned char*)__s1 - 1);
|
||||
const unsigned char* val2 = ((const unsigned char*)__s2 - 1);
|
||||
|
||||
size_t size = __n + 1;
|
||||
while (--size > 0) {
|
||||
if (*++val1 != *++val2) {
|
||||
return val1[0] < val2[0] ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 803660D8-80366104 360A18 002C+00 0/0 1/1 0/0 .text __memrchr */
|
||||
unsigned char* __memrchr(unsigned char* s, unsigned char c, size_t n) {
|
||||
int n_count;
|
||||
size_t char_check;
|
||||
|
||||
char_check = (unsigned char)c;
|
||||
s = &s[n];
|
||||
n_count = n + 1;
|
||||
while (--n_count) {
|
||||
if (*--s == char_check) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 80366104-80366130 360A44 002C+00 0/0 1/1 0/0 .text memchr */
|
||||
void* memchr(unsigned char* s, int c, size_t n) {
|
||||
int n_count;
|
||||
size_t char_check;
|
||||
|
||||
char_check = (unsigned char)c;
|
||||
s = &s[-1];
|
||||
n_count = n + 1;
|
||||
while (--n_count) {
|
||||
if (*++s == char_check) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#include "MSL_C/MSL_Common/Src/mem_funcs.h"
|
||||
|
||||
/* 80366130-803661FC 360A70 00CC+00 0/0 2/2 0/0 .text memmove */
|
||||
void* memmove(void* dst, const void* src, size_t len) {
|
||||
void* memmove(void* dst, const void* src, size_t n) {
|
||||
unsigned char* csrc;
|
||||
unsigned char* cdst;
|
||||
|
||||
int reverse = (unsigned int)src < (unsigned int)dst;
|
||||
|
||||
if (len >= 32) {
|
||||
if (n >= 32) {
|
||||
if (((unsigned int)dst ^ (unsigned int)src) & 3) {
|
||||
if (!reverse) {
|
||||
__copy_longs_unaligned(dst, src, len);
|
||||
__copy_longs_unaligned(dst, src, n);
|
||||
} else {
|
||||
__copy_longs_rev_unaligned(dst, src, len);
|
||||
__copy_longs_rev_unaligned(dst, src, n);
|
||||
}
|
||||
} else {
|
||||
if (!reverse) {
|
||||
__copy_longs_aligned(dst, src, len);
|
||||
__copy_longs_aligned(dst, src, n);
|
||||
} else {
|
||||
__copy_longs_rev_aligned(dst, src, len);
|
||||
__copy_longs_rev_aligned(dst, src, n);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,17 +28,17 @@ void* memmove(void* dst, const void* src, size_t len) {
|
|||
if (!reverse) {
|
||||
csrc = ((unsigned char*)src) - 1;
|
||||
cdst = ((unsigned char*)dst) - 1;
|
||||
len++;
|
||||
n++;
|
||||
|
||||
while (--len > 0) {
|
||||
while (--n > 0) {
|
||||
*++cdst = *++csrc;
|
||||
}
|
||||
} else {
|
||||
csrc = (unsigned char*)src + len;
|
||||
cdst = (unsigned char*)dst + len;
|
||||
len++;
|
||||
csrc = (unsigned char*)src + n;
|
||||
cdst = (unsigned char*)dst + n;
|
||||
n++;
|
||||
|
||||
while (--len > 0) {
|
||||
while (--n > 0) {
|
||||
*--cdst = *--csrc;
|
||||
}
|
||||
}
|
||||
|
@ -122,3 +46,41 @@ void* memmove(void* dst, const void* src, size_t len) {
|
|||
|
||||
return dst;
|
||||
}
|
||||
|
||||
/* 80366104-80366130 360A44 002C+00 0/0 1/1 0/0 .text memchr */
|
||||
void* memchr(const void* ptr, int ch, size_t count) {
|
||||
const unsigned char* p;
|
||||
|
||||
unsigned long v = (ch & 0xff);
|
||||
|
||||
for (p = (unsigned char*)ptr - 1, count++; --count;)
|
||||
if ((*++p & 0xff) == v)
|
||||
return (void*)p;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 803660D8-80366104 360A18 002C+00 0/0 1/1 0/0 .text __memrchr */
|
||||
void* __memrchr(const void* ptr, int ch, size_t count) {
|
||||
const unsigned char* p;
|
||||
|
||||
unsigned long v = (ch & 0xff);
|
||||
|
||||
for (p = (unsigned char*)ptr + count, count++; --count;)
|
||||
if (*--p == v)
|
||||
return (void*)p;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 8036608C-803660D8 3609CC 004C+00 0/0 19/19 5/5 .text memcmp */
|
||||
int memcmp(const void* lhs, const void* rhs, size_t count) {
|
||||
const unsigned char* p1;
|
||||
const unsigned char* p2;
|
||||
|
||||
for (p1 = (const unsigned char*)lhs - 1, p2 = (const unsigned char*)rhs - 1, count++; --count;)
|
||||
if (*++p1 != *++p2)
|
||||
return ((*p1 < *p2) ? -1 : +1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,65 +1,221 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/mem_funcs
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/mem_funcs.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void __copy_longs_rev_unaligned();
|
||||
void __copy_longs_unaligned();
|
||||
void __copy_longs_rev_aligned();
|
||||
void __copy_longs_aligned();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 803661FC-803662A8 360B3C 00AC+00 0/0 1/1 0/0 .text __copy_longs_rev_unaligned */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __copy_longs_rev_unaligned() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem_funcs/__copy_longs_rev_unaligned.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 803662A8-80366368 360BE8 00C0+00 0/0 1/1 0/0 .text __copy_longs_unaligned */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __copy_longs_unaligned() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem_funcs/__copy_longs_unaligned.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 80366368-80366410 360CA8 00A8+00 0/0 1/1 0/0 .text __copy_longs_rev_aligned */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __copy_longs_rev_aligned() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem_funcs/__copy_longs_rev_aligned.s"
|
||||
}
|
||||
#pragma pop
|
||||
#define cps ((unsigned char*)src)
|
||||
#define cpd ((unsigned char*)dst)
|
||||
#define lps ((unsigned long*)src)
|
||||
#define lpd ((unsigned long*)dst)
|
||||
#define deref_auto_inc(p) *++(p)
|
||||
|
||||
/* 80366410-803664CC 360D50 00BC+00 0/0 1/1 0/0 .text __copy_longs_aligned */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __copy_longs_aligned() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem_funcs/__copy_longs_aligned.s"
|
||||
void __copy_longs_aligned(void* dst, const void* src, size_t n) {
|
||||
unsigned long i;
|
||||
|
||||
i = (-(unsigned long)dst) & 3;
|
||||
|
||||
cps = ((unsigned char*)src) - 1;
|
||||
cpd = ((unsigned char*)dst) - 1;
|
||||
|
||||
if (i) {
|
||||
n -= i;
|
||||
|
||||
do
|
||||
deref_auto_inc(cpd) = deref_auto_inc(cps);
|
||||
while (--i);
|
||||
}
|
||||
|
||||
lps = ((unsigned long*)(cps + 1)) - 1;
|
||||
lpd = ((unsigned long*)(cpd + 1)) - 1;
|
||||
|
||||
i = n >> 5;
|
||||
|
||||
if (i)
|
||||
do {
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
} while (--i);
|
||||
|
||||
i = (n & 31) >> 2;
|
||||
|
||||
if (i)
|
||||
do
|
||||
deref_auto_inc(lpd) = deref_auto_inc(lps);
|
||||
while (--i);
|
||||
|
||||
cps = ((unsigned char*)(lps + 1)) - 1;
|
||||
cpd = ((unsigned char*)(lpd + 1)) - 1;
|
||||
|
||||
n &= 3;
|
||||
|
||||
if (n)
|
||||
do
|
||||
deref_auto_inc(cpd) = deref_auto_inc(cps);
|
||||
while (--n);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* 80366368-80366410 360CA8 00A8+00 0/0 1/1 0/0 .text __copy_longs_rev_aligned */
|
||||
void __copy_longs_rev_aligned(void* dst, const void* src, size_t n) {
|
||||
unsigned long i;
|
||||
|
||||
cps = ((unsigned char*)src) + n;
|
||||
cpd = ((unsigned char*)dst) + n;
|
||||
|
||||
i = ((unsigned long)cpd) & 3;
|
||||
|
||||
if (i) {
|
||||
n -= i;
|
||||
|
||||
do
|
||||
*--cpd = *--cps;
|
||||
while (--i);
|
||||
}
|
||||
|
||||
i = n >> 5;
|
||||
|
||||
if (i)
|
||||
do {
|
||||
*--lpd = *--lps;
|
||||
*--lpd = *--lps;
|
||||
*--lpd = *--lps;
|
||||
*--lpd = *--lps;
|
||||
*--lpd = *--lps;
|
||||
*--lpd = *--lps;
|
||||
*--lpd = *--lps;
|
||||
*--lpd = *--lps;
|
||||
} while (--i);
|
||||
|
||||
i = (n & 31) >> 2;
|
||||
|
||||
if (i)
|
||||
do
|
||||
*--lpd = *--lps;
|
||||
while (--i);
|
||||
|
||||
n &= 3;
|
||||
|
||||
if (n)
|
||||
do
|
||||
*--cpd = *--cps;
|
||||
while (--n);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* 803662A8-80366368 360BE8 00C0+00 0/0 1/1 0/0 .text __copy_longs_unaligned */
|
||||
void __copy_longs_unaligned(void* dst, const void* src, size_t n) {
|
||||
unsigned long i, v1, v2;
|
||||
unsigned int src_offset, left_shift, right_shift;
|
||||
|
||||
i = (-(unsigned long)dst) & 3;
|
||||
|
||||
cps = ((unsigned char*)src) - 1;
|
||||
cpd = ((unsigned char*)dst) - 1;
|
||||
|
||||
if (i) {
|
||||
n -= i;
|
||||
|
||||
do
|
||||
deref_auto_inc(cpd) = deref_auto_inc(cps);
|
||||
while (--i);
|
||||
}
|
||||
|
||||
src_offset = ((unsigned int)(cps + 1)) & 3;
|
||||
|
||||
left_shift = src_offset << 3;
|
||||
right_shift = 32 - left_shift;
|
||||
|
||||
cps -= src_offset;
|
||||
|
||||
lps = ((unsigned long*)(cps + 1)) - 1;
|
||||
lpd = ((unsigned long*)(cpd + 1)) - 1;
|
||||
|
||||
i = n >> 3;
|
||||
|
||||
v1 = deref_auto_inc(lps);
|
||||
|
||||
do {
|
||||
v2 = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = (v1 << left_shift) | (v2 >> right_shift);
|
||||
v1 = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = (v2 << left_shift) | (v1 >> right_shift);
|
||||
} while (--i);
|
||||
|
||||
if (n & 4) {
|
||||
v2 = deref_auto_inc(lps);
|
||||
deref_auto_inc(lpd) = (v1 << left_shift) | (v2 >> right_shift);
|
||||
}
|
||||
|
||||
cps = ((unsigned char*)(lps + 1)) - 1;
|
||||
cpd = ((unsigned char*)(lpd + 1)) - 1;
|
||||
|
||||
n &= 3;
|
||||
|
||||
if (n) {
|
||||
cps -= 4 - src_offset;
|
||||
do
|
||||
deref_auto_inc(cpd) = deref_auto_inc(cps);
|
||||
while (--n);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* 803661FC-803662A8 360B3C 00AC+00 0/0 1/1 0/0 .text __copy_longs_rev_unaligned */
|
||||
void __copy_longs_rev_unaligned(void* dst, const void* src, size_t n) {
|
||||
unsigned long i, v1, v2;
|
||||
unsigned int src_offset, left_shift, right_shift;
|
||||
|
||||
cps = ((unsigned char*)src) + n;
|
||||
cpd = ((unsigned char*)dst) + n;
|
||||
|
||||
i = ((unsigned long)cpd) & 3;
|
||||
|
||||
if (i) {
|
||||
n -= i;
|
||||
|
||||
do
|
||||
*--cpd = *--cps;
|
||||
while (--i);
|
||||
}
|
||||
|
||||
src_offset = ((unsigned int)cps) & 3;
|
||||
|
||||
left_shift = src_offset << 3;
|
||||
right_shift = 32 - left_shift;
|
||||
|
||||
cps += 4 - src_offset;
|
||||
|
||||
i = n >> 3;
|
||||
|
||||
v1 = *--lps;
|
||||
|
||||
do {
|
||||
v2 = *--lps;
|
||||
*--lpd = (v2 << left_shift) | (v1 >> right_shift);
|
||||
v1 = *--lps;
|
||||
*--lpd = (v1 << left_shift) | (v2 >> right_shift);
|
||||
} while (--i);
|
||||
|
||||
if (n & 4) {
|
||||
v2 = *--lps;
|
||||
*--lpd = (v2 << left_shift) | (v1 >> right_shift);
|
||||
}
|
||||
|
||||
n &= 3;
|
||||
|
||||
if (n) {
|
||||
cps += src_offset;
|
||||
do
|
||||
*--cpd = *--cps;
|
||||
while (--n);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#pragma pop
|
||||
|
|
|
@ -1,30 +1,8 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/misc_io
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/misc_io.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void __stdio_atexit();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void __close_all(void);
|
||||
extern void (*__stdio_exit)(void);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
#include "MSL_C/MSL_Common/Src/abort_exit.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
/* 803664CC-803664DC 360E0C 0010+00 0/0 2/2 0/0 .text __stdio_atexit */
|
||||
void __stdio_atexit() {
|
||||
void __stdio_atexit(void) {
|
||||
__stdio_exit = __close_all;
|
||||
}
|
||||
|
|
|
@ -4,15 +4,17 @@
|
|||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/MSL_Common/Src/ctype.h"
|
||||
#include "MSL_C/MSL_Common/Src/mem.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "MSL_C/MSL_Common/Src/wchar_io.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void fprintf();
|
||||
void __StringWrite();
|
||||
void __FileWrite();
|
||||
void __pformatter();
|
||||
|
@ -28,7 +30,6 @@ extern char const* const MSL_Common_Src_printf__stringBase0;
|
|||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memcpy();
|
||||
void __div2u();
|
||||
void __mod2u();
|
||||
void __num2dec();
|
||||
|
@ -36,13 +37,6 @@ void __end_critical_region();
|
|||
void __begin_critical_region();
|
||||
void fwrite();
|
||||
void wcstombs();
|
||||
void memchr();
|
||||
void strchr();
|
||||
void strcpy();
|
||||
void strlen();
|
||||
void fwide();
|
||||
extern void* __files[80];
|
||||
extern u8 __ctype_map[256];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
|
@ -52,7 +46,7 @@ extern u8 __ctype_map[256];
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm size_t sprintf(const char*, const char*, ...) {
|
||||
asm int sprintf(const char* str, const char* format, ...) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/printf/sprintf.s"
|
||||
}
|
||||
|
@ -62,7 +56,7 @@ asm size_t sprintf(const char*, const char*, ...) {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm size_t snprintf(const char*, size_t, const char*, ...) {
|
||||
asm int snprintf(const char* str, size_t n, const char* format, ...) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/printf/snprintf.s"
|
||||
}
|
||||
|
@ -72,7 +66,7 @@ asm size_t snprintf(const char*, size_t, const char*, ...) {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm size_t vsnprintf(char* buffer, size_t buffer_size, const char* format, va_list args) {
|
||||
asm int vsnprintf(char* str, size_t n, const char* format, va_list arg) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/printf/vsnprintf.s"
|
||||
}
|
||||
|
@ -82,7 +76,7 @@ asm size_t vsnprintf(char* buffer, size_t buffer_size, const char* format, va_li
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm size_t vprintf(const char*, va_list) {
|
||||
asm int vprintf(const char* format, va_list arg) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/printf/vprintf.s"
|
||||
}
|
||||
|
@ -92,7 +86,7 @@ asm size_t vprintf(const char*, va_list) {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fprintf() {
|
||||
asm int fprintf(FILE* stream, const char* format, ...) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/printf/fprintf.s"
|
||||
}
|
||||
|
@ -102,7 +96,7 @@ asm void fprintf() {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm size_t printf(const char*, ...) {
|
||||
asm int printf(const char* format, ...) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/printf/printf.s"
|
||||
}
|
||||
|
@ -136,7 +130,7 @@ SECTION_DEAD static char const* const stringBase_803A2318 = "";
|
|||
#pragma pop
|
||||
|
||||
/* 80450AD8-80450AE0 000558 0002+06 1/1 0/0 0/0 .sdata @wstringBase0 */
|
||||
SECTION_SDATA static u8 data_80450AD8[2 + 6 /* padding */] = {
|
||||
SECTION_SDATA static unsigned char data_80450AD8[2 + 6 /* padding */] = {
|
||||
0x00,
|
||||
0x00,
|
||||
/* padding */
|
||||
|
@ -176,7 +170,7 @@ SECTION_DEAD static char const* const pad_803A233D = "\0\0";
|
|||
#pragma pop
|
||||
|
||||
/* 80456670-80456678 004C70 0008+00 1/1 0/0 0/0 .sdata2 @1089 */
|
||||
SECTION_SDATA2 static u8 lit_1089[8] = {
|
||||
SECTION_SDATA2 static unsigned char lit_1089[8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
|
|
|
@ -1,31 +1,10 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/scanf
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/scanf.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void __StringRead();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8036878C-8036881C 3630CC 0090+00 0/0 2/2 0/0 .text __StringRead */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __StringRead() {
|
||||
asm int __StringRead(char* str, int ch, int behavior) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/scanf/__StringRead.s"
|
||||
}
|
||||
|
|
|
@ -1,39 +1,18 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/signal
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/signal.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/abort_exit.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void raise();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void exit();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 8044D878-8044D890 07A598 0018+00 1/1 0/0 0/0 .bss signal_funcs */
|
||||
static u8 signal_funcs[24];
|
||||
static unsigned char signal_funcs[24];
|
||||
|
||||
/* 8036881C-803688DC 36315C 00C0+00 0/0 1/1 0/0 .text raise */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void raise() {
|
||||
asm int raise(int sig) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/signal/raise.s"
|
||||
}
|
||||
|
|
|
@ -1,77 +1,123 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/string
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#define K1 0x80808080
|
||||
#define K2 0xFEFEFEFF
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
/* 80368BE4-80368C00 363524 001C+00 0/0 28/28 8/8 .text strlen */
|
||||
size_t strlen(const char* str) {
|
||||
size_t len = -1;
|
||||
unsigned char* p = (unsigned char*)str - 1;
|
||||
|
||||
/* 803688DC-80368924 36321C 0048+00 0/0 1/1 0/0 .text strrchr */
|
||||
char* strrchr(const char* str, int chr) {
|
||||
const u8* p = (u8*)str - 1;
|
||||
const u8* q = NULL;
|
||||
u32 c = (chr & 0xFF);
|
||||
do {
|
||||
len++;
|
||||
} while (*++p);
|
||||
|
||||
u32 ch;
|
||||
while (ch = *++p) {
|
||||
if (ch == c) {
|
||||
q = p;
|
||||
}
|
||||
}
|
||||
|
||||
if (q != NULL) {
|
||||
return (char*)q;
|
||||
}
|
||||
|
||||
return c ? NULL : (char*)p;
|
||||
return len;
|
||||
}
|
||||
|
||||
/* 80368924-80368954 363264 0030+00 0/0 3/3 0/0 .text strchr */
|
||||
char* strchr(const char* str, int chr) {
|
||||
const u8* p = (u8*)str - 1;
|
||||
u32 c = (chr & 0xFF);
|
||||
/* 80368B2C-80368BE4 36346C 00B8+00 0/0 131/131 13/13 .text strcpy */
|
||||
char* strcpy(char* dst, const char* src) {
|
||||
register unsigned char *destb, *fromb;
|
||||
register unsigned long w, t, align;
|
||||
|
||||
u32 ch;
|
||||
while (ch = *++p) {
|
||||
if (ch == c) {
|
||||
return (char*)p;
|
||||
}
|
||||
fromb = (unsigned char*)src;
|
||||
destb = (unsigned char*)dst;
|
||||
|
||||
if ((align = ((int)fromb & 3)) != ((int)destb & 3)) {
|
||||
goto bytecopy;
|
||||
}
|
||||
|
||||
return c ? NULL : (char*)p;
|
||||
if (align) {
|
||||
if ((*destb = *fromb) == 0) {
|
||||
return dst;
|
||||
}
|
||||
|
||||
for (align = 3 - align; align; align--) {
|
||||
if ((*(++destb) = *(++fromb)) == 0) {
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
++destb;
|
||||
++fromb;
|
||||
}
|
||||
|
||||
w = *((int*)(fromb));
|
||||
|
||||
t = w + K2;
|
||||
|
||||
t &= K1;
|
||||
if (t) {
|
||||
goto bytecopy;
|
||||
}
|
||||
--((int*)(destb));
|
||||
|
||||
do {
|
||||
*(++((int*)(destb))) = w;
|
||||
w = *(++((int*)(fromb)));
|
||||
|
||||
t = w + K2;
|
||||
t &= K1;
|
||||
if (t) {
|
||||
goto adjust;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
adjust:
|
||||
++((int*)(destb));
|
||||
|
||||
bytecopy:
|
||||
if ((*destb = *fromb) == 0) {
|
||||
return dst;
|
||||
}
|
||||
|
||||
do {
|
||||
if ((*(++destb) = *(++fromb)) == 0) {
|
||||
return dst;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
/* 80368954-80368994 363294 0040+00 0/0 6/6 0/0 .text strncmp */
|
||||
int strncmp(const char* strA, const char* strB, u32 n) {
|
||||
const u8* p1 = (u8*)strA - 1;
|
||||
const u8* p2 = (u8*)strB - 1;
|
||||
u32 c1, c2;
|
||||
/* 80368AE8-80368B2C 363428 0044+00 0/0 9/9 1/1 .text strncpy */
|
||||
char* strncpy(char* dst, const char* src, size_t n) {
|
||||
const unsigned char* p = (const unsigned char*)src - 1;
|
||||
unsigned char* q = (unsigned char*)dst - 1;
|
||||
|
||||
n++;
|
||||
while (--n) {
|
||||
if ((c1 = *++p1) != (c2 = *++p2)) {
|
||||
return c1 - c2;
|
||||
} else if (c1 == 0) {
|
||||
if (!(*++q = *++p)) {
|
||||
while (--n) {
|
||||
*++q = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return dst;
|
||||
}
|
||||
|
||||
/* 80368ABC-80368AE8 3633FC 002C+00 0/0 20/20 8/8 .text strcat */
|
||||
char* strcat(char* dst, const char* src) {
|
||||
const unsigned char* p = (unsigned char*)src - 1;
|
||||
unsigned char* q = (unsigned char*)dst - 1;
|
||||
|
||||
while (*++q) {
|
||||
}
|
||||
|
||||
q--;
|
||||
|
||||
while (*++q = *++p) {
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
/* 80368994-80368ABC 3632D4 0128+00 0/0 155/155 279/279 .text strcmp */
|
||||
int strcmp(const char* strA, const char* strB) {
|
||||
register u8* left = (u8*)strA;
|
||||
register u8* right = (u8*)strB;
|
||||
u32 align, l1, r1, x;
|
||||
int strcmp(const char* str1, const char* str2) {
|
||||
register unsigned char* left = (unsigned char*)str1;
|
||||
register unsigned char* right = (unsigned char*)str2;
|
||||
unsigned long align, l1, r1, x;
|
||||
|
||||
l1 = *left;
|
||||
r1 = *right;
|
||||
|
@ -146,112 +192,55 @@ bytecopy:
|
|||
} while (1);
|
||||
}
|
||||
|
||||
/* 80368ABC-80368AE8 3633FC 002C+00 0/0 20/20 8/8 .text strcat */
|
||||
char* strcat(char* dst, const char* src) {
|
||||
const u8* p = (u8*)src - 1;
|
||||
u8* q = (u8*)dst - 1;
|
||||
|
||||
while (*++q) {
|
||||
}
|
||||
|
||||
q--;
|
||||
|
||||
while (*++q = *++p) {
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
/* 80368AE8-80368B2C 363428 0044+00 0/0 9/9 1/1 .text strncpy */
|
||||
char* strncpy(char* dst, const char* src, size_t n) {
|
||||
const u8* p = (const u8*)src - 1;
|
||||
u8* q = (u8*)dst - 1;
|
||||
/* 80368954-80368994 363294 0040+00 0/0 6/6 0/0 .text strncmp */
|
||||
int strncmp(const char* str1, const char* str2, size_t n) {
|
||||
const unsigned char* p1 = (unsigned char*)str1 - 1;
|
||||
const unsigned char* p2 = (unsigned char*)str2 - 1;
|
||||
unsigned long c1, c2;
|
||||
|
||||
n++;
|
||||
while (--n) {
|
||||
if (!(*++q = *++p)) {
|
||||
while (--n) {
|
||||
*++q = 0;
|
||||
}
|
||||
if ((c1 = *++p1) != (c2 = *++p2)) {
|
||||
return c1 - c2;
|
||||
} else if (c1 == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 80368B2C-80368BE4 36346C 00B8+00 0/0 131/131 13/13 .text strcpy */
|
||||
char* strcpy(char* dst, const char* src) {
|
||||
register u8 *destb, *fromb;
|
||||
register u32 w, t, align;
|
||||
/* 80368924-80368954 363264 0030+00 0/0 3/3 0/0 .text strchr */
|
||||
char* strchr(const char* str, int c) {
|
||||
const unsigned char* p = (unsigned char*)str - 1;
|
||||
unsigned long chr = (c & 0xFF);
|
||||
|
||||
fromb = (u8*)src;
|
||||
destb = (u8*)dst;
|
||||
|
||||
if ((align = ((int)fromb & 3)) != ((int)destb & 3)) {
|
||||
goto bytecopy;
|
||||
unsigned long ch;
|
||||
while (ch = *++p) {
|
||||
if (ch == chr) {
|
||||
return (char*)p;
|
||||
}
|
||||
}
|
||||
|
||||
if (align) {
|
||||
if ((*destb = *fromb) == 0) {
|
||||
return dst;
|
||||
}
|
||||
|
||||
for (align = 3 - align; align; align--) {
|
||||
if ((*(++destb) = *(++fromb)) == 0) {
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
++destb;
|
||||
++fromb;
|
||||
}
|
||||
|
||||
w = *((int*)(fromb));
|
||||
|
||||
t = w + K2;
|
||||
|
||||
t &= K1;
|
||||
if (t) {
|
||||
goto bytecopy;
|
||||
}
|
||||
--((int*)(destb));
|
||||
|
||||
do {
|
||||
*(++((int*)(destb))) = w;
|
||||
w = *(++((int*)(fromb)));
|
||||
|
||||
t = w + K2;
|
||||
t &= K1;
|
||||
if (t) {
|
||||
goto adjust;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
adjust:
|
||||
++((int*)(destb));
|
||||
|
||||
bytecopy:
|
||||
if ((*destb = *fromb) == 0) {
|
||||
return dst;
|
||||
}
|
||||
|
||||
do {
|
||||
if ((*(++destb) = *(++fromb)) == 0) {
|
||||
return dst;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
return dst;
|
||||
return chr ? NULL : (char*)p;
|
||||
}
|
||||
|
||||
/* 80368BE4-80368C00 363524 001C+00 0/0 28/28 8/8 .text strlen */
|
||||
u32 strlen(const char* str) {
|
||||
size_t len = -1;
|
||||
u8* p = (u8*)str - 1;
|
||||
/* 803688DC-80368924 36321C 0048+00 0/0 1/1 0/0 .text strrchr */
|
||||
char* strrchr(const char* str, int c) {
|
||||
const unsigned char* p = (unsigned char*)str - 1;
|
||||
const unsigned char* q = NULL;
|
||||
unsigned long chr = (c & 0xFF);
|
||||
|
||||
do {
|
||||
len++;
|
||||
} while (*++p);
|
||||
unsigned long ch;
|
||||
while (ch = *++p) {
|
||||
if (ch == chr) {
|
||||
q = p;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
if (q != NULL) {
|
||||
return (char*)q;
|
||||
}
|
||||
|
||||
return chr ? NULL : (char*)p;
|
||||
}
|
||||
|
|
|
@ -4,35 +4,16 @@
|
|||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/strtoul.h"
|
||||
#include "MSL_C/MSL_Common/Src/ctype.h"
|
||||
#include "MSL_C/MSL_Common/Src/scanf.h"
|
||||
#include "errno.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void strtol();
|
||||
void strtoul();
|
||||
void __strtoul();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void __StringRead();
|
||||
extern u8 __ctype_map[256];
|
||||
extern u8 __upper_map[256];
|
||||
extern u8 errno[4 + 4 /* padding */];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 80368C00-80368CF0 363540 00F0+00 0/0 3/3 0/0 .text strtol */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void strtol() {
|
||||
asm long strtol(const char* str, char** endptr, int base) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/strtoul/strtol.s"
|
||||
}
|
||||
|
@ -42,7 +23,7 @@ asm void strtol() {
|
|||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void strtoul() {
|
||||
asm unsigned long strtoul(const char* str, char** endptr, int base) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/strtoul/strtoul.s"
|
||||
}
|
||||
|
@ -69,14 +50,14 @@ SECTION_DATA static void* lit_431[17 + 1 /* padding */] = {
|
|||
(void*)(((char*)__strtoul) + 0x310),
|
||||
(void*)(((char*)__strtoul) + 0x1FC),
|
||||
/* padding */
|
||||
NULL,
|
||||
0,
|
||||
};
|
||||
|
||||
/* 80368D9C-80369114 3636DC 0378+00 3/2 0/0 0/0 .text __strtoul */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __strtoul() {
|
||||
asm unsigned long __strtoul(const char* str, char** endptr, int base) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/strtoul/__strtoul.s"
|
||||
}
|
||||
|
|
|
@ -1,30 +1,8 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/wchar_io
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/wchar_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
int fwide(FILE* file, int mode);
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 80369114-8036919C 363A54 0088+00 0/0 5/5 0/0 .text fwide */
|
||||
int fwide(FILE* file, int mode) {
|
||||
if (file == NULL || file->file_mode.file_kind == CLOSED_FILE) {
|
||||
if (file == NULL || file->file_mode.file_kind == __closed_file) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,6 +123,7 @@ LIBMSL_C_PPCEABI_BARE_H_A_CFLAGS := \
|
|||
-lang=c \
|
||||
-fp_contract on \
|
||||
-use_lmw_stmw on \
|
||||
-inline deferred,auto \
|
||||
|
||||
LIBMSL_C_PPCEABI_BARE_H_A_LDFLAGS := \
|
||||
-nodefaults \
|
||||
|
|
|
@ -22,7 +22,7 @@ static const double
|
|||
|
||||
double ldexp(double x, int n)
|
||||
{
|
||||
s32 k, hx, lx; /*- cc 020130 -*/
|
||||
long k, hx, lx; /*- cc 020130 -*/
|
||||
if (!isfinite(x) || x == 0.0)
|
||||
return x;
|
||||
|
||||
|
|
|
@ -1,30 +1,11 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: PPC_EABI/Src/critical_regions.gamecube
|
||||
//
|
||||
|
||||
#include "MSL_C/PPC_EABI/Src/critical_regions.gamecube.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
void __kill_critical_regions();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 80365464-80365468 35FDA4 0004+00 0/0 12/12 0/0 .text __end_critical_region */
|
||||
void __end_critical_region() {
|
||||
/* 8036546C-80365470 35FDAC 0004+00 0/0 2/2 0/0 .text __kill_critical_regions */
|
||||
void __kill_critical_regions() {
|
||||
/* empty function */
|
||||
}
|
||||
|
||||
|
@ -33,7 +14,7 @@ void __begin_critical_region() {
|
|||
/* empty function */
|
||||
}
|
||||
|
||||
/* 8036546C-80365470 35FDAC 0004+00 0/0 2/2 0/0 .text __kill_critical_regions */
|
||||
void __kill_critical_regions() {
|
||||
/* 80365464-80365468 35FDA4 0004+00 0/0 12/12 0/0 .text __end_critical_region */
|
||||
void __end_critical_region() {
|
||||
/* empty function */
|
||||
}
|
||||
}
|
|
@ -4,8 +4,6 @@
|
|||
//
|
||||
|
||||
#include "MSL_C/PPC_EABI/Src/math_ppc.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "fdlibm.h"
|
||||
|
||||
//
|
||||
|
@ -21,14 +19,9 @@ float acosf(float);
|
|||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8036C9C4-8036C9E8 367304 0024+00 0/0 2/2 0/0 .text tanf */
|
||||
float tanf(float x) {
|
||||
return tan(x);
|
||||
}
|
||||
|
||||
/* 8036C9E8-8036CA0C 367328 0024+00 0/0 4/4 0/0 .text sinf */
|
||||
float sinf(float x) {
|
||||
return sin(x);
|
||||
/* 8036CA30-8036CA54 367370 0024+00 0/0 1/1 0/0 .text acosf */
|
||||
float acosf(float x) {
|
||||
return acos(x);
|
||||
}
|
||||
|
||||
/* 8036CA0C-8036CA30 36734C 0024+00 0/0 4/4 0/0 .text cosf */
|
||||
|
@ -36,7 +29,12 @@ float cosf(float x) {
|
|||
return cos(x);
|
||||
}
|
||||
|
||||
/* 8036CA30-8036CA54 367370 0024+00 0/0 1/1 0/0 .text acosf */
|
||||
float acosf(float x) {
|
||||
return acos(x);
|
||||
/* 8036C9E8-8036CA0C 367328 0024+00 0/0 4/4 0/0 .text sinf */
|
||||
float sinf(float x) {
|
||||
return sin(x);
|
||||
}
|
||||
|
||||
/* 8036C9C4-8036C9E8 367304 0024+00 0/0 2/2 0/0 .text tanf */
|
||||
float tanf(float x) {
|
||||
return tan(x);
|
||||
}
|
||||
|
|
|
@ -1,39 +1,14 @@
|
|||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: PPC_EABI/Src/uart_console_io_gcn
|
||||
//
|
||||
|
||||
#include "MSL_C/PPC_EABI/Src/uart_console_io_gcn.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
int __close_console();
|
||||
int __write_console(s32 arg0, s32 arg1, s32* arg2, s32 arg3);
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
s32 OSGetConsoleType(void);
|
||||
s32 InitializeUART(u32);
|
||||
s32 WriteUARTN(s32, s32);
|
||||
s32 __TRK_write_console(s32, s32, s32*, s32);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8036919C-803691A4 363ADC 0008+00 0/0 1/0 0/0 .text __close_console */
|
||||
int __close_console() {
|
||||
return 0;
|
||||
}
|
||||
int InitializeUART(size_t);
|
||||
int WriteUARTN(unsigned char*, size_t);
|
||||
int __TRK_write_console(__file_handle handle, unsigned char* buffer, size_t* count,
|
||||
__idle_proc idle_fn);
|
||||
|
||||
/* 803691A4-80369274 363AE4 00D0+00 0/0 1/0 0/0 .text __write_console */
|
||||
int __write_console(s32 param_0, s32 param_1, s32* param_2, s32 param_3) {
|
||||
int __write_console(__file_handle handle, unsigned char* buffer, size_t* count,
|
||||
__idle_proc idle_fn) {
|
||||
static int initialized;
|
||||
|
||||
if ((OSGetConsoleType() & 0x20000000) == 0) {
|
||||
|
@ -50,12 +25,17 @@ int __write_console(s32 param_0, s32 param_1, s32* param_2, s32 param_3) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (WriteUARTN(param_1, *param_2) != 0) {
|
||||
*param_2 = 0;
|
||||
if (WriteUARTN(buffer, *count) != 0) {
|
||||
*count = 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
__TRK_write_console(param_0, param_1, param_2, param_3);
|
||||
__TRK_write_console(handle, buffer, count, idle_fn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 8036919C-803691A4 363ADC 0008+00 0/0 1/0 0/0 .text __close_console */
|
||||
int __close_console(__file_handle handle) {
|
||||
return 0;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue