-
Notifications
You must be signed in to change notification settings - Fork 44
/
NS_01002BE0118AE000_OZMAFIA!!_vivace.js
56 lines (44 loc) · 1.32 KB
/
NS_01002BE0118AE000_OZMAFIA!!_vivace.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// ==UserScript==
// @name [01002BE0118AE000] OZMAFIA!! -vivace-
// @version 1.0.1
// @author Mansive
// @description Yuzu/Sudachi, Ryujinx
// * Poni-Pachet
// * Dramatic Create
// ==/UserScript==
const gameVer = "1.0.1";
const { setHook } = require("./libYuzu.js");
const mainHandler = trans.send(handler, "200+");
const choiceHandler = trans.send(handler2, "200+");
setHook(
{
"1.0.1": {
[0x80058544 - 0x80004000]: mainHandler.bind_(null, 1, "text"),
[0x8005b1f4 - 0x80004000]: choiceHandler.bind_(null, 0, "choice"),
},
}[(globalThis.gameVer = globalThis.gameVer ?? gameVer)]
);
let previous = "";
function handler(regs, index, hookname) {
const address = regs[index].value;
console.log("onEnter: " + hookname);
// console.log(hexdump(address, { header: false, ansi: false, length: 0x50 }));
const s = address.readShiftJisString().replace(/\u{005E}/gu, "");
return s;
}
function handler2(regs, index, hookname) {
const address = regs[index].value;
const s = address.readShiftJisString();
// similar to togainu no chi
if (s.startsWith("_SELZ") === true) {
console.log("attempt: " + hookname);
return s.split(");", 1).at(0).split(",").slice(2).join("\r\n");
}
}
trans.replace((s) => {
if (s === previous) {
return null;
}
previous = s;
return s;
});