PDA

View Full Version : Research: X and Y positions of textbox?


~Teh Panda~
January 6th, 2010, 05:32 PM
Well I have been interested in this for quite a while now. While completely pointless it would still add something quite unique to your game. Now what I was meant to ask and maybe would help research if we found offsets in the ram or something of the x and y offsets for the textboxes location on screen and if you would need a routine for keeping this permanent. I was speaking with ZodiacDaGreat about this and he seemed to think it would need some extensive ASM. I may have explain it bad though as it may have sounded if I wanted to appear like this only sometimes... But I am not too deep in ASM yet. I know some simple commands such as push, pop, load, etc and the registers and such. So maybe someone such as Juan or Interdpth could give an opinion?

----------

What I would think of doing is placing a break for when the textbox appears and see if we could pinpoint the X and y locations in the disassembler. But if we did this we probably would need to find the X and Y locations of not only the textbox but all which goes in it. The individual letter spaces etc.

Thanks and I hope this doesn't sound like a quaint pointless idea.

Full Metal
January 7th, 2010, 06:33 AM
well...this is just a guess...i'm going to say that the x position is "0" for easiness sake. BUT the gba screen 9x 240x160, divide that by 8...30x20, we know that the textbox takes up 4 "rows" in a tilemap, so take away four from our 20. 30x16= 480. So, in tilemap terms, the position (notice the lack of x/y specifier) is 480. so yea....there isn't really an x/y co-ordinate so to speak, if there was though, it would be 0x16 (not hex,but like XxY) no, this is not for certain, like i said, just a guess.

hashtag
January 7th, 2010, 06:35 AM
I've managed to accidentally move my textbox into the top left corner. :)

~Teh Panda~
January 7th, 2010, 07:45 AM
well...this is just a guess...i'm going to say that the x position is "0" for easiness sake. BUT the gba screen 9x 240x160, divide that by 8...30x20, we know that the textbox takes up 4 "rows" in a tilemap, so take away four from our 20. 30x16= 480. So, in tilemap terms, the position (notice the lack of x/y specifier) is 480. so yea....there isn't really an x/y co-ordinate so to speak, if there was though, it would be 0x16 (not hex,but like XxY) no, this is not for certain, like i said, just a guess.

Wow I completely forgot it must be in tilemap form as in Tilemolester they just use the simple amount of tiles etc. But still that must mean we could find that? ;P

I've managed to accidentally move my textbox into the top left corner. :)

Ooh ooh, did all the text still work though? Since my theory is the text has different data just telling where it places it on the screen no matter where the text box may be.

hashtag
January 7th, 2010, 07:46 AM
Here's a screenshot of the aforementioned problem. http://i46.tinypic.com/2nq7hat.png

Full Metal
January 7th, 2010, 09:42 AM
care to share how u did that --or fixed it-- ?
and panda....since the text and textbox are on the same pallette, plus going off the screenshot that doc gave us, i would expect to find that the text is put onto the screen relative to the textbox.

~Teh Panda~
January 7th, 2010, 03:48 PM
Here's a screenshot of the aforementioned problem. http://i46.tinypic.com/2nq7hat.png

Looks like a nice start. I would also wish to know how you did this

care to share how u did that --or fixed it-- ?
and panda....since the text and textbox are on the same pallette, plus going off the screenshot that doc gave us, i would expect to find that the text is put onto the screen relative to the textbox.

You are right probably. I am interested more in Ruby with this so I believe Firered uses this method you state. Not sure of ruby though (Probably same xD)

hashtag
January 7th, 2010, 03:50 PM
I was messing around a lot in a hex editor and tile molester. But, I guess I can try to replicate it.

~Teh Panda~
January 7th, 2010, 03:52 PM
I was messing around a lot in a hex editor and tile molester. But, I guess I can try to replicate it.

Ahhh, well in Ruby they structure a lot similarly so I bet it wouldn't be much different. But did something screw up in the pallet on yours or did you just not edit it yet?

hashtag
January 7th, 2010, 04:05 PM
I hadn't edited it yet. :P

