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
|
.extern sprintf
.extern GenerateRandomNumber
#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
#endif
.text
.align 4
.global GetTexFilenameForR5, TexFilenameBuffer, TexFormatString
.set sp, 1
GetTexFilenameForR5:
# obj number should be put into r5
# returned filename is in r5
# this makes it easy to use with dRes_c::GetResource
stwu sp, -0x20(sp)
mflr r0
stw r0, 0x24(sp)
stw r3, 0x1C(sp)
stw r4, 0x18(sp)
stw r6, 0x14(sp)
stw r7, 0x10(sp)
stw r8, 0xC(sp)
stw r9, 0x8(sp)
lis r3, TexFilenameBuffer@h
ori r3, r3, TexFilenameBuffer@l
lis r4, TexFormatString@h
ori r4, r4, TexFormatString@l
crclr 4*cr1+eq
bl sprintf
lis r5, TexFilenameBuffer@h
ori r5, r5, TexFilenameBuffer@l
lwz r0, 0x24(sp)
lwz r3, 0x1C(sp)
lwz r4, 0x18(sp)
lwz r6, 0x14(sp)
lwz r7, 0x10(sp)
lwz r8, 0xC(sp)
lwz r9, 0x8(sp)
mtlr r0
addi sp, sp, 0x20
blr
.global TEX_YoshiEggSetColour
TEX_YoshiEggSetColour:
stwu sp, -0x30(sp)
mflr r0
stw r0, 0x24(sp)
mr r9, r3
stw r4, 0x18(sp)
stw r5, 0x14(sp)
stw r6, 0x10(sp)
stw r7, 0x0C(sp)
li r3, 10
bl GenerateRandomNumber
stw r3, 0x5F8(r9)
lwz r0, 0x24(sp)
mr r3, r9
lwz r4, 0x18(sp)
lwz r5, 0x14(sp)
lwz r6, 0x10(sp)
lwz r7, 0x0C(sp)
mtlr r0
addi sp, sp, 0x30
blr
.global TEX_YoshiEggSetBrres
TEX_YoshiEggSetBrres:
lwz r5, 0x5F8(r27)
clrlwi r5, r5, 28
cmpwi r5, 4
blt YoshiEggOne
cmpwi r5, 8
blt YoshiEggTwo
li r5, 2
b GetTexFilenameForR5
YoshiEggOne:
li r5, 0
b GetTexFilenameForR5
YoshiEggTwo:
li r5, 1
b GetTexFilenameForR5
.global TEX_YoshiEggSetFrame
TEX_YoshiEggSetFrame:
lwz r5, 0x5F8(r27)
clrlwi r5, r5, 30
blr
.global TEX_YoshiEggEffect
TEX_YoshiEggEffect:
lwz r0, 0x5F8(r3)
clrlwi r0, r0, 30
blr
.global TEX_YoshiSetColour
TEX_YoshiSetColour:
lwz r4, 0x5F8(r31)
oris r4, r4, 1
blr
.global TEX_YoshiHack
TEX_YoshiHack:
stwu sp, -0x30(sp)
mflr r0
stw r0, 0x24(sp)
stw r3, 0x1C(sp)
stw r4, 0x18(sp)
stw r5, 0x14(sp)
stw r6, 0x10(sp)
stw r7, 0x0C(sp)
stw r8, 0x08(sp)
stw r9, 0x04(sp)
lwz r5, 0x24C(r31)
clrlwi r5, r5, 28
lis r3, TexFilenameBuffer@h
ori r3, r3, TexFilenameBuffer@l
lis r4, TexFormatString@h
ori r4, r4, TexFormatString@l
crclr 4*cr1+eq
bl sprintf
lis r5, TexFilenameBuffer@h
ori r5, r5, TexFilenameBuffer@l
lis r4, YoshiArc@h
ori r4, r4, YoshiArc@l
lwz r0, 0x24(sp)
lwz r3, 0x1C(sp)
lwz r6, 0x10(sp)
lwz r7, 0x0C(sp)
lwz r8, 0x08(sp)
lwz r9, 0x04(sp)
mtlr r0
addi sp, sp, 0x30
blr
.global TEX_WoodBox
TEX_WoodBox:
lwz r5, 4(r30)
srwi r5, r5, 24
b GetTexFilenameForR5
.global TEX_Bush
TEX_Bush:
srwi r5, r27, 28
b GetTexFilenameForR5
# The below was added by Tempus
.global TEX_Goomba
TEX_Goomba:
lwz r5, 4(r3)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_BigGoomba
TEX_BigGoomba:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Barrel
TEX_Barrel:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Blooper
TEX_Blooper:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_BigBlock
TEX_BigBlock:
lwz r5, 4(r28)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Thwomp
TEX_Thwomp:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_GiantBuzzy
TEX_GiantBuzzy:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Buzzy
TEX_Buzzy:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_BuzzyShell
TEX_BuzzyShell:
lwz r5, 4(r3)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_SpikeTop
TEX_SpikeTop:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Spiny
TEX_Spiny:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_SpinyShell
TEX_SpinyShell:
lwz r5, 4(r3)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_SpringBlock
TEX_SpringBlock:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Coaster
TEX_Coaster:
lwz r5, 4(r3)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Koopa
TEX_Koopa:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Gabon
TEX_Gabon:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Gabon_Spike
TEX_Gabon_Spike:
andis. r4, r4, 0xFFF0
blr
.global TEX_GabonRock
TEX_GabonRock:
lwz r5, 4(r28)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Podoboo
TEX_Podoboo:
lwz r5, 4(r31)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Switch
TEX_Switch:
lwz r5, 4(r29)
srwi r5, r5, 16
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_WiggleShroom
TEX_WiggleShroom:
lwz r5, -0x520(r3)
# This sprite is pretty complex
# The register with THIS is r29
# before the loading function,
# it passes it into r3, and then mr's
# it into r30. r3 is then overwritten.
# Then, it puts r31 into r5, r30 partly
# into r3 and partly into r4. Why?
# So, the possibilities for THIS are
# r30, r3, and r4, no? In the next function,
# r30 is stored over before our getFile, as
# are r29/r28.
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Bramball
TEX_Bramball:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Monty
TEX_Monty:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_ChainChomp
TEX_ChainChomp:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Manta
TEX_Manta:
lwz r5, 4(r28)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Parabeetle
TEX_Parabeetle:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Bomb
TEX_Bomb:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_ParaBomb
TEX_ParaBomb:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_CheepA
TEX_CheepA:
lwz r5, 4(r27)
srwi r5, r5, 20
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_CheepB
TEX_CheepB:
lwz r5, 4(r28)
srwi r5, r5, 20
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_CheepC
TEX_CheepC:
lwz r5, 4(r28)
srwi r5, r5, 20
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_CheepChomp
TEX_CheepChomp:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_BigBoo
TEX_BigBoo:
lwz r5, 4(r27)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Boo
TEX_Boo:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Midway
TEX_Midway:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xFF
b GetTexFilenameForR5
.global TEX_Goal
TEX_Goal:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_StretchMush
TEX_StretchMush:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_BlockSlide
TEX_BlockSlide:
lwz r5, 4(r28)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Spinner
TEX_Spinner:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Platforms
TEX_Platforms:
li r5, 1
b GetTexFilenameForR5
# cmpwi r0, 9
# blt ReplacePlatforms
#
# lwzx r5, r5, r0
# blr
ReplacePlatforms:
lwz r5, 4(r29)
srwi r5, r5, 4
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Platform_ShifterH
TEX_Platform_ShifterH:
stw r5, 0x504(r30)
lwz r5, 4(r30)
stw r5, 0x3D8(r30)
blr
.global TEX_Platform_ShifterF
TEX_Platform_ShifterF:
stw r4, 0x504(r30)
lwz r4, 4(r30)
stw r4, 0x3D8(r30)
blr
.global TEX_Platform_ShifterL
TEX_Platform_ShifterL:
stw r5, 0x504(r28)
lwz r5, 4(r28)
stw r5, 0x3D8(r28)
blr
.global TEX_Platform_ShifterR
TEX_Platform_ShifterR:
stw r4, 0x504(r31)
lwz r4, 4(r31)
stw r4, 0x3D8(r31)
blr
.global TEX_Platform_ShifterS
TEX_Platform_ShifterS:
stw r30, 0x4C4(r27)
lwz r30, 4(r27)
stw r30, 0x398(r27)
blr
.global TEX_Platform_ShifterK
TEX_Platform_ShifterK:
stw r4, 0x5A4(r27)
lwz r4, 4(r27)
stw r4, 0x478(r27)
blr
.global TEX_Platform_ShifterW
TEX_Platform_ShifterW:
stw r0, 0x504(r29)
lwz r0, 4(r29)
stw r0, 0x3D8(r29)
blr
.global TEX_Platform_ShifterSL
TEX_Platform_ShifterSL:
stw r4, 0x504(r29)
lwz r4, 4(r29)
stw r4, 0x3D8(r29)
blr
.global TEX_PokeyA
TEX_PokeyA:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_PokeyB
TEX_PokeyB:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_PokeySnowman
TEX_PokeySnowman:
lwz r10, 4(r30)
srwi r10, r10, 24
andi. r10, r10, 0xF
cmpwi r10, 0x2
bne SnowmanPokey
lwz r10, 4(r30)
# r10 is the current height
andi. r10, r10, 0xF
# Find it
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f0, r11, r10 # get it from the array
blr
SnowmanPokey:
lfs f0, 0x54(r31)
blr
.global TEX_PokeySnowmanPosF
TEX_PokeySnowmanPosF:
lwz r10, 4(r31)
andi. r10, r10, 0xF
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f2, r11, r10 # get it from the array
fmuls f0, f0, f2
stfs f0, 0xB0(r30)
blr
.global TEX_PokeySnowmanPosE
TEX_PokeySnowmanPosE:
lwz r10, 4(r31)
andi. r10, r10, 0xF
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f2, r11, r10 # get it from the array
fmuls f31, f31, f2
stfs f31, 0xB0(r29)
blr
.global TEX_PokeySnowmanPosD
TEX_PokeySnowmanPosD:
lwz r10, 4(r31)
andi. r10, r10, 0xF
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f2, r11, r10 # get it from the array
fmuls f1, f1, f2
stfs f1, 0xB0(r30)
blr
.global TEX_PokeySnowmanPosC
TEX_PokeySnowmanPosC:
lwz r10, 4(r31)
andi. r10, r10, 0xF
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f2, r11, r10 # get it from the array
fmuls f0, f0, f2
stfs f0, 0xB0(r31)
blr
.global TEX_PokeySnowmanPosB
TEX_PokeySnowmanPosB:
lwz r10, 4(r31)
andi. r10, r10, 0xF
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f0, r11, r10 # get it from the array
fmuls f1, f1, f0
stfs f1, 0x18(r1)
blr
.global TEX_PokeySnowmanPosA
TEX_PokeySnowmanPosA:
lwz r10, 4(r31)
andi. r10, r10, 0xF
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f0, r11, r10 # get it from the array
fmuls f3, f3, f0
stfs f3, 0x168(r31)
blr
.global TEX_PokeySnowmanPos
TEX_PokeySnowmanPos:
mr r3, r30
lwz r10, 4(r30)
andi. r10, r10, 0xF
lis r11, SnowmanTable@h
ori r11, r11, SnowmanTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
lfsx f0, r11, r10 # get it from the array
lis r5, AddAmount@h
ori r5, r5, AddAmount@l
slwi r6, r6, 2 # size *= 4 (size of float)
lfsx f3, r5, r6 # get it from the array
lfs f2, 0xB0(r30)
fmuls f3, f3, f0
fmuls f3, f3, f0
fmuls f3, f3, f0
fsubs f2, f2, f3
stfs f2, 0xB0(r30)
blr
SnowmanPokeyPos:
fsubs f0, f0, f31
fsubs f0, f0, f31
fsubs f1, f1, f31
fsubs f1, f1, f31
lfs f2, 8(r1)
fadds f2, f2, f31
stfs f2, 8(r1)
blr
.global TEX_PokeyC
TEX_PokeyC:
lwz r5, 4(r30)
andis. r5, r5, 0xFFF0
or r5, r5, r31
or r5, r5, r0
lwz r0, 0x524(r30)
slwi r0, r0, 8
or r5, r5, r0
blr
.global TEX_PokeyNoSand
TEX_PokeyNoSand:
cmpwi r3, 0x20
blr
.global TEX_CloudBounce
TEX_CloudBounce:
lwz r5, 4(r28)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_SpikeBall
TEX_SpikeBall:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_Huckit
TEX_Huckit:
lwz r5, 4(r29)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global TEX_HuckitBalls
TEX_HuckitBalls:
lwz r5, 4(r30)
srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
.global HammerTime
HammerTime:
lwz r8, 4(r31)
srwi r8, r8, 8
andi. r8, r8, 0xF
cmpwi r8, 1
beq ThrowBobomb
cmpwi r8, 2
beq ThrowGoomba
cmpwi r8, 3
beq ThrowSpiny
cmpwi r8, 4
beq ThrowCoin
cmpwi r8, 5
beq ThrowLemmyBall
blr
ThrowBobomb:
li r3, 133
lis r4, 0x3000
ori r4, r4, 0x0041
blr
ThrowGoomba:
li r3, 0x33
li r4, 1
blr
ThrowSpiny:
li r3, 0x39
li r4, 1
blr
ThrowCoin:
li r3, 10
mflr r8
mr r9, r5
bl GenerateRandomNumber
mr r5, r9
mtlr r8
cmpwi r3, 1
beq ThrowItem
li r3, 0x193
li r4, 0
li r6, 0
li r7, 0
blr
ThrowItem:
li r3, 6
mflr r8
mr r9, r5
bl GenerateRandomNumber
mtlr r8
mr r5, r9
li r4, 0
mr r4, r3
li r3, 0x3C
li r6, 0
li r7, 0
blr
ThrowLemmyBall:
li r3, 0x232
li r4, 0
blr
.global HammerLaunch
HammerLaunch:
mr r3, r30
# r31 is the new actor currently
# r30 is self, all others are volatile
lwz r5, 4(r30)
lwz r8, 0x348(r30)
srwi r5, r5, 8
andi. r5, r5, 0xF
cmpwi r5, 0
beqlr
lis r7, LaunchAngle@h
ori r7, r7, LaunchAngle@l
# lfs f0, 0(r7)
# stfs f0, 0xDC(r31)
# stfs f0, 0xE0(r31)
# stfs f0, 0xE4(r31)
# Nybble 11 is for y right now
li r6, 0
slwi r6, r6, 2 # size *= 4 (size of float)
lfsx f0, r7, r6 # get it from the array
stfs f0, 0xEC(r31)
cmpwi r5, 5
beq LemmyLaunch
li r6, 1
slwi r6, r6, 2 # size *= 4 (size of float)
cmpwi r8, 0
bne FacingLeft
# Nybble 12 is for x right now
lfsx f0, r7, r6 # get it from the array
stfs f0, 0xE8(r31)
blr
FacingLeft:
lis r7, LaunchAngleLeft@h
ori r7, r7, LaunchAngleLeft@l
# Nybble 12 is for x right now
lfsx f0, r7, r6 # get it from the array
stfs f0, 0xE8(r31)
li r7, 270
sth r7, 0x102(r31)
blr
LemmyLaunch:
li r6, 2
slwi r6, r6, 2 # size *= 4 (size of float)
cmpwi r8, 0
bne FacingLeft
# Nybble 12 is for x right now
lfsx f0, r7, r6 # get it from the array
stfs f0, 0xE8(r31)
blr
.global HammerSpin
HammerSpin:
# sth r3, 0x100(r31)
blr
.data
TexFilenameBuffer:
.long 0,0,0,0
TexFormatString:
.string "g3d/t%02d.brres"
ConvertFloat:
.word 0x43300000,0x0,0x43300000,0x80000000
.align 4
SnowmanTable:
.float 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5
AddAmount:
.float 32.0
LaunchAngle:
.float 4.0, 2.5, 1.5
LaunchAngleLeft:
.float -4.0, -2.5, -1.5
.align 4
YoshiArc:
.string "Y_TexGreen"
.align 4
Y_TexGreen:
.string "Y_TexGreen"
.align 4
Y_TexRed:
.string "Y_TexRed"
.align 4
Y_TexYellow:
.string "Y_TexYellow"
.align 4
Y_TexBlue:
.string "Y_TexBlue"
.align 4
Y_TexPurple:
.string "Y_TexPurple"
.align 4
Y_TexOrange:
.string "Y_TexOrange"
.align 4
Y_TexSkyBlue:
.string "Y_TexSkyBlue"
.align 4
Y_TexBlack:
.string "Y_TexBlack"
.align 4
Y_TexWhite:
.string "Y_TexWhite"
.align 4
YoshiStrings:
.long Y_TexGreen, Y_TexRed, Y_TexYellow, Y_TexBlue, Y_TexPurple, Y_TexOrange, Y_TexSkyBlue, Y_TexBlack, Y_TexWhite
.align 4
|