08084AB0 0400 lsl r0,r0,10h ; this is at 0x080B49F2 in Emerald (U), 0x0808196C in R/S (J), 0x080B414A E (J), 0x08084FEC R/S (FR), 0x080B4A06 Emerald (FR)
08084AB2 0C00 lsr r0,r0,10h
08084AB4 2831 cmp r0,31h ; see post #749
08084AB6 D907 bls 8084AC8h
08084AB8 E03E b 8084B38h ; if the calculated slot is not feebas's ([0;49]), skip the feebas tile determination routine
08084ABE 0202 lsl r2,r0,8h
08084AC0 DC00 bgt 8084AC4h ; DIFFERENT ON R/S JAP and FR
08084AC2 0839 lsr r1,r7,20h
08084AC4 2001 mov r0,1h ; feebas = true
08084AC6 E038 b 8084B3Ah
08084AC8 481F ldr r0,=2025734h ; r0 = 0x03005D8C (pointer) in Emerald (U)
08084ACA 4B20 ldr r3,=2DD6h ; 0x2E6A in Emerald.
08084ACC 18C0 add r0,r0,r3 ; 0x0202850A in R/S (U and FR), 0x02028896 E (U), 0x0202826A R/S (J), 0x02028542 E (J), 0x02028882 E (FR)
08084ACE 8800 ldrh r0,[r0] ; load feebas seed on r0
08084AD0 F000F850 bl 8084B74h
08084B74 0400 lsl r0,r0,10h
08084B76 0C00 lsr r0,r0,10h
08084B78 4901 ldr r1,=202FF80h ; store r0 in 0x202FF80 (R/S U)
08084B7A 6008 str r0,[r1]
08084B7C 4770 bx r14
08084AD4 2500 mov r5,0h ; r5 (loop counter) = 0;
08084AD6 4E1E ldr r6,=1BFh ; r6 = 0x1BF
08084AD8 F000F83C bl 8084B54h
08084B54 4A04 ldr r2,=202FF80h
08084B56 6811 ldr r1,[r2] ; load full seed
08084B58 4804 ldr r0,=41C64E6Dh
08084B5A 4348 mul r0,r1
08084B5C 4904 ldr r1,=3039h ; 0x3039 [B]NOT[/B] 0x6073 !
08084B5E 1840 add r0,r0,r1
08084B60 6010 str r0,[r2] ; store full (u32) result of (0x41C64E6D * seed + 0x3039) at 0x202FF80
08084B62 0C00 lsr r0,r0,10h ; r0 (output) >>= 16
08084B64 4770 bx r14
08084ADC 0069 lsl r1,r5,1h ; r1 = 0
08084ADE 466A mov r2,r13 ; r2 = sp
08084AE0 1854 add r4,r2,r1 ; r4 = r2 + 0
08084AE2 0400 lsl r0,r0,10h
08084AE4 0C00 lsr r0,r0,10h
08084AE6 1C31 mov r1,r6 ; r1 = 0x1BF
08084AE8 F15CFA0E bl 81E0F08h ; r0 = r0 mod r1
08084AEC 8020 strh r0,[r4] ; store r0 ( tile ) on the stack
08084AEE 0400 lsl r0,r0,10h
08084AF0 2800 cmp r0,0h ; if r0 is null
08084AF2 D100 bne 8084AF6h
08084AF4 8026 strh r6,[r4] ; store 0x1BF instead
08084AF6 8820 ldrh r0,[r4] ; load calculated feebas tile
08084AF8 3801 sub r0,1h
08084AFA 0400 lsl r0,r0,10h
08084AFC 0C00 lsr r0,r0,10h
08084AFE 2802 cmp r0,2h ; if tile is either 1,2, or 3, (unacessible) don't increment the loop, so generate new tiles number to be checked with
08084B00 D902 bls 8084B08h
08084B02 1C68 add r0,r5,1
08084B04 0600 lsl r0,r0,18h
08084B06 0E05 lsr r5,r0,18h ; increment r5 by 1.
08084B08 2D06 cmp r5,6h ; if r5 < 6;
08084B0A D1E5 bne 8084AD8h ; calculate another feebas tile to check with.
08084B0C 464B mov r3,r9
08084B0E 2100 mov r1,0h
08084B10 5E58 ldsh r0,[r3,r1] ; r0 = rod->map.x
08084B12 4642 mov r2,r8
08084B14 2300 mov r3,0h
08084B16 5ED1 ldsh r1,[r2,r3] ; r1 = rod->map.y
08084B18 1C3A mov r2,r7
08084B1A F7FFFF33 bl 8084984h ; from (fishing) coordinates return current tile in r0
08084B1E 0400 lsl r0,r0,10h
08084B20 0C01 lsr r1,r0,10h
08084B22 2500 mov r5,0h
08084B24 0068 lsl r0,r5,1h
08084B26 4468 add r0,r13 ; r0 = sp
08084B28 8800 ldrh r0,[r0]
08084B2A 4281 cmp r1,r0 ; is the current tile a feebas tile ? SET A BREAKPOINT THERE TO SEE THE CURRENT TILE AND ALL YOUR FEEBAS TILES.
; in emerald, this opcode is located at 0x080B4A6C (U)
08084B2C D0CA beq 8084AC4h ; if so, feebas = true
08084B2E 1C68 add r0,r5,1 ; increment r5
08084B30 0600 lsl r0,r0,18h
08084B32 0E05 lsr r5,r0,18h
08084B34 2D05 cmp r5,5h
08084B36 D9F5 bls 8084B24h ; if r5 <= 5 increment
08084B38 2000 mov r0,0h ; The current tile is not a feebas tile (feebas = false)
08084B3A B004 add sp,10h
08084B3C BC18 pop r3,r4
08084B3E 4698 mov r8,r3
08084B40 46A1 mov r9,r4
08084B42 BCF0 pop r4-r7
08084B44 BC02 pop r1
08084B46 4708 bx r1