News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Help to find PS2 Pointers and pointers table  (Read 834 times)

nokiajavi

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Help to find PS2 Pointers and pointers table
« on: June 17, 2021, 10:20:59 am »
Good morning everyone and thank you very much for your help,

I introduce myself first, I am nokiajavi and I have been translating the PS2 game Jade Cocoon 2 into Spanish for years.

From the beginning I tried to find the pointer table to be able to make the best possible translation, but I have not been successful in finding it, I have tried the formula that is used with other nes roms and others without success.

I think it is possible that the table of pointers is integrated in a single file, I put you in situation.

This game has mainly 2 files in which the game text and menus are located.

On the one hand there is the file SLES_507.35 that includes the texts of the user interface and the character table and on the other hand we have a file called CDDATA.000 that includes the images of the game and dialogues above all.

The SLES file is accompanied by 2 other files called SLES_5 ~ 1.XMA and SLES_5 ~ 2.XMA with extension .XMA, which is plain text, it is like a trace or something for the SLES file, I think it could indicate the pointers to that file.

Code: [Select]
00671CD8 00000007 .rodata @ 272 (modesel.c)
  00671CE0 00000002 .rodata @ 273 (modesel.c)
  00671CF0 0000001A .rodata @ 479 (m2Main.c)
  00671D10 00000017 .rodata @ 480 (m2Main.c)
  00671D30 00000017 .rodata @ 481 (m2Main.c)
  00671D50 00000016 .rodata @ 482 (m2Main.c)
  00671D70 00000016 .rodata @ 483 (m2Main.c)
  00671D90 0000001A .rodata @ 484 (m2Main.c)
  00671DB0 0000001A .rodata @ 485 (m2Main.c)
  00671DD0 0000001A .rodata @ 539 (m2Main.c)
  00671DF0 0000001A .rodata @ 540 (m2Main.c)
  00671E10 00000018 .rodata @ 541 (m2Main.c)
  00671E30 00000019 .rodata @ 542 (m2Main.c)
  00671E50 00000019 .rodata @ 543 (m2Main.c)

The first text that appears in the game is "New game", in the main menu, which I want to replace with "New game".
The first letter is at the offset: 5797544 = 0x5876A8 (HEX)
The last letter is at the offset: 5797551 = 0x5876AF (HEX)

I have tried applying the following formula:
Dialog pointer = (Position of the first character of the dialog)
- (header - from ROM if any) + (leave the
last four digits) + (group them in pairs) + (reverse them)

To try to find a pointer that points to the beginning or end of the text, but I don't know if there is a header here, nor the size that the pointer can occupy, 2, 3 or 4 bytes to apply the formula correctly.

SLES file fragment:


As for the CDDATA.000 file, the structure is a compressed file that includes images, textures, etc., in addition to the dialogs.

This file comes with another one called CDDATA.LOC, it is a binary or encoded file, and maybe it is to be able to unzip the file or maybe it has the pointer table of the entire CDDATA.000 file.

Likewise, the offset of the first word of the dialogues that appears in the game is: 129883904 = 7BDDF00 (HEX)
  the last of the first sentence: 129883908 = 7BDDF04 (HEX)

The separation with the following phrases is by groups of 00, the number of groups varies 12 or 15 or 8, it does not follow a pattern.

I put a fragment:


Let's see if you can tell me how I could try to find that table of pointers to be able to modify them and expand the amount of text that I can display.

Thank you very much, if you need any more information to help me, ask me.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7150
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Help to find PS2 Pointers and pointers table
« Reply #1 on: June 17, 2021, 06:03:21 pm »
Pointers are going to be different for every console.
Reading about NES pointers isn't going to help for PS2 games.

I would use a debugging feature in an emulator (if there is one for PS2 games), but that is an advanced way of solving the problem.
I don't know if there is a good method for beginners to use.
"My watch says 30 chickens" Google, 2018

nokiajavi

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Help to find PS2 Pointers and pointers table
« Reply #2 on: June 18, 2021, 01:59:22 am »
I also tried to debug with the ps2 emulator PCSX2, but I find it hard to entente the pointers the truth.

I'll try to try again, anyway if someone has translated any ps2 game, who has any idea of pointers on ps2, although I know that for each game it may be different, but at least have an idea of how or what to look for.

Thanks a lot

FAST6191

  • Hero Member
  • *****
  • Posts: 3168
    • View Profile
Re: Help to find PS2 Pointers and pointers table
« Reply #3 on: June 18, 2021, 09:35:32 am »
Yeah it could be file level, sector level (though probably not here), memory level (the game only caring once it lands in a fixed section of memory and operating from that assumption rather than location on disc or within sub file).

If they are not obvious (if you pulled apart the SLES file does it have any file names/extensions at the start that might help? Are there any numbers immediately before or after the text sections that change in similar amounts to the locations of new lines/sentence end/section end?) then playing with a debugger is probably where you will want to go.
If you know where the text is you want to find a means to figure out when it being read from the disc. Once there you can follow what happens in memory and how it chooses where to send its read commands to change things into graphics for the screen, part of which will be the pointers.

nokiajavi

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Help to find PS2 Pointers and pointers table
« Reply #4 on: June 19, 2021, 05:13:17 am »
Thank you very much, I will try to use the pcsx2 debug and the cheatengine to look for the memory address of the game text while emulating, to see if there is luck and logo to get something out.