forked from hkc/cc-stuff
Ignore the bottom right pixel
This commit is contained in:
parent
3ad3535b67
commit
2ed6749c87
|
@ -21,8 +21,8 @@ with open(argv[1], "wb") as fp:
|
|||
for ox, bi in enumerate(l):
|
||||
if img.getpixel((x * 2 + ox, y * 3 + oy)):
|
||||
val |= bi
|
||||
if img.getpixel((x * 2 + 1, y * 3 + 2)):
|
||||
val ^= 0x9f
|
||||
# if img.getpixel((x * 2 + 1, y * 3 + 2)):
|
||||
# val ^= 0x9f
|
||||
line.append(val)
|
||||
fp.write(line)
|
||||
print(f"wrote {i + 1} / {len(argv) - 2}")
|
||||
|
|
BIN
badapple.bin
BIN
badapple.bin
Binary file not shown.
|
@ -6,16 +6,20 @@ mon.setTextScale(1)
|
|||
|
||||
local w, h = string.byte(tape.read(2), 1, 2)
|
||||
|
||||
local b = ""
|
||||
for _ = 1, w do b = b .. "0" end
|
||||
local f = b
|
||||
|
||||
repeat
|
||||
for y = 1, h do
|
||||
mon.setCursorPos(1, y)
|
||||
local buf = { string.byte(tape.read(w), 1, -1) }
|
||||
local s, f, b = "", "", ""
|
||||
local s = "" -- , f, b = "", "", ""
|
||||
for x = 1, w do
|
||||
s = s .. string.char(0x80 + bit32.band(0x7F, buf[x]))
|
||||
local inv = bit32.band(0x80, buf[x])
|
||||
f = f .. (inv and "f" or "0")
|
||||
b = b .. (inv and "0" or "f")
|
||||
-- local inv = bit32.band(0x80, buf[x])
|
||||
-- f = f .. (inv and "f" or "0")
|
||||
-- b = b .. (inv and "0" or "f")
|
||||
end
|
||||
mon.blit(s, f, b)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue