mirror of
https://github.com/notwa/mm
synced 2025-02-05 05:23:22 -08:00
update lips
This commit is contained in:
parent
df06f13fda
commit
0ad33f97fe
2 changed files with 10 additions and 2 deletions
|
@ -2,7 +2,6 @@ local floor = math.floor
|
||||||
local format = string.format
|
local format = string.format
|
||||||
local insert = table.insert
|
local insert = table.insert
|
||||||
local remove = table.remove
|
local remove = table.remove
|
||||||
local unpack = unpack or table.unpack
|
|
||||||
|
|
||||||
local path = string.gsub(..., "[^.]+$", "")
|
local path = string.gsub(..., "[^.]+$", "")
|
||||||
local data = require(path.."data")
|
local data = require(path.."data")
|
||||||
|
@ -222,6 +221,15 @@ function Dumper:fill(length, content)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Dumper:pc()
|
function Dumper:pc()
|
||||||
|
--[[ work around a potential overflow issue. consider the assembly:
|
||||||
|
.base 0x80000000 ; possibly by default and not explicitly written
|
||||||
|
.org 0x80001000
|
||||||
|
mylabel:
|
||||||
|
la a0, mylabel ; BUG: this would load 0x1000 instead of 0x80001000
|
||||||
|
--]]
|
||||||
|
if self.pos >= 0x80000000 and self.base >= 0x80000000 then
|
||||||
|
return self.pos - 0x80000000 + self.base
|
||||||
|
end
|
||||||
return self.pos + self.base
|
return self.pos + self.base
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
local insert = table.insert
|
local insert = table.insert
|
||||||
local unpack = rawget(_G, 'unpack') or table.insert
|
local unpack = rawget(_G, 'unpack') or table.unpack
|
||||||
|
|
||||||
local path = string.gsub(..., "[^.]+$", "")
|
local path = string.gsub(..., "[^.]+$", "")
|
||||||
local data = require(path.."data")
|
local data = require(path.."data")
|
||||||
|
|
Loading…
Add table
Reference in a new issue