News: 11 March 2016 - Forum Rules

Author Topic: Text Pointers: Script Extracting and Inserting  (Read 5104 times)

Bob Liu

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Text Pointers: Script Extracting and Inserting
« on: January 27, 2015, 04:35:08 pm »
It's been a long time since I've done anything related to this sort and my memory is really fuzzy. That said, I already know Cartographer and Atlas are the main ones used, but are there any which aren't command prompt and easy to use? Although I'll learn if I have to, but I'd like some help on that first. And I know I could search, but I prefer to hear from people directly on which to use. Anyway, what I want to do is extract the script from Neon Genesis Evangelion: Ayanami Raising Project on the Dreamcast and change the text pointers so I can add new text screens, since it runs off screen most of the time. Is that possible with Cartographer and Atlas or would other programs be needed for a Dreamcast game?

Anyway, I found where the games text is stored and which file with help from a friend, and it appears 100% fine when shifted to JIS.
https://www.mediafire.com/?a761izcaj7vwdw7

Here's also a few JP lines from the script at the start of the game, I'd really appreciate help with this. I've already translated the game on the DS, and recently, the Dreamcast community asked me to traverse that into the Dreamcast version so only extraction, insertion, and changing text pointers is necessary.
リツコ「お入りなさい」

ぼく「失礼します」

ぼく「お久しぶりです、赤木博士。元気そうで何よりです」

Pennywise

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 2450
  • Prepare thyself for holy judgment
    • View Profile
    • Yojimbo's Translations
Re: Text Pointers: Script Extracting and Inserting
« Reply #1 on: January 27, 2015, 04:50:42 pm »
You do realize that command line programs are incredibly easy to use when all you have to do is make a batch file to run them? In fact, Cartographer comes with a batch file IIRC.

Bob Liu

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #2 on: January 28, 2015, 10:50:28 am »
You do realize that command line programs are incredibly easy to use when all you have to do is make a batch file to run them? In fact, Cartographer comes with a batch file IIRC.
Yeah, but I'd just like some help on setting up this extract and insert stuff. Anyhow, I dumped FF1 as a test since it was already in the batch and it worked. Yay! Although I'm unsure about some of the setup when switching to another game. Notably the script start and pointer table start, how would I compute something like this $28010 for another game? Also, care to explain pointer table start, what does that mean?

Code: [Select]
#GAME NAME: Nekketsu! Beach Volley dayo Kunio-kun (GB)

#BLOCK NAME: Dialogue Block (RAW)
#TYPE: NORMAL
#METHOD: RAW
#SCRIPT START: $28210
#SCRIPT STOP: $2B496
#TABLE: Beach_Volleyball.tbl
#COMMENTS: Yes //start first line with //
#END BLOCK //remainder of comment placement
//is handled by control codes

#BLOCK NAME: Dialogue Block (POINTER_RELATIVE)
#TYPE: NORMAL
#METHOD: POINTER_RELATIVE
#POINTER ENDIAN: LITTLE
#POINTER TABLE START: $28010
#POINTER TABLE STOP: $28210
#POINTER SIZE: $02
#POINTER SPACE: $00
#ATLAS PTRS: Yes
#BASE POINTER: $20010 //add $20010 to each pointer to get
#TABLE: Beach_Volleyball.tbl //the string address
#COMMENTS: Yes
#END BLOCK

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #3 on: January 28, 2015, 11:29:57 am »
You don't compute the addresses, you dig them out of the code.

Bob Liu

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #4 on: January 28, 2015, 04:00:22 pm »
You don't compute the addresses, you dig them out of the code.
Then how do I do that? I think I remember seeing a program before about doing that but I can't remember it's name. Anyhow, does this way of changing text pointers work with more than just retro systems, such as the Dreamcast and the like?

Klarth

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #5 on: January 28, 2015, 05:12:33 pm »
Then how do I do that? I think I remember seeing a program before about doing that but I can't remember it's name. Anyhow, does this way of changing text pointers work with more than just retro systems, such as the Dreamcast and the like?
A relative search program like Monkey Moore will help you find both the location of text in the game file as well as the text encoding so you can make a table. Atlas can calculate the majority of pointers with a bit of ingenuity, regardless of system.

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #6 on: January 29, 2015, 01:42:36 am »
To find the addresses you have to look at the assembly code. Ideally it should just be a constant that you can search for once you know the value. But sometimes you need to take on the tough challenge of reverse engineering the code.

Bob Liu

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #7 on: January 30, 2015, 10:47:21 am »
A relative search program like Monkey Moore will help you find both the location of text in the game file as well as the text encoding so you can make a table. Atlas can calculate the majority of pointers with a bit of ingenuity, regardless of system.
Well, I don't exactly need a table (for the Dreamcast game at least, and I already have one for the GBA game) since the text displays fully when shifted to JIS, but I guess I'll need one for using Atlas and Cartographer. I'll try out this Monkey Moore and see if it will create a table of sorts from it. Also, isn't Atlas the importer? How would that calculate the pointers if you have to change them first in the script dump using Cartographer? Or at least I think that's how it's done.

Seihen

  • Sr. Member
  • ****
  • Posts: 402
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #8 on: January 30, 2015, 05:21:03 pm »
Well, I don't exactly need a table (for the Dreamcast game at least, and I already have one for the GBA game) since the text displays fully when shifted to JIS, but I guess I'll need one for using Atlas and Cartographer. I'll try out this Monkey Moore and see if it will create a table of sorts from it. Also, isn't Atlas the importer? How would that calculate the pointers if you have to change them first in the script dump using Cartographer? Or at least I think that's how it's done.

This sounds like it calls for a custom inserter, since it's just using straight-up Shift-JIS (the name of the encoding itself is Shift-JIS, or SJIS, not called "shifting to JIS"). But I believe that somewhere here in the tools is a standard Shift-JIS encoding table file, so you might want to use that? If not here, I know online that there are tables with all the characters and their hex encodings, so you can make one that way.

As for the Cartographer issue, I'm not sure I understand. Dumping data is a read-only procedure (since all you're doing is getting the data out of the original file), and shouldn't ever be modifying anything. In that case, you would have to provide Cartographer with pointers to find the text to dump, but by no means should it be modifying them. Unless there's something I'm missing.

Bob Liu

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Text Pointers: Script Extracting and Inserting
« Reply #9 on: January 31, 2015, 10:53:23 am »
This sounds like it calls for a custom inserter, since it's just using straight-up Shift-JIS (the name of the encoding itself is Shift-JIS, or SJIS, not called "shifting to JIS"). But I believe that somewhere here in the tools is a standard Shift-JIS encoding table file, so you might want to use that? If not here, I know online that there are tables with all the characters and their hex encodings, so you can make one that way.

As for the Cartographer issue, I'm not sure I understand. Dumping data is a read-only procedure (since all you're doing is getting the data out of the original file), and shouldn't ever be modifying anything. In that case, you would have to provide Cartographer with pointers to find the text to dump, but by no means should it be modifying them. Unless there's something I'm missing.
Well, I need to change the pointers because the game refuses to load new screens of text when I enter the hex 0D (0A is line break) for it to do so, as it currently runs off screen and also the text box, or at least I hope changing the pointers will fix that. Anyhow, I found the Shift-JIS table, but as a review says, there are a few incorrect Kanji, and I'm unsure which Kanji those specifically are
http://www.romhacking.net/documents/179/