Text to Item

Started by Panda On Smack, May 18, 2010, 10:24:06 PM

Previous topic - Next topic

dcx2

Quote from: Panda On Smack on May 20, 2010, 04:09:12 PM
It should now be C0000000 0000000A though as it's got an extra line of code
lol oops

QuoteI also change the 2nd line to 3F6092AA 637B1CE9 because leaving it at E8 gave me all 0's
Yes, I forgot to check that...you have to read every other byte, and you weren't aligned with the actual data bytes.

QuoteI entered 0123 in my input box and pressed C

at 900E0610 is this: 1230000A

at 92AA1CE8 is this: 00300031
at 92AA1CEC is this: 00320033

so the code works but it misses the first 0?
When writing ASM codes, it's important to be able to step through the code and watch what's happening.  I've never tried to debug a C0 code live (in fact, I've never written one, but I kinda want to...).  I wonder if you could find your code in memory and set an execute breakpoint on it.

Try searching for a really unique value in your code, like 7CA55214, and limit your search to areas in MEM1 below 80010000 (I think that's it), because that's where our codes go.  Set your Execute breakpoint and you should be able to step through the code live, seeing what values are being loaded into registers etc.

Anyway, I figured out the problem.  lbzu r10,2(r27).  If r27 = 637B1CE9 then the lbzu will begin by reading 637B1CEB, which is where the 1 is.  Instead, you must set r27 = 637B1CE7, so the offset of 2 will line up with the beginning of the string.

Quote from: Panda On Smack on May 20, 2010, 09:15:37 AM
Are we sure it's unicode? geckoDotNet cant read it as that, only ascii

ASCII is an 8-bit standard for representing characters.  It only has 256 different things it can represent (some of them control codes, like line break and carriage return, beep, etc).  Can you imagine writing Chinese with only 256 characters?

Unicode is a 16-bit standard that was designed to support Chinese, Japanese, etc with 64k possible characters.  To make things easy, English Unicode is built on top of ASCII, with 0 for the first 8 bits and ASCII for the second 8 bits.

If Gecko.NET can't see the right stuff in Unicode view, then I should look into this...

Panda On Smack

ta mate, you got in before I had chance to change my reply. all working now!

dcx2

lol, I missed your edit.  I see you discovered all of this.

Your error checking would be making sure you don't hit C when there's something invalid in there.  :)

Even if you type in garbage, it will still make numbers.  You should probably make sure the final number in r5 is less than your max item value, just in case someone puts garbage in and presses C anyway, because it could cause freezing.

You might also want to consider adding an extra digit or two that allows you to specify the slot you want to put the item into.  Assuming the slots are laid out adjacent in memory, you just need a mulli by the slot number (probably starts with 0, not 1), where the immediate is the number of bytes in a slot (probably 2?), and add it to the slot 0 address (900E0610?)

Panda On Smack

#18
yeah, nice one

Hopefully I can work out how to tweak it and improve

Crap youtube vid of it:

http://www.youtube.com/watch?v=atBurJa7mYc

current ASM
lis r27,-27990
ori r27,r27,7399
li r5,0
li r9,12
lbzu r10,2(r27)
cmpwi r10,58
blt- 0x08
addi r10,r10,9
andi. r10,r10,15
slw r10,r10,r9
add r5,r5,r10
subi r9,r9,4
cmpwi r9,0
bge+ 0xFFFFFFDC
lis r27,-28658
ori r27,r27,1552
sth r5,0(r27)
li r5,15
sth r5,2(r27)


highest value someone can enter is 02EA which is 746. so do I compare r5 to 746 and if its higher then branch?


lis r27,-28658
ori r27,r27,1552
cmpwi r5,746
bgt- 0x0C
sth r5,0(r27)
li r5,15
sth r5,2(r27)


Panda On Smack

P.S. since this is an online code i presume it's not allowed in the code list? Although, this is a public part of the forum where anyone can see it.

dcx2

This is a code that incidentally works online.  It wasn't designed with an online advantage in mind.

Also, you should try this template instead.  If r5 < 747, it does nothing.  If r5 >= 747, it will load r5 with a valid value.

cmpwi r5,747
blt- 0x08
li r5, 2
sth r5,0(r27)
li r5,15
sth r5,2(r27)

Panda On Smack

Thanks again, will test it out. While I don't want to break the forum rules this code can only be used online because you cant use the chat function offline.

doh

dcx2

Hm, this is tricky then, because the whole "can't chat offline" thing is the only reason it would be an "online" code.  It still feels like the online aspect is accidental more than intentional.

I imagine there are already codes that allow you to create an item out of nowhere, they're just more unwieldy than the text->item code.  Considering how the consensus was "some/embargo", and this code can't be used to deny someone else service, and an embargo is useless because item creation codes already exist...I don't see any real harm in it.  I've largely given up on policing those threads except for the unban codes.

Skiller

Quote from: dcx2 on May 21, 2010, 02:54:26 PM
Hm, this is tricky then, because the whole "can't chat offline" thing is the only reason it would be an "online" code.  It still feels like the online aspect is accidental more than intentional.

I imagine there are already codes that allow you to create an item out of nowhere, they're just more unwieldy than the text->item code.  Considering how the consensus was "some/embargo", and this code can't be used to deny someone else service, and an embargo is useless because item creation codes already exist...I don't see any real harm in it.  I've largely given up on policing those threads except for the unban codes.

we can try to bring the Chat box into the offline play .. if we did that i could change up the full roller code for what u just made :) and we could do one for the Equipment .> hell any Mod codes we would make could use this format .

this would be cool to add to say a code type for Gecko .. so that we could just use say a few lines

Example

CTB00000 KKKKKKKK
AAAAAAAA VVVVLLLL

CT = Code type
B = Bit type
A = Address
K = Keyboard Address
V = Max Value
L = Lowest Value
0 = Unused .. but could be used for something

anything on the address that used the CT codetype would then be printed to using the Keyboard values ...

thats if the rest of the code could become universal .

dcx2

Bringing the chat box offline would be an epic hack.   ;D

I don't think this is standard enough for a code type, though.  There will probably be a general template that people will have to port by hand.

Regarding the item roller, I imagine your do a one-press-equals-one-item.  Have you considered adding a scroller?  That's what I did with my Tales item modifier; left and right will change items one at a time, while + and - scroll through the items.  It scrolls at 30 items/sec, so if you had more than 300 items or so you might want to consider scrolling by 2 or 3 items/frame instead of 1.

Romaap

Making the chat box work in offline play would be a tricky thing I guess.
Unless the game just reads a boolean for that, you would have to Reverse Engineer the whole subroutine taking care of that.

Skiller

Quote from: dcx2 on May 21, 2010, 07:34:34 PM
Bringing the chat box offline would be an epic hack.   ;D

I don't think this is standard enough for a code type, though.  There will probably be a general template that people will have to port by hand.

Regarding the item roller, I imagine your do a one-press-equals-one-item.  Have you considered adding a scroller?  That's what I did with my Tales item modifier; left and right will change items one at a time, while + and - scroll through the items.  It scrolls at 30 items/sec, so if you had more than 300 items or so you might want to consider scrolling by 2 or 3 items/frame instead of 1.

i alow them to change the speed of the change ..
i have it change every Second normaly but u can set it to Change every Millsecond if u wanted .. :P