diff options
Diffstat (limited to 'src/spritetex.S')
-rw-r--r-- | src/spritetex.S | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/src/spritetex.S b/src/spritetex.S index bf7a02f..55c00af 100644 --- a/src/spritetex.S +++ b/src/spritetex.S @@ -1,4 +1,5 @@ .extern sprintf
+.extern GenerateRandomNumber #ifndef __MWERKS__
.set r0,0; .set r1,1; .set r2,2; .set r3,3; .set r4,4
@@ -55,6 +56,125 @@ GetTexFilenameForR5: 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
+ @@ -723,3 +843,42 @@ AddAmount: .float 32.0 .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 + + |