View Single Post
Old November 15th, 2009 (5:09 AM). Edited November 15th, 2009 by Juan.
Juan Juan is offline
Brazilian with a bad English
    Join Date: Jun 2007
    Location: Pindamonhangaba - SP
    Age: 26
    Nature: Adamant
    Posts: 92
    0x43E9E8 7E 01 A4 08 14 F5 41 08 98 0D 42 08
    0x08A4017E = ????
    0x0841F514 = tileset
    0x08420D98 = tilemap


    ROM:080F819C ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:080F819C Locations
    ROM:080F819C var_10          = -0x10
    ROM:080F819C                 PUSH    {R4,R5,LR}
    ROM:080F819E                 SUB     SP, SP, #4
    ROM:080F81A0                 LSL     R0, R0, #0x18
    ROM:080F81A2                 LSR     R0, R0, #0x18
    ROM:080F81A4                 BL      sub_80F80E4
    ROM:080F81A8                 LSL     R0, R0, #0x18
    ROM:080F81AA                 LSR     R5, R0, #0x18
    ROM:080F81AC                 CMP     R5, #0x1C
    ROM:080F81AE                 BEQ     loc_80F8224
    ROM:080F81B0                 BL      sub_80F6808
    ROM:080F81B4                 LDR     R4, =0x843E9E8  ; table pointers (????||tileset||tilemap) ???
    ROM:080F81B6                 LSL     R5, R5, #4
    ROM:080F81B8                 ADD     R0, R4, #0
    ROM:080F81BA                 ADD     R0, #0xC
    ROM:080F81BC                 ADD     R0, R5, R0
    ROM:080F81BE                 LDR     R0, [R0]
    ROM:080F81C0                 MOV     R1, #0xD0
    ROM:080F81C2                 MOV     R2, #0x60
    ROM:080F81C4                 BL      sub_80703EC
    ROM:080F81C8                 ADD     R4, #4          ; first tileset pointer
    ROM:080F81CA                 ADD     R4, R5, R4
    ROM:080F81CC                 LDR     R1, [R4]        ; reads the offset of the tileset used
    ROM:080F81CE                 MOV     R4, #0
    ROM:080F81D0                 STR     R4, [SP,#0x10+var_10]
    ROM:080F81D2                 MOV     R0, #0
    ROM:080F81D4                 MOV     R2, #0
    ROM:080F81D6                 MOV     R3, #0
    ROM:080F81D8                 BL      sub_80F6878
    ROM:080F81DC                 MOV     R0, #0
    ROM:080F81DE                 BL      sub_8002008
    ROM:080F81E2                 CMP     R0, #0
    ROM:080F81E4                 BNE     loc_80F8208
    ROM:080F81E6                 MOVL    R0, 0x800
    ROM:080F81EA                 BL      sub_8002B9C
    ROM:080F81EE                 ADD     R1, R0, #0
    ROM:080F81F0                 MOV     R0, #0
    ROM:080F81F2                 BL      sub_8001FA0
    ROM:080F81F6                 LDR     R1, =0x203ABED
    ROM:080F81F8                 MOV     R0, #1
    ROM:080F81FA                 STRB    R0, [R1]
    ROM:080F81FC                 B       loc_80F820C
    ROM:080F81FC ; ---------------------------------------------------------------------------
    ROM:080F81FE                 DCB    0
    ROM:080F81FF                 DCB    0
    ROM:080F8200 dword_80F8200   DCD 0x843E9E8           ; DATA XREF: Locations+18r
    ROM:080F8204 dword_80F8204   DCD 0x203ABED           ; DATA XREF: Locations+5Ar
    ROM:080F8208 ; ---------------------------------------------------------------------------
    ROM:080F8208 loc_80F8208                             ; CODE XREF: Locations+48j
    ROM:080F8208                 LDR     R0, =0x203ABED
    ROM:080F820A                 STRB    R4, [R0]
    ROM:080F820C loc_80F820C                             ; CODE XREF: Locations+60j
    ROM:080F820C                 LDR     R0, =off_843E9E8
    ROM:080F820E                 ADD     R0, #8          ; first tilemap pointer
    ROM:080F8210                 ADD     R0, R5, R0
    ROM:080F8212                 LDR     R1, [R0]        ; reads the offset of the tileset used
    ROM:080F8214                 MOV     R0, #0
    ROM:080F8216                 MOV     R2, #0
    ROM:080F8218                 MOV     R3, #0
    ROM:080F821A                 BL      sub_8002040
    ROM:080F821E                 MOV     R0, #0
    ROM:080F8220                 BL      sub_80020BC
    ROM:080F8224 loc_80F8224                             ; CODE XREF: Locations+12j
    ROM:080F8224                 ADD     SP, SP, #4
    ROM:080F8226                 POP     {R4,R5}
    ROM:080F8228                 POP     {R0}
    ROM:080F822A                 BX      R0
    ROM:080F822A ; End of function Locations
    ROM:080F822A ; ---------------------------------------------------------------------------
    ROM:080F822C dword_80F822C   DCD 0x203ABED           ; DATA XREF: Locations:loc_80F8208r
    ROM:080F8230 off_80F8230     DCD off_843E9E8         ; DATA XREF: Locations:loc_80F820Cr

    ROM:08001FA0 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:08001FA0 sub_8001FA0                             ; CODE XREF: Locations+56p
    ROM:08001FA0                 PUSH    {R4,R5,LR}
    ROM:08001FA2                 ADD     R5, R1, #0
    ROM:08001FA4                 LSL     R0, R0, #0x18
    ROM:08001FA6                 LSR     R4, R0, #0x18
    ROM:08001FA8                 ADD     R0, R4, #0
    ROM:08001FAA                 BL      sub_80028EC
    ROM:08001FAE                 CMP     R0, #0
    ROM:08001FB0                 BNE     loc_8001FCA
    ROM:08001FB2                 ADD     R0, R4, #0
    ROM:08001FB4                 MOV     R1, #1
    ROM:08001FB6                 BL      sub_80011E4
    ROM:08001FBA                 LSL     R0, R0, #0x10
    ROM:08001FBC                 CMP     R0, #0
    ROM:08001FBE                 BEQ     loc_8001FCA
    ROM:08001FC0                 LDR     R0, =0x30008E8
    ROM:08001FC2                 LSL     R1, R4, #4
    ROM:08001FC4                 ADD     R0, #4
    ROM:08001FC6                 ADD     R1, R1, R0
    ROM:08001FC8                 STR     R5, [R1]
    ROM:08001FCA loc_8001FCA                             ; CODE XREF: sub_8001FA0+10j
    ROM:08001FCA                                         ; sub_8001FA0+1Ej
    ROM:08001FCA                 POP     {R4,R5}
    ROM:08001FCC                 POP     {R0}
    ROM:08001FCE                 BX      R0
    ROM:08001FCE ; End of function sub_8001FA0
    ROM:08001FCE ; ---------------------------------------------------------------------------
    ROM:08001FD0 dword_8001FD0   DCD 0x30008E8           ; DATA XREF: sub_8001FA0+20r
    ROM:08002008 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:08002008 sub_8002008                             ; CODE XREF: Locations+42p
    ROM:08002008                 PUSH    {R4,LR}
    ROM:0800200A                 LSL     R0, R0, #0x18
    ROM:0800200C                 LSR     R0, R0, #0x18
    ROM:0800200E                 ADD     R4, R0, #0
    ROM:08002010                 BL      sub_80028EC
    ROM:08002014                 CMP     R0, #0
    ROM:08002016                 BNE     loc_8002038
    ROM:08002018                 ADD     R0, R4, #0
    ROM:0800201A                 MOV     R1, #1
    ROM:0800201C                 BL      sub_80011E4
    ROM:08002020                 LSL     R0, R0, #0x10
    ROM:08002022                 CMP     R0, #0
    ROM:08002024                 BEQ     loc_8002038
    ROM:08002026                 LDR     R0, =0x30008E8
    ROM:08002028                 LSL     R1, R4, #4
    ROM:0800202A                 ADD     R0, #4
    ROM:0800202C                 ADD     R1, R1, R0
    ROM:0800202E                 LDR     R0, [R1]
    ROM:08002030                 B       loc_800203A
    ROM:08002030 ; ---------------------------------------------------------------------------
    ROM:08002032                 DCB    0
    ROM:08002033                 DCB    0
    ROM:08002034 dword_8002034   DCD 0x30008E8           ; DATA XREF: sub_8002008+1Er
    ROM:08002038 ; ---------------------------------------------------------------------------
    ROM:08002038 loc_8002038                             ; CODE XREF: sub_8002008+Ej
    ROM:08002038                                         ; sub_8002008+1Cj
    ROM:08002038                 MOV     R0, #0
    ROM:0800203A loc_800203A                             ; CODE XREF: sub_8002008+28j
    ROM:0800203A                 POP     {R4}
    ROM:0800203C                 POP     {R1}
    ROM:0800203E                 BX      R1
    ROM:0800203E ; End of function sub_8002008
    ROM:0800203E ; ---------------------------------------------------------------------------
    ROM:08002040 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:08002040 sub_8002040                             ; CODE XREF: Locations+7Ep
    ROM:08002040                 PUSH    {R4-R7,LR}
    ROM:08002042                 MOV     R7, R10
    ROM:08002044                 MOV     R6, R9
    ROM:08002046                 MOV     R5, R8
    ROM:08002048                 PUSH    {R5-R7}
    ROM:0800204A                 MOV     R10, R1
    ROM:0800204C                 LSL     R0, R0, #0x18
    ROM:0800204E                 LSR     R4, R0, #0x18
    ROM:08002050                 MOV     R9, R4
    ROM:08002052                 LSL     R7, R2, #0x10
    ROM:08002054                 LSR     R6, R7, #0x10
    ROM:08002056                 LSL     R3, R3, #0x10
    ROM:08002058                 LSR     R5, R3, #0x10
    ROM:0800205A                 MOV     R8, R5
    ROM:0800205C                 ADD     R0, R4, #0
    ROM:0800205E                 BL      sub_80028EC
    ROM:08002062                 CMP     R0, #0
    ROM:08002064                 BNE     loc_80020A8
    ROM:08002066                 ADD     R0, R4, #0
    ROM:08002068                 BL      sub_8002900
    ROM:0800206C                 CMP     R0, #0
    ROM:0800206E                 BNE     loc_80020A8
    ROM:08002070                 CMP     R6, #0
    ROM:08002072                 BEQ     loc_8002090
    ROM:08002074                 LDR     R0, =0x30008E8
    ROM:08002076                 LSL     R1, R4, #4
    ROM:08002078                 ADD     R0, #4
    ROM:0800207A                 ADD     R1, R1, R0
    ROM:0800207C                 LSL     R0, R5, #5
    ROM:0800207E                 LDR     R1, [R1]
    ROM:08002080                 ADD     R1, R1, R0
    ROM:08002082                 LSR     R2, R7, #0x11
    ROM:08002084                 MOV     R0, R10
    ROM:08002086                 BL      swi_0x0b
    ROM:0800208A                 B       loc_80020A8
    ROM:0800208A ; ---------------------------------------------------------------------------
    ROM:0800208C dword_800208C   DCD 0x30008E8           ; DATA XREF: sub_8002040+34r
    ROM:08002090 ; ---------------------------------------------------------------------------
    ROM:08002090 loc_8002090                             ; CODE XREF: sub_8002040+32j
    ROM:08002090                 LDR     R0, =0x30008E8
    ROM:08002092                 MOV     R2, R9
    ROM:08002094                 LSL     R1, R2, #4
    ROM:08002096                 ADD     R0, #4
    ROM:08002098                 ADD     R1, R1, R0
    ROM:0800209A                 MOV     R2, R8
    ROM:0800209C                 LSL     R0, R2, #5
    ROM:0800209E                 LDR     R1, [R1]
    ROM:080020A0                 ADD     R1, R1, R0
    ROM:080020A2                 MOV     R0, R10
    ROM:080020A4                 BL      sub_81E3B70
    ROM:080020A8 loc_80020A8                             ; CODE XREF: sub_8002040+24j
    ROM:080020A8                                         ; sub_8002040+2Ej ...
    ROM:080020A8                 POP     {R3-R5}
    ROM:080020AA                 MOV     R8, R3
    ROM:080020AC                 MOV     R9, R4
    ROM:080020AE                 MOV     R10, R5
    ROM:080020B0                 POP     {R4-R7}
    ROM:080020B2                 POP     {R0}
    ROM:080020B4                 BX      R0
    ROM:080020B4 ; End of function sub_8002040
    ROM:080020B4 ; ---------------------------------------------------------------------------
    ROM:080020B6                 DCB    0
    ROM:080020B7                 DCB    0
    ROM:080020B8 dword_80020B8   DCD 0x30008E8           ; DATA XREF: sub_8002040:loc_8002090r
    ROM:080020BC ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:080020BC sub_80020BC                             ; CODE XREF: Locations+84p
    ROM:080020BC var_C           = -0xC
    ROM:080020BC                 PUSH    {R4,LR}
    ROM:080020BE                 SUB     SP, SP, #4
    ROM:080020C0                 LSL     R0, R0, #0x18
    ROM:080020C2                 LSR     R4, R0, #0x18
    ROM:080020C4                 ADD     R0, R4, #0
    ROM:080020C6                 BL      sub_80028EC
    ROM:080020CA                 CMP     R0, #0
    ROM:080020CC                 BNE     loc_8002118
    ROM:080020CE                 ADD     R0, R4, #0
    ROM:080020D0                 BL      sub_8002900
    ROM:080020D4                 CMP     R0, #0
    ROM:080020D6                 BNE     loc_8002118
    ROM:080020D8                 ADD     R0, R4, #0
    ROM:080020DA                 BL      sub_8002898
    ROM:080020DE                 CMP     R0, #0
    ROM:080020E0                 BEQ     loc_80020EA
    ROM:080020E2                 CMP     R0, #1
    ROM:080020E4                 BEQ     loc_80020F6
    ROM:080020E6                 MOV     R2, #0
    ROM:080020E8                 B       loc_8002102
    ROM:080020EA ; ---------------------------------------------------------------------------
    ROM:080020EA loc_80020EA                             ; CODE XREF: sub_80020BC+24j
    ROM:080020EA                 ADD     R0, R4, #0
    ROM:080020EC                 MOV     R1, #0
    ROM:080020EE                 BL      sub_800273C
    ROM:080020F2                 LSL     R0, R0, #0x1B
    ROM:080020F4                 B       loc_8002100
    ROM:080020F6 ; ---------------------------------------------------------------------------
    ROM:080020F6 loc_80020F6                             ; CODE XREF: sub_80020BC+28j
    ROM:080020F6                 ADD     R0, R4, #0
    ROM:080020F8                 MOV     R1, #0
    ROM:080020FA                 BL      sub_80027AC
    ROM:080020FE                 LSL     R0, R0, #0x18
    ROM:08002100 loc_8002100                             ; CODE XREF: sub_80020BC+38j
    ROM:08002100                 LSR     R2, R0, #0x10
    ROM:08002102 loc_8002102                             ; CODE XREF: sub_80020BC+2Cj
    ROM:08002102                 LDR     R0, =0x30008E8
    ROM:08002104                 LSL     R1, R4, #4
    ROM:08002106                 ADD     R0, #4
    ROM:08002108                 ADD     R1, R1, R0
    ROM:0800210A                 LDR     R1, [R1]
    ROM:0800210C                 MOV     R0, #2
    ROM:0800210E                 STR     R0, [SP,#0xC+var_C]
    ROM:08002110                 ADD     R0, R4, #0
    ROM:08002112                 MOV     R3, #0
    ROM:08002114                 BL      sub_8001298
    ROM:08002118 loc_8002118                             ; CODE XREF: sub_80020BC+10j
    ROM:08002118                                         ; sub_80020BC+1Aj
    ROM:08002118                 ADD     SP, SP, #4
    ROM:0800211A                 POP     {R4}
    ROM:0800211C                 POP     {R0}
    ROM:0800211E                 BX      R0
    ROM:0800211E ; End of function sub_80020BC
    ROM:0800211E ; ---------------------------------------------------------------------------
    ROM:08002120 dword_8002120   DCD 0x30008E8           ; DATA XREF: sub_80020BC:loc_8002102r
    ROM:08002B9C ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:08002B9C sub_8002B9C                             ; CODE XREF: sub_80F6AA0+16p
    ROM:08002B9C                                         ; Locations+4Ep
    ROM:08002B9C                 PUSH    {LR}
    ROM:08002B9E                 ADD     R1, R0, #0
    ROM:08002BA0                 LDR     R0, =0x3000A38
    ROM:08002BA2                 LDR     R0, [R0]
    ROM:08002BA4                 BL      sub_800295C
    ROM:08002BA8                 POP     {R1}
    ROM:08002BAA                 BX      R1
    ROM:08002BAA ; End of function sub_8002B9C
    ROM:08002BAA ; ---------------------------------------------------------------------------
    ROM:08002BAC dword_8002BAC   DCD 0x3000A38           ; DATA XREF: sub_8002B9C+4r
    ROM:080703EC ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:080703EC sub_80703EC                             ; CODE XREF: Locations+28p
    ROM:080703EC                 PUSH    {R4-R6,LR}
    ROM:080703EE                 ADD     R6, R0, #0
    ROM:080703F0                 ADD     R4, R1, #0
    ROM:080703F2                 ADD     R5, R2, #0
    ROM:080703F4                 LSL     R4, R4, #0x10
    ROM:080703F6                 LSL     R5, R5, #0x10
    ROM:080703F8                 LSR     R4, R4, #0xF
    ROM:080703FA                 LDR     R1, =0x20371F8
    ROM:080703FC                 ADD     R1, R4, R1
    ROM:080703FE                 LSR     R5, R5, #0x11
    ROM:08070400                 ADD     R2, R5, #0
    ROM:08070402                 BL      swi_0x0b
    ROM:08070406                 LDR     R0, =0x20375F8
    ROM:08070408                 ADD     R4, R4, R0
    ROM:0807040A                 ADD     R0, R6, #0
    ROM:0807040C                 ADD     R1, R4, #0
    ROM:0807040E                 ADD     R2, R5, #0
    ROM:08070410                 BL      swi_0x0b
    ROM:08070414                 POP     {R4-R6}
    ROM:08070416                 POP     {R0}
    ROM:08070418                 BX      R0
    ROM:08070418 ; End of function sub_80703EC
    ROM:08070418 ; ---------------------------------------------------------------------------
    ROM:0807041A                 DCB    0
    ROM:0807041B                 DCB    0
    ROM:0807041C dword_807041C   DCD 0x20371F8           ; DATA XREF: sub_80703EC+Er
    ROM:08070420 dword_8070420   DCD 0x20375F8           ; DATA XREF: sub_80703EC+1Ar
    ROM:080F6808 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:080F6808 sub_80F6808                             ; CODE XREF: Locations+14p
    ROM:080F6808                 PUSH    {LR}
    ROM:080F680A                 LDR     R3, =0x203AB5C
    ROM:080F680C                 LDR     R1, =0x203AB60
    ROM:080F680E                 MOV     R2, #0
    ROM:080F6810                 ADD     R0, R1, #0
    ROM:080F6812                 ADD     R0, #0x7C
    ROM:080F6814 loc_80F6814                             ; CODE XREF: sub_80F6808+12j
    ROM:080F6814                 STR     R2, [R0]
    ROM:080F6816                 SUB     R0, #4
    ROM:080F6818                 CMP     R0, R1
    ROM:080F681A                 BGE     loc_80F6814
    ROM:080F681C                 MOV     R0, #0
    ROM:080F681E                 STRH    R0, [R3]
    ROM:080F6820                 POP     {R0}
    ROM:080F6822                 BX      R0
    ROM:080F6822 ; End of function sub_80F6808
    ROM:080F6822 ; ---------------------------------------------------------------------------
    ROM:080F6824 dword_80F6824   DCD 0x203AB5C           ; DATA XREF: sub_80F6808+2r
    ROM:080F6828 dword_80F6828   DCD 0x203AB60           ; DATA XREF: sub_80F6808+4r
    ROM:080F80E4 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:080F80E4 sub_80F80E4                             ; CODE XREF: Locations+8p
    ROM:080F80E4                 PUSH    {LR}
    ROM:080F80E6                 LSL     R0, R0, #0x18
    ROM:080F80E8                 LSR     R3, R0, #0x18
    ROM:080F80EA                 MOV     R1, #0
    ROM:080F80EC                 LDR     R2, =off_843E9E8
    ROM:080F80EE loc_80F80EE                             ; CODE XREF: sub_80F80E4+22j
    ROM:080F80EE                 LDRB    R0, [R2]
    ROM:080F80F0                 CMP     R0, R3
    ROM:080F80F2                 BNE     loc_80F8100
    ROM:080F80F4                 LSL     R0, R1, #0x18
    ROM:080F80F6                 LSR     R0, R0, #0x18
    ROM:080F80F8                 B       loc_80F810A
    ROM:080F80F8 ; ---------------------------------------------------------------------------
    ROM:080F80FA                 DCB    0
    ROM:080F80FB                 DCB    0
    ROM:080F80FC off_80F80FC     DCD off_843E9E8         ; DATA XREF: sub_80F80E4+8r
    ROM:080F8100 ; ---------------------------------------------------------------------------
    ROM:080F8100 loc_80F8100                             ; CODE XREF: sub_80F80E4+Ej
    ROM:080F8100                 ADD     R2, #0x10
    ROM:080F8102                 ADD     R1, #1
    ROM:080F8104                 CMP     R1, #0x1B
    ROM:080F8106                 BLS     loc_80F80EE
    ROM:080F8108                 MOV     R0, #0x1C
    ROM:080F810A loc_80F810A                             ; CODE XREF: sub_80F80E4+14j
    ROM:080F810A                 POP     {R1}
    ROM:080F810C                 BX      R1
    ROM:080F810C ; End of function sub_80F80E4
    ROM:080F810C ; ---------------------------------------------------------------------------
    ROM:080F6878 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
    ROM:080F6878 sub_80F6878                             ; CODE XREF: Locations+3Cp
    ROM:080F6878 var_24          = -0x24
    ROM:080F6878 var_20          = -0x20
    ROM:080F6878 arg_0           =  0
    ROM:080F6878                 PUSH    {R4-R7,LR}
    ROM:080F687A                 MOV     R7, R9
    ROM:080F687C                 MOV     R6, R8
    ROM:080F687E                 PUSH    {R6,R7}
    ROM:080F6880                 SUB     SP, SP, #8
    ROM:080F6882                 ADD     R4, R1, #0
    ROM:080F6884                 ADD     R5, R2, #0
    ROM:080F6886                 LDR     R1, [SP,#0x24+arg_0]
    ROM:080F6888                 LSL     R0, R0, #0x18
    ROM:080F688A                 LSR     R0, R0, #0x18
    ROM:080F688C                 MOV     R8, R0
    ROM:080F688E                 LSL     R3, R3, #0x10
    ROM:080F6890                 LSR     R3, R3, #0x10
    ROM:080F6892                 MOV     R9, R3
    ROM:080F6894                 LSL     R1, R1, #0x18
    ROM:080F6896                 LSR     R7, R1, #0x18
    ROM:080F6898                 LDR     R6, =0x203AB5C
    ROM:080F689A                 LDRH    R0, [R6]
    ROM:080F689C                 CMP     R0, #0x1F
    ROM:080F689E                 BHI     loc_80F68E0
    ROM:080F68A0                 ADD     R0, R4, #0
    ROM:080F68A2                 ADD     R1, SP, #0x24+var_20
    ROM:080F68A4                 BL      sub_80F6AA0
    ROM:080F68A8                 ADD     R4, R0, #0
    ROM:080F68AA                 CMP     R5, #0
    ROM:080F68AC                 BNE     loc_80F68B0
    ROM:080F68AE                 LDR     R5, [SP,#0x24+var_20]
    ROM:080F68B0 loc_80F68B0                             ; CODE XREF: sub_80F6878+34j
    ROM:080F68B0                 CMP     R4, #0
    ROM:080F68B2                 BEQ     loc_80F68D4
    ROM:080F68B4                 LSL     R2, R5, #0x10
    ROM:080F68B6                 LSR     R2, R2, #0x10
    ROM:080F68B8                 STR     R7, [SP,#0x24+var_24]
    ROM:080F68BA                 MOV     R0, R8
    ROM:080F68BC                 ADD     R1, R4, #0
    ROM:080F68BE                 MOV     R3, R9
    ROM:080F68C0                 BL      sub_80F6AD0
    ROM:080F68C4                 LDR     R2, =0x203AB60
    ROM:080F68C6                 LDRH    R0, [R6]
    ROM:080F68C8                 ADD     R1, R0, #1
    ROM:080F68CA                 STRH    R1, [R6]
    ROM:080F68CC                 LSL     R0, R0, #0x10
    ROM:080F68CE                 LSR     R0, R0, #0xE
    ROM:080F68D0                 ADD     R0, R0, R2
    ROM:080F68D2                 STR     R4, [R0]
    ROM:080F68D4 loc_80F68D4                             ; CODE XREF: sub_80F6878+3Aj
    ROM:080F68D4                 ADD     R0, R4, #0
    ROM:080F68D6                 B       loc_80F68E2
    ROM:080F68D6 ; ---------------------------------------------------------------------------
    ROM:080F68D8 dword_80F68D8   DCD 0x203AB5C           ; DATA XREF: sub_80F6878+20r
    ROM:080F68DC dword_80F68DC   DCD 0x203AB60           ; DATA XREF: sub_80F6878+4Cr
    ROM:080F68E0 ; ---------------------------------------------------------------------------
    ROM:080F68E0 loc_80F68E0                             ; CODE XREF: sub_80F6878+26j
    ROM:080F68E0                 MOV     R0, #0
    ROM:080F68E2 loc_80F68E2                             ; CODE XREF: sub_80F6878+5Ej
    ROM:080F68E2                 ADD     SP, SP, #8
    ROM:080F68E4                 POP     {R3,R4}
    ROM:080F68E6                 MOV     R8, R3
    ROM:080F68E8                 MOV     R9, R4
    ROM:080F68EA                 POP     {R4-R7}
    ROM:080F68EC                 POP     {R1}
    ROM:080F68EE                 BX      R1
    ROM:080F68EE ; End of function sub_80F6878
    ROM:080F68EE ; ---------------------------------------------------------------------------
    I did not say the routine for 'lack of time'.
    Who wants to analyze it and comment on it, feel free
    Reply With Quote