Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .thumb
- .global beevee_encounter_routine
- @the pokemon species gets loaded on 0x080B5012, then calls a function
- @for now, beevee's species shall be AB for now, i can change it easily
- @r4, r8, and r9 seem to contain the level of the pokemon encountered
- @it looks like r1 is disposable at the very beginning, but needs the level before calling the function
- @r2 is not used until the function gets called
- @r3 contains 118?
- @function that gets called is at 0x080B4E68
- @beevee table is the species number, and then it ends with 00 00.
- .equ main, 0x08XXXXXX
- .align 2
- .org 0x080B5014
- main_hook:
- ldr r1, pointer
- bx r1
- .align 2
- pointer: .word main+1
- .align 2
- .org main
- main_hook:
- cmp r0, #0xAB
- beq is_beevee
- continue:
- mov r1, r4
- ldr r2, calc_wild_poke_stats
- bl call_with_r2
- is_beevee:
- ldr r2, rand_func
- bl call_with_r2
- ldr r1, beevee_table
- lsr r0, r0, #8 @just makes it more likely that the RNG will load a number that works
- sub_loop:
- ldrh r2, [r1]
- cmp r0, r2
- beq continue
- cmp r2, #0
- beq is_beevee
- add r1, r1, #2
- b sub_loop
- call_with_r2:
- bx r2
- .align 2
- rand_func: .word 0x0806F5CC+1
- beevee_table: .word 0x08XXXXXX
- calc_wild_poke_stats: .word 0x080B4E68+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement