Created
March 7, 2021 19:58
-
-
Save chrisws/b2a60d7143fab4eb0fd4afbab6bd39a8 to your computer and use it in GitHub Desktop.
Why was the Amiga Kickstart 1.x "Insert floppy" graphic so bad?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem | |
rem Why was the Amiga Kickstart 1.x "Insert floppy" graphic so bad? | |
rem | |
rem https://news.ycombinator.com/item?id=26369057 | |
rem https://www.youtube.com/watch?v=gXhxE4j6dm0 | |
rem | |
rem The machine-language code uses a simple program stored in an array to draw | |
rem the different parts of the diskette, hand, and the fingers, run-time. | |
rem This DSL implements three commands: | |
rem | |
rem 1. Draw a polyline. Parameters: color index for the drawing pen | |
rem and an arbitrarily long list of x,y coordinates. | |
rem 2. Flood-fill an area. Parameters: color index of the desired fill color | |
rem and a single x,y coordinate for indicating where to begin filling. | |
rem 3. End the program | |
rem | |
const palette = [7, rgb(12,12,12), rgb(0x70, 0x70, 0xC0), rgb(0x80, 0x80, 0x80)] | |
const polyLine = 255 | |
const floodFill = 254 | |
const endOfCommand = 255 | |
color 0,7: cls | |
pushed = [] | |
func pop | |
local result, v1, v2 | |
if len(pushed) == 1 then | |
result = pushed[0] | |
pushed = [] | |
else | |
read v1 | |
read v2 | |
result = [val("0x" + v1), val("0x" + v2)] | |
endif | |
return result | |
end | |
while 1 | |
[b1, b2] = pop | |
if b1 == endOfCommand && b2 == endOfCommand then | |
exit loop | |
else if b1 == polyLine then | |
a = [] | |
while 1 | |
v = pop | |
if (v[0] == polyLine || v[0] == floodFill) then | |
pushed << v | |
exit loop | |
else | |
a << v | |
endif | |
wend | |
drawpoly a color palette[b2] | |
else if b1 == floodFill then | |
[x, y] = pop | |
paint x, y, palette[b2] | |
else | |
throw "unknown command" | |
endif | |
wend | |
pause | |
Data "FF","01","23","0B","3A","0B","3A","21","71","21","71","0B","7D","0B","88","16","88","5E","7F","5E","7F","38","40","38" | |
Data "3E","36","35","36","34","38","2D","38","2D","41","23","48","23","0B","FE","02","25","45","FF","01","21","48","21","0A" | |
Data "7E","0A","8A","16","8A","5F","56","5F","56","64","52","6C","4E","71","4A","74","44","7D","3C","81","3C","8C","0A","8C" | |
Data "0A","6D","09","6D","09","51","0D","4B","14","45","15","41","19","3A","1E","37","21","36","21","36","1E","38","1A","3A" | |
Data "16","41","15","45","0E","4B","0A","51","0A","6C","0B","6D","0B","8B","28","8B","28","76","30","76","34","72","34","5F" | |
Data "32","5C","32","52","41","45","41","39","3E","37","3B","37","3E","3A","3E","41","3D","42","36","42","33","3F","2A","46" | |
Data "1E","4C","12","55","12","54","1E","4B","1A","4A","17","47","1A","49","1E","4A","21","48","FF","01","32","3D","34","36" | |
Data "3C","37","3D","3A","3D","41","36","41","32","3D","FF","01","33","5C","33","52","42","45","42","39","7D","39","7D","5E" | |
Data "34","5E","33","5A","FF","01","3C","0B","6F","0B","6F","20","3C","20","3C","0B","FF","01","60","0E","6B","0E","6B","1C" | |
Data "60","1C","60","0E","FE","03","3E","1F","FF","01","62","0F","69","0F","69","1B","62","1B","62","0F","FE","02","63","1A" | |
Data "FF","01","2F","39","32","39","32","3B","2F","3F","2F","39","FF","01","29","8B","29","77","30","77","35","72","35","69" | |
Data "39","6B","41","6B","41","6D","45","72","49","72","49","74","43","7D","3B","80","3B","8B","29","8B","FF","01","35","5F" | |
Data "35","64","3A","61","35","5F","FF","01","39","62","35","64","35","5F","4A","5F","40","69","3F","69","41","67","3C","62" | |
Data "39","62","FF","01","4E","5F","55","5F","55","64","51","6C","4E","70","49","71","46","71","43","6D","43","6A","4E","5F" | |
Data "FF","01","44","6A","44","6D","46","70","48","70","4C","6F","4D","6C","49","69","44","6A","FF","01","36","68","3E","6A" | |
Data "40","67","3C","63","39","63","36","65","36","68","FF","01","7E","0B","89","16","89","5E","FE","01","22","0B","FE","01" | |
Data "3B","0B","FE","01","61","0F","FE","01","6A","1B","FE","01","70","0F","FE","01","7E","5E","FE","01","4B","60","FE","01" | |
Data "2E","39","FF","FF" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment