....., I forgot it has a dependency on the log; that tells it where everything actually saved. As for that error, the log format changed a bit (It pretty much copies the IDX entry + a file-name to where it saved for each file). Attached current extractor (difference=saves new log format) and a current log file from my end. (Gotta like Xemnas :p) Edit: --Removed old program, see newer post--
No problem. Well, I got this into a workable state now, so this will be the easiest way: I attached a version of my file replacer to this post. It can't replace compressed files at the moment (it will complain), or files that are too much bigger then their originals, but works perfectly for the font. The usage for this is: Put a copy (that way if the program does mess up, you still have an ISO) of the KH1 iso in the same folder as it, name it "kh.iso". Make a folder called "export", and in that folder another called "menu"; put sysfont.bin in there. Run the program, it will tell you to make sure to have a back-up and press enter, you should see something like this: Code: DEBUG: Size=3540123648 found boot2 Sector: 282 found IDX Sector: 2450 Hash to check: Now you can type either the hash or name of the file to replace. For us, "menu/sysfont.bin" will work. It will tell you filesize is the same, that means it has written it to the ISO. Then press enter twice to exit (it will complain about bad hash, ignore). The ISO should be patched now. Alternative hex-editor way: Spoiler I'm going to use wxHexEditor (v0.21beta). Open the ISO in the hex editor, and open the sysfont.bin in another hex editor window. In the font.bin editor, click on the hex view and press Ctrl+A to select everything. Press Ctrl+C to copy. In the ISO editor, click in the hex view, press Ctrl+G and enter 384901120 (Decimal From beginning) and click Go. Then press Ctrl+V to paste. It should overwrite the data (font) that was there. Now just Click File->Save, and close both windows. Edit: --Removed old program, see newer post--
DEBUG: Size=3540123648 found boot2 Sector: 282 found IDX Sector: 2450 Hash to check:
Ok, so I believe I've finished the font. I'm going to start trying to get a compression function now for re-inserting files (Ohh boy...). Attached the sysfont.bin + a character map. By the way, sysfont.bin is stored non-compressed, you can hex edit it in. It's at offset: 384,901,120 bytes on my ISO. Edit: Removed horribly outdated attachment.
Almost got the font rebuilt. Just a few oddities left in it. Unfortunately, the game just cuts some stuff off. It's probably somewhere in "title.2ld", but I have no idea how to read that file... I can try taking a look at it later when I have time though. Someone else working on KH2FM, nice. ^^
Crap, this couldn't be easy. :( So apparently, the game doesn't use the full "slot" for every character. For example, the slot that used to be a semicolon is VERY slim. Now the letter "m" wants to be there, and is getting cut off. I'm going to have to remap everything. I'm probably just going to move all the punctuation into the same slot it was in the FM font, and all Latin characters into one of the full-width kanji slots. This will break compatibility with... pretty much everything so far, but the font won't look horrible then.
Of course. I'll release the font, the new file-replacing tool (when I get the compression), and an updated extractor-tool.
I can't wait either, been years since I've actually even played the first properly; and I'm glad to have a part in this project. ^^ Ok, so I got the English font aligned to the proper grid, and all seems well. View attachment 35839 (Memory editing, no idea what file this is in.) I kept everything in the same order as the normal English font as best as I could, so if we're lucky we could just copy+paste most text strings from Eng KH1. After I get compression working for the main IMG file, I'll port a string mapper I made for KH2 over (It will be similar to this).
Well, the game took it. I'm getting mis-aligned font issues, but nothing's crashing. I'll see if I can align the font today. BTW, if there are any symbols you want (such as for a name) in the FM font but not in the English one, tell me; I'll add it in.
I don't think those are, Square tends to be pretty decent about reusing resources that are (always) the same. As for text, my guess is they're in the per-world .img files. This tool doesn't insert files yet, but I plan on making one to do that soon. Edit 1: Ha-ha! I can edit the font! ^^ My tools for working with the system font in KH2FM work perfectly on this game's sysfont.bin. For the people translating, should the English KH1 font work fine? Final Mix: View attachment 35836 English: View attachment 35837 I'm assuming one side is for menus and the other is for subtitles (KH2 worked this way); they're also slightly different if you overlay the sides in an image editor.
When running that cheat code, yep. Basically I hooked the game's hash function, so whenever it tries to hash a file name, I print that name then let it hash. My hook's probably not in a very good spot of memory, but that's another story.... (And it's just a temporary code for testing, so doesn't matter much.) That also means if a file is only loaded once in the game, and can't be done at will (riku\ansem battle, turning into a heartless, Disney Castle cutscenes, etc), I have to make a new game and play through it. (Wish this game had a theater mode... lol) --- Also, I haven't figured out if the game actually uses kingdom.img atm. It's a 1.11 GB file, and I know it's what's installed on the PS2 HDD if you have a capable unit. But I'm not sure if the game uses it from disk too, as when booting to title screen it hashes the name twice. I'll probably NULL out the whole file and try playing, see what it does, sometime. :p
Well, I'll post what I have at the moment. This tool is capable of extracting and decompressing all files in the IDX list, with names if they're known. I even got some of the files used by PSBBN, such as this: View attachment 35834 (Can't tell if there's more, it gives me some error in Japanese ) There's still about 600 @noname files; Still accepting help with this! (See spoiler at http://kh-vids.net/threads/kingdom-...ure-thinking-sorry.121896/page-8#post-4044590) Edit: --Removed old program, see newer post--
Nah, I find this fun. ^^ It's like doing a puzzle: Fun, but if you stare at it for too long you lock yourself up. Gotta keep it varied. As for progress, I got a partial dumper working. It can extract all files in the IDX, and has support for getting the original name from a database given a hash (this is where the cheat above comes in; I use it to make the database). Working on decompression right now, as it is it just dumps the compressed data. I have no idea how I'm going to make something to rebuild this though, I can't find how the game loads it. I might get lucky, and the method I'm using work, but I doubt it.
Well, I have a few delays at the moment. First is I don't have the decompression function. If it's in Farlo's or yaz0r's program (I think I saw it in one), I can port it over. If it's in neither, I can try to find it in the KH1 ELF itself, but that will take much longer to port. Second is filenames. KH1 stores names similarly to KH2: it hashes the names then accesses them via that hash (or number). Unless we want a ton of "5479f2de.bin"s, we need the original names... --- And I have a way to get the names now, the only major pitfalls is that it only works in PCSX2 and that the game has to actually load the file; but this should be able to get all the names. Spoiler If you want to help with filenames, you need to run the game with EE console on and this cheat. "Misc->Show Console" to show the console, and "Sources->EE Console" in that window to make it log what we need. The cheat to run is this: Code: patch=1,EE,00100010,word,08040044 patch=1,EE,00100018,word,27bdfff0 patch=1,EE,0010001c,word,ffbf0000 patch=1,EE,00100020,word,ffa40008 patch=1,EE,00100024,word,64850000 patch=1,EE,00100028,word,3c040049 patch=1,EE,0010002c,word,0c094092 patch=1,EE,00100030,word,6484fe18 patch=1,EE,00100034,word,dfbf0000 patch=1,EE,00100038,word,dfa40008 patch=1,EE,0010003c,word,27bd0010 patch=1,EE,00100040,word,080944b1 patch=1,EE,00100044,word,0080802d patch=1,EE,00120104,word,0c040006 The console will spam "can't open file *" whenever it loads something; that's just my code, it is loading perfectly fine. And when you're done playing, there should be a file called "emuLog.txt" in the logs folder. That's what I need; PM or something. I'm going to start on the decompression function now, after a break (took me hours to find somewhere to hook that didn't crash the game). ;)
patch=1,EE,00100010,word,08040044 patch=1,EE,00100018,word,27bdfff0 patch=1,EE,0010001c,word,ffbf0000 patch=1,EE,00100020,word,ffa40008 patch=1,EE,00100024,word,64850000 patch=1,EE,00100028,word,3c040049 patch=1,EE,0010002c,word,0c094092 patch=1,EE,00100030,word,6484fe18 patch=1,EE,00100034,word,dfbf0000 patch=1,EE,00100038,word,dfa40008 patch=1,EE,0010003c,word,27bd0010 patch=1,EE,00100040,word,080944b1 patch=1,EE,00100044,word,0080802d patch=1,EE,00120104,word,0c040006
Well, in that case, I'll release the code. Disable Re:CoM check in theater: Code: 21f1c564 087c7176 or Code: patch=1,EE,01f1c564,word,087c7176 A warning about this: This code modifies function code in a dynamically loaded ELF file. This means it can (and does) interfere with other dynamic ELFs (they load to the same place in memory afaik); In particular, this affects prerecorded FMVs, shops, and gummi-ship stuff. I have confirmed bad opcodes and crashes using this code in Assault of the Dreadnought, and bad memory reads in the opening FMV (though it still plays). So basically, only use this code when you're just watching the videos. Edit a long time later: I fixed the code to not crash other things, so you should always be able to use this code. So, so use this instead of the above one! Code: // Enable JAP Theater w\o Re:CoM patch=1,EE,E00164b0,extended,01f18014 patch=1,EE,21f1c564,extended,087c7176
21f1c564 087c7176
patch=1,EE,01f1c564,word,087c7176
// Enable JAP Theater w\o Re:CoM patch=1,EE,E00164b0,extended,01f18014 patch=1,EE,21f1c564,extended,087c7176
Looking at the few extractors that there are out there, I can tell the game compresses some files. That would be why you can't find them. I'm going to try to make my own extractor, but I won't have a good tool to put it back together for a bit (I'm not good at making compression functions, never-mind that the file is hidden in the ISO...). But this will be able to extract all the files, at least. As for the font, I'll try to look at that later too.
Well, I'll help if I can. From what I've read, Hidden Smithery can hex-edit the ISO to change text, but that's it. Is that right? I also know farlo and yaz0r made extractors for the game; do we know if they get all the files? Depending on how similar the file formats in the game are, I might be able to get some of my KH2FM tools to work on it. Also, because I saw it mentioned earlier in this thread, I can change text (and images, and some others...) in KH2FM without string length limits. If anyone's interested, I can pull out the strings to excel to fix them. (I don't want to hijack this thread for that; PM or something.)
I have a question for whoever can answer, if you don't mind. So I know KH2FM uses clear data from Re:CoM (Jap version) to unlock more features, but exactly what features? Is it only the Japanese voices in theater mode? I'm asking as I'm trying to make a patch to remove the need for Re:CoM data. At the moment, I have the Japanese theater mode working without Re:CoM, but if there's other things I'll try for them too. Thanks in advanced. ^^