-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# kh-savefileconverter.github.io | ||
A simple savefile converter that can convert EGS savefiles for Kingdom Hearts to Steam and vice-versa | ||
|
||
Initial draft and code done by ChatGPT because this was just a "what if lol" idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
function copyHexOffsets() { | ||
const fileInput1 = document.getElementById('file1').files[0]; | ||
const fileInput2 = document.getElementById('file2').files[0]; | ||
|
||
if (!fileInput1 || !fileInput2) { | ||
alert("Please select two files."); | ||
return; | ||
} | ||
|
||
const reader1 = new FileReader(); | ||
const reader2 = new FileReader(); | ||
|
||
reader1.onload = function (e1) { | ||
const arrayBuffer1 = e1.target.result; | ||
const uint8Array1 = new Uint8Array(arrayBuffer1); | ||
|
||
reader2.onload = function (e2) { | ||
const arrayBuffer2 = e2.target.result; | ||
const uint8Array2 = new Uint8Array(arrayBuffer2); | ||
|
||
// Copy offsets from 00000000 to 00000150 | ||
for (let i = 0; i <= 0x150; i++) { | ||
uint8Array1[i] = uint8Array2[i]; | ||
} | ||
|
||
// Create new file | ||
const blob1 = new Blob([uint8Array1], { type: 'application/octet-stream' }); | ||
|
||
const downloadLink1 = document.getElementById('download1'); | ||
downloadLink1.href = URL.createObjectURL(blob1); | ||
downloadLink1.download = fileInput2.name; | ||
downloadLink1.style.display = 'block'; | ||
}; | ||
|
||
reader2.readAsArrayBuffer(fileInput2); | ||
}; | ||
|
||
reader1.readAsArrayBuffer(fileInput1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Kingdom Hearts 1.5+2.5 + DDD Savefile Converter</title> | ||
</head> | ||
<body> | ||
<h1>Kingdom Hearts 1.5+2.5 + DDD Savefile Converter</h1> | ||
<h2>To use this tool, you first must create an empty savefile to convert to (so an empty KHIIFM_WW.png if you want to convert to Steam or an empty KHIIFM.png if you want to convert to Epic Games) | ||
<h3>Convert from (put your original savefile here):</h3> | ||
<input type="file" id="file1" accept=".png"> | ||
<h3>Convert to (put your empty savefile you want to play with here):</h3> | ||
<input type="file" id="file2" accept=".png"> | ||
<br><br> | ||
<button onclick="copyHexOffsets()">Convert</button> | ||
<br><br> | ||
<a id="download1" style="display: none;">Download converted savefile</a> | ||
|
||
<script src="copyHexOffsets.js"></script> | ||
</body> | ||
</html> |