Skip to content

Commit

Permalink
Add docs for PSET
Browse files Browse the repository at this point in the history
  • Loading branch information
jestin committed Nov 28, 2023
1 parent a9f2d65 commit df93615
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions appendix/basic_commands.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,7 @@ \subsection{PRINT\#}
EDIT "MYFILE"\\
}

The file should contain the following patter:
The file should contain the following pattern:\\

\codeblock{
*\\
Expand All @@ -2119,7 +2119,27 @@ \subsection{PRINT\#}

\subsection{PSET}

<TODO>
The {\ttfamily PSET} statement sets the color of a single pixel in graphics
mode (set with {\ttfamily SCREEN \$80}). The {\ttfamily PSET} statement is
followed by the x and y coordinates and number from 0-255 to specify the color
from the palette.\\

Example:\\

\codeblock{
10 SCREEN\$80\\
20 FOR Y=0 to 239\\
30 FOR X=0 to 319\\
40 C=INT(Y/15)*16+INT(X/15)\\
50 PSET X,Y,C\\
60 NEXT X,Y\\
}

The above program uses {\ttfamily PSET} to display the default VERA color
palette to the screen. Because it calculates and draws each pixel one at a
time, it takes a few minutes to complete. After all, it has 76,800 pixels to
calculate! See the {\ttfamily RECT} statement for a much faster way to display
the palette. It only has to calculate the color 256 times.\\

\subsection{PSGCHORD}

Expand Down Expand Up @@ -2361,9 +2381,18 @@ \subsection{RECT}

\codeblock{
10 SCREEN \$80\\
20 RECT 10,10,310,230,2\\
20 FOR Y=0 TO 15\\
30 FOR X=0 TO 15\\
40 C=Y*16+X\\
50 X1=X*20\\
60 Y1=Y*15\\
70 RECT X1,Y1,X1+19,Y1+14,C\\
80 NEXT X,Y\\
}

The above program displays the default VERA color palette to the graphics
screen by drawing a 20x15 rectangle for each color.\\

The {\ttfamily RECT} statement is similar to the {\ttfamily FRAME} statment,
except that {\ttfamily RECT} fills the rectangle with the specified color.

Expand Down

0 comments on commit df93615

Please sign in to comment.