forked from 0xDC00/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNS_01004B301415A000_Final_Fantasy_4.js
33 lines (28 loc) · 1.08 KB
/
NS_01004B301415A000_Final_Fantasy_4.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
// ==UserScript==
// @name [01004B301415A000] Final Fantasy IV
// @version 1.0.2
// @author [Kalleo]
// @description Yuzu
// * Square Enix
// *
// ==/UserScript==
const gameVer = '1.0.2';
const { setHook } = require('./libYuzu.js');
const mainHandler = trans.send(handler, '200+');
setHook({
'1.0.2': {
[0x81e44bf4 - 0x80004000]: mainHandler.bind_(null, 0, "main text"), // Main text
[0x819f92c4 - 0x80004000]: mainHandler.bind_(null, 0, "rolling text"), // Rolling text
[0x81e2e798 - 0x80004000]: mainHandler.bind_(null, 0, "battle text"), // Battle text
[0x81b1e6a8 - 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;
}