代码:
结构 火红Tileset(
u8 压缩 //00 =不压缩 || 01 =压缩|
u8 tileset //00 =主要tileset || 01 =第二tileset
u16 填料 //00 00
u32 *图片 //图片的指针
u32 *调色板 //调色板的指针
u32 *块 //块的指针
u32 *动画 //动画程序的指针
u32 *行为 //行为的指针 );
PS: LeafGreen uses the same structure then FireRed.
Explained by LU-HO.
Tileset 0:
代码:
0x2D4A94:
ROM:082D4A94 DCB 1 //压缩
ROM:082D4A95 DCB 0 //主要tileset
ROM:082D4A96 DCW 0 //0x0
ROM:082D4A98 DCD off_8EA1D68 //图片的指针
ROM:082D4A9C DCD off_8EA1B68 //调色板的指针
ROM:082D4AA0 DCD off_829F6C8 //块的指针
ROM:082D4AA4 DCD off_8070155 //动画程序的指针
ROM:082D4AA8 DCD off_82A1EC8 //行为的指针
在本教程中,我们将只使用“动画程序的指针。”
反编译0x8070154 (THUMB mode you should call the routines with "offset +1) we have:
代码:
ROM:08070154
ROM:08070154 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
ROM:08070154
ROM:08070154
ROM:08070154 Tileset0AnimationHeader ; DATA XREF: ROM:082D4AA4o
ROM:08070154 LDR R1, =0x3000FAE
ROM:08070156 MOV R0, #0
ROM:08070158 STRH R0, [R1]
ROM:0807015A LDR R1, =0x3000FB0
ROM:0807015C MOV R2, 0xA0
ROM:0807015E LSL R2, R2, #2
ROM:08070160 ADD R0, R2, #0
ROM:08070162 STRH R0, [R1]
ROM:08070164 LDR R1, =0x3000FB8
ROM:08070166 LDR R0, =0x8070121
ROM:08070168 STR R0, [R1]
ROM:0807016A BX LR
ROM:0807016A ; End of function Tileset0AnimationHeader
ROM:0807016A
ROM:0807016A ; ---------------------------------------------------------------------------
ROM:0807016C dword_807016C DCD 0x3000FAE ; DATA XREF: Tileset0AnimationHeaderr
ROM:08070170 dword_8070170 DCD 0x3000FB0 ; DATA XREF: Tileset0AnimationHeader+6r
ROM:08070174 dword_8070174 DCD 0x3000FB8 ; DATA XREF: Tileset0AnimationHeader+10r
ROM:08070178 dword_8070178 DCD 0x8070121 ; DATA XREF: Tileset0AnimationHeader+12r
在这列程中什么事最重要的呢
0x3000FB8 : 在RAM中局部存储的指针动画例程。
0x8070121 : Offset of routine animation + 1 (THUMB)
代码:
ROM:08070164 LDR R1, =0x3000FB8
ROM:08070166 LDR R0, =0x8070121
ROM:08070168 STR R0, [R1]
...
好难懂的教程,看都看不明白