Well, I'm remaking Real-time world edit so I can understand how it works :p
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)
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 :p
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
08-20-2009
dragonboy269
Well, I shortened it, then added the "check if pointer holds #0" thing, and now it's the same size again :p
Code:
add r2,pc,#1
bx r2
.thumb
ldr r1,CoordinatesPointer
ldr r1,[r1]
cmp r1,#0
beq Exit
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
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
lsl r2,#5
lsl r0,#9
lsl r4,#0xB
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
Next (not going to be released) version will work indoors and outdoors.
08-20-2009
Vash
You did the math yourself? I doubt that. Sorry...
08-20-2009
dragonboy269
Quote:
Originally Posted by Vash
You did the math yourself? I doubt that. Sorry...
I did do it all by myself. I didn't even look at the original RTWE :(
Look at how completely different mine is than Toenailed's. The only part of the code that I used from other codes is the text to item conversion
08-20-2009
Beretta
Quote:
Originally Posted by dragonboy269
Next (not going to be released) version will work indoors and outdoors.
I figured that would have been the reason to make this? I would of loved to had the chance to use this in the house.
08-20-2009
dragonboy269
Quote:
Originally Posted by Beretta
I figured that would have been the reason to make this? I would of loved to had the chance to use this in the house.
Well, the reason I'm not releasing the indoor version is because it does work on wi-fi, and can be used to trash other players' houses.
Oh and Vash,
:( I really did spend a lot of hard work making this and my Search/Teleport code
I admit before I wouldn't really make a lot of stuff on my own, but those two codes were on my own (I got some help from Maniac in my Search/Teleport code, but I didn't get any help at all in remaking RTWE)
You really underestimate me, I can do a lot more than you think
08-20-2009
Beretta
I respect that decision. :)
08-20-2009
Lord Was
Quote:
Originally Posted by dragonboy269
Well, the reason I'm not releasing the indoor version is because it does work on wi-fi, and can be used to trash other players' houses.
Oh and Vash,
:( I really did spend a lot of hard work making this and my Search/Teleport code
I admit before I wouldn't really make a lot of stuff on my own, but those two codes were on my own (I got some help from Maniac in my Search/Teleport code, but I didn't get any help at all in remaking RTWE)
You really underestimate me, I can do a lot more than you think
Very well said. i hope you don't get underestimated again. :)
08-20-2009
dragonboy269
Quote:
Originally Posted by Lord Was
Very well said. i hope you don't get underestimated again. :)
I will be, Vash and Virus think I'm a credit stealing, stuck-up poser who likes to show off
08-21-2009
dragonboy269
Just want to say, I used some division routines and the text conversion routine from the original RTWE
And, that Toenailed came up with the coordinates to mapslot routine before me, I just made a different one, so technically it's still made by Toenailed
08-21-2009
siestacat
I;ll see if I can get it to work with meh emulator. My real AR Broke, but I'll see...
08-22-2009
dragonboy269
Well, here's my final version of real-time world edit. I won't post the code, just the source.
It's coded completely by me, the only thing found by others are the addresses. I came up with the calculations on my own too :p
(the text conversion part is still just modified from Toenailed's, I'll make a new one later)
Credit for the original goes to Toenailed
Final RTWE
Features:
Works indoors/outdoors
Allows removing of leading zeros
Automatically determines your location
Allows "de-seeding" outdoors, and removing of blank spaces inside (even in other towns)
Two lines shorter than the original RTWE
Includes different DPad check that works in all directions including diagonally (i think the original didn't, i haven't checked)
Anyway, here is the source
Code:
@Convert to thumb
add r2,pc,#1
bx r2
.thumb
ldr r5,CheckLocation
ldrb r5,[r5]
cmp r5,#5
@Check if you're in a location other than outdoors/player house
bgt Exit
ldr r1,CoordinatesPointer
ldr r1,[r1]
cmp r1,#0
@Check if you're at the games menu or some place that clears the address in the pointer
beq Exit
ldr r4,IOKeys
ldrb r4,[r4]
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
add r2,#8
ldr r2,[r1,r2] @r2 now holds y coordinate
lsr r2,#0xC
@---DPad check---@
@start with left
mov r0,#0x20
tst r4,r0
bne Right
sub r3,#2
Right:
mov r0,#0x10
tst r4,r0
bne Up
add r3,#2
Up:
mov r0,#0x40
tst r4,r0
bne Down
sub r2,#2
Down:
mov r0,#0x80
tst r4,r0
bne None
add r2,#2
None:
cmp r5,#0
beq OutdoorsCheck
cmp r3,#0 @check if you're outside of the house's item slots
blt Exit
cmp r3,#0x1E @check if you're outside of the house's item slots
bgt Exit
cmp r2,#0
blt Exit
cmp r2,#0x1E
bgt Exit
b Continue
OutdoorsCheck:
cmp r3,#0x20 @check if you're before the map
blt Exit
cmp r3,#0xA0 @check if you're after the map
bgt Exit
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
Continue:
lsr r3,#1
lsr r2,#1
cmp r5,#0
@If you're in the house, there's no need to subtract
bgt BeginDivision
sub r3,#0x10
sub r2,#0x10
@r2 holds column
@r3 holds row
BeginDivision:
mov r0,#0xF
mov r4,#0xF
@-----------My routine
Divide1:
and r0,r3,r0
lsr r3,#4
@-----------My routine
Divide2:
and r4,r2,r4
lsr r2,#4
Finish:
@r3 holds y box multiply by #0x200
@r2 holds x box multiply by #0x800
@r0 holds column multiply by #0x2
@r4 holds row multiply by #0x20
lsl r0,#1 @multiply by #2
lsl r4,#5 @multiply by #32
lsl r3,#9 @multiply by #512
lsl r2,#0xB @multiply by #2048
ldr r1,Map
cmp r5,#0
beq AddSlot
sub r5,#1
mov r1,#0x45
lsl r1,#4
mul r5,r1
ldr r1,House
add r1,r5
@add to the map to get the space you're on
AddSlot:
add r1,r4
add r1,r0
add r1,r2
add r1,r3
@[texttoItem] = r5
@My version allows removing of leading zeros
ldr r4, Text
mov r5,#0x0
mov r0,#0xC
mov r2,#0xF
loop:
ldrb r3,[r4]
add r4,#0x1
cmp r3,#0x20
bgt skipthis
sub r4,#1
lsr r5,r0
lsr r5,#4
b Store
skipthis:
cmp r3,#0x40
blt skip
sub r3,#0x7
skip:
and r3,r2
lsl r3,r0
add r5,r3
sub r0,#0x4
bpl loop
@Store the item in that space
Store:
strh r5,[r1]
Exit:
bx lr
Well, here's my final version of real-time world edit. I won't post the code, just the source.
It's coded completely by me, the only thing found by others are the addresses. I came up with the calculations on my own too :p
(the text conversion part is still just modified from Toenailed's, I'll make a new one later)
Credit for the original goes to Toenailed
Final RTWE
Features:
Works indoors/outdoors
Allows removing of leading zeros
Automatically determines your location
Allows "de-seeding" outdoors, and removing of blank spaces inside (even in other towns)
Two lines shorter than the original RTWE
Includes different DPad check that works in all directions including diagonally (i think the original didn't, i haven't checked)
Anyway, here is the source
Code:
@Convert to thumb
add r2,pc,#1
bx r2
.thumb
ldr r5,CheckLocation
ldrb r5,[r5]
cmp r5,#5
@Check if you're in a location other than outdoors/player house
bgt Exit
ldr r1,CoordinatesPointer
ldr r1,[r1]
cmp r1,#0
@Check if you're at the games menu or some place that clears the address in the pointer
beq Exit
ldr r4,IOKeys
ldrb r4,[r4]
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
add r2,#8
ldr r2,[r1,r2] @r2 now holds y coordinate
lsr r2,#0xC
@---DPad check---@
@start with left
mov r0,#0x20
tst r4,r0
bne Right
sub r3,#2
Right:
mov r0,#0x10
tst r4,r0
bne Up
add r3,#2
Up:
mov r0,#0x40
tst r4,r0
bne Down
sub r2,#2
Down:
mov r0,#0x80
tst r4,r0
bne None
add r2,#2
None:
cmp r5,#0
beq OutdoorsCheck
cmp r3,#0 @check if you're outside of the house's item slots
blt Exit
cmp r3,#0x1E @check if you're outside of the house's item slots
bgt Exit
cmp r2,#0
blt Exit
cmp r2,#0x1E
bgt Exit
b Continue
OutdoorsCheck:
cmp r3,#0x20 @check if you're before the map
blt Exit
cmp r3,#0xA0 @check if you're after the map
bgt Exit
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
Continue:
lsr r3,#1
lsr r2,#1
cmp r5,#0
@If you're in the house, there's no need to subtract
bgt BeginDivision
sub r3,#0x10
sub r2,#0x10
@r2 holds column
@r3 holds row
BeginDivision:
mov r0,#0xF
mov r4,#0xF
@-----------My routine
Divide1:
and r0,r3,r0
lsr r3,#4
@-----------My routine
Divide2:
and r4,r2,r4
lsr r2,#4
Finish:
@r3 holds y box multiply by #0x200
@r2 holds x box multiply by #0x800
@r0 holds column multiply by #0x2
@r4 holds row multiply by #0x20
lsl r0,#1 @multiply by #2
lsl r4,#5 @multiply by #32
lsl r3,#9 @multiply by #512
lsl r2,#0xB @multiply by #2048
ldr r1,Map
cmp r5,#0
beq AddSlot
sub r5,#1
mov r1,#0x45
lsl r1,#4
mul r5,r1
ldr r1,House
add r1,r5
@add to the map to get the space you're on
AddSlot:
add r1,r4
add r1,r0
add r1,r2
add r1,r3
@[texttoItem] = r5
@My version allows removing of leading zeros
ldr r4, Text
mov r5,#0x0
mov r0,#0xC
mov r2,#0xF
loop:
ldrb r3,[r4]
add r4,#0x1
cmp r3,#0x20
bgt skipthis
sub r4,#1
lsr r5,r0
lsr r5,#4
b Store
skipthis:
cmp r3,#0x40
blt skip
sub r3,#0x7
skip:
and r3,r2
lsl r3,r0
add r5,r3
sub r0,#0x4
bpl loop
@Store the item in that space
Store:
strh r5,[r1]
Exit:
bx lr