~Teh Panda~
January 7th, 2010, 04:09 PM
I hadn't edited it yet. :P

Ooh, that splains it then :). So looks pretty cool then. I suppose you would figure out how to move the Oak over also and his lil stand :).

interdpth
January 7th, 2010, 04:30 PM
IIRC the messagebox gets set to memory address 2001840 then throw into 0x600fb80

I decided to eat dinner after I found that out, i'm sure further enlightment will follow

~Teh Panda~
January 7th, 2010, 08:59 PM
IIRC the messagebox gets set to memory address 2001840 then throw into 0x600fb80

I decided to eat dinner after I found that out, i'm sure further enlightment will follow

Wow sounds cool yet I am not yet capable of making this all out hahaha. I still am learning more advanced stuff but thanks for the memory address. Ill tweak around a bit with that! Maybe I can ask Zodiac some more about this now.

By the way is this Ruby? Or Firered and that such.

davidthefat
January 8th, 2010, 02:42 PM
So Im not exactly an ASM genius (in fact IDK any ASM) but I would assume that you can make variables and plug them in like as a more traditional language. So if you find the location of the coordinates, you can potentially change it in-game via the d pad. You can create a function that takes in the input of the d pad and then replacing the old coordinates with the new one, but IDK what that would do... its pointless, a text box you can move... LOL

~Teh Panda~
January 8th, 2010, 06:09 PM
So Im not exactly an ASM genius (in fact IDK any ASM) but I would assume that you can make variables and plug them in like as a more traditional language. So if you find the location of the coordinates, you can potentially change it in-game via the d pad. You can create a function that takes in the input of the d pad and then replacing the old coordinates with the new one, but IDK what that would do... its pointless, a text box you can move... LOL

Well if this theory was possible then I assume you could implement a feature with ASM to the settings where you can place the textbox where ever you would like around the screen

Tropical Sunlight
January 11th, 2010, 07:59 AM
So it would be posssible to have a textbox on top of the screen?
What else will they make :)

Darthatron
January 20th, 2010, 07:49 PM
Is anyone working on this? If not I wouldn't mind doing so.

~Teh Panda~
January 20th, 2010, 08:44 PM
Is anyone working on this? If not I wouldn't mind doing so.

Go for it Darcy! *But on Ruby first :3*

Shiny Quagsire
November 23rd, 2010, 03:07 PM
Tee Hee! I Figured it out on fire red, and I'll try and find it on ruby.

The textbox data is stored at 0x020204b4. The amounts all relate to the amount of 8x8 squares. It goes in this format:

