summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authortom-overton <tom.overton@outlook.com>2021-05-24 00:46:21 -0700
committertom-overton <tom.overton@outlook.com>2021-05-24 00:46:21 -0700
commit5420962e218c510a9baa21f8789b6a5459184b7c (patch)
tree0dab9a2dcdfd51f33cf4d460bbce28db34a27769 /asm
parent3885057795ef543fc0a2ecdcac7718488d975df3 (diff)
FRLG: Add support for randomizing the roaming Raikou/Entei/Suicune
Diffstat (limited to 'asm')
-rw-r--r--asm/hardcoded_statics/roamers/fr_roamers_10.asm44
-rw-r--r--asm/hardcoded_statics/roamers/fr_roamers_11.asm44
-rw-r--r--asm/hardcoded_statics/roamers/lg_roamers_10.asm44
-rw-r--r--asm/hardcoded_statics/roamers/lg_roamers_11.asm44
4 files changed, 176 insertions, 0 deletions
diff --git a/asm/hardcoded_statics/roamers/fr_roamers_10.asm b/asm/hardcoded_statics/roamers/fr_roamers_10.asm
new file mode 100644
index 0000000..5759c39
--- /dev/null
+++ b/asm/hardcoded_statics/roamers/fr_roamers_10.asm
@@ -0,0 +1,44 @@
+ .gba
+ .thumb
+ .open "pokefirered.gba", "pokefirered_roamers.gba", 0x08000000
+
+ CREATE_INITIAL_ROAMER_MON_HOOK_ADDR equ 0x08141C9E
+ CREATE_INITIAL_ROAMER_MON_CONTINUED equ 0x08141CBA
+ NEW_SUBR_ADDR equ 0x08A80200
+
+ ; Hook that jumps to our new subroutine
+ .org CREATE_INITIAL_ROAMER_MON_HOOK_ADDR
+ bl org() + 8
+ mov r6, r0
+ b CREATE_INITIAL_ROAMER_MON_CONTINUED
+ ldr r2,=#(NEW_SUBR_ADDR + 1)
+ bx r2
+ .pool
+
+ ; New subroutine that pc-relative loads Raikou/Entei/Suicune's IDs into r0.
+ ; Takes the ID of Bulbasaur/Charmander/Squirtle as input via r0.
+ ; We had to write this because the compiler optimized these IDs down to a byte.
+ .org NEW_SUBR_ADDR
+ .area 40
+
+ push { r7, lr }
+ mov r1, r0
+ cmp r1, #0x1
+ beq @@bulbasaur
+ cmp r1, #0x4
+ beq @@charmander
+ b @@squirtle
+@@bulbasaur:
+ ldr r0,=#0xF4 ; Entei
+ b @@end
+@@charmander:
+ ldr r0,=#0xF5 ; Suicune
+ b @@end
+@@squirtle:
+ ldr r0,=#0xF3 ; Raikou
+@@end:
+ pop { r7, pc }
+ .pool
+ .endarea
+
+ .close \ No newline at end of file
diff --git a/asm/hardcoded_statics/roamers/fr_roamers_11.asm b/asm/hardcoded_statics/roamers/fr_roamers_11.asm
new file mode 100644
index 0000000..e870668
--- /dev/null
+++ b/asm/hardcoded_statics/roamers/fr_roamers_11.asm
@@ -0,0 +1,44 @@
+ .gba
+ .thumb
+ .open "pokefirered_rev1.gba", "pokefirered_rev1_roamers.gba", 0x08000000
+
+ CREATE_INITIAL_ROAMER_MON_HOOK_ADDR equ 0x08141D16
+ CREATE_INITIAL_ROAMER_MON_CONTINUED equ 0x08141D32
+ NEW_SUBR_ADDR equ 0x08A80200
+
+ ; Hook that jumps to our new subroutine
+ .org CREATE_INITIAL_ROAMER_MON_HOOK_ADDR
+ bl org() + 8
+ mov r6, r0
+ b CREATE_INITIAL_ROAMER_MON_CONTINUED
+ ldr r2,=#(NEW_SUBR_ADDR + 1)
+ bx r2
+ .pool
+
+ ; New subroutine that pc-relative loads Raikou/Entei/Suicune's IDs into r0.
+ ; Takes the ID of Bulbasaur/Charmander/Squirtle as input via r0.
+ ; We had to write this because the compiler optimized these IDs down to a byte.
+ .org NEW_SUBR_ADDR
+ .area 40
+
+ push { r7, lr }
+ mov r1, r0
+ cmp r1, #0x1
+ beq @@bulbasaur
+ cmp r1, #0x4
+ beq @@charmander
+ b @@squirtle
+@@bulbasaur:
+ ldr r0,=#0xF4 ; Entei
+ b @@end
+@@charmander:
+ ldr r0,=#0xF5 ; Suicune
+ b @@end
+@@squirtle:
+ ldr r0,=#0xF3 ; Raikou
+@@end:
+ pop { r7, pc }
+ .pool
+ .endarea
+
+ .close \ No newline at end of file
diff --git a/asm/hardcoded_statics/roamers/lg_roamers_10.asm b/asm/hardcoded_statics/roamers/lg_roamers_10.asm
new file mode 100644
index 0000000..4e559e0
--- /dev/null
+++ b/asm/hardcoded_statics/roamers/lg_roamers_10.asm
@@ -0,0 +1,44 @@
+ .gba
+ .thumb
+ .open "pokeleafgreen.gba", "pokeleafgreen_roamers.gba", 0x08000000
+
+ CREATE_INITIAL_ROAMER_MON_HOOK_ADDR equ 0x08141C76
+ CREATE_INITIAL_ROAMER_MON_CONTINUED equ 0x08141C92
+ NEW_SUBR_ADDR equ 0x08A80200
+
+ ; Hook that jumps to our new subroutine
+ .org CREATE_INITIAL_ROAMER_MON_HOOK_ADDR
+ bl org() + 8
+ mov r6, r0
+ b CREATE_INITIAL_ROAMER_MON_CONTINUED
+ ldr r2,=#(NEW_SUBR_ADDR + 1)
+ bx r2
+ .pool
+
+ ; New subroutine that pc-relative loads Raikou/Entei/Suicune's IDs into r0.
+ ; Takes the ID of Bulbasaur/Charmander/Squirtle as input via r0.
+ ; We had to write this because the compiler optimized these IDs down to a byte.
+ .org NEW_SUBR_ADDR
+ .area 40
+
+ push { r7, lr }
+ mov r1, r0
+ cmp r1, #0x1
+ beq @@bulbasaur
+ cmp r1, #0x4
+ beq @@charmander
+ b @@squirtle
+@@bulbasaur:
+ ldr r0,=#0xF4 ; Entei
+ b @@end
+@@charmander:
+ ldr r0,=#0xF5 ; Suicune
+ b @@end
+@@squirtle:
+ ldr r0,=#0xF3 ; Raikou
+@@end:
+ pop { r7, pc }
+ .pool
+ .endarea
+
+ .close \ No newline at end of file
diff --git a/asm/hardcoded_statics/roamers/lg_roamers_11.asm b/asm/hardcoded_statics/roamers/lg_roamers_11.asm
new file mode 100644
index 0000000..ba23aac
--- /dev/null
+++ b/asm/hardcoded_statics/roamers/lg_roamers_11.asm
@@ -0,0 +1,44 @@
+ .gba
+ .thumb
+ .open "pokeleafgreen_rev1.gba", "pokeleafgreen_rev1_roamers.gba", 0x08000000
+
+ CREATE_INITIAL_ROAMER_MON_HOOK_ADDR equ 0x08141CEE
+ CREATE_INITIAL_ROAMER_MON_CONTINUED equ 0x08141D0A
+ NEW_SUBR_ADDR equ 0x08A80200
+
+ ; Hook that jumps to our new subroutine
+ .org CREATE_INITIAL_ROAMER_MON_HOOK_ADDR
+ bl org() + 8
+ mov r6, r0
+ b CREATE_INITIAL_ROAMER_MON_CONTINUED
+ ldr r2,=#(NEW_SUBR_ADDR + 1)
+ bx r2
+ .pool
+
+ ; New subroutine that pc-relative loads Raikou/Entei/Suicune's IDs into r0.
+ ; Takes the ID of Bulbasaur/Charmander/Squirtle as input via r0.
+ ; We had to write this because the compiler optimized these IDs down to a byte.
+ .org NEW_SUBR_ADDR
+ .area 40
+
+ push { r7, lr }
+ mov r1, r0
+ cmp r1, #0x1
+ beq @@bulbasaur
+ cmp r1, #0x4
+ beq @@charmander
+ b @@squirtle
+@@bulbasaur:
+ ldr r0,=#0xF4 ; Entei
+ b @@end
+@@charmander:
+ ldr r0,=#0xF5 ; Suicune
+ b @@end
+@@squirtle:
+ ldr r0,=#0xF3 ; Raikou
+@@end:
+ pop { r7, pc }
+ .pool
+ .endarea
+
+ .close \ No newline at end of file