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):
|
for ox, bi in enumerate(l):
|
||||||
if img.getpixel((x * 2 + ox, y * 3 + oy)):
|
if img.getpixel((x * 2 + ox, y * 3 + oy)):
|
||||||
val |= bi
|
val |= bi
|
||||||
if img.getpixel((x * 2 + 1, y * 3 + 2)):
|
# if img.getpixel((x * 2 + 1, y * 3 + 2)):
|
||||||
val ^= 0x9f
|
# val ^= 0x9f
|
||||||
line.append(val)
|
line.append(val)
|
||||||
fp.write(line)
|
fp.write(line)
|
||||||
print(f"wrote {i + 1} / {len(argv) - 2}")
|
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 w, h = string.byte(tape.read(2), 1, 2)
|
||||||
|
|
||||||
|
local b = ""
|
||||||
|
for _ = 1, w do b = b .. "0" end
|
||||||
|
local f = b
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
for y = 1, h do
|
for y = 1, h do
|
||||||
mon.setCursorPos(1, y)
|
mon.setCursorPos(1, y)
|
||||||
local buf = { string.byte(tape.read(w), 1, -1) }
|
local buf = { string.byte(tape.read(w), 1, -1) }
|
||||||
local s, f, b = "", "", ""
|
local s = "" -- , f, b = "", "", ""
|
||||||
for x = 1, w do
|
for x = 1, w do
|
||||||
s = s .. string.char(0x80 + bit32.band(0x7F, buf[x]))
|
s = s .. string.char(0x80 + bit32.band(0x7F, buf[x]))
|
||||||
local inv = bit32.band(0x80, buf[x])
|
-- local inv = bit32.band(0x80, buf[x])
|
||||||
f = f .. (inv and "f" or "0")
|
-- f = f .. (inv and "f" or "0")
|
||||||
b = b .. (inv and "0" or "f")
|
-- b = b .. (inv and "0" or "f")
|
||||||
end
|
end
|
||||||
mon.blit(s, f, b)
|
mon.blit(s, f, b)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue