Kanon English Patch - Need Help

Discussion in 'PSP - Hacking & Homebrew' started by Meni, Apr 12, 2015.

  1. Meni
    OP

    Meni Newbie

    Newcomer
    1
    3
    Apr 12, 2015
    United States
    [​IMG]
    Start menu translated.

    [​IMG]
    Log of previous read text.

    [​IMG]
    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.
     
    Hargrun, NicoBlogs and mdtank like this.
  2. michael cao

    michael cao Newbie

    Newcomer
    2
    0
    Mar 1, 2016
    United States
    How much progress have you made on this game?
     
  3. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    715
    402
    May 17, 2009
    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.