Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Remaking Real Time world edit

  1. #1
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default Remaking Real Time world edit

    Well, I'm remaking Real-time world edit so I can understand how it works
    I think I understand, but my source so far is nowhere near as neat as Toenailed's

    Here's what I have so far, this checks the space you're in (I just started a few minutes ago, so there might be errors and stuff like that

    If you think I'm on the right track, just say so XD (just say if I'm right or wrong, I wanna figure it out on my own so don't tell me what I should do)

    And yes I start all codes like this, I jump right in without planning anything and hope it works in the end XD




    Update: I got it to work (no dpad check just yet though) XD

    Tell me what you think Got it working on my second try (first time I accidentally put a lsr instead of a lsl, that's all that was wrong XD)

    Code:
    add r2,pc,#1            
    bx r2
    .thumb
    
    
    ldr r1,CoordinatesPointer
    
    ldr r1,[r1]
    mov r2,#0xA9
    lsl r2,#3
    neg r2,r2
    ldr r3,[r1,r2]
    lsr r3,#0xC
    cmp r3,#0x20
    blt Exit
    cmp r3,#0xA0
    bgt Exit
    
    add r2,#8
    ldr r2,[r1,r2]
    lsr r2,#0xC
    cmp r2,#0x20
    blt Exit
    cmp r3,#0xA0
    bgt Exit
    
    lsr r3,#1
    lsr r2,#1
    sub r3,#0x10
    sub r2,#0x10
    
    mov r0,#0
    mov r4,#0
    
    Divide1:
    cmp r3,#16
    blt Divide2
    sub r3,#16
    add r0,#1
    b Divide1
    
    Divide2:
    cmp r2,#16
    blt Finish
    sub r2,#16
    add r4,#1
    b Divide2
    
    Finish:
    @r0 holds y box #0x200
    @r4 holds x box #0x800
    @r3 holds column #0x2
    @r2 holds row #0x20
    
    lsl r3,#1
    mov r1,#0x20
    mul r2,r1
    lsl r1,#4
    mul r0,r1
    lsl r1,#2
    mul r4,r1
    
    ldr r1,Map
    add r1,r4
    add r1,r0
    add r1,r2
    add r1,r3
    mov r4,r1
    
    @[texttoItem] = r5
    ldr r1, Text
    mov r5,#0x0
    mov r0,#0xC
    mov r2,#0xF
    loop:
    ldrb r3,[r1]
    add r1,#0x1
    cmp r3,#0x3A
    blt number
    add r3,#0x9
    number:
    and r3,r2
    lsl r3,r0
    add r5,r3
    sub r0,#0x4
    bpl loop
    
    strh r5,[r4]
    Exit:
    bx lr
    
    
    
    
    
    .arm
    CoordinatesPointer:
    .long 0x21C6DEC
    CheckLocation:
    .long 0x21EED6C
    Map:
    .long 0x21E3124
    Text:
    .long 0x22AF136
    Credit to Toenailed for the Text to item routine, I'll add my own later but I was just lazy and really wanted to make sure it worked before I went to bed

    Compiled AR code:
    L+R
    Code:
    94000130 FCFF0000
    023FF090 012FFF11
    E0000000 00000098
    E28F2001 E12FFF12
    6809491F 00D222A9
    588B4252 2B200B1B
    2BA0DB34 3208DC32
    0B12588A DB2D2A20
    DC2B2BA0 0852085B
    3A103B10 24002000
    DB022B10 30013B10
    2A10E7FA 3A10DB02
    E7FA3401 2120005B
    0109434A 00894348
    490D434C 18091909
    18C91889 490B1C0C
    200C2500 780B220F
    2B3A3101 3309DB00
    40834013 380418ED
    8025D5F5 00004770
    021C6DEC 021EED6C
    021E3124 022AF136
    023FF090 E3520003
    D2000000 00000000
    (021EED6C is in there so I can make it work in player houses later)

  2. The Following User Says Thank You to dragonboy269 For This Useful Post:


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

    Default

    Should note your source... sorta like i did when starting the find item code..

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


  4. #3
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by Maniac View Post
    Should note your source... sorta like i did when starting the find item code..
    I'll note it, and maybe move some things.

  5. #4
    Member
    Join Date
    Aug 2008
    Location
    Vancouver, Washington
    Posts
    226

    Default

    Quote Originally Posted by dragonboy269 View Post
    I'll note it, and maybe move some things.
    Nice. That's all i have to say on that.
    I Lost the Game.

    -Lord Was

  6. #5
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    How's this? I added a few notes

    Code:
    add r2,pc,#1            
    bx r2
    .thumb
    
    
    ldr r1,CoordinatesPointer
    
    ldr r1,[r1]
    mov r2,#0xA9
    lsl r2,#3
    neg r2,r2 @r2 now holds negative #0x548
    ldr r3,[r1,r2] @r3 now holds X coordinates
    lsr r3,#0xC
    
    cmp r3,#0x20 @check if you're before the map
    blt Exit
    cmp r3,#0xA0 @check if you're after the map
    bgt Exit
    
    add r2,#8
    ldr r2,[r1,r2] @r2 now holds y coordinate
    lsr r2,#0xC
    
    cmp r2,#0x20 @check if you're before the map
    blt Exit
    cmp r2,#0xA0 @check if you're after the map
    bgt Exit
    
    
    @Divide by 2 and subtract #0x10 so you end up with the Row/Column number
    @might get rid of the divide cause you multiply everything later
    
    lsr r3,#1 
    lsr r2,#1
    sub r3,#0x10
    sub r2,#0x10
    
    @r3 holds column
    @r2 holds row
    
    mov r0,#0
    mov r4,#0
    
    
    
    @Quotient holds Column Box
    @Remainder holds Column
    Divide1:
    cmp r3,#16
    blt Divide2
    sub r3,#16
    add r0,#1
    b Divide1
    
    
    @Quotient holds Row Box
    @Remainder holds Row
    Divide2:
    cmp r2,#16
    blt Finish
    sub r2,#16
    add r4,#1
    b Divide2
    
    Finish:
    @r0 holds y box multiply by #0x200
    @r4 holds x box multiply by #0x800
    @r3 holds column multiply by #0x2
    @r2 holds row  multiply by #0x20
    
    lsl r3,#1
    mov r1,#0x20
    mul r2,r1
    lsl r1,#4
    mul r0,r1
    lsl r1,#2
    mul r4,r1
    
    ldr r1,Map
    
    @add to the map to get the space you're on
    
    add r1,r4
    add r1,r0
    add r1,r2
    add r1,r3
    
    @[texttoItem] = r5
    ldr r4, Text
    mov r5,#0x0
    mov r0,#0xC
    mov r2,#0xF
    loop:
    ldrb r3,[r4]
    add r4,#0x1
    cmp r3,#0x3A
    blt number
    add r3,#0x9
    number:
    and r3,r2
    lsl r3,r0
    add r5,r3
    sub r0,#0x4
    bpl loop
    
    
    @Store the item in that space
    strh r5,[r1]
    Exit:
    bx lr
    
    
    
    .arm
    CoordinatesPointer:
    .long 0x21C6DEC
    Map:
    .long 0x21E3124
    Text:
    .long 0x22AF136
    Shortened by another line too XD
    (6 lines shorter than Toenailed's "Without Dpad Check" version)

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

    Default

    Much easier to read.. lol thanks <_>

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


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

    Default

    Is this working? Seems a little simplified. There's more math involved in turning the coordinate into a world map slot.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  9. #8
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by Vash View Post
    Is this working? Seems a little simplified. There's more math involved in turning the coordinate into a world map slot.
    It works, go ahead and test it XD

    L+R activator
    Code:
    94000130 FCFF0000
    023FF090 012FFF11
    E0000000 00000090
    E28F2001 E12FFF12
    6809491E 00D222A9
    588B4252 2B200B1B
    2BA0DB33 3208DC31
    0B12588A DB2C2A20
    DC2A2AA0 0852085B
    3A103B10 24002000
    DB022B10 30013B10
    2A10E7FA 3A10DB02
    E7FA3401 2120005B
    0109434A 00894348
    490B434C 18091909
    18C91889 25004C09
    220F200C 34017823
    DB002B3A 40133309
    18ED4083 D5F53804
    4770800D 021C6DEC
    021E3124 022AF136
    023FF090 E3520003
    D2000000 00000000

  10. #9
    Member
    Join Date
    Aug 2008
    Location
    Vancouver, Washington
    Posts
    226

    Default

    Quote Originally Posted by dragonboy269 View Post
    It works, go ahead and test it XD

    L+R activator
    Code:
    94000130 FCFF0000
    023FF090 012FFF11
    E0000000 00000090
    E28F2001 E12FFF12
    6809491E 00D222A9
    588B4252 2B200B1B
    2BA0DB33 3208DC31
    0B12588A DB2C2A20
    DC2A2AA0 0852085B
    3A103B10 24002000
    DB022B10 30013B10
    2A10E7FA 3A10DB02
    E7FA3401 2120005B
    0109434A 00894348
    490B434C 18091909
    18C91889 25004C09
    220F200C 34017823
    DB002B3A 40133309
    18ED4083 D5F53804
    4770800D 021C6DEC
    021E3124 022AF136
    023FF090 E3520003
    D2000000 00000000
    Trust the dragonboy269, my young friend xD
    I Lost the Game.

    -Lord Was

  11. #10
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Anyone with 1.0 wanna confirm that it works? I've already tested it nonstop for the past half hour (mindless running around my town using it XD)
    But I'd like a second opinion too

Posting Permissions

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