Skip to content

Commit

Permalink
Disable reading JIS strings since they cause errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bkacjios committed Jan 21, 2025
1 parent 403d624 commit 6d112e7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 59 deletions.
20 changes: 10 additions & 10 deletions source/modules/games/GALE01-2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ game.memorymap[CSSDT_BUF_ADDR] = {
[0x0C] = { type = "u8", name = "chatmsg.index" }, -- 1
[0x0D] = { type = "u32", name = "vs.left_names" }, -- 4
[0x11] = { type = "u32", name = "vs.right_names" }, -- 4
[0x15] = { type = "string-jis", len = 31, name = "local_player.name", debug = true }, -- 31
[0x34] = { type = "string-jis", len = 31, name = "players.1.name", debug = true }, -- 31
[0x53] = { type = "string-jis", len = 31, name = "players.2.name", debug = true }, -- 31
[0x72] = { type = "string-jis", len = 31, name = "players.3.name" }, -- 31
[0x91] = { type = "string-jis", len = 31, name = "players.4.name" }, -- 31
[0xB0] = { type = "string-jis", len = 31, name = "opponent.name" }, -- 31
[0xCF] = { type = "string-jis", len = 10, name = "players.1.code", debug = true }, -- 10
[0xD9] = { type = "string-jis", len = 10, name = "players.2.code", debug = true }, -- 10
[0xE3] = { type = "string-jis", len = 10, name = "players.3.code" }, -- 10
[0xED] = { type = "string-jis", len = 10, name = "players.4.code" }, -- 10
-- [0x15] = { type = "string-jis", len = 31, name = "local_player.name", debug = true }, -- 31
-- [0x34] = { type = "string-jis", len = 31, name = "players.1.name", debug = true }, -- 31
-- [0x53] = { type = "string-jis", len = 31, name = "players.2.name", debug = true }, -- 31
-- [0x72] = { type = "string-jis", len = 31, name = "players.3.name" }, -- 31
-- [0x91] = { type = "string-jis", len = 31, name = "players.4.name" }, -- 31
-- [0xB0] = { type = "string-jis", len = 31, name = "opponent.name" }, -- 31
-- [0xCF] = { type = "string-jis", len = 10, name = "players.1.code", debug = true }, -- 10
-- [0xD9] = { type = "string-jis", len = 10, name = "players.2.code", debug = true }, -- 10
-- [0xE3] = { type = "string-jis", len = 10, name = "players.3.code" }, -- 10
-- [0xED] = { type = "string-jis", len = 10, name = "players.4.code" }, -- 10
-- [0xF7] = { type = "string", len = 29, name = "players.1.uuid", debug = true }, -- 29
-- [0x114] = { type = "string", len = 29, name = "players.2.uuid", debug = true }, -- 29
-- [0x131] = { type = "string", len = 29, name = "players.3.uuid", debug = true }, -- 29
Expand Down
38 changes: 0 additions & 38 deletions source/modules/games/GSTE69-0.lua

This file was deleted.

23 changes: 12 additions & 11 deletions source/modules/memory/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,22 @@ local function convertJisStr(str)
while i <= #str do
local c1 = string.sub(str, i, i)
local b1 = string.byte(c1)
if b1 then
if bit.band(b1, 0x80) == 0x80 then
local c2 = string.sub(str, i + 1, i + 1)
local b2 = string.byte(c2)

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

local b16 = bit.bor(bit.lshift(b1, 8), bit.lshift(b2, 0))
if char_replacement_map[b16] then
niceStr = niceStr .. char_replacement_map[b16]
end

if char_replacement_map[b16] then
niceStr = niceStr .. char_replacement_map[b16]
i = i + 2
else
niceStr = niceStr .. c1
i = i + 1
end

i = i + 2
else
niceStr = niceStr .. c1
i = i + 1
end
end
return niceStr
Expand Down

0 comments on commit 6d112e7

Please sign in to comment.