link padclamp.c

troublesome file
This commit is contained in:
EpochFlame 2023-02-04 16:46:41 -05:00
parent 0ca9e8c423
commit 0478b24daf
9 changed files with 69 additions and 583 deletions

View File

@ -75,7 +75,7 @@ include obj_files.mk
O_FILES := $(JSYSTEM) $(DOLPHIN) $(PLUGPROJECT) $(SYS) $(UTILITY)
ifeq ($(EPILOGUE_PROCESS),1)
E_FILES := $(DVD_UNSCHEDULED) $(OS_UNSCHEDULED) $(SI_UNSCHEDULED) $(GBA_UNSCHEDULED)
E_FILES := $(DVD_UNSCHEDULED) $(OS_UNSCHEDULED) $(PAD_UNSCHEDULED) $(SI_UNSCHEDULED) $(GBA_UNSCHEDULED)
endif
DEPENDS := $($(filter *.o,O_FILES):.o=.d)
DEPENDS += $($(filter *.o,E_FILES):.o=.d)

View File

@ -1,392 +0,0 @@
.include "macros.inc"
.section .rodata # 0x804732E0 - 0x8049E220
.balign 8
.obj ClampRegion, local
.4byte 0x1EB40F48
.4byte 0x280F3B1F
.2byte 0x382C
.endobj ClampRegion
.section .sdata2, "a" # 0x80516360 - 0x80520E40
.balign 8
.obj lbl_80517758, local
.float 0.0
.endobj lbl_80517758
.balign 8
.obj lbl_80517760, local
.double 0.5
.endobj lbl_80517760
.balign 8
.obj lbl_80517768, local
.double 3.0
.endobj lbl_80517768
.balign 8
.obj lbl_80517770, local
.4byte 0x43300000
.4byte 0x80000000
.endobj lbl_80517770
.section .text, "ax" # 0x800056C0 - 0x80472F00
.fn ClampStick, local
/* 800F3048 000EFF88 88 03 00 00 */ lbz r0, 0(r3)
/* 800F304C 000EFF8C 89 84 00 00 */ lbz r12, 0(r4)
/* 800F3050 000EFF90 7C 00 07 75 */ extsb. r0, r0
/* 800F3054 000EFF94 7D 8C 07 74 */ extsb r12, r12
/* 800F3058 000EFF98 7C 0B 03 78 */ mr r11, r0
/* 800F305C 000EFF9C 41 80 00 0C */ blt .L_800F3068
/* 800F3060 000EFFA0 38 00 00 01 */ li r0, 1
/* 800F3064 000EFFA4 48 00 00 0C */ b .L_800F3070
.L_800F3068:
/* 800F3068 000EFFA8 38 00 FF FF */ li r0, -1
/* 800F306C 000EFFAC 7D 6B 00 D0 */ neg r11, r11
.L_800F3070:
/* 800F3070 000EFFB0 2C 0C 00 00 */ cmpwi r12, 0
/* 800F3074 000EFFB4 41 80 00 0C */ blt .L_800F3080
/* 800F3078 000EFFB8 39 00 00 01 */ li r8, 1
/* 800F307C 000EFFBC 48 00 00 0C */ b .L_800F3088
.L_800F3080:
/* 800F3080 000EFFC0 39 00 FF FF */ li r8, -1
/* 800F3084 000EFFC4 7D 8C 00 D0 */ neg r12, r12
.L_800F3088:
/* 800F3088 000EFFC8 7C E7 07 74 */ extsb r7, r7
/* 800F308C 000EFFCC 7C 0B 38 00 */ cmpw r11, r7
/* 800F3090 000EFFD0 41 81 00 0C */ bgt .L_800F309C
/* 800F3094 000EFFD4 39 60 00 00 */ li r11, 0
/* 800F3098 000EFFD8 48 00 00 08 */ b .L_800F30A0
.L_800F309C:
/* 800F309C 000EFFDC 7D 67 58 50 */ subf r11, r7, r11
.L_800F30A0:
/* 800F30A0 000EFFE0 7C 0C 38 00 */ cmpw r12, r7
/* 800F30A4 000EFFE4 41 81 00 0C */ bgt .L_800F30B0
/* 800F30A8 000EFFE8 39 80 00 00 */ li r12, 0
/* 800F30AC 000EFFEC 48 00 00 08 */ b .L_800F30B4
.L_800F30B0:
/* 800F30B0 000EFFF0 7D 87 60 50 */ subf r12, r7, r12
.L_800F30B4:
/* 800F30B4 000EFFF4 2C 0B 00 00 */ cmpwi r11, 0
/* 800F30B8 000EFFF8 40 82 00 1C */ bne .L_800F30D4
/* 800F30BC 000EFFFC 2C 0C 00 00 */ cmpwi r12, 0
/* 800F30C0 000F0000 40 82 00 14 */ bne .L_800F30D4
/* 800F30C4 000F0004 38 00 00 00 */ li r0, 0
/* 800F30C8 000F0008 98 04 00 00 */ stb r0, 0(r4)
/* 800F30CC 000F000C 98 03 00 00 */ stb r0, 0(r3)
/* 800F30D0 000F0010 4E 80 00 20 */ blr
.L_800F30D4:
/* 800F30D4 000F0014 7C C6 07 74 */ extsb r6, r6
/* 800F30D8 000F0018 7D 26 61 D6 */ mullw r9, r6, r12
/* 800F30DC 000F001C 7C E6 59 D6 */ mullw r7, r6, r11
/* 800F30E0 000F0020 7C 09 38 00 */ cmpw r9, r7
/* 800F30E4 000F0024 41 81 00 44 */ bgt .L_800F3128
/* 800F30E8 000F0028 7C A9 07 74 */ extsb r9, r5
/* 800F30EC 000F002C 7C A6 48 50 */ subf r5, r6, r9
/* 800F30F0 000F0030 7C AC 29 D6 */ mullw r5, r12, r5
/* 800F30F4 000F0034 7D 26 49 D6 */ mullw r9, r6, r9
/* 800F30F8 000F0038 7C E7 2A 14 */ add r7, r7, r5
/* 800F30FC 000F003C 7C 09 38 00 */ cmpw r9, r7
/* 800F3100 000F0040 40 80 00 64 */ bge .L_800F3164
/* 800F3104 000F0044 7C CB 49 D6 */ mullw r6, r11, r9
/* 800F3108 000F0048 7C AC 49 D6 */ mullw r5, r12, r9
/* 800F310C 000F004C 7C C6 3B D6 */ divw r6, r6, r7
/* 800F3110 000F0050 7C A5 3B D6 */ divw r5, r5, r7
/* 800F3114 000F0054 7C C6 07 74 */ extsb r6, r6
/* 800F3118 000F0058 7C A5 07 74 */ extsb r5, r5
/* 800F311C 000F005C 39 66 00 00 */ addi r11, r6, 0
/* 800F3120 000F0060 39 85 00 00 */ addi r12, r5, 0
/* 800F3124 000F0064 48 00 00 40 */ b .L_800F3164
.L_800F3128:
/* 800F3128 000F0068 7C A7 07 74 */ extsb r7, r5
/* 800F312C 000F006C 7C A6 38 50 */ subf r5, r6, r7
/* 800F3130 000F0070 7C AB 29 D6 */ mullw r5, r11, r5
/* 800F3134 000F0074 7D 46 39 D6 */ mullw r10, r6, r7
/* 800F3138 000F0078 7C E9 2A 14 */ add r7, r9, r5
/* 800F313C 000F007C 7C 0A 38 00 */ cmpw r10, r7
/* 800F3140 000F0080 40 80 00 24 */ bge .L_800F3164
/* 800F3144 000F0084 7C CB 51 D6 */ mullw r6, r11, r10
/* 800F3148 000F0088 7C AC 51 D6 */ mullw r5, r12, r10
/* 800F314C 000F008C 7C C6 3B D6 */ divw r6, r6, r7
/* 800F3150 000F0090 7C A5 3B D6 */ divw r5, r5, r7
/* 800F3154 000F0094 7C C6 07 74 */ extsb r6, r6
/* 800F3158 000F0098 7C A5 07 74 */ extsb r5, r5
/* 800F315C 000F009C 39 66 00 00 */ addi r11, r6, 0
/* 800F3160 000F00A0 39 85 00 00 */ addi r12, r5, 0
.L_800F3164:
/* 800F3164 000F00A4 7C A0 59 D6 */ mullw r5, r0, r11
/* 800F3168 000F00A8 7C 08 61 D6 */ mullw r0, r8, r12
/* 800F316C 000F00AC 98 A3 00 00 */ stb r5, 0(r3)
/* 800F3170 000F00B0 98 04 00 00 */ stb r0, 0(r4)
/* 800F3174 000F00B4 4E 80 00 20 */ blr
.endfn ClampStick
.fn ClampCircle, local
/* 800F3178 000F00B8 94 21 FF C0 */ stwu r1, -0x40(r1)
/* 800F317C 000F00BC 7C C6 07 74 */ extsb r6, r6
/* 800F3180 000F00C0 7C E6 00 D0 */ neg r7, r6
/* 800F3184 000F00C4 88 03 00 00 */ lbz r0, 0(r3)
/* 800F3188 000F00C8 89 24 00 00 */ lbz r9, 0(r4)
/* 800F318C 000F00CC 7C 00 07 74 */ extsb r0, r0
/* 800F3190 000F00D0 7C 07 00 00 */ cmpw r7, r0
/* 800F3194 000F00D4 7D 29 07 74 */ extsb r9, r9
/* 800F3198 000F00D8 40 80 00 14 */ bge .L_800F31AC
/* 800F319C 000F00DC 7C 00 30 00 */ cmpw r0, r6
/* 800F31A0 000F00E0 40 80 00 0C */ bge .L_800F31AC
/* 800F31A4 000F00E4 39 00 00 00 */ li r8, 0
/* 800F31A8 000F00E8 48 00 00 18 */ b .L_800F31C0
.L_800F31AC:
/* 800F31AC 000F00EC 2C 00 00 00 */ cmpwi r0, 0
/* 800F31B0 000F00F0 40 81 00 0C */ ble .L_800F31BC
/* 800F31B4 000F00F4 7D 06 00 50 */ subf r8, r6, r0
/* 800F31B8 000F00F8 48 00 00 08 */ b .L_800F31C0
.L_800F31BC:
/* 800F31BC 000F00FC 7D 00 32 14 */ add r8, r0, r6
.L_800F31C0:
/* 800F31C0 000F0100 7C 07 48 00 */ cmpw r7, r9
/* 800F31C4 000F0104 40 80 00 14 */ bge .L_800F31D8
/* 800F31C8 000F0108 7C 09 30 00 */ cmpw r9, r6
/* 800F31CC 000F010C 40 80 00 0C */ bge .L_800F31D8
/* 800F31D0 000F0110 39 20 00 00 */ li r9, 0
/* 800F31D4 000F0114 48 00 00 18 */ b .L_800F31EC
.L_800F31D8:
/* 800F31D8 000F0118 2C 09 00 00 */ cmpwi r9, 0
/* 800F31DC 000F011C 40 81 00 0C */ ble .L_800F31E8
/* 800F31E0 000F0120 7D 26 48 50 */ subf r9, r6, r9
/* 800F31E4 000F0124 48 00 00 08 */ b .L_800F31EC
.L_800F31E8:
/* 800F31E8 000F0128 7D 29 32 14 */ add r9, r9, r6
.L_800F31EC:
/* 800F31EC 000F012C 7C A7 07 74 */ extsb r7, r5
/* 800F31F0 000F0130 7C C8 41 D6 */ mullw r6, r8, r8
/* 800F31F4 000F0134 7C A9 49 D6 */ mullw r5, r9, r9
/* 800F31F8 000F0138 7C 07 39 D6 */ mullw r0, r7, r7
/* 800F31FC 000F013C 7C A6 2A 14 */ add r5, r6, r5
/* 800F3200 000F0140 7C 00 28 00 */ cmpw r0, r5
/* 800F3204 000F0144 40 80 01 04 */ bge .L_800F3308
/* 800F3208 000F0148 6C A5 80 00 */ xoris r5, r5, 0x8000
/* 800F320C 000F014C C8 E2 94 10 */ lfd f7, lbl_80517770@sda21(r2)
/* 800F3210 000F0150 90 A1 00 3C */ stw r5, 0x3c(r1)
/* 800F3214 000F0154 3C 00 43 30 */ lis r0, 0x4330
/* 800F3218 000F0158 C0 02 93 F8 */ lfs f0, lbl_80517758@sda21(r2)
/* 800F321C 000F015C 90 01 00 38 */ stw r0, 0x38(r1)
/* 800F3220 000F0160 C8 21 00 38 */ lfd f1, 0x38(r1)
/* 800F3224 000F0164 EC 21 38 28 */ fsubs f1, f1, f7
/* 800F3228 000F0168 FC 01 00 40 */ fcmpo cr0, f1, f0
/* 800F322C 000F016C 40 81 00 B0 */ ble .L_800F32DC
/* 800F3230 000F0170 90 A1 00 3C */ stw r5, 0x3c(r1)
/* 800F3234 000F0174 C8 C2 94 00 */ lfd f6, lbl_80517760@sda21(r2)
/* 800F3238 000F0178 90 01 00 38 */ stw r0, 0x38(r1)
/* 800F323C 000F017C C8 A2 94 08 */ lfd f5, lbl_80517768@sda21(r2)
/* 800F3240 000F0180 C8 01 00 38 */ lfd f0, 0x38(r1)
/* 800F3244 000F0184 90 A1 00 34 */ stw r5, 0x34(r1)
/* 800F3248 000F0188 EC 00 38 28 */ fsubs f0, f0, f7
/* 800F324C 000F018C 90 01 00 30 */ stw r0, 0x30(r1)
/* 800F3250 000F0190 FC 60 00 34 */ frsqrte f3, f0
/* 800F3254 000F0194 C8 01 00 30 */ lfd f0, 0x30(r1)
/* 800F3258 000F0198 90 A1 00 2C */ stw r5, 0x2c(r1)
/* 800F325C 000F019C EC 40 38 28 */ fsubs f2, f0, f7
/* 800F3260 000F01A0 FC 23 00 F2 */ fmul f1, f3, f3
/* 800F3264 000F01A4 90 01 00 28 */ stw r0, 0x28(r1)
/* 800F3268 000F01A8 FC 86 00 F2 */ fmul f4, f6, f3
/* 800F326C 000F01AC C8 01 00 28 */ lfd f0, 0x28(r1)
/* 800F3270 000F01B0 FC 22 00 72 */ fmul f1, f2, f1
/* 800F3274 000F01B4 90 A1 00 24 */ stw r5, 0x24(r1)
/* 800F3278 000F01B8 EC 60 38 28 */ fsubs f3, f0, f7
/* 800F327C 000F01BC 90 01 00 20 */ stw r0, 0x20(r1)
/* 800F3280 000F01C0 FC 25 08 28 */ fsub f1, f5, f1
/* 800F3284 000F01C4 C8 01 00 20 */ lfd f0, 0x20(r1)
/* 800F3288 000F01C8 90 A1 00 1C */ stw r5, 0x1c(r1)
/* 800F328C 000F01CC FC 84 00 72 */ fmul f4, f4, f1
/* 800F3290 000F01D0 90 01 00 18 */ stw r0, 0x18(r1)
/* 800F3294 000F01D4 EC 40 38 28 */ fsubs f2, f0, f7
/* 800F3298 000F01D8 C8 01 00 18 */ lfd f0, 0x18(r1)
/* 800F329C 000F01DC FC 24 01 32 */ fmul f1, f4, f4
/* 800F32A0 000F01E0 FC 86 01 32 */ fmul f4, f6, f4
/* 800F32A4 000F01E4 FC 23 00 72 */ fmul f1, f3, f1
/* 800F32A8 000F01E8 EC 00 38 28 */ fsubs f0, f0, f7
/* 800F32AC 000F01EC FC 25 08 28 */ fsub f1, f5, f1
/* 800F32B0 000F01F0 FC 64 00 72 */ fmul f3, f4, f1
/* 800F32B4 000F01F4 FC 23 00 F2 */ fmul f1, f3, f3
/* 800F32B8 000F01F8 FC 66 00 F2 */ fmul f3, f6, f3
/* 800F32BC 000F01FC FC 22 00 72 */ fmul f1, f2, f1
/* 800F32C0 000F0200 FC 25 08 28 */ fsub f1, f5, f1
/* 800F32C4 000F0204 FC 23 00 72 */ fmul f1, f3, f1
/* 800F32C8 000F0208 FC 00 00 72 */ fmul f0, f0, f1
/* 800F32CC 000F020C FC 00 00 18 */ frsp f0, f0
/* 800F32D0 000F0210 D0 01 00 14 */ stfs f0, 0x14(r1)
/* 800F32D4 000F0214 C0 01 00 14 */ lfs f0, 0x14(r1)
/* 800F32D8 000F0218 48 00 00 14 */ b .L_800F32EC
.L_800F32DC:
/* 800F32DC 000F021C 90 A1 00 1C */ stw r5, 0x1c(r1)
/* 800F32E0 000F0220 90 01 00 18 */ stw r0, 0x18(r1)
/* 800F32E4 000F0224 C8 01 00 18 */ lfd f0, 0x18(r1)
/* 800F32E8 000F0228 EC 00 38 28 */ fsubs f0, f0, f7
.L_800F32EC:
/* 800F32EC 000F022C FC 00 00 1E */ fctiwz f0, f0
/* 800F32F0 000F0230 7C A8 39 D6 */ mullw r5, r8, r7
/* 800F32F4 000F0234 D8 01 00 18 */ stfd f0, 0x18(r1)
/* 800F32F8 000F0238 80 C1 00 1C */ lwz r6, 0x1c(r1)
/* 800F32FC 000F023C 7C 09 39 D6 */ mullw r0, r9, r7
/* 800F3300 000F0240 7D 05 33 D6 */ divw r8, r5, r6
/* 800F3304 000F0244 7D 20 33 D6 */ divw r9, r0, r6
.L_800F3308:
/* 800F3308 000F0248 7D 00 07 74 */ extsb r0, r8
/* 800F330C 000F024C 98 03 00 00 */ stb r0, 0(r3)
/* 800F3310 000F0250 7D 20 07 74 */ extsb r0, r9
/* 800F3314 000F0254 98 04 00 00 */ stb r0, 0(r4)
/* 800F3318 000F0258 38 21 00 40 */ addi r1, r1, 0x40
/* 800F331C 000F025C 4E 80 00 20 */ blr
.endfn ClampCircle
.fn PADClamp, global
/* 800F3320 000F0260 7C 08 02 A6 */ mflr r0
/* 800F3324 000F0264 3C 80 80 48 */ lis r4, ClampRegion@ha
/* 800F3328 000F0268 90 01 00 04 */ stw r0, 4(r1)
/* 800F332C 000F026C 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 800F3330 000F0270 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 800F3334 000F0274 93 C1 00 18 */ stw r30, 0x18(r1)
/* 800F3338 000F0278 3B C0 00 00 */ li r30, 0
/* 800F333C 000F027C 93 A1 00 14 */ stw r29, 0x14(r1)
/* 800F3340 000F0280 3B A3 00 00 */ addi r29, r3, 0
/* 800F3344 000F0284 93 81 00 10 */ stw r28, 0x10(r1)
/* 800F3348 000F0288 3B 84 A4 80 */ addi r28, r4, ClampRegion@l
/* 800F334C 000F028C 3B FC 00 01 */ addi r31, r28, 1
.L_800F3350:
/* 800F3350 000F0290 88 1D 00 0A */ lbz r0, 0xa(r29)
/* 800F3354 000F0294 7C 00 07 75 */ extsb. r0, r0
/* 800F3358 000F0298 40 82 00 AC */ bne .L_800F3404
/* 800F335C 000F029C 88 BC 00 03 */ lbz r5, 3(r28)
/* 800F3360 000F02A0 38 7D 00 02 */ addi r3, r29, 2
/* 800F3364 000F02A4 88 DC 00 04 */ lbz r6, 4(r28)
/* 800F3368 000F02A8 38 9D 00 03 */ addi r4, r29, 3
/* 800F336C 000F02AC 88 FC 00 02 */ lbz r7, 2(r28)
/* 800F3370 000F02B0 4B FF FC D9 */ bl ClampStick
/* 800F3374 000F02B4 88 BC 00 06 */ lbz r5, 6(r28)
/* 800F3378 000F02B8 38 7D 00 04 */ addi r3, r29, 4
/* 800F337C 000F02BC 88 DC 00 07 */ lbz r6, 7(r28)
/* 800F3380 000F02C0 38 9D 00 05 */ addi r4, r29, 5
/* 800F3384 000F02C4 88 FC 00 05 */ lbz r7, 5(r28)
/* 800F3388 000F02C8 4B FF FC C1 */ bl ClampStick
/* 800F338C 000F02CC 88 9D 00 06 */ lbz r4, 6(r29)
/* 800F3390 000F02D0 88 1C 00 00 */ lbz r0, 0(r28)
/* 800F3394 000F02D4 88 7F 00 00 */ lbz r3, 0(r31)
/* 800F3398 000F02D8 7C 04 00 40 */ cmplw r4, r0
/* 800F339C 000F02DC 41 81 00 10 */ bgt .L_800F33AC
/* 800F33A0 000F02E0 38 00 00 00 */ li r0, 0
/* 800F33A4 000F02E4 98 1D 00 06 */ stb r0, 6(r29)
/* 800F33A8 000F02E8 48 00 00 20 */ b .L_800F33C8
.L_800F33AC:
/* 800F33AC 000F02EC 7C 03 20 40 */ cmplw r3, r4
/* 800F33B0 000F02F0 40 80 00 08 */ bge .L_800F33B8
/* 800F33B4 000F02F4 98 7D 00 06 */ stb r3, 6(r29)
.L_800F33B8:
/* 800F33B8 000F02F8 88 7C 00 00 */ lbz r3, 0(r28)
/* 800F33BC 000F02FC 88 1D 00 06 */ lbz r0, 6(r29)
/* 800F33C0 000F0300 7C 03 00 50 */ subf r0, r3, r0
/* 800F33C4 000F0304 98 1D 00 06 */ stb r0, 6(r29)
.L_800F33C8:
/* 800F33C8 000F0308 88 9D 00 07 */ lbz r4, 7(r29)
/* 800F33CC 000F030C 88 1C 00 00 */ lbz r0, 0(r28)
/* 800F33D0 000F0310 88 7F 00 00 */ lbz r3, 0(r31)
/* 800F33D4 000F0314 7C 04 00 40 */ cmplw r4, r0
/* 800F33D8 000F0318 41 81 00 10 */ bgt .L_800F33E8
/* 800F33DC 000F031C 38 00 00 00 */ li r0, 0
/* 800F33E0 000F0320 98 1D 00 07 */ stb r0, 7(r29)
/* 800F33E4 000F0324 48 00 00 20 */ b .L_800F3404
.L_800F33E8:
/* 800F33E8 000F0328 7C 03 20 40 */ cmplw r3, r4
/* 800F33EC 000F032C 40 80 00 08 */ bge .L_800F33F4
/* 800F33F0 000F0330 98 7D 00 07 */ stb r3, 7(r29)
.L_800F33F4:
/* 800F33F4 000F0334 88 7C 00 00 */ lbz r3, 0(r28)
/* 800F33F8 000F0338 88 1D 00 07 */ lbz r0, 7(r29)
/* 800F33FC 000F033C 7C 03 00 50 */ subf r0, r3, r0
/* 800F3400 000F0340 98 1D 00 07 */ stb r0, 7(r29)
.L_800F3404:
/* 800F3404 000F0344 3B DE 00 01 */ addi r30, r30, 1
/* 800F3408 000F0348 2C 1E 00 04 */ cmpwi r30, 4
/* 800F340C 000F034C 3B BD 00 0C */ addi r29, r29, 0xc
/* 800F3410 000F0350 41 80 FF 40 */ blt .L_800F3350
/* 800F3414 000F0354 80 01 00 24 */ lwz r0, 0x24(r1)
/* 800F3418 000F0358 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 800F341C 000F035C 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 800F3420 000F0360 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 800F3424 000F0364 83 81 00 10 */ lwz r28, 0x10(r1)
/* 800F3428 000F0368 38 21 00 20 */ addi r1, r1, 0x20
/* 800F342C 000F036C 7C 08 03 A6 */ mtlr r0
/* 800F3430 000F0370 4E 80 00 20 */ blr
.endfn PADClamp
.fn PADClampCircle, global
/* 800F3434 000F0374 7C 08 02 A6 */ mflr r0
/* 800F3438 000F0378 3C 80 80 48 */ lis r4, ClampRegion@ha
/* 800F343C 000F037C 90 01 00 04 */ stw r0, 4(r1)
/* 800F3440 000F0380 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 800F3444 000F0384 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 800F3448 000F0388 93 C1 00 18 */ stw r30, 0x18(r1)
/* 800F344C 000F038C 3B C0 00 00 */ li r30, 0
/* 800F3450 000F0390 93 A1 00 14 */ stw r29, 0x14(r1)
/* 800F3454 000F0394 3B A3 00 00 */ addi r29, r3, 0
/* 800F3458 000F0398 93 81 00 10 */ stw r28, 0x10(r1)
/* 800F345C 000F039C 3B 84 A4 80 */ addi r28, r4, ClampRegion@l
/* 800F3460 000F03A0 3B FC 00 01 */ addi r31, r28, 1
.L_800F3464:
/* 800F3464 000F03A4 88 1D 00 0A */ lbz r0, 0xa(r29)
/* 800F3468 000F03A8 7C 00 07 75 */ extsb. r0, r0
/* 800F346C 000F03AC 40 82 00 A4 */ bne .L_800F3510
/* 800F3470 000F03B0 88 BC 00 08 */ lbz r5, 8(r28)
/* 800F3474 000F03B4 38 7D 00 02 */ addi r3, r29, 2
/* 800F3478 000F03B8 88 DC 00 02 */ lbz r6, 2(r28)
/* 800F347C 000F03BC 38 9D 00 03 */ addi r4, r29, 3
/* 800F3480 000F03C0 4B FF FC F9 */ bl ClampCircle
/* 800F3484 000F03C4 88 BC 00 09 */ lbz r5, 9(r28)
/* 800F3488 000F03C8 38 7D 00 04 */ addi r3, r29, 4
/* 800F348C 000F03CC 88 DC 00 05 */ lbz r6, 5(r28)
/* 800F3490 000F03D0 38 9D 00 05 */ addi r4, r29, 5
/* 800F3494 000F03D4 4B FF FC E5 */ bl ClampCircle
/* 800F3498 000F03D8 88 9D 00 06 */ lbz r4, 6(r29)
/* 800F349C 000F03DC 88 1C 00 00 */ lbz r0, 0(r28)
/* 800F34A0 000F03E0 88 7F 00 00 */ lbz r3, 0(r31)
/* 800F34A4 000F03E4 7C 04 00 40 */ cmplw r4, r0
/* 800F34A8 000F03E8 41 81 00 10 */ bgt .L_800F34B8
/* 800F34AC 000F03EC 38 00 00 00 */ li r0, 0
/* 800F34B0 000F03F0 98 1D 00 06 */ stb r0, 6(r29)
/* 800F34B4 000F03F4 48 00 00 20 */ b .L_800F34D4
.L_800F34B8:
/* 800F34B8 000F03F8 7C 03 20 40 */ cmplw r3, r4
/* 800F34BC 000F03FC 40 80 00 08 */ bge .L_800F34C4
/* 800F34C0 000F0400 98 7D 00 06 */ stb r3, 6(r29)
.L_800F34C4:
/* 800F34C4 000F0404 88 7C 00 00 */ lbz r3, 0(r28)
/* 800F34C8 000F0408 88 1D 00 06 */ lbz r0, 6(r29)
/* 800F34CC 000F040C 7C 03 00 50 */ subf r0, r3, r0
/* 800F34D0 000F0410 98 1D 00 06 */ stb r0, 6(r29)
.L_800F34D4:
/* 800F34D4 000F0414 88 9D 00 07 */ lbz r4, 7(r29)
/* 800F34D8 000F0418 88 1C 00 00 */ lbz r0, 0(r28)
/* 800F34DC 000F041C 88 7F 00 00 */ lbz r3, 0(r31)
/* 800F34E0 000F0420 7C 04 00 40 */ cmplw r4, r0
/* 800F34E4 000F0424 41 81 00 10 */ bgt .L_800F34F4
/* 800F34E8 000F0428 38 00 00 00 */ li r0, 0
/* 800F34EC 000F042C 98 1D 00 07 */ stb r0, 7(r29)
/* 800F34F0 000F0430 48 00 00 20 */ b .L_800F3510
.L_800F34F4:
/* 800F34F4 000F0434 7C 03 20 40 */ cmplw r3, r4
/* 800F34F8 000F0438 40 80 00 08 */ bge .L_800F3500
/* 800F34FC 000F043C 98 7D 00 07 */ stb r3, 7(r29)
.L_800F3500:
/* 800F3500 000F0440 88 7C 00 00 */ lbz r3, 0(r28)
/* 800F3504 000F0444 88 1D 00 07 */ lbz r0, 7(r29)
/* 800F3508 000F0448 7C 03 00 50 */ subf r0, r3, r0
/* 800F350C 000F044C 98 1D 00 07 */ stb r0, 7(r29)
.L_800F3510:
/* 800F3510 000F0450 3B DE 00 01 */ addi r30, r30, 1
/* 800F3514 000F0454 2C 1E 00 04 */ cmpwi r30, 4
/* 800F3518 000F0458 3B BD 00 0C */ addi r29, r29, 0xc
/* 800F351C 000F045C 41 80 FF 48 */ blt .L_800F3464
/* 800F3520 000F0460 80 01 00 24 */ lwz r0, 0x24(r1)
/* 800F3524 000F0464 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 800F3528 000F0468 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 800F352C 000F046C 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 800F3530 000F0470 83 81 00 10 */ lwz r28, 0x10(r1)
/* 800F3534 000F0474 38 21 00 20 */ addi r1, r1, 0x20
/* 800F3538 000F0478 7C 08 03 A6 */ mtlr r0
/* 800F353C 000F047C 4E 80 00 20 */ blr
.endfn PADClampCircle

