summaryrefslogtreecommitdiff
path: root/src/spritetex.S
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-05-17 04:59:17 +0200
committerTreeki <treeki@gmail.com>2011-05-17 04:59:17 +0200
commitdc60abac09195b10032ea97caf3dff5fe709fbab (patch)
tree9c526bcf21820355d61fedd9953e2971b93e2ea8 /src/spritetex.S
parent351ecd543045cf719bdbe955d5ee97e5b74e4592 (diff)
downloadkamek-dc60abac09195b10032ea97caf3dff5fe709fbab.tar.gz
kamek-dc60abac09195b10032ea97caf3dff5fe709fbab.zip
sprite texture name generation no longer clobbers r6..9
Diffstat (limited to '')
-rw-r--r--src/spritetex.S24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/spritetex.S b/src/spritetex.S
index 7464820..0f89cd5 100644
--- a/src/spritetex.S
+++ b/src/spritetex.S
@@ -21,11 +21,15 @@ GetTexFilenameForR5:
# returned filename is in r5
# this makes it easy to use with dRes_c::GetResource
- stwu sp, -0x10(sp)
+ stwu sp, -0x20(sp)
mflr r0
- stw r0, 0x14(sp)
- stw r3, 0xC(sp)
- stw r4, 0x8(sp)
+ 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
@@ -39,11 +43,15 @@ GetTexFilenameForR5:
lis r5, TexFilenameBuffer@h
ori r5, r5, TexFilenameBuffer@l
- lwz r0, 0x14(sp)
- lwz r3, 0xC(sp)
- lwz r4, 0x8(sp)
+ 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, 0x10
+ addi sp, sp, 0x20
blr