Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (25 sloc) 0.504 kb
screen_width = 32
screen_height = 16
vram = 0x8000
maxint = 65535
library :screen
ch = '.'.ord
block :main do
extend TrigMacros
label :loop
# Lookup y value from table, flip it upside-down, and scale it to the screen.
SET y, maxint
SUB y, [x+:sin_table]
DIV y, (maxint/screen_height)
# Draw to (x, y).
SET z, y
MUL z, screen_width
ADD z, x
SET [z+vram], ch
ADD x, 1
IFG screen_width, x
SET pc, :loop
SUB pc, 1
label :sin_table
sin_lookup_table screen_width
end
Jump to Line
Something went wrong with that request. Please try again.