- 192
- Posts
- 17
- Years
- Seen Oct 28, 2020
Is it possible to make this number become infinite?
In case 0xFFFFFFFF (=4294967295) frames are not enough for you you can remove the 05 DD (BLE) at 08078C04 and replace it with 05 E0 (B).
Is it possible to make this number become infinite?
'---------------
#org 0x271354
cmdd8
cmdd9
special 0x3B
special 0x3A
waitstate
goto 0x827143C
'---------------
#org 0x27143C
special 0x37
waitmsg
waitkeypress
special 0x20B
compare LASTRESULT 0x1
if 0x1 goto 0x8271356
goto 0x8271454
'---------------
#org 0x271356
special 0x3B
special 0x3A
waitstate
goto 0x827143C
'---------------
#org 0x271454
repeattrainerbattle
special2 LASTRESULT 0x36
compare LASTRESULT 0x0
if 0x1 goto 0x8271491
compare LASTRESULT 0x2
if 0x1 goto 0x8271491
compare LASTRESULT 0x1
if 0x1 goto 0x8271491
compare LASTRESULT 0x6
if 0x1 goto 0x8271491
compare LASTRESULT 0x8
if 0x1 goto 0x8271491
endtrainerbattle2
releaseall
end
'---------------
#org 0x271491
endtrainerbattle2
releaseall
end
How are voicegroups stored? Do they use samples like DS games, by basing each sample on a MIDI instrument that is played at that point in the song? I'm curious as to so. I might try something if I can get that bit answered.
0x0203C000 is being used by the help menu: it floods to 00s on opening.EDIT: I did some research, and I think I found some safe areas to store the new variables in. For FR/LG, the whole area between 0x0203C000 - 0x0203EFFF appears to be totally unused. I somewhat confirmed it by putting a breakpoint on read/write on the whole area. I wasn't able to get the debugger to break yet. Also, here's a list I made, which clearly shows my theory:
0x02036E4B holds the Y coordinate of the player
0x02036E4D holds the X coordinate of the player
0x0203F3A8 holds the current player map (byte)
0x0203F3A9 holds the current player map bank(byte)
0x0203F3AA holds the last map the player was at (byte)
0x0203F3AB holds the last map bank the player was at (byte)
0x0203F3AC holds the map the player was at 2 maps beforehand (byte)
0x0203F3AD holds the map bank the player wast at 2 maps beforehand (byte)
One more question, does anyone know where the whiteout and win-battle routines are?
08054BC8 sub_08054BC8: @ CODE XREF: sub_080566A4+26p
08054BC8 PUSH {R4,LR}
08054BCA LDR R0, =unk_081A654B
08054BCC BL script_start2
08054BD0 LDR R0, =saveblock1
08054BD2 LDR R4, [R0]
08054BD4 MOVS R0, 0x290
08054BD8 ADDS R4, R4, R0
08054BDA BL sub_08054C04
08054BDE MOVS R1, R0
08054BE0 MOVS R0, R4
08054BE2 BL sub_0809FDD8
08054BE6 BL sp_00_heal_pokemon
08054BEA BL sub_08054DD8
08054BEE BL whiteout_mem1
08054BF2 BL load_warp_map
08054BF6 POP {R4}
08054BF8 POP {R0}
08054BFA BX R0
08054BFA @ End of function sub_08054BC8
080554BC whiteout_mem1: @ CODE XREF: sub_08054BC8+26p
080554BC PUSH {LR}
080554BE LDR R0, =mapnumbers_mem1
080554C0 BL whiteout (=080BFCD0)
080554C4 POP {R0}
080554C6 BX R0
080554C6 @ End of function whiteout_mem1
080566a4 b500 push {lr}
080566a6 b081 add sp, -#0x4
080566a8 4917 ldr r1, [$08056708] (=$030030f0)
080566aa 2087 mov r0, #0x87
080566ac 00c0 lsl r0, r0, #0x03
080566ae 1809 add r1, r1, r0
080566b0 7808 ldrb r0, [r1, #0x0]
080566b2 3001 add r0, #0x1
080566b4 7008 strb r0, [r1, #0x0]
080566b6 0600 lsl r0, r0, #0x18
080566b8 0e00 lsr r0, r0, #0x18
080566ba 2877 cmp r0, #0x77
080566bc d921 bls $08056702
080566be f000 bl $080569bc
080566c2 f01b bl $08071a94
080566c6 f7ff bl $08056420
080566ca f7fe bl $08054bc8
080566ca f7fe bl $08054bc8
080566ce 2002 mov r0, #0x2
080566d0 f7ff bl $080559f8
080566d4 f013 bl $08069a80
080566d8 f013 bl $0806994c
080566dc 490b ldr r1, [$0805670c] (=$03005020)
080566de 480c ldr r0, [$08056710] (=$0807f5f1)
080566e0 6008 str r0, [r1, #0x0]
080566e2 4669 mov r1, sp
080566e4 2000 mov r0, #0x0
080566e6 7008 strb r0, [r1, #0x0]
080566e8 4668 mov r0, sp
080566ea f000 bl $08056e5c
080566ee f0bb bl $08112364
080566ee f0bb bl $08112364
080566f2 f000 bl $08056a04
[COLOR=Black][B]080566f6 4807 ldr r0, [$08056714] (=$08056535)
080566f8 f7ff bl $080565e0
080566fc 4806 ldr r0, [$08056718] (=$080565b5)
080566fe f7a9 bl $08000544[/B][/COLOR]
08056702 b001 add sp, #0x4
08056704 bc01 pop {r0}
08056706 4700 bx r0
080566A4 @ =============== S U B R O U T I N E =======================================
080566A4
080566A4
080566A4 c2_whiteout_maybe: @ DATA XREF: sub_0807FB40+2Ao
080566A4 @ sub_0807FB40:off_0807FB7Co ...
080566A4
080566A4 var_8 = -8
080566A4
080566A4 PUSH {LR}
080566A6 SUB SP, SP, #4
080566A8 LDR R1, =callback1
080566AA MOVS R0, 0x438
080566AE ADDS R1, R1, R0
080566B0 LDRB R0, [R1]
080566B2 ADDS R0, #1
080566B4 STRB R0, [R1]
080566B6 LSLS R0, R0, #0x18
080566B8 LSRS R0, R0, #0x18
080566BA CMP R0, #0x77
080566BC BLS loc_08056702
080566BE BL sub_080569BC
080566C2 BL sub_08071A94
080566C6 BL clear_flag_x800_2
080566CA BL sub_08054BC8
080566CE MOVS R0, #2
080566D0 BL sub_080559F8
080566D4 BL script_start_3
080566D8 BL script_pause
080566DC LDR R1, =unk_03005020
080566DE LDR R0, =(run_c3_whiteout+1)
080566E0 STR R0, [R1]
080566E2 MOV R1, SP
080566E4 MOVS R0, #0
080566E6 STRB R0, [R1,#8+var_8]
080566E8 MOV R0, SP
080566EA BL sub_08056E5C
080566EE BL sub_08112364
080566F2 BL sub_08056A04
080566F6 LDR R0, =(c1_overworld+1)
080566F8 BL set_callback1
080566FC LDR R0, =(c2_overworld+1) @ func
080566FE BL set_callback2
08056702
08056702 loc_08056702: @ CODE XREF: c2_whiteout_maybe+18j
08056702 ADD SP, SP, #4
08056704 POP {R0}
08056706 BX R0
08056706 @ End of function c2_whiteout_maybe
08056706
08056706 @ ---------------------------------------------------------------------------
0807F5F0 @ =============== S U B R O U T I N E =======================================
0807F5F0
0807F5F0
0807F5F0 run_c3_whiteout: @ DATA XREF: c2_whiteout_maybe+3Ao
0807F5F0 @ ROM:off_08056710o
0807F5F0 PUSH {LR}
0807F5F2 BL script_play
0807F5F6 BL fill_unfaded_pal
0807F5FA LDR R0, =(c3_whiteout+1)
0807F5FC MOVS R1, #0xA
0807F5FE BL add_to_callback3_list
0807F602 LSLS R0, R0, #0x18
0807F604 LSRS R0, R0, #0x18
0807F606 LDR R2, =callback3
0807F608 LSLS R1, R0, #2
0807F60A ADDS R1, R1, R0
0807F60C LSLS R1, R1, #3
0807F60E ADDS R1, R1, R2
0807F610 MOVS R0, #0
0807F612 STRH R0, [R1,#c3entry.args.arg1]
0807F614 POP {R0}
0807F616 BX R0
0807F616 @ End of function run_c3_whiteout
0807F616
0807F616 @ ---------------------------------------------------------------------------
0807F45C @ =============== S U B R O U T I N E =======================================
0807F45C
0807F45C
0807F45C c3_whiteout: @ DATA XREF: run_c3_whiteout+Ao
0807F45C @ ROM:off_0807F618o
0807F45C PUSH {R4-R7,LR}
0807F45E LSLS R0, R0, #0x18
0807F460 LSRS R6, R0, #0x18
0807F462 LDR R1, =callback3
0807F464 LSLS R0, R6, #2
0807F466 ADDS R0, R0, R6
0807F468 LSLS R0, R0, #3
0807F46A ADDS R0, R0, R1
0807F46C MOVS R2, #c3entry.args.arg1
0807F46E LDRSH R0, [R0,R2]
0807F470 MOVS R2, R1
0807F472 CMP R0, #6
0807F474 BLS loc_0807F478
0807F476 B loc_0807F5E4
0807F478 @ ---------------------------------------------------------------------------
0807F478
0807F478 loc_0807F478: @ CODE XREF: c3_whiteout+18j
0807F478 LSLS R0, R0, #2
0807F47A LDR R1, =off_0807F48C
0807F47C ADDS R0, R0, R1
0807F47E LDR R0, [R0]
0807F480 MOV PC, R0
0807F480 @ ---------------------------------------------------------------------------
0807F482 .byte 0
0807F483 .byte 0
0807F484 off_0807F484: .long callback3 @ DATA XREF: c3_whiteout+6r
0807F488 off_0807F488: .long off_0807F48C @ DATA XREF: c3_whiteout+1Er
0807F48C off_0807F48C: .long loc_0807F4A8,loc_0807F538,loc_0807F588@ 0
0807F48C @ DATA XREF: c3_whiteout+1Eo
0807F48C @ c3_whiteout:off_0807F488o
0807F48C .long loc_0807F5B6,loc_0807F540,loc_0807F588@ 3
0807F48C .long loc_0807F5D0 @ 6
0807F4A8 @ ---------------------------------------------------------------------------
0807F4A8
0807F4A8 loc_0807F4A8: @ DATA XREF: c3_whiteout:off_0807F48Co
0807F4A8 LDR R0, =unk_083C68E4
0807F4AA BL textbox_mega_func
0807F4AE LSLS R0, R0, #0x18
0807F4B0 LSRS R5, R0, #0x18
0807F4B2 LDR R1, =callback3
0807F4B4 LSLS R4, R6, #2
0807F4B6 ADDS R0, R4, R6
0807F4B8 LSLS R0, R0, #3
0807F4BA ADDS R7, R0, R1
0807F4BC STRH R5, [R7,#0xA]
0807F4BE MOVS R0, #0xF0
0807F4C0 BL sub_080F77CC
0807F4C4 MOVS R0, R5
0807F4C6 MOVS R1, #0
0807F4C8 BL sub_0800445C
0807F4CC MOVS R0, R5
0807F4CE BL sub_08003FA0
0807F4D2 MOVS R0, R5
0807F4D4 MOVS R1, #3
0807F4D6 BL sub_08003F20
0807F4DA MOVS R0, #1
0807F4DC BL sub_080BFCB0
0807F4E0 MOVS R3, R0
0807F4E2 LDR R0, =saveblock1
0807F4E4 LDR R2, [R0]
0807F4E6 LDRH R0, [R2,#0x1C]
0807F4E8 LDRH R5, [R3]
0807F4EA CMP R0, R5
0807F4EC BNE loc_0807F524
0807F4EE MOVS R1, #0x1E
0807F4F0 LDRSB R1, [R2,R1]
0807F4F2 MOVS R0, #1
0807F4F4 NEGS R0, R0
0807F4F6 CMP R1, R0
0807F4F8 BNE loc_0807F524
0807F4FA MOVS R0, #0x20
0807F4FC LDRSH R1, [R2,R0]
0807F4FE MOVS R5, #2
0807F500 LDRSH R0, [R3,R5]
0807F502 CMP R1, R0
0807F504 BNE loc_0807F524
0807F506 MOVS R0, #0x22
0807F508 LDRSH R1, [R2,R0]
0807F50A MOVS R2, #4
0807F50C LDRSH R0, [R3,R2]
0807F50E CMP R1, R0
0807F510 BNE loc_0807F524
0807F512 MOVS R0, #4
0807F514 STRH R0, [R7,#c3entry.args.arg1]
0807F516 B loc_0807F5E4
0807F516 @ ---------------------------------------------------------------------------
0807F518 off_0807F518: .long unk_083C68E4 @ DATA XREF: c3_whiteout:loc_0807F4A8r
0807F51C off_0807F51C: .long callback3 @ DATA XREF: c3_whiteout+56r
0807F520 off_0807F520: .long saveblock1 @ DATA XREF: c3_whiteout+86r
0807F524 @ ---------------------------------------------------------------------------
0807F524
0807F524 loc_0807F524: @ CODE XREF: c3_whiteout+90j
0807F524 @ c3_whiteout+9Cj ...
0807F524 LDR R0, =callback3
0807F526 ADDS R1, R4, R6
0807F528 LSLS R1, R1, #3
0807F52A ADDS R1, R1, R0
0807F52C MOVS R0, #1
0807F52E STRH R0, [R1,#c3entry.args.arg1]
0807F530 B loc_0807F5E4
0807F530 @ ---------------------------------------------------------------------------
0807F532 .byte 0
0807F533 .byte 0
0807F534 off_0807F534: .long callback3 @ DATA XREF: c3_whiteout:loc_0807F524r
0807F538 @ ---------------------------------------------------------------------------
0807F538
0807F538 loc_0807F538: @ DATA XREF: c3_whiteout:off_0807F48Co
0807F538 LDR R1, =a1ScurriedToAPokMonCenterProtec @ "?1 scurried to a POK\x1BMON CENTER, protec"...
0807F53A B loc_0807F542
0807F53A @ ---------------------------------------------------------------------------
0807F53C off_0807F53C: .long a1ScurriedToAPokMonCenterProtec
0807F53C @ DATA XREF: c3_whiteout:loc_0807F538r
0807F53C @ "?1 scurried to a POK\x1BMON CENTER, protec"...
0807F540 @ ---------------------------------------------------------------------------
0807F540
0807F540 loc_0807F540: @ DATA XREF: c3_whiteout:off_0807F48Co
0807F540 LDR R1, =a1ScurriedBackHomeProtectingThe @ "?1 scurried back home, protecting the e"...
0807F542
0807F542 loc_0807F542: @ CODE XREF: c3_whiteout+DEj
0807F542 MOVS R0, R6
0807F544 MOVS R2, #2
0807F546 MOVS R3, #8
0807F548 BL sub_0807F3A4
0807F54C LSLS R0, R0, #0x18
0807F54E CMP R0, #0
0807F550 BEQ loc_0807F5E4
0807F552 LDR R0, =walkrun_state
0807F554 LDRB R1, [R0,#walkrun.npcid]
0807F556 LSLS R0, R1, #3
0807F558 ADDS R0, R0, R1
0807F55A LSLS R0, R0, #2
0807F55C LDR R1, =npc_states
0807F55E ADDS R0, R0, R1
0807F560 MOVS R1, #2
0807F562 BL sub_0805F218
0807F566 LDR R1, =callback3
0807F568 LSLS R0, R6, #2
0807F56A ADDS R0, R0, R6
0807F56C LSLS R0, R0, #3
0807F56E ADDS R0, R0, R1
0807F570 LDRH R1, [R0,#8]
0807F572 ADDS R1, #1
0807F574 STRH R1, [R0,#8]
0807F576 B loc_0807F5E4
0807F576 @ ---------------------------------------------------------------------------
0807F578 off_0807F578: .long a1ScurriedBackHomeProtectingThe
0807F578 @ DATA XREF: c3_whiteout:loc_0807F540r
0807F578 @ "?1 scurried back home, protecting the e"...
0807F57C off_0807F57C: .long walkrun_state @ DATA XREF: c3_whiteout+F6r
0807F580 off_0807F580: .long npc_states @ DATA XREF: c3_whiteout+100r
0807F584 off_0807F584: .long callback3 @ DATA XREF: c3_whiteout+10Ar
0807F588 @ ---------------------------------------------------------------------------
0807F588
0807F588 loc_0807F588: @ DATA XREF: c3_whiteout:off_0807F48Co
0807F588 LSLS R4, R6, #2
0807F58A ADDS R4, R4, R6
0807F58C LSLS R4, R4, #3
0807F58E ADDS R4, R4, R2
0807F590 LDRB R5, [R4,#0xA]
0807F592 MOVS R0, R5
0807F594 BL sub_080040B8
0807F598 MOVS R0, R5
0807F59A MOVS R1, #1
0807F59C BL sub_08003F20
0807F5A0 MOVS R0, R5
0807F5A2 BL sub_08003E3C
0807F5A6 BL fill_unfaded_pal
0807F5AA BL sub_0807DC00
0807F5AE LDRH R0, [R4,#8]
0807F5B0 ADDS R0, #1
0807F5B2 STRH R0, [R4,#8]
0807F5B4 B loc_0807F5E4
0807F5B6 @ ---------------------------------------------------------------------------
0807F5B6
0807F5B6 loc_0807F5B6: @ DATA XREF: c3_whiteout:off_0807F48Co
0807F5B6 BL sub_0807E418
0807F5BA CMP R0, #1
0807F5BC BNE loc_0807F5E4
0807F5BE MOVS R0, R6
0807F5C0 BL sub_08077508
0807F5C4 LDR R0, =scr_081A8D97
0807F5C6 BL script_start_1
0807F5CA B loc_0807F5E4
0807F5CA @ ---------------------------------------------------------------------------
0807F5CC off_0807F5CC: .long scr_081A8D97 @ DATA XREF: c3_whiteout+168r
0807F5D0 @ ---------------------------------------------------------------------------
0807F5D0
0807F5D0 loc_0807F5D0: @ DATA XREF: c3_whiteout:off_0807F48Co
0807F5D0 BL sub_0807E418
0807F5D4 CMP R0, #1
0807F5D6 BNE loc_0807F5E4
0807F5D8 MOVS R0, R6
0807F5DA BL sub_08077508
0807F5DE LDR R0, =scr_081A8DD8
0807F5E0 BL script_start_1
0807F5E4
0807F5E4 loc_0807F5E4: @ CODE XREF: c3_whiteout+1Aj
0807F5E4 @ c3_whiteout+BAj ...
0807F5E4 POP {R4-R7}
0807F5E6 POP {R0}
0807F5E8 BX R0
0807F5E8 @ End of function c3_whiteout
0807F5E8
0807F5E8 @ ---------------------------------------------------------------------------
081A8D97 scr_081A8D97: .byte lockall @ DATA XREF: c3_whiteout+168o
081A8D97 @ c3_whiteout:off_0807F5CCo
081A8D98 .byte change_text_color
081A8D99 .byte 1
081A8D9A .byte load_message
081A8D9B .byte 0
081A8D9C .long aFirstYouShouldRestoreYourPokMo @ "First, you should restore your POK\x1BMON "...
081A8DA0 .byte callstd
081A8DA1 .byte 4
081A8DA2 .byte call
081A8DA3 .long scr_081A65CE
081A8DA7 .byte checkflag
081A8DA8 .short 0x4B0
081A8DAA .byte if_call
081A8DAB .byte 0
081A8DAC .long scr_081A8DC6
081A8DB0 .byte checkflag
081A8DB1 .short 0x4B0
081A8DB3 .byte if_call
081A8DB4 .byte 1
081A8DB5 .long scr_081A8DCF
081A8DB9 .byte execute_movement
081A8DBA .short 0x800F
081A8DBC .long unk_081A666C
081A8DC0 .byte waitmove
081A8DC1 .short 0
081A8DC3 .byte fade_to_default
081A8DC4 .byte release
081A8DC5 .byte end
081A8DC6 scr_081A8DC6: .byte load_message @ DATA XREF: ROM:081A8DACo
081A8DC7 .byte 0
081A8DC8 .long aYourPokMonHaveBeenHealedToPerf @ "Your POK\x1BMON have been healed to perfec"...
081A8DCC .byte callstd
081A8DCD .byte 4
081A8DCE .byte return
081A8DCF scr_081A8DCF: .byte load_message @ DATA XREF: ROM:081A8DB5o
081A8DD0 .byte 0
081A8DD1 .long aYourPokMonHaveBeenHealedToPe_0 @ "Your POK\x1BMON have been healed to perfec"...
081A8DD5 .byte callstd
081A8DD6 .byte 4
081A8DD7 .byte return
...
081A65CE scr_081A65CE: .byte execute_movement @ DATA XREF: ROM:081A8DA3o
081A65CF .short 0x800F
081A65D1 .long unk_081A75E7
081A65D5 .byte waitmove
081A65D6 .short 0
081A65D8 .byte execute_HM
081A65D9 .short 0x19
081A65DB .byte checkarray_HM_animation
081A65DC .short 0x19
081A65DE .byte execute_movement
081A65DF .short 0x800F
081A65E1 .long unk_081A75ED
081A65E5 .byte waitmove
081A65E6 .short 0
081A65E8 .byte special_call
081A65E9 .short 0
081A65EB .byte return
081A8DD8 scr_081A8DD8: .byte lockall @ DATA XREF: c3_whiteout+182o
081A8DD8 @ ROM:off_0807F5ECo
081A8DD9 .byte change_text_color
081A8DDA .byte 1
081A8DDB .byte execute_movement
081A8DDC .short 1
081A8DDE .long unk_081A75ED
081A8DE2 .byte waitmove
081A8DE3 .short 0
081A8DE5 .byte load_message
081A8DE6 .byte 0
081A8DE7 .long aMom1WelcomeHome__itSoundsLikeY @ "MOM: ?1! Welcome home._It sounds like y"...
081A8DEB .byte callstd
081A8DEC .byte 4
081A8DED .byte call
081A8DEE .long scr_081A6C26
081A8DF2 .byte load_message
081A8DF3 .byte 0
081A8DF4 .long aMomOhGoodYouAndYourPokMonAreLo @ "MOM: Oh, good! You and your POK\x1BMON are"...
081A8DF8 .byte callstd
081A8DF9 .byte 4
081A8DFA .byte fade_to_default
081A8DFB .byte release
081A8DFC .byte end
...
081A6C26 scr_081A6C26: .byte screen_special_effect @ DATA XREF: ROM:081A8DEEo
081A6C27 .byte 1
081A6C28 .byte play_fanfare
081A6C29 .short 0x100
081A6C2B .byte wait_fanfare
081A6C2C .byte special_call
081A6C2D .short 0
081A6C2F .byte screen_special_effect
081A6C30 .byte 0
081A6C31 .byte return
Do you or anyone else have the addresses for the seven HM routines and the badge check routine for the menu in FR? Been searching for a while and can't find them, if they are found I'd guess it'd be simple enough to make all HMs usable without giving the badges.Hm... Turns out, the checkflag routine (the actual one that does the calculations) is run a lot of times in the OW (I know, duh, the people event flags) so I got the flag location (or at least, the memory pointer to it). In Emerald, it's at the address pointed at by 0x03005D8C plus 0x1270.
Now, I have to find the bit that designates the badge flags..
EDIT: 0x0809C7EC in Emerald contains the surf-check-routine... at least for the tile. I'm not sure about the PKMN menu one.
EDIT2: 0x081B54E8 (again, in Emerald) contains the badge-check-routine for the menu. I'm trying to find out where the numbers to add to the first badge are obtained from...
EDIT3: Well, apparently they're loaded from 0x02000020, but I can't find how it gets the value...
Anybody, feel free to help me out with this. :/
EDIT4: Well, I hacked the routine and made it load different flag numbers for each of the old badge+base number. And it works! :D
To get all of the flags to work out on the field, however, you'll need to edit all of the scripts for, say, Rock Smash, Strength, and Cut so that they have the new flags. And then you'll need to hack the surf routine, like I said above.
Also, with the Set Disobedience findings, all we need to control the badges completely is to find out where the Attack/Defense... stats are increased.Even though that doesn't matter much, it would still be cool to be able to control the badges completely.
I think what he means is something similar to the routine I found in Emerald; the one that checks for flags before allowing the move to be used from the menu. What you have posted, however, is NOT what he's looking for.
JPAN already did it xD
https://www.pokecommunity.com/posts/6078341/