summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/tools/lua/stmp/rom.lua
blob: fbba75bb3c32876a06fe9cd73ebe758c70a692d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
--- ROM
---
STMP.rom = {}

-- if path is nil, create a generic path that depends on stmp version and rom version
function STMP.rom.dump(path)
    local name = path
    if name == nil then
        name = string.format("stmp%04x_ta%d.bin", hwstub.dev.stmp.chipid, hwstub.dev.stmp.rev + 1)
    end
    local file = io.open(name, "wb")
    file:write(DEV.read(0xffff0000, 0x10000))
    file:close()
    print("Dumping ROM to " .. name)
end