I was bored the last few days, so I've been working on this.
It's finished, I'm just thinking about adding a few things
I'll make it better once I figure out why the "clz count leading zeroes" instruction freezes...
Real-time World Edit/World Viewer(Indoors and outdoors)
Differences from original RTWE:
*You don't send the message, you copy it..
*When you copy the item hex, it saves it in the code, so you can continue typing or
copying stuff without affecting which item hex you have stored. No need to retype.
*You can also read the hex code of the item directly under you or beside you.
*All these features work outdoors and in the house in every room (the code automatically determines where you're at)
---------------------------------------
Directions:
Real Time World Edit:
First, to select the item hex, type ztXXXX and copy it. XXXX is the item hex you want to use. The default stored hex is 0000, and that will be replaced by whatever hex you've chosen.
Next, stand on the space you want to place an item on, and press L+R+A. The item will appear directly under you. You can also use the dpad to place items beside you with L+R+A+Dpad
If you're in your house and want to place an item on top of another item, type a plus sign after the hex you want to place, like...ztXXXX+
Real Time World Viewer:
To view the hex code of an item, stand above or beside it, and type (and copy)
0x to view the item directly under you
0x+ to view the item one space above you
0x- to view the item one space below you
0x> to view the item one space to the right
0x< to view the item one space to the left
Once you've copied it, simply paste and the item's hex code will be pasted.
Like above, if you want to view the hex code of an item on top of another item (in the house) you must enter a hex code followed by a + sign, like ztXXXX+ and then use the above directions for Real Time World Viewer.
ASM source:
I know I had some horrible coding habits, but...
it was more for shortness of code than readability :P
I experimented with lots of advanced things...
I'll note it soon :] and fix up a few of the routines, they could be smoother and prettier.
Code:
@Convert to THUMB
@to produce shorter code...
add r2, pc, #0x1
bx r2
.thumb
/* this will multiply the results
* each X single slot increments by 0x2
* so multiply that by 0x2
* each Y single slot increments by 0x20 (#32)
* because to increment 1 Y you need 0x10 X (0x10 * 0x2)
* each X acre increments by #512 (0x200)
* 16*16 slots in each acre, 256*2 is #512
* each Y acre increments by #2048 (0x800)
* to increment 1 Y acre you need 1 X row
* which is 256*4 = 1024*2 = #2048
* so multiply by #2048
*/
lsl r1, #1
lsl r4, #5
lsl r3, #9
lsl r2, #0xB
@now, add the results together to get offset
add r4, r1
add r4, r2
add r4, r3
ldr r1, Map
mov r2, #0
@store item in slot1 + offset
strh r2, [r1,r4]
bx lr
If you compile the ASM source, compile it under nitrohax, and copy everything except the c2 line at the top.
08-29-2010
Vash
Thumb divide doesn't work in ARM9 for whatever reason. You have to use a "dirty hack" to divide. Check out toenailed's noted RTWE source. He has his version of divide in there. I see you already have your own, though.
08-29-2010
dragonboy269
Toenailed's divide routine is good for dividing any number by any number. It works in all cases, but it's not always the simplest or fastest method.
Besides, his RTWE is a lot more complex, but I guess it's more "neat and organized."
I tried to make mine in a way I could understand, and that's why mine is simplified. I just used animalmap and a calculator to figure it out :P
I added a few features.
Now you can press L+R+B to store the item underneath you in your first inventory slot, AND in your RTWE saved item.
If you're using text to item, the "store item in slot" part doesn't work...so I separated it into a subroutine away from the rest of the code. Otherwise the entire code won't work if you're using TII. So everything should work fine.
*does an obvious action in spite of just adding 1 to my post count*
lolme
On topic now.
I thought ARM7 was the best the AR can go. Wow. The Possibilities now.