summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-04-07 20:54:38 +0200
committerTreeki <treeki@gmail.com>2011-04-07 20:54:38 +0200
commita6df2167268ad72d9007126ba022eee481bd1d97 (patch)
treee81814e2f752af416d7f939333f80a1f77e60b6a
parent9f5670af10badc2c4e14ca7602db40f311f397b7 (diff)
downloadkamek-a6df2167268ad72d9007126ba022eee481bd1d97.tar.gz
kamek-a6df2167268ad72d9007126ba022eee481bd1d97.zip
cleaning up spritetex code
Diffstat (limited to '')
-rw-r--r--spritetex.s185
-rw-r--r--spritetex.yaml2
-rw-r--r--src/spritetex.S143
3 files changed, 137 insertions, 193 deletions
diff --git a/spritetex.s b/spritetex.s
deleted file mode 100644
index e5164de..0000000
--- a/spritetex.s
+++ /dev/null
@@ -1,185 +0,0 @@
-.align 4
-.global GetTexFilenameForR5, TexFilenameBuffer, TexFormatString
-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, -0x10(%sp)
- mflr %r0
- stw %r0, 0x14(%sp)
- stw %r3, 0xC(%sp)
- stw %r4, 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, 0x14(%sp)
- lwz %r3, 0xC(%sp)
- lwz %r4, 0x8(%sp)
- mtlr %r0
- addi %sp, %sp, 0x10
- blr
-
-
-TexFilenameBuffer:
- .long 0,0,0,0
-
-TexFormatString:
- .string "g3d/t%02d.brres"
-
-
-
-.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_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(%r30)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Thwomp
-TEX_Thwomp:
- lwz %r5, 4(%r30)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_GiantBuzzy
-TEX_GiantBuzzy:
- lwz %r5, 4(%r30)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Buzzy
-TEX_Buzzy:
- lwz %r5, 4(%r30)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_SpikeTop
-TEX_SpikeTop:
- lwz %r5, 4(%r30)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Spiny
-TEX_Spiny:
- lwz %r5, 4(%r31)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_SpringBlock
-TEX_SpringBlock:
- lwz %r5, 4(%r31)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Coaster
-TEX_Coaster:
- lwz %r5, 4(%r5)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Koopa
-TEX_Koopa:
- lwz %r5, 4(%r30)
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Gabon
-TEX_Gabon:
- lwz %r5, 4(%r30)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Podoboo
-TEX_Podoboo:
- lwz %r5, 4(%r27)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_Switch
-TEX_Switch:
- lwz %r5, 4(%r30)
- srwi %r5, %r5, 16
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
-.global TEX_WiggleShroom
-TEX_WiggleShroom:
- lwz %r5, 4(%r31)
- srwi %r5, %r5, 24
- andi. r5, r5, 0xF
- b GetTexFilenameForR5
-
-
diff --git a/spritetex.yaml b/spritetex.yaml
index 2d909f0..aaa2a2d 100644
--- a/spritetex.yaml
+++ b/spritetex.yaml
@@ -1,5 +1,5 @@
---
-source_files: [spritetex.s]
+source_files: [../src/spritetex.s]
hooks:
# - name: TEX_WoodBox
# type: branch_insn
diff --git a/src/spritetex.S b/src/spritetex.S
index 681f763..65aeefc 100644
--- a/src/spritetex.S
+++ b/src/spritetex.S
@@ -20,25 +20,25 @@ 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, -0x10(sp)
mflr r0
stw r0, 0x14(sp)
stw r3, 0xC(sp)
stw r4, 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, 0x14(sp)
lwz r3, 0xC(sp)
lwz r4, 0x8(sp)
@@ -63,6 +63,135 @@ TEX_Bush:
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_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(r30)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Thwomp
+TEX_Thwomp:
+ lwz r5, 4(r30)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_GiantBuzzy
+TEX_GiantBuzzy:
+ lwz r5, 4(r30)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Buzzy
+TEX_Buzzy:
+ lwz r5, 4(r30)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_SpikeTop
+TEX_SpikeTop:
+ lwz r5, 4(r30)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Spiny
+TEX_Spiny:
+ lwz r5, 4(r31)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_SpringBlock
+TEX_SpringBlock:
+ lwz r5, 4(r31)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Coaster
+TEX_Coaster:
+ lwz r5, 4(r5)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Koopa
+TEX_Koopa:
+ lwz r5, 4(r30)
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Gabon
+TEX_Gabon:
+ lwz r5, 4(r30)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Podoboo
+TEX_Podoboo:
+ lwz r5, 4(r27)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_Switch
+TEX_Switch:
+ lwz r5, 4(r30)
+ srwi r5, r5, 16
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
+
+.global TEX_WiggleShroom
+TEX_WiggleShroom:
+ lwz r5, 4(r31)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
+
@@ -71,5 +200,5 @@ TexFilenameBuffer:
.long 0,0,0,0
TexFormatString:
- .string "g3d/t%02d.brres"
+ .string "g3d/t02d.brres"