Sfoglia il codice sorgente

added item extension and support for more tms

Philipp 8 anni fa
parent
commit
bc0257428a

+ 9
- 0
data/item/tm_hm_move_table.S Vedi File

@@ -0,0 +1,9 @@
1
+.align 2
2
+.thumb
3
+.text
4
+
5
+
6
+@TODO: Use attack names to build table
7
+.global tm_hm_move_table
8
+tm_hm_move_table:
9
+.incbin "data/item/tm_hm_moves.bin"

BIN
data/item/tm_hm_moves.bin Vedi File


data/animation_table.S → data/moves/animation_table.S Vedi File


data/effect_table.S → data/moves/effect_table.S Vedi File


todo/pokemon_tm_vm.s → data/pkmn_tables/pokemon_tm_vm.s Vedi File

@@ -1,7 +1,7 @@
1 1
 .text
2 2
 .align 2
3
-.global tm_vm_kompatibilitaet
4
-tm_vm_kompatibilitaet:
3
+.global tm_hm_comp_table
4
+tm_hm_comp_table:
5 5
 
6 6
 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7 7
 .byte 160, 135, 57, 132, 9, 138, 17, 0, 32, 4, 224, 162, 8, 4, 0, 41

+ 1
- 0
main.asm Vedi File

@@ -8,6 +8,7 @@
8 8
 .include "patches/special.asm"
9 9
 .include "patches/moves.asm"
10 10
 .include "patches/music.asm"
11
+.include "patches/items/items.asm"
11 12
 
12 13
 .include "patches/pokemon_data/pokemon_footprints.asm"
13 14
 .include "patches/pokemon_data/altitude_table.asm"

+ 7
- 0
patches/items/item_limits.asm Vedi File

@@ -0,0 +1,7 @@
1
+NUMBER_OF_ITEMS EQU 375
2
+
3
+.org 0x08098998
4
+.halfword NUMBER_OF_ITEMS
5
+
6
+.org 0x0809a8ae
7
+.word 0x00000000

+ 19
- 0
patches/items/item_routines.asm Vedi File

@@ -0,0 +1,19 @@
1
+.org 0x08125A78
2
+ldr r1, =new_tm_index+1
3
+bx r1
4
+.pool
5
+
6
+.org 0x08131D5A
7
+ldr r0, =new_tm_number_name+1
8
+bx r0
9
+.pool
10
+
11
+.org 0x08043C40
12
+ldr r0, =tm_compat+1
13
+bx r0
14
+.pool
15
+
16
+.org 0x08099E6A
17
+ldr r0, =tm_save_slot+1
18
+bx r0
19
+.pool

+ 8
- 0
patches/items/item_tables.asm Vedi File

@@ -0,0 +1,8 @@
1
+//which tms are bound to which move
2
+
3
+.org 0x08125A8C
4
+.word tm_hm_move_table
5
+
6
+.org 0x0812AAAC
7
+.word tm_hm_move_table
8
+

+ 4
- 0
patches/items/items.asm Vedi File

@@ -0,0 +1,4 @@
1
+.include "patches/items/item_limits.asm"
2
+.include "patches/items/item_tables.asm"
3
+.include "patches/items/item_routines.asm"
4
+.include "patches/items/tm_fixes.asm"

+ 6
- 0
patches/items/tm_fixes.asm Vedi File

@@ -0,0 +1,6 @@
1
+.org 0x0811CE6E
2
+.halfword 0x0000
3
+
4
+.org 0x0811CA2C
5
+.halfword 0xF000
6
+.halfword 0xFA0E

+ 70
- 0
src/item/tmhm/tm_compatability.S Vedi File

