1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
|
.text
.align 4
.set sp, 1
.extern returnFromGPSFASixth
.extern daEnItem_c__GetWhetherPlayerCanGetPowerupOrNot
.extern dAcPy_c__ChangePowerupWithAnimation
.extern PlayPlayerSound
.extern CreateActor
.extern PlayerProjectileShooting
.extern Actor_SearchByName
.extern SomeTable_802F5440
.extern SomeTable_802F5580
.extern SomeTable_802F56C0
.extern BlahTable
.extern continuePlumberSetPowerupTexture
.extern doneSettingThePowerupTexture
.extern doneSettingThePowerupTexture2
.extern returnFromPowerupSoundChange
#ifndef __MWERKS__
.set r0,0; .set r1,1; .set r2,2; .set r3,3; .set r4,4
.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
.set r30,30; .set r31,31; .set f0,0; .set f2,2; .set f3,3
.set f1,1; .set f30,30; .set f31,31
#endif
.global DisableHatForHammer
DisableHatForHammer:
lwz r0, 0x17C(r31)
clrlwi. r0, r0, 31
beq DontDrawTheFuckingHat_
lbz r0, 0x152(r31)
cmpwi r0, 7
beq DontDrawTheFuckingHat_
b DrawTheFuckingHat
DontDrawTheFuckingHat_:
b DontDrawTheFuckingHat # this is a hack to avoid implementing R_PPC_REL14
.extern DontDrawTheFuckingHat
.extern DrawTheFuckingHat
.global GetInfoFromDumbTable
GetInfoFromDumbTable:
lis r3, SomeTable@h
ori r3, r3, SomeTable@l
slwi r4, r4, 2
slwi r0, r5, 6
lwzx r3, r3, r4
add r3, r3, r0
blr
.global FukidashiFix
FukidashiFix:
lis r7, ZeroFloat@h
ori r7, r7, ZeroFloat@l
lis r8, FukidashiTable2@h
ori r8, r8, FukidashiTable2@l
mulli r6, r4, 0x20
slwi r0, r5, 2
add r0, r0, r6
lfs f0, 0(r7)
lfsx f1, r8, r0
stfs f0, 0x1DC(r3)
stfs f1, 0x1E0(r3)
stfs f0, 0x1E4(r3)
blr
.global PlayerGetHeight
PlayerGetHeight:
lwz r0, 0x14D4(r3)
lwz r4, 0x1090(r3)
slwi r4, r4, 3
cmpwi r0, 0
beq useNormal
cmpwi r0, 1
bne useDucking
useNormal:
lis r3, PlayerHeightsNormal@h
ori r3, r3, PlayerHeightsNormal@l
b gotOffset
useDucking:
lis r3, PlayerHeightsDucking@h
ori r3, r3, PlayerHeightsDucking@l
gotOffset:
lfsx f1, r3, r4
blr
.global WtfEver
WtfEver:
lis r3, WtfEverTable@h
ori r3, r3, WtfEverTable@l
lfsx f0, r3, r0
blr
.global YetAnother
YetAnother:
lis r3, YetAnotherTable@h
ori r3, r3, YetAnotherTable@l
lfsx f0, r3, r0
blr
.global GetWeirdScaleTable
GetWeirdScaleTable:
lis r5, WeirdScaleTable@h
ori r5, r5, WeirdScaleTable@l
lfsx f1, r5, r0
blr
.global GetAsdfTable
GetAsdfTable:
extsb r0, r4
cmpwi r0, -1
bne dontGetThisOne
lwz r0, 0x1090(r3)
extsb r4, r0
dontGetThisOne:
extsb r0, r4
lis r3, AsdfTable@h
ori r3, r3, AsdfTable@l
lbzx r3, r3, r0
blr
.global GetBlahTableOffset
GetBlahTableOffset:
lis r5, BlahTableOffsets@h
ori r5, r5, BlahTableOffsets@l
lwzx r30, r5, r4
blr
.global DealWithBlahTable
DealWithBlahTable:
lis r5, BlahTableOffsets@h
ori r5, r5, BlahTableOffsets@l
# points to BlahTable
lis r4, BlahTable@h
ori r4, r4, BlahTable@l
# get blahtableoffset entry based on powerup
lwz r0, 0x1090(r3)
slwi r0, r0, 2
lwzx r0, r5, r0
# now get the entry from the blahtable
slwi r0, r0, 2
lwzx r4, r4, r0
# do shit here
lfs f3, 0(r4)
stfs f3, 0x14E4(r3)
stfs f3, 0x164(r3)
lfs f1, 0x2A70(r3)
lfs f0, 0x2A74(r3)
lfs f2, 4(r4)
fadds f1, f2, f1
fadds f0, f0, f1
stfs f0, 0x14E8(r3)
stfs f0, 0x168(r3)
lfs f0, 0x8(r4)
lfs f1, 0xC(r4)
stfs f0, 0x16C(r3)
stfs f1, 0x170(r3)
# hope I did this right
blr
.global GetPowerupScaleFloatAddr_r6_trash_r0_valshl2_r4_dest
GetPowerupScaleFloatAddr_r6_trash_r0_valshl2_r4_dest:
lis r6, PowerupScaleFloats@h
ori r6, r6, PowerupScaleFloats@l
add r4, r6, r0
blr
.global GetPowerupScaleFloatAddr_r6_trash_r0_valshl2_r3_dest
GetPowerupScaleFloatAddr_r6_trash_r0_valshl2_r3_dest:
lis r6, PowerupScaleFloats@h
ori r6, r6, PowerupScaleFloats@l
add r3, r6, r0
blr
.global GetPowerupScaleFloatAddr_r8_trash_r0_valshl2_r7_dest
GetPowerupScaleFloatAddr_r8_trash_r0_valshl2_r7_dest:
lis r8, PowerupScaleFloats@h
ori r8, r8, PowerupScaleFloats@l
add r7, r8, r0
blr
.global GetPowerupScaleFloatAddr_fixForSixth
GetPowerupScaleFloatAddr_fixForSixth:
lis r5, PowerupScaleFloats@h
ori r5, r5, PowerupScaleFloats@l
add r4, r5, r4
b returnFromGPSFASixth
.global PlumberSetPowerupFix
PlumberSetPowerupFix:
lbz r0, 0x152(r31) # get powerup id
cmpwi r0, 2
beq doFireTex
cmpwi r0, 6
beq doIceTex
cmpwi r0, 7
beq doHammerTex
li r4, 0
b gotTexID
doFireTex:
li r4, 1
b gotTexID
doIceTex:
li r4, 2
b gotTexID
doHammerTex:
li r4, 3
gotTexID:
lwz r12, 0(r31)
mr r3, r31
lwz r12, 0x34(r12)
mtctr r12
bctrl
b doneSettingThePowerupTexture
.global PlumberSetPowerupFix2
PlumberSetPowerupFix2:
cmpwi r31, 2
beq doFireTex2
cmpwi r31, 6
beq doIceTex2
cmpwi r31, 7
beq doHammerTex2
li r4, 0
b gotTexID2
doFireTex2:
li r4, 1
b gotTexID2
doIceTex2:
li r4, 2
b gotTexID2
doHammerTex2:
li r4, 3
gotTexID2:
lwz r3, 0x2A64(r30)
lwz r12, 0(r3)
lwz r12, 0x34(r12)
mtctr r12
bctrl
b doneSettingThePowerupTexture2
.global PlumberSetPowerupTextureFix
PlumberSetPowerupTextureFix:
stb r4, 0x153(r3)
lis r5, PowerupTextures@h
ori r5, r5, PowerupTextures@l
slwi r4, r4, 2
lfsx f31, r5, r4
b continuePlumberSetPowerupTexture
.global SetHammerToEnItemDCA
SetHammerToEnItemDCA:
bl daEnItem_c__GetWhetherPlayerCanGetPowerupOrNot
cmpwi r3, 1
bne DontSetHammer
li r0, 5
sth r0, 0xDCA(r31)
DontSetHammer:
lwz r0, 0x14(sp)
lwz r31, 0xC(sp)
mtlr r0
addi sp, sp, 0x10
blr
.global SetHammerToEnItemDCASpecial
SetHammerToEnItemDCASpecial:
cmplwi r4, 0x19
b _not19
li r0, 0xD
sth r0, 0xDCA(r3)
_not19:
cmplwi r4, 6
bnelr
li r0, 5
sth r0, 0xDCA(r3)
blr
#.global EnItem_BindAnimation_Fix
#EnItem_BindAnimation_Fix:
# lhz r0, 0xDCA(r3)
# cmpwi r0, 5
# beqlr
# stwu sp, -0x20(sp)
# b EnItem_BindAnimation_Continued
.global FixPowerupSound
FixPowerupSound:
#lis r3, DBString@h
#ori r3, r3, DBString@l
#lwz r4, 0x1090(r29)
#crclr 4*cr1+eq
#bl OSReport
lwz r5, 0x14DC(r29) # Original powerup
lwz r0, 0x1090(r29) # New powerup
# if NEW is 1 (big) and OLD is not 0 or 3, then play 273 (powerdown)
cmpwi r0, 1
bne dontConsiderPowerdown
cmpwi r5, 0
beq dontConsiderPowerdown
cmpwi r5, 3
beq dontConsiderPowerdown
# If the player is here, he was downgraded from a higher powerup to Big Mario
# So play the powerdown sound
mr r3, r29
li r4, 273
li r5, 0
b returnFromPowerupSoundChange
dontConsiderPowerdown:
lis r3, PowerupSounds@h
ori r3, r3, PowerupSounds@l
slwi r4, r0, 2
lwzx r4, r3, r4
mr r3, r29
li r5, 0
b returnFromPowerupSoundChange
.global WeirdAnimLoadHack
WeirdAnimLoadHack:
cmplwi r4, 5 #hammersuit
beqlr
cmplwi r4, 6 #1up
beqlr
# neither of those succeeded
crclr 4*cr0+eq
blr
.global TryToGiveMarioHammerSuit
TryToGiveMarioHammerSuit:
stwu sp, -0x10(sp)
mflr r0
stw r0, 0x14(sp)
# check the obtained item number
cmplwi r3, 5
bne IsntGettingHammerSuit
# check the current player powerup
cmplwi r4, 7
bne DontHaveHammerSuit
li r28, 0
li r29, 2
b ReturnFromTTGMHS
DontHaveHammerSuit:
mr r3, r30
li r4, 7
bl dAcPy_c__ChangePowerupWithAnimation
cmpwi r3, 0
beq ReturnFromTTGMHS
li r29, 1
IsntGettingHammerSuit:
ReturnFromTTGMHS:
# end of function
lwz r0, 0x14(sp)
mtlr r0
addi sp, sp, 0x10
# leftover instruction from what we replaced to add the bl
cmpwi r29, 0
blr
.global ThrowHammer
ThrowHammer:
# continues on from PlayerProjectileShooting
# get powerup
lwz r3, 0x1090(r30)
cmplwi r3, 7
bne ReturnFromThrowHammer
mr r3, r30
li r4, 498
li r5, 0
bl PlayPlayerSound
li r3, 0x73 # Hammer
li r4, 0 # Settings
addi r5, sp, 0x2C # Position
li r6, 0 # Rotation
lbz r7, 0x38F(r30) # Layer
bl CreateActor
# Store player ID
lwz r4, 0(r30)
stw r4, 0x450(r3)
# store player number, but add 0x100 to differentiate it from 0
lbz r4, 0x38D(r30)
addi r4, r4, 0x100
stw r4, 0x458(r3)
# Fix scale
lis r4, OneFloat@h
ori r4, r4, OneFloat@l
lfs f0, 0(r4)
stfs f0, 0xDC(r3)
stfs f0, 0xE0(r3)
stfs f0, 0xE4(r3)
mr r4, r30
lwz r12, 0x60(r3)
lwz r12, 0x8C(r12)
mtctr r12
bctrl
ReturnFromThrowHammer:
lwz r0, 0xC4(sp)
psq_l f31, 0xB8(sp), 1, 0
lfd f31, 0xB0(sp)
psq_l f30, 0xA8(sp), 1, 0
lfd f30, 0xA0(sp)
lwz r31, 0x9C(sp)
lwz r30, 0x98(sp)
mtlr r0
addi sp, sp, 0xC0
blr
.global MoreProjectileStuff_Fix
MoreProjectileStuff_Fix:
lwz r3, 0x1090(r31)
cmplwi r3, 7
bne ReturnFromMPSFix
mr r3, r31
li r4, 1
bl PlayerProjectileShooting
ReturnFromMPSFix:
lwz r0, 0x14(sp)
lwz r31, 0xC(sp)
mtlr r0
addi sp, sp, 0x10
blr
.global ProjectileShootCheck_Fix
ProjectileShootCheck_Fix:
lwz r3, 0x1090(r31)
cmplwi r3, 7
bne Return0fromPSCFix
lbz r3, 0x38D(r31)
li r4, 0
extsb r3, r3
bl CheckHammerLimit
cmpwi r3, 0
beq Return0fromPSCFix
b Return1fromPSCFix
Return0fromPSCFix:
li r3, 0
b ReturnFromPSCFix
Return1fromPSCFix:
li r3, 1
ReturnFromPSCFix:
lwz r0, 0x14(sp)
lwz r31, 0xC(sp)
mtlr r0
addi sp, sp, 0x10
blr
.global CheckHammerLimit
CheckHammerLimit:
stwu sp, -0x10(sp)
mflr r0
stw r0, 0x14(sp)
stw r31, 0xC(sp)
stw r30, 0x8(sp)
# r30 = player number
mr r30, r3
addi r30, r30, 0x100
# r31 = hammer count so far
li r31, 0
# search for every Hammer
li r3, 0
b startOrContinueLoop
loop:
lwz r4, 0x458(r3)
cmpw r4, r30
bne startOrContinueLoop
addi r31, r31, 1
startOrContinueLoop:
mr r4, r3
li r3, 0x73
bl Actor_SearchByName
cmpwi r3, 0
bne loop
# now if the current count is >= 2, return 0
# otherwise return 1
cmpwi r31, 2
bge tooManyHammers
li r3, 1
b gotHammerStatus
tooManyHammers:
li r3, 0
gotHammerStatus:
lwz r0, 0x14(sp)
lwz r31, 0xC(sp)
lwz r30, 0x8(sp)
mtlr r0
addi sp, sp, 0x10
blr
.extern continueToadPowerupSet
.global ToadPowerupFix
ToadPowerupFix:
cmpwi r4, 3
beq isHammerForToad
lis r8, PowerupTextures@h
ori r8, r8, PowerupTextures@l
slwi r9, r4, 2
lfsx f1, r8, r9
fadds f31, f31, f1
b continueToadPowerupSet
isHammerForToad:
lis r8, ToadTextures@h
ori r8, r8, ToadTextures@l
slwi r9, r0, 2
lfsx f31, r8, r9
b continueToadPowerupSet
.global CheckExistingPowerup
CheckExistingPowerup:
lwz r3, 0x14E0(r3)
blr
.global AcPyCtorHS
AcPyCtorHS:
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xC(r1)
mr r31, r3
bl build__21dHammerSuitRenderer_cFv
stw r3, 0x2D08(r31)
mr r3, r31
lwz r31, 0xC(r1)
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
.global AcPyDtorHS
AcPyDtorHS:
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xC(r1)
stw r30, 8(r1)
mr r31, r4
mr r30, r3
cmpwi r3, 0
beq oops2
lwz r3, 0x2D08(r30)
li r4, 1
bl __dt__21dHammerSuitRenderer_cFv
oops2:
mr r3, r30
mr r4, r31
bl RealAcPyDtor
lwz r30, 8(r1)
lwz r31, 0xC(r1)
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
.global AcPySetMeUpHS
AcPySetMeUpHS:
# partway in: r31 = this
lwz r3, 0x2D08(r31)
addi r4, r31, 0x2A60
bl setup__21dHammerSuitRenderer_cFP21dPlayerModelHandler_c
# epilogue
li r3, 1
lwz r31, 0xC(r1)
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
.global AcPyDrawHS
AcPyDrawHS:
# partway in: r31 = this
lwz r3, 0x2D08(r31)
bl draw__21dHammerSuitRenderer_cFv
# epilogue
li r3, 1
lwz r0, 0x14(r1)
lwz r31, 0xC(r1)
mtlr r0
addi r1, r1, 0x10
blr
# DO IT AGAIN
.global Wm2dPlayerCtorHS
Wm2dPlayerCtorHS:
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xC(r1)
mr r31, r3
bl build__21dHammerSuitRenderer_cFv
stw r3, 0x384(r31)
mr r3, r31
lwz r31, 0xC(r1)
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
.global Wm2dPlayerDtorHS
Wm2dPlayerDtorHS:
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xC(r1)
stw r30, 8(r1)
mr r31, r4
mr r30, r3
cmpwi r3, 0
beq oops
lwz r3, 0x384(r30)
li r4, 1
bl __dt__21dHammerSuitRenderer_cFv
oops:
mr r3, r30
mr r4, r31
bl RealWm2dPlayerDtor
lwz r30, 8(r1)
lwz r31, 0xC(r1)
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
.global Wm2dPlayerSetMeUpHS
Wm2dPlayerSetMeUpHS:
# partway in: r27 = this
lwz r3, 0x384(r27)
lwz r4, 0x128(r27)
li r5, 1
bl setup__21dHammerSuitRenderer_cFP21dPlayerModelHandler_ci
# epilogue
addi r11, r1, 0x20
bl _restgpr_27
lwz r0, 0x24(r1)
mtlr r0
addi r1, r1, 0x20
blr
.global Wm2dPlayerDrawHS
Wm2dPlayerDrawHS:
# dicks (a very insightful comment)
lbz r0, 0x261(r3)
cmpwi r0, 0
beqlr
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xC(r1)
mr r31, r3
lwz r3, 0x384(r31)
bl draw__21dHammerSuitRenderer_cFv
lwz r3, 0x128(r31)
bl draw__21dPlayerModelHandler_cFv
lwz r0, 0x14(r1)
lwz r31, 0xC(r1)
mtlr r0
addi r1, r1, 0x10
blr
.extern _restgpr_27
.extern RealAcPyDtor
.extern RealWm2dPlayerDtor
.extern build__21dHammerSuitRenderer_cFv
.extern __dt__21dHammerSuitRenderer_cFv
.extern setup__21dHammerSuitRenderer_cFP21dPlayerModelHandler_ci
.extern setup__21dHammerSuitRenderer_cFP21dPlayerModelHandler_c
.extern draw__21dHammerSuitRenderer_cFv
.extern draw__21dPlayerModelHandler_cFv
.global HammerGabonRock
HammerGabonRock:
# r27 = apOther
# r28 = apThis
# r29 = objOther
# r31 = objThis
lbz r0, 0x2D(r27)
cmpwi r0, 19
bne hgrExit
lbz r0, 0xA1(r28)
ori r0, r0, 2
stb r0, 0xA1(r28)
hgrExit:
lwz r27, 0x2C(r1)
lwz r28, 0x30(r1)
lwz r29, 0x34(r1)
lwz r30, 0x38(r1)
lwz r31, 0x3C(r1)
lwz r0, 0x44(r1)
mtlr r0
addi r1, r1, 0x40
blr
.data
PowerupSounds:
.long 273, 274, 274, 275, 276, 277, 274, 274
SomeTable:
.long SomeTable_802F5580
.long SomeTable_802F56C0
.long SomeTable_802F56C0
.long SomeTable_802F5440
.long SomeTable_802F56C0
.long SomeTable_802F56C0
.long SomeTable_802F56C0
.long SomeTable_802F56C0
ZeroFloat:
.float 0.0
OneFloat:
.float 1.0
FukidashiTable2:
.float 20.0, 32.0, 32.0, 12.0, 38.0, 33.0, 32.0, 32.0
.float 20.0, 34.0, 34.0, 12.0, 39.0, 35.0, 34.0, 34.0
.float 20.0, 29.0, 29.0, 11.0, 34.0, 29.0, 29.0, 29.0
.float 20.0, 29.0, 29.0, 11.0, 34.0, 29.0, 29.0, 29.0
PlayerHeightsNormal:
.float 16.0, 27.0, 27.0, 12.0, 27.0, 27.0, 27.0, 27.0
PlayerHeightsDucking:
.float 13.0, 21.0, 21.0, 9.0, 21.0, 21.0, 21.0, 21.0
WtfEverTable:
.float 4.5, 10.0, 10.0, 1.0, 10.0, 9.0, 10.0, 10.0
YetAnotherTable:
.float 0.0, -4.0, -4.0, 4.0, -6.0, -2.0, -4.0, -4.0
WeirdScaleTable:
.float 16.0, 31.0, 31.0, 6.0, 34.0, 31.0, 31.0, 31.0
AsdfTable:
.byte 1, 2, 2, 0, 2, 2, 2, 2
BlahTableOffsets:
.long 1, 2, 2, 0, 3, 2, 2, 2
PowerupScaleFloats:
.long 0xDEADBEEF, 0xDEADBEEF # padding
.float 1.0
.float 1.0
.float 1.0
.float 0.6
.float 1.0
.float 1.0
.float 1.0
.float 1.0
PowerupTextures:
.float 0.0
.float 1.0
.float 2.0
.float 3.0
ToadTextures:
.long 0xDEADBEEF, 0xDEADBEEF
.float 7.0, 8.0, 6.0
.global BrosArcFileName
BrosArcFileName:
.string "hammerM"
.global I_hammerArcFilename
I_hammerArcFilename:
.string "I_hammer"
.global I_hammerResFile
I_hammerResFile:
# .string "g3d/I_hammer.brres"
.string "g3d/I_fireflower.brres"
.global I_hammerModelName
I_hammerModelName:
# .string "I_hammer"
.string "I_fireflower"
.global g3d_I_kinoko_brres
g3d_I_kinoko_brres: .string "g3d/I_kinoko.brres"
.global I_propeller_model
I_propeller_model: .string "I_propeller_model"
.global SI_kinoko
SI_kinoko: .string "SI_kinoko"
.global SI_hammer
SI_hammer: .string "SI_hammer"
g3d: .string "g3d/"
.text
.global AddHSToBattleItem_FixWait2Anim
AddHSToBattleItem_FixWait2Anim:
lis r4, wait2@h
ori r4, r4, wait2@l
blr
.global InsertLostG3D
InsertLostG3D:
lis r4, g3d@h
ori r4, r4, g3d@l
blr
.data
wait2: .string "wait2"
#PowerupTexDebugStr:
# .string "Plumber::SetPowerupTexture() called on class %p with texnum %d lr=%p\n"
#DBString:
# .string "PW:%d\n"
#.global BrosModelFilename
#BrosModelFilename:
# .string "g3d/bros.brres"
#.global HammerModelName
#HammerModelName:
# .string "bros_hammer"
.text
.extern continueFromStrongBox
.global StrongboxInit
StrongboxInit:
# MODE
li r4, 2
stw r4, 0x8E0(r30)
# ITEM COUNT (nybble 8)
extrwi r4, r7, 4, 12
stw r4, 0x8E8(r30)
b continueFromStrongBox
.extern continueFromStrongBox2
.extern AddStockPowerup
.extern create__13dStageActor_cF6ActorsUiP7Point3dP6S16VecUc
.global StrongboxGiveBattleItem
StrongboxGiveBattleItem:
# save a reg we can use
stw r29, 0x24(r1)
# get number of current item
lhz r6, 0x8FA(r30)
# create a shift amount...
slwi r6, r6, 2
lwz r7, 4(r30)
# ..and use it to get the item
srw r7, r7, r6
clrlwi r29, r7, 28
# now give it
lis r4, IndexItemsForStockItem@h
ori r4, r4, IndexItemsForStockItem@l
lbzx r4, r4, r29
bl AddStockPowerup
# and then copy the position
lfs f1, 0xAC(r30)
stfs f1, 0x10(r1)
lfs f1, 0xB0(r30)
lfs f2, 0x8D8(r30)
fsubs f1, f1, f2
stfs f1, 0x14(r1)
lfs f1, 0xB4(r30)
stfs f1, 0x18(r1)
li r3, 0x25
slwi r4, r31, 4
or r4, r4, r29
addi r5, r1, 0x10
li r6, 0
li r7, 0
bl create__13dStageActor_cF6ActorsUiP7Point3dP6S16VecUc
# restore our reg
lwz r29, 0x24(r1)
b continueFromStrongBox2
.data
IndexItemsForStockItem:
.byte 0,1,2,3,5,6,4,7
SLGWindow: .string "A00_Window"
SLGBtn0: .string "B00_itemButton"
SLGBtn1: .string "B01_itemButton"
SLGBtn2: .string "B02_itemButton"
SLGBtn3: .string "B03_itemButton"
SLGBtn4: .string "B04_itemButton"
SLGBtn5: .string "B05_itemButton"
SLGBtn6: .string "B06_itemButton"
SLGBtn7: .string "HammerGroup"
SLButtonBase00: .string "P_buttonBase_00"
SLButtonBase01: .string "P_buttonBase_01"
SLButtonBase02: .string "P_buttonBase_02"
SLButtonBase03: .string "P_buttonBase_03"
SLButtonBase04: .string "P_buttonBase_04"
SLButtonBase05: .string "P_buttonBase_05"
SLButtonBase06: .string "P_buttonBase_06"
SLButtonBase07: .string "P_buttonBase_07"
SLIcon0: .string "P_iconKinoko_00"
SLIcon1: .string "P_iconFlower_00"
SLIcon2: .string "P_iconPro_00"
SLIcon3: .string "P_iconIce_00"
SLIcon4: .string "P_iconPen_00"
SLIcon5: .string "P_mameKinoko_00"
SLIcon6: .string "P_iconStar_00"
SLIcon7: .string "P_iconHammer_00"
SLIconPane0: .string "N_iconKinoko_00"
SLIconPane1: .string "N_iconFlower_00"
SLIconPane2: .string "N_iconPro_00"
SLIconPane3: .string "N_iconIce_00"
SLIconPane4: .string "N_iconPen_00"
SLIconPane5: .string "N_mameKinoko_00"
SLIconPane6: .string "N_iconStar_00"
SLIconPane7: .string "N_iconHammer_00"
.align 4
SILayoutGroupNames:
.long SLGWindow
.long SLGBtn0,SLGBtn1,SLGBtn2,SLGBtn6,SLGBtn4,SLGBtn5,SLGBtn3
.long SLGBtn0,SLGBtn1,SLGBtn2,SLGBtn6,SLGBtn4,SLGBtn5,SLGBtn3
.long SLGBtn0,SLGBtn1,SLGBtn2,SLGBtn6,SLGBtn4,SLGBtn5,SLGBtn3
.long SLGBtn0,SLGBtn1,SLGBtn2,SLGBtn6,SLGBtn4,SLGBtn5,SLGBtn3
.long SLGWindow
.long SLGBtn7,SLGBtn7,SLGBtn7
SILayoutGroupIDs:
.long 0
.long 1,1,1,1,1,1,1
.long 2,2,2,2,2,2,2
.long 3,3,3,3,3,3,3
.long 4,4,4,4,4,4,4
.long 5
.long 1,3,4
SILayoutButtonBases:
.long SLButtonBase00,SLButtonBase01,SLButtonBase02,SLButtonBase06
.long SLButtonBase04,SLButtonBase05,SLButtonBase03,SLButtonBase07
SILayoutIconPictures:
.long SLIcon0,SLIcon1,SLIcon2,SLIcon3
.long SLIcon4,SLIcon5,SLIcon6,SLIcon7
SILayoutIconPanes:
.long SLIconPane0,SLIconPane1,SLIconPane2,SLIconPane3
.long SLIconPane4,SLIconPane5,SLIconPane6,SLIconPane7
.text
.global SILayoutGroupParams
SILayoutGroupParams:
lis r4, SILayoutGroupNames@h
ori r4, r4, SILayoutGroupNames@l
lis r5, SILayoutGroupIDs@h
ori r5, r5, SILayoutGroupIDs@l
li r6, 0x21
blr
# - 0x920 : Button Bases
# - 0x940 : Icon Panes
# - 0x960 : Icon Pictures
.extern getPanes__Q23m2d13EmbedLayout_cCFPPCcPPQ34nw4r3lyt4Panei
.extern getPictures__Q23m2d13EmbedLayout_cCFPPCcPPQ34nw4r3lyt7Picturei
.extern ContinueFromSILayoutExtraStuffs
.extern IsWideScreen__Fv
.global SILayoutExtraStuffs
SILayoutExtraStuffs:
addi r3, r30, 0x74
lis r4, SILayoutButtonBases@h
ori r4, r4, SILayoutButtonBases@l
addi r5, r30, 0x920
li r6, 8
bl getPictures__Q23m2d13EmbedLayout_cCFPPCcPPQ34nw4r3lyt7Picturei
addi r3, r30, 0x74
lis r4, SILayoutIconPanes@h
ori r4, r4, SILayoutIconPanes@l
addi r5, r30, 0x940
li r6, 8
bl getPanes__Q23m2d13EmbedLayout_cCFPPCcPPQ34nw4r3lyt4Panei
addi r3, r30, 0x74
lis r4, SILayoutIconPictures@h
ori r4, r4, SILayoutIconPictures@l
addi r5, r30, 0x960
li r6, 8
bl getPictures__Q23m2d13EmbedLayout_cCFPPCcPPQ34nw4r3lyt7Picturei
bl IsWideScreen__Fv
cmpwi r3, 1
beq dontScaleDownSI
lis r3, float0_85@h
ori r3, r3, float0_85@l
lfs f1, 0(r3)
lwz r3, 0x248(r30)
stfs f1, 0x44(r3)
stfs f1, 0x48(r3)
dontScaleDownSI:
li r3, 1
b ContinueFromSILayoutExtraStuffs
.global HideItemsByDefault
.extern ContinueFromHideItemsByDefault
HideItemsByDefault:
li r3, 8
mtctr r3
mr r4, r31
meNext:
lwz r9, 0x960(r4)
lbz r5, 0xBB(r9)
rlwinm r5, r5, 0,24,30
stb r5, 0xBB(r9)
addi r4, r4, 4
bdnz meNext
li r8, 0
li r7, 1
li r6, 4
li r5, 0xE
li r0, 0xF
li r3, 1
b ContinueFromHideItemsByDefault
.global AddHammerPowerupFinalValue
AddHammerPowerupFinalValue:
li r24, 0
lis r22, OutputPowerupsByItemID@h
ori r22, r22, OutputPowerupsByItemID@l
blr
.data
OutputPowerupsByItemID:
.long 1, 2, 4, 6, 5, 3, -1, 7
.text
.global FixStockItemEffectPlayer
FixStockItemEffectPlayer:
lwz r0, 0x8A0(r30)
slwi r0, r0, 2
add r5, r30, r0
lwz r28, 0x940(r5)
blr
.global FixStockItemEffectPlayer2
FixStockItemEffectPlayer2:
lwz r0, 0x8A0(r30)
stw r0, 0x8D0(r30)
blr
.global FixMoreSIEffectRelatedCrap
FixMoreSIEffectRelatedCrap:
lwz r0, 0x8D0(r31)
slwi r0, r0, 2
add r3, r31, r0
lwz r29, 0x940(r3)
blr
.global AddHammerSuitAddSound
.extern MakeSFISound
.extern ContinueFromSIAddSound
AddHammerSuitAddSound:
cmpwi r0, 7
beq _MakeSFISound
b ContinueFromSIAddSound
_MakeSFISound:
b MakeSFISound
.extern resetAnim__Q23m2d13EmbedLayout_cFib
.extern ContinueFromResetHammerAnimOnOpen
.global ResetHammerAnimOnOpen
ResetHammerAnimOnOpen:
addi r3, r28, 0x74
li r4, 0x1E
li r5, 0
bl resetAnim__Q23m2d13EmbedLayout_cFib
addi r3, r28, 0x74
b ContinueFromResetHammerAnimOnOpen
.extern ChosenStartChoice
.global PickHammerAsPossibleStartChoice
PickHammerAsPossibleStartChoice:
lwz r0, 0x918(r30)
li r3, 6
cmpwi r0, 0
beq notGoodEnough
stw r3, 0x8A0(r30)
b ChosenStartChoice
notGoodEnough:
lwz r0, 0x91C(r30)
li r3, 7
cmpwi r0, 0
beq _ChosenStartChoice
stw r3, 0x8A0(r30)
_ChosenStartChoice:
b ChosenStartChoice
.global ChooseOldButtonOffAnim
ChooseOldButtonOffAnim:
cmpwi r4, 7
beq useHammerOffAnim
addi r4, r4, 0x16
blr
useHammerOffAnim:
li r4, 0x20
blr
.global ChooseOldButtonOffAnim2
ChooseOldButtonOffAnim2:
cmpwi r3, 7
beq useHammerOffAnim2
addi r0, r3, 0x16
blr
useHammerOffAnim2:
li r0, 0x20
blr
.global ChooseButtonOnAnim
ChooseButtonOnAnim:
cmpwi r4, 7
beq useHammerOnAnim
addi r4, r4, 1
blr
useHammerOnAnim:
li r4, 0x1E
blr
.global DoSISelectCursor
.extern UpdateSelectCursor
DoSISelectCursor:
slwi r0, r0, 2
add r3, r3, r0
lwz r3, 0x920(r3)
li r4, 0
li r5, 0
b UpdateSelectCursor
.global ChooseHitButtonAnim
ChooseHitButtonAnim:
cmpwi r4, 7
beq useHammerHitAnim
addi r4, r4, 0xF
blr
useHammerHitAnim:
li r4, 0x1F
blr
.global UpdateCalcPowerupResult
.extern ContinueFromCalcPowerupResult
UpdateCalcPowerupResult:
cmpwi r3, 7
bne cprIsDone
li r6, 7
stb r0, 0xF(r1)
cprIsDone:
b ContinueFromCalcPowerupResult
.global SISLayoutExtraStuffs
.extern ContinueFromSISLayoutExtraStuffs
.extern findTextBoxByName__Q23m2d17EmbedLayoutBase_cCFPCc
.extern findPictureByName__Q23m2d17EmbedLayoutBase_cCFPCc
SISLayoutExtraStuffs:
addi r3, r30, 0x70
lis r4, whatever_s@h
ori r4, r4, whatever_s@l
bl findTextBoxByName__Q23m2d17EmbedLayoutBase_cCFPCc
stw r3, 0x288(r30)
addi r3, r30, 0x70
lis r4, fuck_brlyts@h
ori r4, r4, fuck_brlyts@l
bl findTextBoxByName__Q23m2d17EmbedLayoutBase_cCFPCc
stw r3, 0x284(r30)
addi r3, r30, 0x70
lis r4, im_tired_of_this@h
ori r4, r4, im_tired_of_this@l
bl findPictureByName__Q23m2d17EmbedLayoutBase_cCFPCc
stw r3, 0x28C(r30)
li r3, 1
b ContinueFromSISLayoutExtraStuffs
.data
whatever_s: .string "whatever"
fuck_brlyts: .string "fuck_brlyts"
im_tired_of_this: .string "im_tired_of_this"
.text
.global UpdateSIS
.extern ContinueFromUpdateSIS
.extern WriteNumberToTextBox__FPiPCiPQ34nw4r3lyt7TextBoxb
UpdateSIS:
cmpwi r0, 0
beq DontUpdateSIS
subi r25, r25, 0x1C
# replicate this shit
lwz r0, 0x280(r25)
cmpwi r0, 0
lwz r3, 0x28C(r25)
lbz r0, 0xBB(r3)
beq theresNone
li r4, 1
rlwinm r0, r0, 0,24,30
b changedBase
theresNone:
li r4, 0
ori r0, r0, 1
changedBase:
stb r0, 0xBB(r3)
slwi r29, r4, 2
addi r5, r1, 0x14
lwzx r27, r26, r29
li r4, 0
stw r27, 0x14(r1)
lwz r3, 0x284(r25)
lwz r12, 0(r3)
lwz r12, 0x28(r12)
mtctr r12
bctrl
lwzx r29, r28, r29
addi r5, r1, 0x10
stw r29, 0x10(r1)
li r4, 2
lwz r3, 0x284(r25)
lwz r12, 0(r3)
lwz r12, 0x28(r12)
mtctr r12
bctrl
addi r5, r1, 0x14
li r4, 0
lwz r3, 0x288(r25)
lwz r12, 0(r3)
lwz r12, 0x28(r12)
mtctr r12
bctrl
addi r5, r1, 0x10
li r4, 2
lwz r3, 0x288(r25)
lwz r12, 0(r3)
lwz r12, 0x28(r12)
mtctr r12
bctrl
lwz r5, 0x284(r25)
addi r3, r25, 0x280
lis r4, ptrToTwo@h
ori r4, r4, ptrToTwo@l
li r6, 1
bl WriteNumberToTextBox__FPiPCiPQ34nw4r3lyt7TextBoxb
DontUpdateSIS:
addi r11, r1, 0x40
b ContinueFromUpdateSIS
.data
.align 4
ptrToTwo: .long 2
float0_85: .float 0.85
.text
.global SkawoHatesMe, SkawoStillHatesMe
SkawoHatesMe:
lwzx r4, r27, r0
cmpwi r0, 28
bnelr
lis r5, SkawoFucksDucks@h
ori r5, r5, SkawoFucksDucks@l
blr
SkawoStillHatesMe:
lwzx r4, r4, r0
cmpwi r0, 28
bnelr
lis r4, DuckFuckersUnited@h
ori r4, r4, DuckFuckersUnited@l
blr
.data
SkawoFucksDucks: .string "g3d/I_fireflower.brres"
DuckFuckersUnited: .string "I_fireflower"
.align 4
|