Hacking Kanon English Patch - Need Help

Meni

New Member
OP
Newbie
Joined
Apr 12, 2015
Messages
1
Trophies
0
Age
37
XP
51
Country
United States
XbWIZuY.jpg

Start menu translated.

rkRQoEq.jpg

Log of previous read text.

RgzQqTR.jpg

8-bit text string. (16-bit looks the same)

Hi I have been porting the english script of the pc version of Kanon into the psp version. I have been able to edit images and replace text. I have got most of the technical problems solved except for one: the scripts are too big for the space provided in memory. There is only enough space for the longest script file at 134 Kb but each script almost doubles in size when I replace the japanese text with english. If the script is bigger than 134 Kb the script will overflow into code that is needed to run the game and will crash.

I have thought of two solutions: move where the script is saved into memory or change the strings of text from 16-bit to 8-bit.

I have tried option 2 first and was able to change the text strings to 8-bit. Changing the strings this way only increased the size of script files by roughly 10% of the original size of the scripts. After changing to 8-bit I was unable to advance the text to the next string. The buttons were responding when I chose new game but once I started into the new game I could only advance by setting the options to advance automatically. The buttons L and R were also unresponsive but I when I had the game set to advance automatically if the text was being written to the screen I could press R or O and it would complete the text string in the box but would not advance to the next string. Also changing the script to 8-bit caused the game to crash when i tried to save in game.

If I stick with the second option how do I check in ppsspp what happens after a button push? The game reuses a lot of code and I think I need to edit the value used for button presses. I also think the game crashes when i save because I did not change the part that saves to use 8-bit characters for the one sentence it saves as its title.

If the second option does not work how would I go to find a space around 400-500 Kb in memory that is free where I can put my edited scripts?

If anyone has any ideas on what I should do please help me out.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
733
Trophies
0
XP
957
Country
United States
I have never solved a problem like this before, but I would like to help.
I think try a memory dump and look for 500kB of empty space.
In PPSSPP:
Make sure you are using windowed mode (not fullscreen)
CTRL+D to open the debugger
R-click in memory view and choose dump...
Choose a RAM dump
Search it for 500kB of zeros.

Most PSP games can use 24MB of memory. That is 0x1800000 worth of bytes in hex. So search the first 0x1800000 of your dump only.
To convert to PSP virtual address, you add 0x8800000.
Some later games can use 56MB (on PSP 2000 and later models only) but I don't know how to convert older games to newer so they can use the extra memory.

How about this RAM searcher for Python 3: http://pastebin.com/MidhYEcW

I tried straight-up replacing text with ASCII and it didn't work. My test string was "abcdefghijklmnop"
ULJM05203_00001.jpg ULJM05203_00002.jpg

There is this function sceCtrlReadBufferPositive that gets hit when the game reads control inputs. It can be a clue when debugging as this is the point in the program that your control input gets read.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/Y9WKPRUjNQ4?si=raUf8jEiET8rmH2P