summaryrefslogtreecommitdiff
path: root/utils/hwstub/tools/lua/stmp/rom.lua
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/tools/lua/stmp/rom.lua')
-rw-r--r--utils/hwstub/tools/lua/stmp/rom.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/hwstub/tools/lua/stmp/rom.lua b/utils/hwstub/tools/lua/stmp/rom.lua
new file mode 100644
index 0000000000..fbba75bb3c
--- /dev/null
+++ b/utils/hwstub/tools/lua/stmp/rom.lua
@@ -0,0 +1,16 @@
1---
2--- ROM
3---
4STMP.rom = {}
5
6-- if path is nil, create a generic path that depends on stmp version and rom version
7function STMP.rom.dump(path)
8 local name = path
9 if name == nil then
10 name = string.format("stmp%04x_ta%d.bin", hwstub.dev.stmp.chipid, hwstub.dev.stmp.rev + 1)
11 end
12 local file = io.open(name, "wb")
13 file:write(DEV.read(0xffff0000, 0x10000))
14 file:close()
15 print("Dumping ROM to " .. name)
16end