Thread: Research: Items
View Single Post
  #12    
Old July 14th, 2011 (5:40 AM). Edited July 16th, 2011 by knizz.
knizz's Avatar
knizz knizz is offline
 
Join Date: Aug 2007
Posts: 192

I'm sorry I can't post anything on-topic now. But I'll look into this thread again when I have my own computer back. (~4 days) I'm happy you're back and posting, JPAN. I have a IDA-Database for firered. It's worth taking a look at. I have at least some basic notes about items in there too. Also all asm-hackers are invited to join Darthatrons and my IRC-Channel (irc.irchighway.net #pokehack) which is like this thread just with faster responses.

EDIT: I hope this helps a bit.

Code:
080A1998 @ =============== S U B R O U T I N E =======================================
080A1998
080A1998
080A1998 repel:                                  @ DATA XREF: ROM:item_super_repelo
080A1998                                         @ ROM:083DBE98o ...
080A1998                 PUSH    {R4,LR}
080A199A                 LSLS    R0, R0, #0x18
080A199C                 LSRS    R4, R0, #0x18
080A199E                 LDR     R0, =0x4020
080A19A0                 BL      var_load
080A19A4                 LSLS    R0, R0, #0x10
080A19A6                 CMP     R0, #0
080A19A8                 BNE     loc_080A19CC
080A19AA                 MOVS    R0, #0x29
080A19AC                 BL      music_play
080A19B0                 LDR     R0, =callback3table
080A19B2                 LSLS    R1, R4, #2
080A19B4                 ADDS    R1, R1, R4
080A19B6                 LSLS    R1, R1, #3
080A19B8                 ADDS    R1, R1, R0
080A19BA                 LDR     R0, =(c3_repel+1)
080A19BC                 STR     R0, [R1]
080A19BE                 B       loc_080A19D8
080A19BE @ ---------------------------------------------------------------------------
080A19C0 dword_080A19C0: .long 0x4020            @ DATA XREF: repel+6r
080A19C4 off_080A19C4:   .long callback3table    @ DATA XREF: repel+18r
080A19C8 off_080A19C8:   .long c3_repel+1        @ DATA XREF: repel+22r
080A19CC @ ---------------------------------------------------------------------------
080A19CC
080A19CC loc_080A19CC:                           @ CODE XREF: repel+10j
080A19CC                 LDR     R2, =aButTheEffectsOfARepelLingeredF @ "But the effects of a REPEL lingered fro"...
080A19CE                 LDR     R3, =(bag_print+1)
080A19D0                 MOVS    R0, R4
080A19D2                 MOVS    R1, #2
080A19D4                 BL      sub_08108E70
080A19D8
080A19D8 loc_080A19D8:                           @ CODE XREF: repel+26j
080A19D8                 POP     {R4}
080A19DA                 POP     {R0}
080A19DC                 BX      R0
080A19DC @ End of function repel
080A19DC
080A19DC @ ---------------------------------------------------------------------------
080A19DE                 .byte    0
080A19DF                 .byte    0
080A19E0 off_080A19E0:   .long aButTheEffectsOfARepelLingeredF
080A19E0                                         @ DATA XREF: repel:loc_080A19CCr
080A19E0                                         @ "But the effects of a REPEL lingered fro"...
080A19E4 off_080A19E4:   .long bag_print+1       @ DATA XREF: repel+36r
080A19E8
080A19E8 @ =============== S U B R O U T I N E =======================================
080A19E8
080A19E8
080A19E8 c3_repel:                               @ DATA XREF: repel+22o
080A19E8                                         @ repel:off_080A19C8o
080A19E8                 PUSH    {R4-R6,LR}
080A19EA                 LSLS    R0, R0, #0x18
080A19EC                 LSRS    R6, R0, #0x18
080A19EE                 BL      sub_080723E0
080A19F2                 LSLS    R0, R0, #0x18
080A19F4                 CMP     R0, #0
080A19F6                 BNE     loc_080A1A2A
080A19F8                 LDR     R4, =var_800E   @ Used item number location
080A19FA                 LDRH    R2, [R4]
080A19FC                 LDR     R3, =0xFFFF
080A19FE                 MOVS    R0, #4
080A1A00                 MOVS    R1, #0
080A1A02                 BL      sub_080A2294
080A1A06                 LDR     R5, =0x4020
080A1A08                 LDRH    R0, [R4]
080A1A0A                 BL      item_get_quality
080A1A0E                 MOVS    R1, R0
080A1A10                 LSLS    R1, R1, #0x18
080A1A12                 LSRS    R1, R1, #0x18
080A1A14                 MOVS    R0, R5
080A1A16                 BL      var_set
080A1A1A                 BL      sub_080A1A44
080A1A1E                 LDR     R2, =displayed_string
080A1A20                 LDR     R3, =(bag_print+1)
080A1A22                 MOVS    R0, R6
080A1A24                 MOVS    R1, #2
080A1A26                 BL      sub_08108E70
080A1A2A
080A1A2A loc_080A1A2A:                           @ CODE XREF: c3_repel+Ej
080A1A2A                 POP     {R4-R6}
080A1A2C                 POP     {R0}
080A1A2E                 BX      R0
080A1A2E @ End of function c3_repel
080A1A2E
080A1A2E @ ---------------------------------------------------------------------------
080A1A30 off_080A1A30:   .long var_800E          @ DATA XREF: c3_repel+10r
080A1A34 dword_080A1A34: .long 0xFFFF            @ DATA XREF: c3_repel+14r
080A1A38 dword_080A1A38: .long 0x4020            @ DATA XREF: c3_repel+1Er
080A1A3C off_080A1A3C:   .long displayed_string  @ DATA XREF: c3_repel+36r
080A1A40 off_080A1A40:   .long bag_print+1       @ DATA XREF: c3_repel+38r
080A1A44

08452EB8 brm_bottom_right_menu:seisof <aUse, brm_use+1>@ 0 @ DATA XREF: mega_func_3+28Ao 08452EB8 @ ROM:off_08109BA4o ... 08452EB8 seisof <aToss, sub_08109CC0+1>@ 1 @ "USE" 08452EB8 seisof <aRegister_0, sub_0810A000+1>@ 2 08452EB8 seisof <aGive, sub_0810A0A8+1>@ 3 08452EB8 seisof <aCancel_0, brm_cancel+1>@ 4 08452EB8 seisof <aUse, sub_0810A324+1>@ 5 08452EB8 seisof <aCheck, brm_use+1>@ 6 08452EB8 seisof <aOpen, brm_use+1>@ 7 08452EB8 seisof <aOpen, sub_0810A324+1>@ 8 08452EB8 seisof <aWalk, brm_use+1>@ 9 08452EB8 seisof <aDeselect, sub_0810A000+1>@ 10 08452EB8 seisof <unk_084161CD, 0>@ 11

08109C50 @ =============== S U B R O U T I N E ======================================= 08109C50 08109C50 08109C50 brm_use: @ DATA XREF: ROM:brm_bottom_right_menuo 08109C50 PUSH {R4,R5,LR} 08109C52 LSLS R0, R0, #0x18 08109C54 LSRS R4, R0, #0x18 08109C56 LDR R5, =var_800E 08109C58 LDRH R0, [R5] 08109C5A BL sub_0809AA20 08109C5E CMP R0, #0 08109C60 BEQ loc_08109CB4 08109C62 MOVS R0, #0xA 08109C64 BL sub_0810BA3C 08109C68 MOVS R0, #6 08109C6A BL sub_0810BA3C 08109C6E MOVS R0, #0 08109C70 BL sub_08003FA0 08109C74 MOVS R0, #1 08109C76 BL sub_08003FA0 08109C7A MOVS R0, #0 08109C7C BL sub_080F67A4 08109C80 BL count_pokemon 08109C84 LSLS R0, R0, #0x18 08109C86 CMP R0, #0 08109C88 BNE loc_08109CA4 08109C8A LDRH R0, [R5] 08109C8C BL sub_0809A9FC 08109C90 LSLS R0, R0, #0x18 08109C92 LSRS R0, R0, #0x18 08109C94 CMP R0, #1 08109C96 BNE loc_08109CA4 08109C98 MOVS R0, R4 08109C9A BL sub_0810A170 08109C9E B loc_08109CB4 08109C9E @ --------------------------------------------------------------------------- 08109CA0 off_08109CA0: .long var_800E @ DATA XREF: brm_use+6r 08109CA4 @ --------------------------------------------------------------------------- 08109CA4 08109CA4 loc_08109CA4: @ CODE XREF: brm_use+38j 08109CA4 @ brm_use+46j 08109CA4 LDR R0, =var_800E 08109CA6 LDRH R0, [R0] 08109CA8 BL sub_0809AA20 08109CAC MOVS R1, R0 08109CAE MOVS R0, R4 08109CB0 BL bx_r1 @ Call item function 08109CB4 08109CB4 loc_08109CB4: @ CODE XREF: brm_use+10j 08109CB4 @ brm_use+4Ej 08109CB4 POP {R4,R5} 08109CB6 POP {R0} 08109CB8 BX R0 08109CB8 @ End of function brm_use 08109CB8 08109CB8 @ --------------------------------------------------------------------------- 08109CBA .byte 0 08109CBB .byte 0 08109CBC off_08109CBC: .long var_800E @ DATA XREF: brm_use:loc_08109CA4r 08109CC0

EDIT 2:
JPAN, I have two of your wanted offsets.
03005074 is the number of the NPC that is executing a script.
03005090 is a table of structures with a function pointer that is called every frame. Think of it as pokemons multithreading system. It's called callback3 in my DB.

__________________
Firered IDA 6.5 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
VBA-M with lua scripting support
Reply With Quote