diff options
author | Colin Noga <Tempus@Spectrum-Song.local> | 2011-04-04 00:33:21 -0400 |
---|---|---|
committer | Colin Noga <Tempus@Spectrum-Song.local> | 2011-04-04 00:33:21 -0400 |
commit | bc6353dd5424fa5ec8a4592fc89512f89036665d (patch) | |
tree | 1c05b6b3631dfc00e60887d012ec1b82a5eb4707 | |
parent | 0aae0eed9a74a463852f6548e282c10b6c632cf2 (diff) | |
download | kamek-bc6353dd5424fa5ec8a4592fc89512f89036665d.tar.gz kamek-bc6353dd5424fa5ec8a4592fc89512f89036665d.zip |
Added spritetex.s and updated sprittex.yaml with stuff
Diffstat (limited to '')
-rw-r--r-- | spritetex.s | 144 | ||||
-rw-r--r-- | spritetex.yaml | 85 |
2 files changed, 228 insertions, 1 deletions
diff --git a/spritetex.s b/spritetex.s new file mode 100644 index 0000000..fc66898 --- /dev/null +++ b/spritetex.s @@ -0,0 +1,144 @@ +.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
diff --git a/spritetex.yaml b/spritetex.yaml index 5d930c6..af0c077 100644 --- a/spritetex.yaml +++ b/spritetex.yaml @@ -1,5 +1,5 @@ ---
-source_files: [../src/spritetex.S]
+source_files: [spritetex.s]
hooks:
# - name: TEX_WoodBox
# type: branch_insn
@@ -15,3 +15,86 @@ hooks: src_addr_ntsc: 0x80875BB4
src_addr_pal: 0x80875BB4
target_func: 'TEX_Bush'
+ + + +# The below was added by Tempus + + + - name: TEX_Goomba
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80031384
+ target_func: 'TEX_Goomba'
+ + + - name: TEX_Barrel
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x809AB3B4
+ target_func: 'TEX_Barrel'
+ + + - name: TEX_Blooper
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A0451C
+ target_func: 'TEX_Blooper'
+ + + - name: TEX_BigBlock
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x809B8DB8
+ target_func: 'TEX_BigBlock'
+ + + - name: TEX_Thwomp
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x809F63F4
+ target_func: 'TEX_Thwomp'
+ + + - name: TEX_GiantBuzzy
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x809B6B44
+ target_func: 'TEX_GiantBuzzy'
+ + + - name: TEX_Buzzy
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A67834
+ target_func: 'TEX_Buzzy'
+ + + - name: TEX_SpikeTop
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80AB2C34
+ target_func: 'TEX_SpikeTop'
+ + + - name: TEX_Spiny
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x8003DBF8
+ target_func: 'TEX_Spiny'
+ + + - name: TEX_SpringBlock
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80AC8640
+ target_func: 'TEX_SpringBlock'
+ + + - name: TEX_Coaster
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80859714
+ target_func: 'TEX_Coaster'
+ + |