• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: Emerald Info Archive

sonic1

ASM is my life now...
77
Posts
15
Years
Please explain more desuka?

I think i can explain it a bit more. That function is called by this routine:

Code:
08009570 @ =============== S U B R O U T I N E =======================================
08009570
08009570
08009570 LINK_CABLE_DEBUG_FUNC:
08009570
08009570 var_C           = -0xC
08009570
08009570                 PUSH    {R4,LR}
08009572                 SUB     SP, SP, #4
08009574                 BL      init_screen_maybe
08009578                 BL      sub_0800870C
0800957C                 BL      sub_080A8F50
08009580                 LDR     R0, =(sub_080096BC+1)
08009582                 BL      set_callback1xC
08009586                 BL      sub_0800A2E0
0800958A                 LDR     R1, =word_020229C6
0800958C                 LDR     R2, =0x1111
0800958E                 MOVS    R0, R2
08009590                 STRH    R0, [R1]
08009592                 BL      sub_08009734
08009596                 LDR     R0, =callback1
08009598                 LDRH    R0, [R0,#(dword_030022E4 - 0x30022C0)]
0800959A                 BL      Update_Seed
0800959E                 MOVS    R4, #0
080095A0
080095A0 loc_080095A0:                           @ CODE XREF: LINK_CABLE_DEBUG_FUNC+42j
080095A0                 BL      rand
080095A4                 LDR     R1, =saveblock2_trainercard
080095A6                 LDR     R1, [R1]
080095A8                 ADDS    R1, #Saveblock2TrainerCard_entries.Trainer_ID
080095AA                 ADDS    R1, R1, R4
080095AC                 STRB    R0, [R1]
080095AE                 ADDS    R4, #1
080095B0                 CMP     R4, #3
080095B2                 BLE     loc_080095A0
080095B4                 MOVS    R4, #0
080095B6                 STR     R4, [SP,#0xC+var_C]
080095B8                 MOVS    R0, #0
080095BA                 MOVS    R1, #2
080095BC                 MOVS    R2, #4
080095BE                 MOVS    R3, #0
080095C0                 BL      sub_08009414
080095C4                 MOVS    R1, 0x1540
080095C8                 MOVS    R0, #0
080095CA                 BL      sub_080010B4
080095CE                 LDR     R0, =(sub_08009404+1)
080095D0                 MOVS    R1, #0
080095D2                 BL      add_to_callback3_list
080095D6                 BL      call_back3
080095DA                 BL      call_back_oam
080095DE                 BL      write_oam_something
080095E2                 BL      sub_080A1A1C
080095E6                 LDR     R0, =dword_03000D60
080095E8                 STR     R4, [R0]
080095EA                 BL      sub_08009638
080095EE                 LDR     R0, =(sub_0800A850+1)
080095F0                 MOVS    R1, #0
080095F2                 BL      add_to_callback3_list
080095F6                 LDR     R0, =(sub_080099BC+1) @ func
080095F8                 BL      set_callback2
080095FC                 ADD     SP, SP, #4
080095FE                 POP     {R4}
08009600                 POP     {R0}
08009602                 BX      R0
08009602 @ End of function LINK_CABLE_DEBUG_FUNC
08009602
08009602 @ ---------------------------------------------------------------------------
08009604 off_08009604:   .long sub_080096BC+1    @ DATA XREF: LINK_CABLE_DEBUG_FUNC+10r
08009608 off_08009608:   .long word_020229C6     @ DATA XREF: LINK_CABLE_DEBUG_FUNC+1Ar
0800960C dword_0800960C: .long 0x1111            @ DATA XREF: LINK_CABLE_DEBUG_FUNC+1Cr
08009610 off_08009610:   .long callback1         @ DATA XREF: LINK_CABLE_DEBUG_FUNC+26r
08009614 off_08009614:   .long saveblock2_trainercard @ DATA XREF: LINK_CABLE_DEBUG_FUNC+34r
08009618 off_08009618:   .long sub_08009404+1    @ DATA XREF: LINK_CABLE_DEBUG_FUNC+5Er
0800961C off_0800961C:   .long dword_03000D60    @ DATA XREF: LINK_CABLE_DEBUG_FUNC+76r
08009620 off_08009620:   .long sub_0800A850+1    @ DATA XREF: LINK_CABLE_DEBUG_FUNC+7Er
08009624 @ void (__fastcall *off_08009624)()
08009624 off_08009624:   .long sub_080099BC+1    @ DATA XREF: LINK_CABLE_DEBUG_FUNC+86r

Try callasm this function to see what happens and try to understand!



Oh, btw, here's another contribution, newgame routine:
Code:
080844A0 @ =============== S U B R O U T I N E =======================================
080844A0
080844A0
080844A0 newgame:                                @ CODE XREF: c2_Newgame+Ep
080844A0                 PUSH    {R4,R5,LR}
080844A2                 LDR     R0, =word_03006210
080844A4                 LDRH    R0, [R0]
080844A6                 CMP     R0, #0
080844A8                 BEQ     loc_080844AE
080844AA                 CMP     R0, #2
080844AC                 BNE     loc_080844B2
080844AE
080844AE loc_080844AE:                           @ CODE XREF: newgame+8j
080844AE                 BL      sub_0802F3F8
080844B2
080844B2 loc_080844B2:                           @ CODE XREF: newgame+Cj
080844B2                 LDR     R1, =byte_020322D4
080844B4                 MOVS    R0, #1
080844B6                 STRB    R0, [R1]
080844B8                 LDR     R4, =saveblock2_trainercard
080844BA                 LDR     R0, [R4]
080844BC                 ADDS    R0, #0xAC
080844BE                 MOVS    R5, #0
080844C0                 STR     R5, [R0]
080844C2                 BL      sub_08067B0C
080844C6                 BL      sub_08067B2C
080844CA                 BL      sub_080BB2D0
080844CE                 BL      sub_08084400
080844D2                 BL      sub_08076BB8
080844D6                 BL      sub_080D436C
080844DA                 LDR     R0, [R4]
080844DC                 STRB    R5, [R0,#9]
080844DE                 LDR     R0, [R4]
080844E0                 ADDS    R0, #0xA8
080844E2                 STR     R5, [R0]
080844E4                 BL      make_trainerID
080844E8                 BL      sub_080841E4
080844EC                 BL      sub_08084390
080844F0                 BL      sub_0809D300
080844F4                 BL      sub_080EBEE0
080844F8                 BL      sub_080EC21C
080844FC                 BL      sub_080E8B28
08084500                 BL      sub_080E1794
08084504                 LDR     R4, =saveblock1
08084506                 LDR     R0, [R4]
08084508                 MOVS    R1, 0x490
0808450C                 ADDS    R0, R0, R1
0808450E                 LDR     R1, =0xBB8
08084510                 BL      sub_080E5128
08084514                 MOVS    R0, #0
08084516                 BL      sub_08145C58
0808451A                 BL      sub_080D766C
0808451E                 BL      sub_080847A8
08084522                 BL      sub_080843C0
08084526                 BL      sub_0813C1F8
0808452A                 BL      sub_080F9A7C
0808452E                 BL      sub_080F9AD4
08084532                 LDR     R0, =poke_quantity
08084534                 STRB    R5, [R0]
08084536                 BL      sub_08067B0C
0808453A                 BL      sub_080C7770
0808453E                 BL      sub_08161B34
08084542                 BL      sub_08161B60
08084546                 LDR     R0, [R4]
08084548                 LDR     R1, =0x496
0808454A                 ADDS    R0, R0, R1
0808454C                 STRH    R5, [R0]
0808454E                 BL      sub_080D7094
08084552                 BL      sub_0816ADF4
08084556                 BL      sub_08136E88
0808455A                 BL      sub_081618B4
0808455E                 BL      sub_0811F184
08084562                 BL      sub_08120160
08084566                 BL      sub_081224D4
0808456A                 BL      sub_0813BA10
0808456E                 BL      sub_08177558
08084572                 BL      sub_0808444C
08084576                 LDR     R0, =scr_NEWGAME_start_flags
08084578                 BL      script_start_2
0808457C                 BL      sub_080845CC
08084580                 BL      sub_0801F1DC
08084584                 BL      sub_0818DA30
08084588                 BL      sub_0819FAA0
0808458C                 BL      sub_081A4B14
08084590                 BL      sub_08195E10
08084594                 BL      sub_0801AFD8
08084598                 BL      sub_0800E5AC
0808459C                 BL      sub_081D54BC
080845A0                 BL      sub_080DED74
080845A4                 POP     {R4,R5}
080845A6                 POP     {R0}
080845A8                 BX      R0
080845A8 @ End of function newgame
080845A8
080845A8 @ ---------------------------------------------------------------------------

 
Last edited:

droomph

weeb
4,285
Posts
12
Years
I...don't really know. It changes the screen to a different tilemap, but that's pretty much all that happens, and the other emulator won't cooperate with me today.
 

droomph

weeb
4,285
Posts
12
Years
setmapfooter 0xA7

Okay hey everyone, I'm here today with a new set of things to figure out reference. This thread needs some action, come on~

This is the same command that does the Shoal Cave business. Its use is pretty complicated so I'll try to explain it thoroughly.

Arguments: hword mapNum

Use: Changing the map tiles and map movement on any given map.

This will take the map that it's given through the argument and set it on top of the original map. If the map sizes are not the same, it will align from the top left corner.

mapNum: from 0x8481DD4 (or from the offset pointed to at 0x80849CC) there is a table of map footer offsets. Also, in the map header there is also a map footer offset. The entry in the table plus one is the argument of setmapfooter for that map.

ASM:
Code:
08099EA0 B500     push    {r14}
08099EA2 F7FEFFB3 bl      #0x8098E0C
08099EA6 0400     lsl     r0,r0,#0x10
08099EA8 0C00     lsr     r0,r0,#0x10
08099EAA F003FBF3 bl      #0x809D694
08099EAE 0400     lsl     r0,r0,#0x10
08099EB0 0C00     lsr     r0,r0,#0x10
08099EB2 F7EBFB37 bl      #0x8085524
08099EB6 2000     mov     r0,#0x0
08099EB8 BC02     pop     {r1}
08099EBA 4708     bx      r1
Setmapfooter maps reference (not meant to be completed)
Spoiler:
 
Last edited:

droomph

weeb
4,285
Posts
12
Years
setpokemonpp (setpkmnpp) 0x7B correction

Come on guys~

Alright, so you know setpkmnpp, it takes four bytes as arguments.

The XSE guide says this is how it's used:

b Pokémon slot
b Move slot
h New PP amount
However, the last argument is wrong. Instead of giving a new PP amount, it replaces the move with the move whose index number is equal to the hword you give.

It might just be Emerald, but take note of that.
 
28
Posts
15
Years
  • Seen Jan 20, 2019
ROM:0806A518 getPKMData:
ROM:0806A674 readPKMData:
ROM:0806ACAC writePKMData:
ROM:0806AD9C setPKMData:
08070266 Inheritance- bugged to not prevent inheriting the same IV multiple times Bond697
08070218 Inheritance check- make sure the same IV isn't inherited multiple times- bugged due to the wrong argument being passed to it Bond697
ROM:0806DCB4 @ void __fastcall pokerusHandler(void *pPartyBlock)
ROM:0806DEC4 pokerusSpread:

fun fact: in gen 3, eggs cannot be infected with pokerus. they can still get it, however, by having it spread to them by another party member.
 
Last edited:

FirEmerald

Pokemon reverse engineer
47
Posts
11
Years
  • Age 26
  • Seen Jul 18, 2015
pokemon emerald compressed images, raw data, and palletes

Hi. I've been working on a list of pokemon emerald compressed data using Nintenlord's GBA Graphics Editor.I did't notice the comressed pallete option on the pallete window until I started the items, so I have yet to do any of them before the items.I just completed the compressed data.Attachments follow.
 
Last edited:
Back
Top