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

Author Topic: Dragon Ball Z: The Legacy of Goku II - compressed text  (Read 3753 times)

ikskoks

  • Jr. Member
  • **
  • Posts: 22
  • http://ikskoks.pl/
    • View Profile
    • ikskoks.pl
Dragon Ball Z: The Legacy of Goku II - compressed text
« on: June 22, 2013, 06:33:32 am »
Hey ^^
I have troubles with editing texts in Dragon Ball Z: The Legacy of Goku II.
I think it is compressed. Is there any way to decompress it and edit?
Please help ;)

Here an example dialog:

2 ,,GOKU: Oh, hi, Gohan" I CAN EDIT
2a ,,GOHAN: Dad! Is it really you? " I CAN EDIT
2b ,, Of course it is!" I CAN EDIT
2c ,,Dad! it really is you! I can't belive you're back."  I CAN'T EDIT
2d ,, I missed you so much!"  I CAN'T EDIT
2e ,,I missed you too,son." I CAN EDIT
2f ,, What happened up there on Namek, dad?"  I CAN'T EDIT
2g ,, What happened ..."  I CAN'T EDIT
2h ,,..."
2i ,,You can tell..."  I CAN EDIT



FAST6191

  • Hero Member
  • *****
  • Posts: 3013
    • View Profile
Re: Dragon Ball Z: The Legacy of Goku II - compressed text
« Reply #1 on: June 22, 2013, 09:33:56 am »
Before going too far into this do you have the pointer format? (the looks of things the pointers at the end of each section). I see no obvious compressions (LZ usually gracefully degrades and huffman tends to still be kind of half readable as well) and if there is one covering the whole text it is extremely poorly implemented so inability to edit things here could just as easily be pointer related issues. That said I had a quick look and it is a fairly interesting affair as it seems fairly resilient, to respond to start and stop markers and did not run together/in game order. Also sections that started out in ASCII or something close to it do seem to vanish into the ether before they are done (the opening sixteen years stuff being early in the game and what I shall be looking at here).
Sections following the last readable section do not seem to compress that well, do not appear as an alternate encoding (the usual things like distribution, double letters and punctuation do not get me that far) but they have pointers.
The raw ascii of the missing section also appeared in my memory dump at the appropriate time.
Sticking with the opening scene at 0202F134 in memory (about 3 quarters of the way through the WRAM) up popped the "Two Androids with strength beyond comprehension appeared from out of nowhere" line where before the text which did appear in the ROM did not appear in the memory dump (normal enough on the GBA)
Curiosity obtained, time to fire up VBA-SDL-H
BPW 0202F134 100 (breakpoint on write to that address for that length after the address). I would suggest going through the opening screen first and starting a game or at least getting to the point where the "sixteen years" part should be.
After aggravating my wrist pressing c and enter several hundred times we get started, after the opening what should appear in R1 but 086F0B60 and with the following being 086F0B64
Continuing a few times I decided to read the 0202F134 area (mb 0202F134 is the command) and lo and behold the decoded text is appearing there byte by byte on average about once every 20 instructions (8 bit writes to the WRAM are the normal state of affairs) -- all from a THUMB loop housed in the 03000000 area work ram. I am cooking in front of my machine right now so I have not had time to decode the loop fully. It seems fairly processor intensive -- of those 20 instructions not so many appear to be for the usual compression counters and general upkeep with several actual operations going on (most compression is counter check/upkeep, read, grab, stick in memory where this is almost closer to obfuscation/decoding).

If I have time later I will go further but you were right in your assessment that there was something odd going on.


ikskoks

  • Jr. Member
  • **
  • Posts: 22
  • http://ikskoks.pl/
    • View Profile
    • ikskoks.pl
Re: Dragon Ball Z: The Legacy of Goku II - compressed text
« Reply #2 on: June 25, 2013, 11:00:46 am »
Hey. Thank you for help ^^

I don't have pointer format unfortunately.