Author Topic: Need help finding tab spacing data.  (Read 6331 times)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Need help finding tab spacing data.
« on: 2011-05-28 06:36:46 »
Apparently the tabs in dialogue are created from the space value.  A normal tab is 4 spaces (E1 function), and a selection tab is 10 spaces (E0 function).

I have tried to locate in the executable the whereabouts of the code that decides whether it is 4 or 10 spaces etc.  I need to be able to change this so I can directly affect tab spacing.

Anyone have any idea where it is?  There has to be a place in code that looks up the data in window.bin for the space value and then does the math on it.  Ive tried tracing what accesses the space value but came up with nothing.

Any ideas?


dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Need help finding tab spacing data.
« Reply #1 on: 2011-05-28 14:59:40 »
Can't be sure, because I can't run FF7, but it should be:
Here for E0:
Code: [Select]
00631CF4  />  0FBF55 08     MOVSX EDX,WORD PTR SS:[EBP+8]            ; // E0
(…)
00631D25  |.  83F8 0A       |CMP EAX,0A
And here for E1:
Code: [Select]
00631C5A  />  0FBF45 08     MOVSX EAX,WORD PTR SS:[EBP+8]            ; // E1
(…)
00631C8B  |.  83F9 04       |CMP ECX,4

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Need help finding tab spacing data.
« Reply #2 on: 2011-05-29 16:08:29 »
I will check that out.  Thanks a lot man!

edit:

Yup.  That's the one!  Many thanks.  Seems I used the wrong area to find the code which accesses e0.  I should have been looking at the area around 05a31700.

1 further question:

Do you have any idea why the code for E0 is duplicated?  This same code seems to appear in 2 different areas.  The dialogue cursor position does too.  Possibly 2 different areas for the options depending on particular dialogue boxes?  I am not sure.

In the executable at
0011fae9

and  00231127

I couldn't find the dupe in memory though?  Hmm

The dialogue cursor is at 0063137B with dupe data at 0076967b



« Last Edit: 2011-05-29 16:50:17 by DLPB »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Need help finding tab spacing data.
« Reply #3 on: 2011-05-30 15:11:33 »
Ok, so:
Code: [Select]
0011fae9 + 0x400C00 = 0x5206E9
00231127 + 0x400C00 = 0x631D27
The second address is the spacing for E0 we already know, and the first one holds this line:
Code: [Select]
005206E7  |.  83F8 0A       |CMP EAX,0A                              ; // 0x50No doubt, that loop executes 10 times, but there is a comparison before the loop - something is compared with 0x50. How did you connect it to E0?

As for the cursor - the second address fits with the worldmap part of the ff7.exe (before the chocobo stuff) - you might want to check that.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Need help finding tab spacing data.
« Reply #4 on: 2011-05-30 15:19:44 »
I see... so the second part is probably the world map dialogue boxes, like when you dismount from Chocobo (assuming that they left that in... I can't remember if they removed options on the world map from final game).

That makes sense.  As for the first part... I checked the code before and after the 0a, and it all seemed to match.  Coincidence... possibly..  but it was a lot of identical code.

You seem to have a good grasp of the exe, can I take it you have some documentation somewhere which would help us all?  Like which parts of the exe are used for certain areas of the game?
« Last Edit: 2011-05-30 15:24:55 by DLPB »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Need help finding tab spacing data.
« Reply #5 on: 2011-05-30 15:38:06 »
Documentation... No, not really... I used to have some, but it was all on paper. As for the parts in the exe - compiled code follows the original structure of the source code. If you make a list of every string referenced in the exe (most debuggers offer that) and look at texts like "Entering FRAME_INITIALIZE SWIRL", you'll get a good look at how it was put together.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Need help finding tab spacing data.
« Reply #6 on: 2011-05-30 15:44:15 »
i see ;) Well you have been a great help.  Thanks a lot!  I was looking for something like space address multiplied by 0a

Never thought it was a loop...

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Need help finding tab spacing data.
« Reply #7 on: 2011-05-30 15:54:24 »
Sure, no problem. Good luck reversing ;)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Need help finding tab spacing data.
« Reply #8 on: 2011-06-07 14:05:39 »
Spaced characters (opcode FEE9) any idea where this is used in the exe...? I did a little digging, perhaps I missed it.  This creates large spaces between characters in dialogue.

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Need help finding tab spacing data.
« Reply #9 on: 2011-06-07 17:00:45 »
Depends on what exactly you're after, but... here: 0x006328D3.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Need help finding tab spacing data.
« Reply #10 on: 2011-06-07 17:53:32 »
Yeah I looked at this code... but I thought there would be something simple to adjust the length of the spacing between the letters (make spacing smaller). 

Any ideas?

Or is it gonna take a little coding  8)

Failing being able to change the space size, eliminating the spaces altogether would help.
« Last Edit: 2011-06-08 11:22:40 by DLPB »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Need help finding tab spacing data.
« Reply #11 on: 2011-06-08 16:24:03 »
Ah, look at 0x006E731B then. If the lowest bit of 0x0DC3CD4 is set, extra spacing occurs.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Need help finding tab spacing data.
« Reply #12 on: 2011-06-08 18:02:59 »
Cheers!  Setting xor to 0 should fix that but also from there it was possible to find 6e7b07, which seems to be the spacing value.

Cheers again!

This is how it is looking now.  I also sorted out the useless original spacing issue with loveless.

« Last Edit: 2011-06-08 18:22:11 by DLPB »