View File

@ -759,10 +759,10 @@ LIBS = [
{
"lib": "pad",
"mw_version": "1.2.5e",
"cflags": "$cflags_base",
"cflags": "$cflags_base -fp_contract off ",
"host": False,
"objects": [
"Dolphin/pad/Padclamp",
["Dolphin/pad/Padclamp", True],
"Dolphin/pad/Pad",
],
},

View File

@ -21,12 +21,11 @@
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/gx/GXDisplayList.c">gx/GXDisplayList.c</a> | 647 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/Runtime/__init_cpp_exceptions.cpp">Runtime/__init_cpp_exceptions.cpp</a> | 659 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/Runtime/global_destructor_chain.c">Runtime/global_destructor_chain.c</a> | 965 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDNet.c">card/CARDNet.c</a> | 2505 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/mtx/mtxvec.c">mtx/mtxvec.c</a> | 3122 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/gba/GBAXfer.c">gba/GBAXfer.c</a> | 3891 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDDir.c">card/CARDDir.c</a> | 4548 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/mslsupp.c">TRK_MINNOW_DOLPHIN/mslsupp.c</a> | 4555 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/CircleBuffer.c">TRK_MINNOW_DOLPHIN/CircleBuffer.c</a> | 4715 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/serpoll.c">TRK_MINNOW_DOLPHIN/serpoll.c</a> | 4793 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDRdwr.c">card/CARDRdwr.c</a> | 4881 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/dsp/dsp.c">dsp/dsp.c</a> | 5020 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/mpc_7xx_603e.c">TRK_MINNOW_DOLPHIN/mpc_7xx_603e.c</a> | 5554 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/MSL_C/mem_funcs.c">MSL_C/mem_funcs.c</a> | 5682 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/mtx/mtx44.c">mtx/mtx44.c</a> | 5987 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/pad/Padclamp.c">pad/Padclamp.c</a> | 6237 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/mtx/mtxvec.c">mtx/mtxvec.c</a> | 3122 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDDir.c">card/CARDDir.c</a> | 4548 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/mslsupp.c">TRK_MINNOW_DOLPHIN/mslsupp.c</a> | 4555 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/CircleBuffer.c">TRK_MINNOW_DOLPHIN/CircleBuffer.c</a> | 4715 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/serpoll.c">TRK_MINNOW_DOLPHIN/serpoll.c</a> | 4793 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDRdwr.c">card/CARDRdwr.c</a> | 4881 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/dsp/dsp.c">dsp/dsp.c</a> | 5020 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/mpc_7xx_603e.c">TRK_MINNOW_DOLPHIN/mpc_7xx_603e.c</a> | 5554 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/MSL_C/mem_funcs.c">MSL_C/mem_funcs.c</a> | 5682 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/mtx/mtx44.c">mtx/mtx44.c</a> | 5987 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/MSL_C/direct_io.c">MSL_C/direct_io.c</a> | 6259 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/os/OSMemory.c">os/OSMemory.c</a> | 6385 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/os/OSReboot.c">os/OSReboot.c</a> | 6397 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDWrite.c">card/CARDWrite.c</a> | 6434 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDCreate.c">card/CARDCreate.c</a> | 6611 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/os/OSResetSW.c">os/OSResetSW.c</a> | 6856 |
@ -40,7 +39,6 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/dolphin_trk.c">TRK_MINNOW_DOLPHIN/dolphin_trk.c</a> | 11230 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/MSL_C/alloc.c">MSL_C/alloc.c</a> | 12018 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/TRK_MINNOW_DOLPHIN/support.c">TRK_MINNOW_DOLPHIN/support.c</a> | 12046 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/gx/GXTransform.c">gx/GXTransform.c</a> | 12379 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/card/CARDFormat.c">card/CARDFormat.c</a> | 13901 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/os/OSAlarm.c">os/OSAlarm.c</a> | 13932 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/Dolphin/gx/GXLight.c">gx/GXLight.c</a> | 14151 |
### <section id="JSystem">JSystem</section>
| File | Size (bytes) | File | Size (bytes) |

View File

@ -3,14 +3,14 @@
#include "types.h"
extern const float __float_nan[];
extern const f32 __float_nan[];
#define __float_nan *__float_nan
extern const float __float_huge;
extern const f32 __float_huge;
extern const f64 __double_max;
extern const f64 __double_huge;
extern const f64 __extended_min;
extern const f64 __extended_max;
extern const float __float_max[];
extern const float __float_epsilon[];
extern const f32 __float_max[];
extern const f32 __float_epsilon[];
#endif

View File

@ -104,21 +104,20 @@ inline int __fpclassifyd(f64 x)
#define isfinite(x) ((fpclassify(x) > 2))
inline f32 dolsqrtf(f32 x)
{ // regswaps still
volatile f32 y;
{
static const double _half = .5;
static const double _three = 3.0;
volatile float y;
if (x > 0.0f) {
f64 guess = __frsqrte(x);
f64 intermediate = guess * guess * x;
guess = 0.5 * guess * (3.0 - intermediate);
intermediate = guess * guess * x;
guess = 0.5 * guess * (3.0 - intermediate);
intermediate = guess * guess * x;
guess = 0.5 * guess * (3.0 - intermediate);
y = x * guess;
double guess = __frsqrte((double)x); // returns an approximation to
guess = _half * guess * (_three - guess * guess * x); // now have 12 sig bits
guess = _half * guess * (_three - guess * guess * x); // now have 24 sig bits
guess = _half * guess * (_three - guess * guess * x); // now have 32 sig bits
y = (float)(x * guess);
return y;
} else {
return x;
}
return x;
}
#define ispositive(x) ((((u8*)&x)[0] & 0x80) != 0)

View File

@ -1,12 +1,17 @@
PAD_FILES:=\
$(BUILD_DIR)/asm/Dolphin/pad/Padclamp.o\
$(BUILD_DIR)/src/Dolphin/pad/Padclamp.o\
$(BUILD_DIR)/asm/Dolphin/pad/Pad.o\
$(PAD_FILES): CFLAGS += -common off
PAD_UNSCHEDULED:=\
$(EPILOGUE_DIR)/src/Dolphin/pad/Padclamp.o\
$(PAD_FILES): CFLAGS += -common off -fp_contract off
$(PAD_UNSCHEDULED): CFLAGS += -common off -fp_contract off
$(PAD_FILES): MWCC_VERSION := 1.2.5
DEPENDS += $(PAD_FILES:.o=.d)
$(BUILD_DIR)/src/Dolphin/pad/pad.a: $(PAD_FILES)
$(BUILD_DIR)/src/Dolphin/pad/pad.a: $(PAD_FILES) $(PAD_UNSCHEDULED)
@echo Linking... $@
$(QUIET) mkdir -p $(dir $@)
@echo $(PAD_FILES) > build/PAD_ofiles

View File

@ -126,140 +126,13 @@ void ClampCircle(s8* px, s8* py, s8 radius, s8 min)
squared = x * x + y * y;
if (radius * radius < squared) {
length = dolsqrtf(squared); // regswaps
length = dolsqrtf(squared);
x = (x * radius) / length;
y = (y * radius) / length;
}
*px = x;
*py = y;
/*
.loc_0x0:
stwu r1, -0x40(r1)
extsb r6, r6
neg r7, r6
lbz r0, 0x0(r3)
lbz r9, 0x0(r4)
extsb r0, r0
cmpw r7, r0
extsb r9, r9
bge- .loc_0x34
cmpw r0, r6
bge- .loc_0x34
li r8, 0
b .loc_0x48
.loc_0x34:
cmpwi r0, 0
ble- .loc_0x44
sub r8, r0, r6
b .loc_0x48
.loc_0x44:
add r8, r0, r6
.loc_0x48:
cmpw r7, r9
bge- .loc_0x60
cmpw r9, r6
bge- .loc_0x60
li r9, 0
b .loc_0x74
.loc_0x60:
cmpwi r9, 0
ble- .loc_0x70
sub r9, r9, r6
b .loc_0x74
.loc_0x70:
add r9, r9, r6
.loc_0x74:
extsb r7, r5
mullw r6, r8, r8
mullw r5, r9, r9
mullw r0, r7, r7
add r5, r6, r5
cmpw r0, r5
bge- .loc_0x190
xoris r5, r5, 0x8000
lfd f7, -0x6BF0(r2)
stw r5, 0x3C(r1)
lis r0, 0x4330
lfs f0, -0x6C08(r2)
stw r0, 0x38(r1)
lfd f1, 0x38(r1)
fsubs f1, f1, f7
fcmpo cr0, f1, f0
ble- .loc_0x164
stw r5, 0x3C(r1)
lfd f6, -0x6C00(r2)
stw r0, 0x38(r1)
lfd f5, -0x6BF8(r2)
lfd f0, 0x38(r1)
stw r5, 0x34(r1)
fsubs f0, f0, f7
stw r0, 0x30(r1)
fsqrte f3, f0
lfd f0, 0x30(r1)
stw r5, 0x2C(r1)
fsubs f2, f0, f7
fmul f1, f3, f3
stw r0, 0x28(r1)
fmul f4, f6, f3
lfd f0, 0x28(r1)
fmul f1, f2, f1
stw r5, 0x24(r1)
fsubs f3, f0, f7
stw r0, 0x20(r1)
fsub f1, f5, f1
lfd f0, 0x20(r1)
stw r5, 0x1C(r1)
fmul f4, f4, f1
stw r0, 0x18(r1)
fsubs f2, f0, f7
lfd f0, 0x18(r1)
fmul f1, f4, f4
fmul f4, f6, f4
fmul f1, f3, f1
fsubs f0, f0, f7
fsub f1, f5, f1
fmul f3, f4, f1
fmul f1, f3, f3
fmul f3, f6, f3
fmul f1, f2, f1
fsub f1, f5, f1
fmul f1, f3, f1
fmul f0, f0, f1
frsp f0, f0
stfs f0, 0x14(r1)
lfs f0, 0x14(r1)
b .loc_0x174
.loc_0x164:
stw r5, 0x1C(r1)
stw r0, 0x18(r1)
lfd f0, 0x18(r1)
fsubs f0, f0, f7
.loc_0x174:
fctiwz f0, f0
mullw r5, r8, r7
stfd f0, 0x18(r1)
lwz r6, 0x1C(r1)
mullw r0, r9, r7
divw r8, r5, r6
divw r9, r0, r6
.loc_0x190:
extsb r0, r8
stb r0, 0x0(r3)
extsb r0, r9
stb r0, 0x0(r4)
addi r1, r1, 0x40
blr
*/
}
/*
@ -277,6 +150,7 @@ inline void ClampTrigger(u8* trigger, u8 min, u8 max)
}
*trigger -= min;
}
}
/*
* --INFO--

View File

@ -395,3 +395,5 @@ You have 2076 out of 10000 Pokos and 64 out of 201 treasures.",2023-02-02 12:58:
You have 2078 out of 10000 Pokos and 65 out of 201 treasures.",2023-02-03 00:07:16.218617
2080,967816,0.2080272515923129,65,232045,0.3255145499231261,"
You have 2080 out of 10000 Pokos and 65 out of 201 treasures.",2023-02-04 02:03:54.072636
2083,969088,0.2083006616868199,65,232083,0.3255678566218142,"
You have 2083 out of 10000 Pokos and 65 out of 201 treasures.",2023-02-04 16:09:17.307632

1 code_count_in_pokos code_completion_in_bytes code_completion_in_percentage data_count_in_treasures data_completion_in_bytes data_completion_in_percentage sentence created_at
395
396
397
398
399