|
@@ -15,57 +15,60 @@ saved c324 to cec4 at 14th block (0xd)*/
|
15
|
15
|
/*in pre-patched Fire Red, d9ef0*/
|
16
|
16
|
.global load_hijack
|
17
|
17
|
load_hijack: ldr r1, [r4]
|
18
|
|
- mov r3, #0xff
|
19
|
|
- lsl r3, r3, #0x4
|
20
|
|
- add r3, r3, r1
|
21
|
|
- ldrh r0, [r3, #0x4]
|
22
|
|
- cmp r0, #0x0
|
23
|
|
- beq first_cc_load
|
24
|
|
- cmp r0, #0x4
|
25
|
|
- beq middle_load
|
26
|
|
- cmp r0, #0xd
|
27
|
|
- beq last_load
|
|
18
|
+ mov r3, #0xff
|
|
19
|
+ lsl r3, r3, #0x4
|
|
20
|
+ add r3, r3, r1
|
|
21
|
+ ldrh r0, [r3, #0x4]
|
|
22
|
+ cmp r0, #0x0
|
|
23
|
+ beq first_cc_load
|
|
24
|
+ cmp r0, #0x4
|
|
25
|
+ beq middle_load
|
|
26
|
+ cmp r0, #0xd
|
|
27
|
+ beq last_load
|
28
|
28
|
|
29
|
29
|
|
30
|
30
|
load_ender: cmp r5, #0xd
|
31
|
|
- ble next_loop_iter
|
32
|
|
-
|
33
|
|
- mov r0, #0x1
|
34
|
|
- pop {r3}
|
35
|
|
- mov r8, r3
|
36
|
|
- pop {r4-r7}
|
37
|
|
- pop {r1}
|
38
|
|
- bx r1
|
|
31
|
+ ble next_loop_iter
|
|
32
|
+ mov r0, #0x1
|
|
33
|
+ pop {r3}
|
|
34
|
+ mov r8, r3
|
|
35
|
+ pop {r4-r7}
|
|
36
|
+ pop {r1}
|
|
37
|
+ bx r1
|
39
|
38
|
|
40
|
39
|
first_cc_load: mov r1, #0xcc
|
41
|
|
- ldr r2, c0c8_addr
|
42
|
|
- b load_loop
|
|
40
|
+ ldr r2, c0c8_addr
|
|
41
|
+ b load_loop
|
43
|
42
|
|
44
|
43
|
middle_load: mov r1, #0x96
|
45
|
|
- lsl r1, r1, #0x2
|
46
|
|
- ldr r2, c320_addr
|
47
|
|
- b load_loop
|
|
44
|
+ lsl r1, r1, #0x2
|
|
45
|
+ ldr r2, c320_addr
|
|
46
|
+ b load_loop
|
48
|
47
|
|
49
|
|
-last_load: mov r1, #0xba
|
50
|
|
- lsl r1, r1, #0x4
|
51
|
|
- ldr r2, cec0_addr
|
52
|
|
-
|
|
48
|
+last_load:
|
|
49
|
+ mov r1, #0xba
|
|
50
|
+ lsl r1, r1, #0x4
|
|
51
|
+ ldr r2, cec0_addr
|
53
|
52
|
|
54
|
53
|
load_loop: sub r3, #0x4
|
55
|
|
- ldr r0, [r3]
|
56
|
|
- str r0, [r2]
|
57
|
|
- sub r2, #0x4
|
58
|
|
- sub r1, #0x4
|
59
|
|
- cmp r1, #0x0
|
60
|
|
- bne load_loop
|
61
|
|
- b load_ender
|
62
|
|
-.hword 0x0000
|
|
54
|
+ ldr r0, [r3]
|
|
55
|
+ str r0, [r2]
|
|
56
|
+ sub r2, #0x4
|
|
57
|
+ sub r1, #0x4
|
|
58
|
+ cmp r1, #0x0
|
|
59
|
+ bne load_loop
|
|
60
|
+ b load_ender
|
|
61
|
+
|
|
62
|
+.align 2
|
|
63
|
+
|
63
|
64
|
c0c8_addr: .word 0x0203c0c8
|
64
|
65
|
c320_addr: .word 0x0203c320
|
65
|
66
|
cec0_addr: .word 0x0203cec0
|
66
|
67
|
|
67
|
|
-next_loop_iter: ldr r0, game_load_ret_addr
|
68
|
|
- bx r0
|
|
68
|
+next_loop_iter:
|
|
69
|
+ ldr r0, game_load_ret_addr
|
|
70
|
+ bx r0
|
|
71
|
+
|
69
|
72
|
game_load_ret_addr: .word 0x080D9E71
|
70
|
73
|
/*d9e85 for pre-patched*/
|
71
|
74
|
|