@@ -0,0 +1,70 @@
1
+.text
2
+.align 2
3
+.thumb
4
+.global tm_compat
5
+
6
+tm_compat:
7
+mov r3, r1
8
+cmp r4, #0x56 @number between last hm and first new tm plus 0x3a
9
+bge newtm
10
+
11
+check:
12
+cmp r4, #0x1f
13
+bls first_32
14
+cmp r4, #0x3f
15
+bls first_64
16
+cmp r4, #0x5f
17
+bls first_96
18
+
19
+after_96:
20
+mov r0, r4
21
+sub r0, #0x60
22
+mov r2, #0x1
23
+lsl r2, r0
24
+ldr r0, =tm_hm_comp_table
25
+lsl r1, r1, #0x4
26
+add r0, #0xC
27
+
28
+get_offset:
29
+add r1, r1, r0
30
+ldr r0, [r1]
31
+and r0, r2
32
+b exit
33
+
34
+newtm:
35
+sub r4, #0x1C @number between last hm and first new tm
36
+b check
37
+
38
+first_64:
39
+mov r0, r4
40
+sub r0, #0x20
41
+mov r2, #0x1
42
+lsl r2, r0
43
+ldr r0, =tm_hm_comp_table
44
+lsl r1, r1, #0x4
45
+add r0, #0x4
46
+b get_offset
47
+
48
+first_96:
49
+mov r0, r4
50
+sub r0, #0x40
51
+mov r2, #0x1
52
+lsl r2, r0
53
+ldr r0, =tm_hm_comp_table
54
+lsl r1, r1, #0x4
55
+add r0, #0x8
56
+b get_offset
57
+
58
+first_32:
59
+mov r1, #0x1
60
+lsl r1, r5
61
+ldr r2, =tm_hm_comp_table
62
+lsl r0, r3, #0x4
63
+add r0, r0, r2
64
+ldr r0, [r0]
65
+and r0, r1
66
+
67
+exit:
68
+pop {r4-r5}
69
+pop {r1}
70
+bx r1

+ 30
- 0
src/item/tmhm/tm_index.S Vedi File

@@ -0,0 +1,30 @@
1
+.text
2
+.align 2
3
+.thumb
4
+
5
+.global new_tm_index
6
+
7
+new_tm_index:
8
+mov r1, #0xBB @=176/2 which is the new first tm index - 1
9
+lsl r1, r1, #0x1
10
+cmp r0, r1
11
+bhi newtm
12
+
13
+mov r1, #0x90
14
+lsl r1, r1, #0x1
15
+add r1, r1, #0x1
16
+sub r0, r0 ,r1
17
+lsl r0, r0, #0x1
18
+b exit
19
+
20
+newtm:
21
+add r1, r1, #0x1
22
+sub r0, r0, r1
23
+lsl r0, r0, #0x1
24
+add r0, r0, #0x74
25
+
26
+exit:
27
+ldr r1, =tm_hm_move_table
28
+add r0, r0, r1
29
+ldrh r0, [r0]
30
+bx lr

+ 49
- 0
src/item/tmhm/tm_number.S Vedi File

@@ -0,0 +1,49 @@
1
+.text
2
+.align 2
3
+.thumb
4
+.global new_tm_number_name
5
+
6
+new_tm_number_name:
7
+mov r0, #0xBB @=176/2 which is the new first tm index - 1
8
+lsl r0, r0, #0x1
9
+cmp r6, r0
10
+bhi new_tm
11
+
12
+mov r0, #0xA9
13
+lsl r0, r0, #0x1
14
+cmp r6, r0
15
+bls old_tm
16
+
17
+ldr r1, temp
18
+ldr r0, return1
19
+bx r0
20
+
21
+new_tm:
22
+ldr r1, =string_no
23
+mov r0, r5
24
+bl refresh
25
+
26
+ldr r4, ram
27
+ldr r0, value
28
+ldr r1, return3
29
+bx r1
30
+
31
+old_tm:
32
+ldr r1, return2
33
+bx r1
34
+
35
+refresh:
36
+ldr r2, routine
37
+bx r2
38
+
39
+.align 2
40
+routine: .word 0x08008DA5
41
+temp: .word 0x08463178
42
+return1: .word 0x08131D65
43
+return2: .word 0x08131DA5
44
+ram: .word 0x02021CD0
45
+value: .word 0xFFFFFEBC
46
+return3: .word 0x08131DB1
47
+
48
+string_no:
49
+	.byte 0xF9, 0x08, 0xFC, 0x11, 0x01, 0xFF

+ 16
- 0
src/item/tmhm/tm_save_block.S Vedi File

@@ -0,0 +1,16 @@
1
+.text
2
+.align 2
3
+.thumb
4
+.global tm_save_slot
5
+
6
+tm_save_slot:
7
+ldr r0, tm_save
8
+str r0, [r1, #0x18]
9
+mov r0, #0x6C		@108
10
+strb r0, [r1, #0x1c]
11
+ldr r0, return
12
+bx r0
13
+
14
+.align
15
+tm_save: .word 0x0203cB10
16
+return: .word 0x08099e74+1