forked from 0xDC00/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNS_01000EA014150000_Final_Fantasy_1.js
34 lines (28 loc) · 1.07 KB
/
NS_01000EA014150000_Final_Fantasy_1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// ==UserScript==
// @name [01000EA014150000] Final Fantasy I
// @version 1.0.1
// @author [Kalleo]
// @description Yuzu
// * Square Enix
// *
// ==/UserScript==
const gameVer = '1.0.1';
const { setHook } = require('./libYuzu.js');
const mainHandler = trans.send(handler, '200+');
setHook({
'1.0.1': {
[0x81e88040 - 0x80004000]: mainHandler.bind_(null, 0, "main text"), // Main text
[0x81cae54c - 0x80004000]: mainHandler.bind_(null, 0, "intro text"), // Intro text
[0x81a3e494 - 0x80004000]: mainHandler.bind_(null, 0, "battle text"), // Battle text
[0x81952c28 - 0x80004000]: mainHandler.bind_(null, 0, "location"), // Location
}
}[globalThis.gameVer = globalThis.gameVer ?? gameVer]);
function handler(regs, index, hookname) {
const address = regs[index].value;
//console.log('onEnter:' + hookname);
/* processString */
//console.log(hexdump(address, { header: false, ansi: false, length: 0x50 }));
const len = address.add(0x10).readU32() * 2;
let s = address.add(0x14).readUtf16String(len);
return s;
}