Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: Coordinates to world map location [Complete/Full Source]

  1. #21
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default Re: Coordinates to world map location

    As I said above, I just wanted to make sure it was giving the proper address. By putting it at 0x02000000 I can check.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  2. #22
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default Re: Coordinates to world map location

    I didn't see that :\

    Say what you mean, mean what you say, and let your actions speak for you.


  3. #23

    Default Re: Coordinates to world map location

    My brain hurts :S

    Remember to always click the thanks button of those who help you! It makes them feel wanted:

  4. #24
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default Re: Coordinates to world map location

    It's simple actually >_>

    Say what you mean, mean what you say, and let your actions speak for you.


  5. #25

    Default Re: Coordinates to world map location

    If you understand the language XD

    Remember to always click the thanks button of those who help you! It makes them feel wanted:

  6. #26
    Super Moderator
    Join Date
    Oct 2007
    Location
    Philippines
    Posts
    98

    Default Re: Coordinates to world map location

    text the hex item then Press A + B
    Code:
    023FF090 012FFF11
    E0000000 000000D4
    E3A00301 E5D00130
    E35000FC 112FFF1E
    E28F1001 E12FFF11
    6809492B D0522900
    255446F4 3D01012D
    594B43ED F837F000
    3D081C10 F000594B
    1C11F832 35101C05
    F83AF000 00921E72
    35101C0D F834F000
    1C051992 F830F000
    1B040134 01243C01
    F0001C0D 0133F829
    191B1ACB 02123A01
    18D43B01 49150064
    49151864 200C2200
    3101780B DC012B60
    E0003B30 40833B57
    380418D2 DAF32800
    46E66022 0A1B4770
    24232201 42A30124
    1B1BDB0D 2B203320
    3201DB09 E7FA3B20
    26003D01 DB022D10
    3D103601 4770E7FA
    021C6DEC 021E3124
    022AF136 00000000
    023FF090 E3520003
    i tried this only in no$gba debugger using my trainermaker (with convert to asm, 0.03b has issues with using codehandler danng) and the issue so far is it gives two item next to each other [sometimes it gives two different item] .. maybe i just made some small mistake .. the small location inaccuracy on some portion is more on the 2ndbyte issues since the exact value per slot is around 7800 to 8100 ..

    .. its already very late here .. ill just post the source tomorrow .. and some fix.. im felt very tired today

    EDIT: anyway .. ill just post the source ... i know its still messy .. ill refix it tomorrow

    Code:
    mov r0,#0x04000000
    ldrb r0,[r0,#0x130]
    cmp r0,#0xFC
    bxne lr
    
    ldr r1, =0x21C6DEC
    ldr r1,[r1]
    cmp r1,#0
    beq exit
    mov r12,lr
    ldr r3,[r1,#0xFFFFFAC0]
    bl checkslot
    mov r0,r2
    ldr r3,[r1,#0xFFFFFAB8]
    bl checkslot
    mov r1,r2
    
    add r5,r0, #16
    bl checke
    sub r2,r6,#1
    lsl r2,#2
    add r5,r1, #16
    bl checke
    add r2,r6
    
    mov r5,r0
    bl checke
    lsl r4,r6,#4
    sub r4,r0,r4
    sub r4,#1
    lsl r4,#4
    mov r5,r1
    bl checke
    lsl r3,r6,#4
    sub r3,r1,r3
    add r3,r4
    
    sub r2,#1
    lsl r2,#8
    sub r3,#1
    add r4,r2,r3
    lsl r4,#1
    ldr r1, =0x021E3124
    add r4,r1
    
    ldr r1, =0x22AF136
    mov r2,#0x0
    mov r0,#0xC
    
    loop:
    ldrb r3,[r1],#1
    
    cmp r3,#0x60
    sublt r3,#0x30
    subgt r3,#0x57
    add r2,r3, lsl r0
    sub r0,#0x4 
    cmp r0,#0
    bge loop 
    strh r2,[r4]
    mov lr,r12
    bx lr
    
    checkslot:
    lsr r3,#8
    mov r2,#1
    mov r4,#0x23
    lsl r4,#4
    cmp r3,r4
    blt exit
    sub r3,r4
    add r3,#0x20
    div0:
    cmp r3,#32
    blt exit
    add r2,#1
    sub r3,#32
    b div0
    
    checke:
    sub r5,#1
    mov r6,#0
    div:
    cmp r5,#16
    blt exit
    add r6,#1
    sub r5,#16
    b div
    exit:
    bx lr

  7. #27
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default Re: Coordinates to world map location

    Yeah, it seems to add a random red tulips to where you're standing along with the item you entered. Could this be because you have it taking 4 bytes from the text location instead of 2? Then it would make sense that it's writing 4 bytes (your item+0000).

    EDIT: It also appears that the formula is off just a little bit for the item slots. It seems you forgot the +1 on the end of the X-slot and Y-slot formulas. The item appears one slot above and to the left of you. Solved by adding one to both the X and Y item slots.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  8. #28
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default Re: Coordinates to world map location

    Thanks toe, I'll work on the fixes

    Say what you mean, mean what you say, and let your actions speak for you.


  9. #29
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default Re: Coordinates to world map location

    Maniac has it working pretty much 100%. The odd thing is about 50% of the time it's dead accurate for the slot you're standing on. The other 50% it goes maybe one to the right or one below you. Any idea why, Toe? A mistake in the formula possibly?
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  10. #30
    Super Moderator
    Join Date
    Oct 2007
    Location
    Philippines
    Posts
    98

    Default Re: Coordinates to world map location

    Quote Originally Posted by Vash
    Maniac has it working pretty much 100%. The odd thing is about 50% of the time it's dead accurate for the slot you're standing on. The other 50% it goes maybe one to the right or one below you. Any idea why, Toe? A mistake in the formula possibly?
    actually there is no mistake in formula but we have to retrieve the actual difference of coordinate per map slot .. since the actual difference of 2ndbyte per slot is below 32[0x20] but higher than 30[0x1E] so lowest(1st) byte of coordinate is very important to retrieve a 100% accuracy (topleft most part is 0x020FD7 while topright most part is 0x09F029, will little calculation you will notice that there is a [-/+]0x29 to [-/+]0x52 missing difference per slot which can affect the other portion of the map slot, if we use the 2ndbyte solution) .. anyway its too early in the morning here in philippines ill just ill try to check later this afternoon the exact value of per slot size with coordinate

    EDIT: 2nd Slot starts at 0x00022000 both at x and y coordinate .. so 2ndbyte should start at 0x20 .. except the first slot all slot is 0x2000 big .. so old formula can still be use but instead of 0x0210 .. we will use 0x0220 ... and still incremented with 0x20 ..

    Code:
    if [x] < 0x022000 then rowSlot = 1 else
    rowSlot = (((([x] >> 8) - 0x0220)+32)/32) + 1
    
    if [y] < 0x022000 then rowSlot = 1 else
    columnSlot= (((([y] >> 8) - 0x0220)+32)/32) + 1
    or simply

    Code:
    rowSlot = ((([x] >> 8) - 0x0200)/32) + 1
    columnSlot = ((([y] >> 8) - 0x0200)/32) + 1
    anyway i made two version ..


    Final Test Code, Press L + R
    NOTE: Type the HexItem then Press L+R to replace the item
    that the character is Standing
    Code:
    94000130 FCFF0000
    023FF090 012FFF11
    E0000000 000000C0
    E28F1001 E12FFF11
    68124A2A D04D2A00
    46B046F4 59534D26
    F835F000 3D081C08
    F0005953 1C05F830
    F0003510 1E72F838
    1C0D0092 F0003510
    1992F832 F0001C05
    0134F82E 3C011B04
    1C0D0124 F827F000
    1ACB0133 3A01191B
    3B010212 006418D4
    18644915 25004915
    220F200C 3101780B
    DB002B3A 40133309
    18ED4083 D5F53804
    46468025 0A1B4760
    24202101 1B1B0124
    DB0B2B20 DA092940
    3B203101 3D01E7F8
    2D102600 3601DB02
    E7FA3D10 00004770
    FFFFFAC0 021C6DEC
    021E3124 022AF136
    023FF090 E3520003
    D2000000 00000000
    Press L + R + A to replace item where the Character is Standing
    Press L + R + A + DPAD to replace the item next to where the character is standing, depending on the pressed DPAD location
    Code:
    94000130 FCFE0000
    023FF090 012FFF11
    E0000000 00000104
    E28F1001 E12FFF11
    68124A3B D04F2A00
    46B046F4 59534D36
    F837F000 3D081C08
    F0005953 F000F832
    1C05F844 F0003510
    1E72F838 1C0D0092
    F0003510 1992F832
    F0001C05 0134F82E
    3C011B04 1C0D0124
    F827F000 1ACB0133
    3A01191B 3B010212
    006418D4 18644925
    25004925 220F200C
    3101780B DB002B3A
    40133309 18ED4083
    D5F53804 46468025
    0A1B4760 24202101
    1B1B0124 DB0B2B20
    DA092940 3B203101
    3D01E7F8 2D102600
    3601DB02 DAFA3D10
    4C104770 29017824
    2940D007 2510D005
    D00D422C 422C2520
    2801D00C 2840D0F0
    2540D0EE D007422C
    422C2580 E7E7D006
    E7F23101 E7F03901
    E7E13801 E7DF3001
    FFFFFAC0 04000130
    021C6DEC 021E3124
    022AF136 00000000
    023FF090 E3520003
    D2000000 00000000

    heres the routine that was added on the 2nd version, to check what DPAD was pressed
    r0 = has the rowSlot and r1 = has the columnSlot

    Code:
    checkDPAD:
    mov r4,#0x04000000
    ldrb r4,[r4,#0x130]
    
    leftright:
    cmp r1,#1
    beq updown
    cmp r1,#64
    beq updown
    tst r4,#0x10
    addeq r1,#1
    tst r4,#0x20
    subeq r1,#1
    
    updown:
    cmp r0,#1
    bxeq lr
    cmp r0,#64
    bxeq lr
    tst r4,#0x40
    subeq r0,#1
    tst r4,#0x80
    addeq r0,#1
    
    bx lr
    EDIT: i accidentally used r6 in FInal Test Code .. it might cause a culprit in actual ARDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •