Skip to content

Commit 6d112e7

Browse files
committed
Disable reading JIS strings since they cause errors
1 parent 403d624 commit 6d112e7

File tree

3 files changed

+22
-59
lines changed

3 files changed

+22
-59
lines changed

source/modules/games/GALE01-2.lua

+10-10
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,16 @@ game.memorymap[CSSDT_BUF_ADDR] = {
153153
[0x0C] = { type = "u8", name = "chatmsg.index" }, -- 1
154154
[0x0D] = { type = "u32", name = "vs.left_names" }, -- 4
155155
[0x11] = { type = "u32", name = "vs.right_names" }, -- 4
156-
[0x15] = { type = "string-jis", len = 31, name = "local_player.name", debug = true }, -- 31
157-
[0x34] = { type = "string-jis", len = 31, name = "players.1.name", debug = true }, -- 31
158-
[0x53] = { type = "string-jis", len = 31, name = "players.2.name", debug = true }, -- 31
159-
[0x72] = { type = "string-jis", len = 31, name = "players.3.name" }, -- 31
160-
[0x91] = { type = "string-jis", len = 31, name = "players.4.name" }, -- 31
161-
[0xB0] = { type = "string-jis", len = 31, name = "opponent.name" }, -- 31
162-
[0xCF] = { type = "string-jis", len = 10, name = "players.1.code", debug = true }, -- 10
163-
[0xD9] = { type = "string-jis", len = 10, name = "players.2.code", debug = true }, -- 10
164-
[0xE3] = { type = "string-jis", len = 10, name = "players.3.code" }, -- 10
165-
[0xED] = { type = "string-jis", len = 10, name = "players.4.code" }, -- 10
156+
-- [0x15] = { type = "string-jis", len = 31, name = "local_player.name", debug = true }, -- 31
157+
-- [0x34] = { type = "string-jis", len = 31, name = "players.1.name", debug = true }, -- 31
158+
-- [0x53] = { type = "string-jis", len = 31, name = "players.2.name", debug = true }, -- 31
159+
-- [0x72] = { type = "string-jis", len = 31, name = "players.3.name" }, -- 31
160+
-- [0x91] = { type = "string-jis", len = 31, name = "players.4.name" }, -- 31
161+
-- [0xB0] = { type = "string-jis", len = 31, name = "opponent.name" }, -- 31
162+
-- [0xCF] = { type = "string-jis", len = 10, name = "players.1.code", debug = true }, -- 10
163+
-- [0xD9] = { type = "string-jis", len = 10, name = "players.2.code", debug = true }, -- 10
164+
-- [0xE3] = { type = "string-jis", len = 10, name = "players.3.code" }, -- 10
165+
-- [0xED] = { type = "string-jis", len = 10, name = "players.4.code" }, -- 10
166166
-- [0xF7] = { type = "string", len = 29, name = "players.1.uuid", debug = true }, -- 29
167167
-- [0x114] = { type = "string", len = 29, name = "players.2.uuid", debug = true }, -- 29
168168
-- [0x131] = { type = "string", len = 29, name = "players.3.uuid", debug = true }, -- 29

source/modules/games/GSTE69-0.lua

-38
This file was deleted.

source/modules/memory/init.lua

+12-11
Original file line numberDiff line numberDiff line change
@@ -213,21 +213,22 @@ local function convertJisStr(str)
213213
while i <= #str do
214214
local c1 = string.sub(str, i, i)
215215
local b1 = string.byte(c1)
216+
if b1 then
217+
if bit.band(b1, 0x80) == 0x80 then
218+
local c2 = string.sub(str, i + 1, i + 1)
219+
local b2 = string.byte(c2)
216220

217-
if bit.band(b1, 0x80) == 0x80 then
218-
local c2 = string.sub(str, i + 1, i + 1)
219-
local b2 = string.byte(c2)
221+
local b16 = bit.bor(bit.lshift(b1, 8), bit.lshift(b2, 0))
220222

221-
local b16 = bit.bor(bit.lshift(b1, 8), bit.lshift(b2, 0))
223+
if char_replacement_map[b16] then
224+
niceStr = niceStr .. char_replacement_map[b16]
225+
end
222226

223-
if char_replacement_map[b16] then
224-
niceStr = niceStr .. char_replacement_map[b16]
227+
i = i + 2
228+
else
229+
niceStr = niceStr .. c1
230+
i = i + 1
225231
end
226-
227-
i = i + 2
228-
else
229-
niceStr = niceStr .. c1
230-
i = i + 1
231232
end
232233
end
233234
return niceStr

0 commit comments

Comments
 (0)