byte: Unknown
byte: Text X position. Textbox follows
byte: Text Y position. Textbox follows
byte: Text X amount. Textbox follows.
byte: Text Y amount. Textbox becomes cut open. Never modify.
byte: Text properties (I have yet to figure this out, but it changes font, background, ect.
6 bytes: unknown, and havn't found any functions relating to them.

Try opening VBA's memory viewer and fiddling with the values. Your text box will be at your command :)

knizz
November 23rd, 2010, 03:32 PM
This offset doesn't seem to work. Can you give me offsets of code associated with it?

Team Fail
November 23rd, 2010, 03:38 PM
Tee Hee! I Figured it out on fire red, and I'll try and find it on ruby.

The textbox data is stored at 0x020204b4. The amounts all relate to the amount of 8x8 squares. It goes in this format:

byte: Unknown
byte: Text X position. Textbox follows
byte: Text Y position. Textbox follows
byte: Text X amount. Textbox follows.
byte: Text Y amount. Textbox becomes cut open. Never modify.
byte: Text properties (I have yet to figure this out, but it changes font, background, ect.
6 bytes: unknown, and havn't found any functions relating to them.

Try opening VBA's memory viewer and fiddling with the values. Your text box will be at your command :)

This will be fun. Maybe I'll modify that for my hack. It'll look cool. Tee hee! :P

Shiny Quagsire
November 23rd, 2010, 03:41 PM
This offset doesn't seem to work. Can you give me offsets of code associated with it?

I've found it mostly around 08003014. It's also around 08004950, but other than that, there isn't much reference to it.

looper
January 15th, 2011, 01:22 PM
I tried it out, it works even with german ROMs, after trying, I found out, that the Data is refreshed when refreshing the Map.

So you can easy edit it with a levelscript on each Map, to set it for all Texts.

writebytetooffset 0x2 0x020204b5

will set the box to the top

Tropical Sunlight
January 16th, 2011, 12:14 AM
I tried it out, it works even with german ROMs, after trying, I found out, that the Data is refreshed when refreshing the Map.

So you can easy edit it with a levelscript on each Map, to set it for all Texts.

writebytetooffset 0x2 0x020204b5

will set the box to the top
And when the map is refreshed, it will come back down?
Does it work with all the textboxes? (normal, sign)

looper
January 16th, 2011, 01:02 AM
it works with all textboxes.

When the Map is refreshed(eg.Warp) the Position of the Textbox is normal again

hashtag
January 16th, 2011, 04:40 AM
I was thinking we could maybe get something cool going with this. My thoughts are to maybe move the textbox into the middle of the screen and use a fadescreen for cutscenes. But that's not just it, it'd also be cool if we could find a way for the textbox to disappear and just have the text on top of the fadescreen, y'know?

looper
January 16th, 2011, 05:06 AM
Do you mean like when you dont have any pokémon left?

I guess there is an routine for that, I'll look....

Does anyone know, how to replace Yes/No/Multiple Choice Boxes?

TheDarkShark
January 16th, 2011, 11:53 AM
Do you mean like when you dont have any pokémon left?

I guess there is an routine for that, I'll look....

Does anyone know, how to replace Yes/No/Multiple Choice Boxes?

yup. The Yes/No-Boxes can be changed with a Text Hack, IDK what else you could mean about it. For the multichoice boxes: There's a header - I think there's a tutorial about its lay-out. I'll add link later.

EDIT: Here it is: pokecommunity.com/ showthread.php?t=165939

hashtag
January 16th, 2011, 03:40 PM
Do you mean like when you dont have any pokémon left?

I guess there is an routine for that, I'll look....

Does anyone know, how to replace Yes/No/Multiple Choice Boxes?Here's one I made: http://thepokemonboard.com/showthread.php?386-Basic-Hex-Editing-Lesson-1

Lost Heart
January 16th, 2011, 05:51 PM
Wow, I love the discovery of the offset and stuff, I plan on using this! Thanks! :D

altariaking
January 18th, 2011, 06:01 AM
I was thinking we could maybe get something cool going with this. My thoughts are to maybe move the textbox into the middle of the screen and use a fadescreen for cutscenes. But that's not just it, it'd also be cool if we could find a way for the textbox to disappear and just have the text on top of the fadescreen, y'know?

This is pretty much what I was thinking. It happens when the player is whited out and has to go to the PC/back home, so I don't see why it shouldn't work.

Shiny Quagsire
January 18th, 2011, 07:14 AM
I was thinking we could maybe get something cool going with this. My thoughts are to maybe move the textbox into the middle of the screen and use a fadescreen for cutscenes. But that's not just it, it'd also be cool if we could find a way for the textbox to disappear and just have the text on top of the fadescreen, y'know?

I've hacked the textbox graphics once, so maybe it could check a variable, and if it's set, it will load a blank textbox graphic, and make it disappear. I'll have to find out where it's loaded again, which won't take long.

Derlo
January 18th, 2011, 08:40 AM
Even if you can delete the graphics from the textbox, it will be necessary to use a font that does not have a white background. because even without the textbox is still a white background where the letters appear.

see:
http://img94.imageshack.us/img94/3967/copyxo.png (http://img94.imageshack.us/i/copyxo.png/)

hashtag
January 18th, 2011, 08:58 AM
We weren't talking about deleting the textbox we're talking about having it 'disappear' for small moments in the game.

Derlo
January 18th, 2011, 04:46 PM
Sorry, it was only one way to show what I meant.
I haked the routine of the textbox to load any graphic I want, when I tried to just do the letters appear (not carrying any graph) which appeared in the image.

But seeing as well, I think the problem with this option in itself, is not the background of the letters. But the routine that carries the letters. That should carry them along to the background where they are written.
Because even increasing the textbox (vertically) these "lines" also increases.

If I get something I'll post here.

And sorry for the horrible english ...
google's fault.

NintendoBoyDX
January 18th, 2011, 07:53 PM
You could try taking a look at what goes on in the scripting command for emerald(emerald-only), "hidebox2" or the ruby/sapphire only "hidebox" command.

hashtag
January 19th, 2011, 01:06 PM
I saw a video of ShinyQuagsire's on Youtube which I believe he's going to post here soon and he's done it ;).

Shiny Quagsire
January 19th, 2011, 01:16 PM
I saw a video of ShinyQuagsire's on Youtube which I believe he's going to post here soon and he's done it ;).

Right as I uploaded it. XD

To insert the hack, compile this code:


@Place pointer to this routine at 0x150450
@Place the bytes '08 47' at 0x15044A
@Change the textbox offset and the variable offset to what you want.

.align 2
.thumb

main:
cmp r0, #0x0 @This is the normal textbox number.
bne normal @If signpost, leave value alone.
push {r0-r2}
ldr r0, var
bl call_var_load
cmp r0, #0x0
beq normalandpop
pop {r0-r2}
ldr r0, blackpal
b end
normalandpop:
pop {r0-r2}
normal:
ldr r1, normalpal
add r0, r0, r1
b end
end:
ldr r1, return
bx r1

call_var_load:
ldr r1, var_load
bx r1

.align 2

var_load: .word 0x0806E569
var: .word 0x00004052 @Change at will
normalpal: .word 0x08471DEC
blackpal: .word 0x08XXXXXX @Has to end in 0, 2, 4, 8, or C
return: .word 0x0815044D


or use the compiled version:

00 28 09 D1 07 B4 09 48 00 F0 0B F8 00 28 02 D0 07 BC 08 48 03 E0 07 BC 05 49 40 18 FF E7 06 49 08 47 01 49 08 47 C0 46 69 E5 06 08 XX XX 00 00 EC 1D 47 08 YY YY YY 08 4D 04 15 08


Replace the XX's with the fipped version of the variable, ex: 4052 = 52 40, and the YY's with a pointer to your black pallet.

The black pallet is up to you, but this is the one I use:

2E 53 00 00 FF 7F F7 5A FF 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Just paste that in a hex editor in an offset ending in 0, 2, 4, 8, or C.

In case you didn't see the header in the routine, place pointer to this routine at 0x150450 place the bytes '08 47' at 0x15044A.

80F9VsoIf1Y
If you have any problems, just ask and I'll try to fix them. ;)

looper
January 20th, 2011, 06:49 AM
okay..... I meant with the Choice boxes not the texts but the position

Shiny Quagsire
January 20th, 2011, 07:35 AM
okay..... I meant with the Choice boxes not the texts but the position

This can be done via script:

multichoice [xx] [yy] [zz] [aa]

xx: X co-ordinate
yy: Y co-ordinate
zz: Multi ID. Refer to Multi List
aa: Determines if B can cancel. 0x0 means B can cancel.

diegoisawesome
January 22nd, 2011, 07:00 AM
If you have any problems, just ask and I'll try to fix them. ;)
That looks cool and all, but wouldn't it just be easier to recreate or use the three-line textbox used when you fainted?

Spherical Ice
January 22nd, 2011, 07:02 AM
Absolutely not, this way unlocks so many more possibilities and the ability to make your own scenarios for blacking out while still maintaning the original that still occurs automatically when you lose a trainer battle. :D I'm definitely interested in this.

diegoisawesome
January 22nd, 2011, 07:14 AM
Absolutely not, this way unlocks so many more possibilities and the ability to make your own scenarios for blacking out while still maintaning the original that still occurs automatically when you lose a trainer battle. :D I'm definitely interested in this.
I didn't mean the original one, I meant making one that used the same code, but also having different text and different things happen after it, obviously.