Compress location data into a single byte.

This commit is contained in:
Anna Rose Wiggins 2019-12-11 19:23:28 -05:00
parent ea8b0360bc
commit c86589ec6a
3 changed files with 42 additions and 35 deletions

View file

@ -6,14 +6,33 @@ function init_debug()
debug_res = false
debug_map = false
debug_sfx = false
debug_mod_buffer = false
debug_savedata = false
end
function debug_f(mode)
if (band(mode, 0x1)) debug_res = not debug_res
if (band(mode, 0x2)) debug_map = not debug_map
if (band(mode, 0x4)) debug_sfx = not debug_sfx
if (band(mode, 0x8)) debuf_mod_buffer = not debug_mod_buffer
if band(mode, 0x1) ~= 0 then
debug_res = true
else
debug_res = false
end
if band(mode, 0x2) ~= 0 then
debug_map = true
else
debug_map = false
end
if band(mode, 0x4) ~= 0 then
debug_sfx = true
else
debug_sfx = false
end
if band(mode, 0x8) ~= 0 then
debug_savedata = true
else
debug_savedata = false
end
end
function teleport(x, y)
@ -21,21 +40,10 @@ function teleport(x, y)
end
function debug_print()
if debug_res then
debug_print_res()
end
if debug_map then
debug_print_map()
end
if debug_sfx then
debug_print_sfx()
end
if debug_mod_buffer then
debug_print_mod_buffer()
end
if (debug_res) debug_print_res()
if (debug_map) debug_print_map()
if (debug_sfx) debug_print_sfx()
if (debug_savedata) debug_print_savedata()
end
function debug_print_res()
@ -47,8 +55,8 @@ function debug_print_res()
end
function debug_print_sfx()
clip(64, 0, 8, 8)
print(stat(24), 64, 0, 15)
clip(120, 0, 8, 8)
print(stat(24), 120, 0, 15)
clip()
end
@ -59,11 +67,6 @@ function debug_print_map()
clip()
end
function debug_print_mod_buffer()
clip(0, 0, 16, 128)
rectfill(0,0,16,128,0)
for k,v in pairs(mod_buffer) do
print(k .. ": " .. tostr(v))
end
clip()
function debug_print_savedata()
print(tostr(dget(0), 1), 16, 122, 15)
end