Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- メモリから256バイトの値を取得
- function getValues(address)
- local values = {}
- for i = 0, 255 do
- local value = memory.readbyte(address + i)
- table.insert(values, value)
- end
- return values
- end
- local Mapfloor_addr = 0x0230FB04 -- 地形アドレス
- local ImMapfloor_addr = 0x0230FA04 -- 偽地形アドレス
- local Mapfloors = getValues(Mapfloor_addr)
- local ImMapfloors = getValues(ImMapfloor_addr)
- -- テキストファイルで出力
- function outputMapData(MapData, ImMapData)
- local file = io.open("MapFloor.txt", "w")
- if file == nil then
- error("File could not be opened.")
- end
- for i = 1, 16 do
- local MapDataRow = {}
- for j = 1, 16 do
- table.insert(MapDataRow, string.format("%02X", MapData[(i - 1) * 16 + j]))
- end
- file:write(table.concat(MapDataRow, " ") .. "\n")
- end
- file:write("\n")
- for k = 1, 16 do
- local ImMapDataRow = {}
- for l = 1, 16 do
- table.insert(ImMapDataRow, string.format("%02X", ImMapData[(k - 1) * 16 + l]))
- end
- file:write(table.concat(ImMapDataRow, " ") .. "\n")
- end
- end
- file:close()
- outputMapData(Mapfloors, ImMapfloors)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement