Would it be possible for someone to update the first post? It hasn't been touched in over half a year, and some really interesting stuff has been posted here since then.
Thread should be updated now. :)
Would it be possible for someone to update the first post? It hasn't been touched in over half a year, and some really interesting stuff has been posted here since then.
Thank you so much! :)Thread should be updated now. :)
Huh. Reading through the code it makes it seem like those two commands end up storing the party position instead of Pokémon species. It'd only need a byte for the former. Or maybe I'm still not getting how all these things behave with one another.It looks like its becauseKanto and Johto work by the fact that setting their var by script also clears the upper byte. But for anything beyond 255, you have it set to 1 or higher for the upper part of the halfword. Just change them to store a halfword instead.Code:found: ldr r2, .MON strb r5, [r2] pop {r0-r6, pc} none: ldr r0, .MON mov r1, #0x6 strb r1, [r0] pop {r0-r6, pc}
Oh, you're right on that, it is storing the party position. What I mean is that variables take up two bytes. So when you doThank you so much! :)
I personally can't imagine how annoying/time consuming it must be to comb through tons of posts to find things to add to the first post and organize them appropriately.
Huh. Reading through the code it makes it seem like those two commands end up storing the party position instead of Pokémon species. It'd only need a byte for the former. Or maybe I'm still not getting how all these things behave with one another.
Regardless, it works. Thanks!
Updated light ball to raise Pikachu's attack:
Spoiler:
At 3F020: 00 49 08 47 XX XX XX 08 00 00 00 00 00 00 00 00 00 00
Code:.text .align 2 .thumb .thumb_func mov r3, r10 cmp r3, #0x2d beq ball cmp r3, #0x41 bne noboost ldrh r0, [r6, #0x0] sub r0, #0x68 lsl r0, r0, #0x10 lsr r0, r0, #0x10 cmp r0, #0x1 bhi noboost ldr r1, return1 bx r1 ball: ldrh r0, [r6, #0x0] cmp r0, #0x19 bne noboost ldr r1, return1 bx r1 noboost: ldr r1, return2 bx r1 .align 2 return1: .word 0x0803F033 return2: .word 0x0803F037
53 46 2D 2B 09 D0 41 2B 0C D1 30 88 68 38 00 04 00 0C 01 28 06 D8 04 49 08 47 30 88 19 28 01 D1 01 49 08 47 01 49 08 47 33 F0 03 08 37 F0 03 08
hi, by the way!Spoiler:Tried it and whenever a Pokémon uses a Physical Attack, the game instantly freezes right there.
This is a FR USA v1.0 Routine, right?
Also, it does replace the way that the native Light Ball works giving it this new effect at the same time, right?
Because I already checked and I'm sure I didn't failed in any step, what I did basically was:
1) Copying the routine into a clean .txt and converting it to .bin, which ended up like this:
I pasted it on 456750.Code:53 46 2D 2B 09 D0 41 2B 0C D1 30 88 68 38 00 04 00 0C 01 28 06 D8 04 49 08 47 30 88 19 28 01 D1 01 49 08 47 01 49 08 47 33 F0 03 08 37 F0 03 08
2) Then I went to 3F020 and typed: 00 49 08 47 50 67 45 08 00 00 00 00 00 00 00 00 00 00
Tried the new ROM, and got surprised by the battle freezing when my Lv5 Pikachu with a Light Ball equipped frozened the game in the moment he tried to use "Slam" on a Wild Pidgey. In another try also noticed that another Wild Pidgey's Tackle could freeze the game too.
I've noticed significant demand for working Dawn Stone evolutions, specifically ones that require the mon to be a specific gender. My bad if this is already posted somewhere but here y'all go:
Change the values in the lines marked UPDATE THIS to the indexes of male stone evos and female stone evos. Leave their entries blank in the general evolution table; stone evolutions function differently from level-up evolutions.Code:.org 0x4318e lsl r0, r0, #0x0 ldr r2, .MethodAddr bx r2 .MethodAddr: .word 0x085B2521 #UPDATE THIS TO MAIN FUNCTION OFFSET+1 .org 0x5B2520 #UPDATE THIS TO MOST CONVENIENT FREE SPACE IN YOUR HACK cmp r0, #0x7 beq StandardStone cmp r0, #0x14 #UPDATE THIS beq MaleStone cmp r0, #0x15 #UPDATE THIS beq FemaleStone b NoEvo MaleStone: push {r1-r3} mov r0, r7 mov r1, r8 ldr r1, [r1, #0x0] bl DetermineGender pop {r1-r3} cmp r0, #0x0 beq StandardStone b NoEvo FemaleStone: push {r1-r3} mov r0, r7 mov r1, r8 ldr r1, [r1, #0x0] bl DetermineGender pop {r1-r3} cmp r0, #0xFE beq StandardStone b NoEvo StandardStone: ldrh r0, [r1, #0x2] cmp r0, r9 beq Finish NoEvo: ldr r2, .NoEvoReturn bx r2 DetermineGender: ldr r2, .DetermineGenderFunc bx r2 Finish: ldr r2, .EvoReturn bx r2 .NoEvoReturn: .word 0x08043199 .EvoReturn: .word 0x0804317d .DetermineGenderFunc: .word 0x0803f78d
Would anyone happen to have JPANs custom input routine?
If not, then if I may make a request.
Trying to get a number/character input menu for custom keypad passwords ect...
If possible it would be much appreciated ^_^
Found it somewhere around my computer. I never found out how to use this correctly (despite the readme file with the explanation) so that's all up to you xD
Nice!
That would be amazing if you could pm it to me...
I think I should be able to manage ^_^
I'm stupid and I forgot to paste the download link xDDD
Here you are: https://www.mediafire.com/download/pt18qmw8k78pmco/number_box.zip
I'll take another look to it tonight anyways :p
All the codes are now on github and the auto-insertion is completed via armips.
https://github.com/jiangzhengwenjz/Double_wild_battle
Old post:
Spoiler:I'm here again and here's some information about double wild battle in BPRE. The system is not yet perfect, but I don't have time to improve it so I decided to release the code. Please credit Jambo51 because some of the codes are ripped from his FR649. However, iirr, Karatekid552 has released the ASM codes in FR649 on github, so I think it's not inappropriate to post them here. These routines will make it possible to have "double wild battle" in "grass battles".
Bugs fixed:
1. Loading only 1
2. Capture animation
3. Audio error
4. Captured data
5. pokedex things
6. can't flee
7. nickname issues
Wild Double Battle in BPRE
Now the main bugs are all fixed and here's a picture of what we can do now. (I don't use an English ROM, sorry.)
The byte changes are in the comments of the routines, so please read carefully.
Spoiler:Code:.thumb /*0x82a26 - 04 49 08 47 0x82a38 - XX+1 XX XX 08 0x7F760 - 00 00*/ str r0, [sp] ldr r0, .opponent_slot add r1, r4, #0 add r2, r6, #0 mov r3, #0x20 ldr r4, .pokemon_make_3 bl linker_4 mov r1, #0 mov r2, #0 loop_1: mov r4, #0x64 ldr r0, .party_slot add r0, #0x56 mul r4, r1 add r0, r0, r4 ldrh r0, [r0] cmp r0, #0 bne add_1 increment: add r1, #1 cmp r1, #6 bne loop_1 cmp r2, #2 blt back_1 ldr r1, .offset ldr r2, .save_block_1 ldr r2, [r2] ldrb r3, [r2, #4] @bank lsl r3, r3, #2 add r1, r1, r3 ldr r1, [r1] ldrb r3, [r2, #5] @map lsl r3, r3, #2 add r1, r1, r3 ldr r1, [r1] ldr r1, [r1] ldr r3, [r1, #0x10] ldr r2, .tileset_table cmp r3, r2 bne back_1 bl get_block_id mov r2, #0 loop_2: mov r1, pc add r1, #0x92 lsl r3, r2, #2 add r1, r1, r3 ldrh r3, [r1] cmp r0, r3 beq calculation ldr r1, .end cmp r1, r3 beq back_1 add r2, #1 b loop_2 add_1: add r2, #1 b increment back_1: mov r0, #0 ldr r1, .battle_flag str r0, [r1] back_2: add sp, sp, #0x10 pop {r4-r6, pc} get_block_id: push {lr} ldr r0, .npc_state ldrh r1, [r0, #0x12] @Y ldrh r0, [r0, #0x10] @X ldr r4, .getter bl linker_4 pop {pc} calculation: ldrb r4, [r1, #2] cmp r4, #0x63 bhi doubletwo bl random mov r1, #0x64 bl mod_func doublethree: add r1, r4, #0 cmp r0, r1 bge back_1 double: mov r0, #1 ldr r1, .battle_flag str r0, [r1] ldr r4, .rand_grass bl linker_4 ldr r1, [r7, #4] lsl r0, r0, #2 add r0, r0, r1 ldrh r4, [r0, #2] ldr r1, .generate bl linker_1 add r6, r0, #0 bl random mov r1, #0x19 bl mod_func str r0, [sp] ldr r0, .opponent_slot add r0, #0x64 add r1, r4, #0 add r2, r6, #0 mov r3, #0x20 ldr r4, .pokemon_make_3 bl linker_4 b back_2 doubletwo: mov r0, #0 b doublethree mod_func: ldr r3, .mod_addr bx r3 random: ldr r2, .rand bx r2 linker_1: bx r1 linker_4: bx r4 .word 0x0005000A .word 0x0005000B .word 0x0005000C .word 0x0005000D .hword 0xFEFE .align 2 .opponent_slot: .word 0x0202402C .pokemon_make_3: .word 0x0803DD99 .party_slot: .word 0x02024284 .battle_flag: .word 0x02022B4C .offset: .word 0x083526A8 .save_block_1: .word 0x03005008 .tileset_table: .word 0x082D4A94 .npc_state: .word 0x02036E38 .getter: .word 0x08058E49 .end: .word 0x0000FEFE .mod_addr: .word 0x081E4685 .rand: .word 0x08044EC9 .rand_grass: .word 0x0808274D .generate: .word 0x080828F9
Code:.thumb .align 2 /*0x16824 - 00 48 00 47 JJ+1 JJ JJ 08*/ cmp r3, #5 beq .L_1 mov r0, #1 and r3, r0 cmp r3, #0 bne .L_0 .L_1: ldr r0, =0x801682D bx r0 .L_0: ldr r0, =0x801682D add r0, #0x42 bx r0
Please change [text offset] to a piece of text data. The text should be like "There're 2 on the opponent side and i can't lock on the target".Code:.thumb /*Change all 1D 1E 0A 08 to the pointer (+1) to this routine, and please do the change before inserting the routine!!!!!!!!!!!!!!!!!!*/ ldr r1, .battle_flag ldr r1, [r1] cmp r1, #5 bne normal ldr r1, .struct mov r2, #0x58 lsl r2, r2, #1 add r2, r1, r2 ldrh r1, [r1, #0x28] ldrh r2, [r2, #0x28] mul r1, r2 cmp r1, #0 bne two_mon normal: ldr r1, .pokeball bx r1 two_mon: push {r4, lr} mov r0, #0 mov r1, #2 ldr r2, .string_shown ldr r3, .bag_print ldr r4, .texter bl jump pop {r4, pc} jump: bx r4 .align 2 .battle_flag: .word 0x2022B4C .pokeball: .word 0x80A1E1D .struct: .word 0x2023C3C .bag_print: .word 0x810a1f9 .texter: .word 0x08108E71 .string_shown: .word 0x08[text offset]
Code:.thumb .align 2 /*21d46 - 00 47 21d94 - ZZ+1 ZZ ZZ 08*/ ldr r0, =0x2022b4c ldr r0, [r0] cmp r0, #5 beq double audio: ldr r0, =0x137 ldr r1, =0x80722A1 bl jump ldr r1, =0x8021D4B jump: bx r1 double: ldr r0, =0x2023C3C mov r1, #0x58 lsl r1, r1, #1 add r1, r0, r1 ldrh r0, [r0, #0x28] ldrh r1, [r1, #0x28] add r0, r0, r1 cmp r0, #0 beq audio ldr r1, =0x8021D4B add r1, #8 bx r1
Code:.thumb .align 2 /*0x2D44C - 30 47 0x2D480 - MM+1 MM MM 08 0x2D812 - 00 00 0x2D858 - 00 00 0x2D8A6 - 00 00 0x2D8F4 - 01 1C 0x2DF36 - 08 1C 0x2DE58 - 00 00 0x2DE84 - 00 00 0x2DEA4 - 00 00 0x2DEC2 - 04 1C 0x2D874 - 6C 3D 02 02 0x2D94C - 6C 3D 02 02 0x2DF64 - 6C 3D 02 02 0x2DF04 - 6C 3D 02 02*/ ldr r6, =0x2022b4c ldr r6, [r6] cmp r6, #5 bne normal ldr r6, =0x2023C3C ldrh r6, [r6, #0x28] cmp r6, #0 bne case_1 case_2: mov r0, #3 b back case_1: mov r0, #1 b back normal: mov r1, #1 eor r0, r1 back: ldr r6, =0x2023D6C ldr r1, =0x802d451 bx r1
Code:.thumb .align 2 /*0x2d95c - 00 48 00 47 NN+1 NN NN 08*/ push {r4, r5, lr} ldr r4, =0x0202402C ldr r0, =0x02023D6C ldrb r0, [r0] lsr r0, r0, #1 mov r1, #0x64 mul r0, r1 add r0, r0, r4 add r4, r0, #0 mov r1, #0xb ldr r2, =0x0802D965 bx r2
Code:.thumb .align 2 /*0x2d9de - 00 47 0x2da00 - UU+1 UU UU 08*/ ldr r0, =0x0202402C ldr r1, =0x02023D6C ldrb r1, [r1] lsr r1, r1, #1 mov r2, #0x64 mul r1, r2 add r0, r1, r0 mov r1, #0xb ldr r2, =0x0802D9E1 bx r2
Code:.thumb .align 2 /*0xEF5F8 - 10 47 0xEF680 - QQ+1 QQ QQ 08*/ ldr r2, =0x02037F1B ldr r0, =0x02022B4C ldr r0, [r0] cmp r0, #5 bne normal ldr r0, =0x02023C3C mov r1, #0x58 lsl r1, r1, #1 add r1, r0, r1 ldrh r1, [r1, #0x28] cmp r1, #0 beq normal mov r1, #3 strb r1, [r2] normal: mov r8, r2 ldr r0, =0x080EF5FB bx r0
After inserting the first routine, there will be a table in this format: 0A 00 05 00 0B 00 05 00 0C 00 05 00...... (The table is in the first routine and you can search for it)
The "05" is the rate of double battle in grass battles, which means 5% and you can change that on your own.
A, B, C, D are the ID of the 4 grass tile blocks and it's compatible with the clean BPRE 1.0 ROM.
As for now, there should still be some bugs like the fact that the name of captured is not shown right, but I won't do it now because I'm busy with my univ life. :)
evolution type number
It works like a charm, just when you insert it go to your pointer(0x800000) + 0x164 and at that offset insert
your pointer(0x800000) + 0x0179 = 0x800179 in reverse hex = 79 01 80.
.text
.align 2
.thumb
.thumb_func
.global decryptor
main:
push {r0-r4, lr}
ldr r0, var_8004 @slot number should be in var_8004
ldrh r0, [r0]
mov r1, #0x64
mul r1, r1, r0
ldr r0, partypoke
add r0, r1, r0 @slot loaded
decrypt:
ldr r1, var_8000 @load var_8000
ldrh r1, [r1]
ldr r2, poke_decrypt
bl linker
ldr r1, var_8001
strh r0, [r1] @store result into var_8001
pop {r0-r4, pc}
linker:
bx r2
.align 2
var_8000: .word 0x20375D8
var_8001: .word 0x20375DA
var_8004: .word 0x20375E0
partypoke: .word 0x20244EC
poke_decrypt: .word 0x806A518 + 1
.text
.align 2
.thumb
.thumb_func
.global encryptor_add
main:
push {r0-r4, lr}
ldr r0, var_8004 @slot
ldrh r0, [r0]
mov r1, #0x64
mul r1, r1, r0
ldr r0, partypoke
add r0, r1, r0 @slot loaded
loadvars:
ldr r1, var_8000 @index
ldrh r1, [r1]
ldr r2, var_8001 @value from decryptor
ldrh r2, [r2]
ldr r3, var_8002 @amount to increase
ldrh r3, [r3]
add:
add r4, r3, r2
encrypt:
ldr r2, var_800D
strh r4, [r2]
ldr r3, poke_encrypt @r0 = slot, r1 = index, r2 = new value
bl linker
recalculate:
ldr r3, =(0x8068D0C+1) @Pokemon stat calculator
bl linker
pop {r0-r4, pc}
linker:
bx r3
.align 2
var_8000: .word 0x20375D8
var_8001: .word 0x20375DA
var_8002: .word 0x20375DC
var_8004: .word 0x20375E0
var_800D: .word 0x20375F0
partypoke: .word 0x20244EC
poke_encrypt: .word 0x806ACAC + 1
.text
.align 2
.thumb
.thumb_func
.global encryptor_add
main:
push {r0-r4, lr}
ldr r0, var_8004 @slot
ldrh r0, [r0]
mov r1, #0x64
mul r1, r1, r0
ldr r0, partypoke
add r0, r1, r0 @slot loaded
loadvars:
ldr r1, var_8000 @index
ldrh r1, [r1]
ldr r2, var_8001 @value from decryptor
ldrh r2, [r2]
ldr r3, var_8002 @amount to increase
ldrh r3, [r3]
sub:
sub r4, r2, r3
encrypt:
ldr r2, var_800D
strh r4, [r2]
ldr r3, poke_encrypt @r0 = slot, r1 = index, r2 = new value
bl linker
recalculate:
ldr r3, =(0x8068D0C+1) @Pokemon stat calculator
bl linker
pop {r0-r4, pc}
linker:
bx r3
.align 2
var_8000: .word 0x20375D8
var_8001: .word 0x20375DA
var_8002: .word 0x20375DC
var_8004: .word 0x20375E0
var_800D: .word 0x20375F0
partypoke: .word 0x20244EC
poke_encrypt: .word 0x806ACAC + 1
hiya!Its actually great.
I havent tried it yet but surely will add it to my upcoming hack.
By the way one question, Inserting these routines and making changes to the pointer listed in the routines will automatically activate the double battle or there is something else I need to do?
pls answer.
thanks in advance :)
hiya!
old post routines:Spoiler:if you're talking about the routines under "old post," then there will be a table
it's 0A 00 05 00 0B 00 05 00 0C 00 05 00 0D 00 05 00
each entry is four bytes
0A 00 05 00
0A - tile id
00 - nothing afaik
05 - percentage of a wild double battle happening
00 - nothing
for the new routines in the github link, i believe it's about a 50% chance (the last time i had it explained to me it was ahaha)
EDIT: well, i guess i'll ask something
can someone make fbi's set static party level routine only work if the pokémon is above the level indicated and/or for a certain slot only? either would work, but preferably for a certain slot~
so there are a few things, but nothing that crashes/freezes/stops gameplayThanks for reply and one more thing,
Will the old routice work nicely??
I mean no major bugs??
If there are ani major or minor bugs pls state if you know :)
so there are a few things, but nothing that crashes/freezes/stops gameplay
if you catch the on the left, it displays the one on the right's name and the sprite after catching. it's fine when nicknamed and all that, though. the one on the right is also the only one faded when the battle starts
you can select run for each (twice)
you can use poké balls twice, but only when there is one
when a faints, it asks if you'd like to switch right away. this is how it generally works, BUT when you have no to switch to, it still asks but then continues the battle regardles of choice.
EDIT: probaby more i just haven't encountered them ahaha