screen device and minor formatting
This commit is contained in:
parent
1c3ed6c366
commit
f4c8f22e31
|
@ -42,6 +42,7 @@ implement the following concepts as {coloring computers}:
|
|||
|
||||
* make a folder of examples
|
||||
* whenever we mention the theme loading, link to the suggested palette.
|
||||
* replace intro to colors with a table.
|
||||
|
||||
* include uxn5 in the web tutorial so that code can be run from there
|
||||
=> https://git.sr.ht/~rabbits/uxn5 uxn5
|
||||
|
|
|
@ -276,7 +276,7 @@ we're talking about a device address, 18, but what does it mean?
|
|||
|
||||
looking at the devices table from the varvara reference, we can see that the device with address 1 in the high nibble is the console (standard input and output), and that the column with address 8 in the low nibble corresponds to the "write" port.
|
||||
|
||||
=> https://wiki.xxiivv.com/site/varvara.html#console varvara: console device
|
||||
=> https://wiki.xxiivv.com/site/varvara.html#console XXIIVV — varvara console device
|
||||
|
||||
so, device address 18 corresponds to "console write", or standard output.
|
||||
|
||||
|
|
|
@ -165,6 +165,8 @@ in uxntal examples we can see its labels defined as follows:
|
|||
|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2
|
||||
```
|
||||
|
||||
=> https://wiki.xxiivv.com/site/varvara.html#system XXIIVV — varvara system device
|
||||
|
||||
we will ignore the first elements for the moment, and focus on the color components.
|
||||
|
||||
## system colors
|
||||
|
@ -197,10 +199,10 @@ how would we read what those literal shorts mean?
|
|||
|
||||
we can read each of the colors vertically, from left to right. therefore:
|
||||
|
||||
* color0 would have: red: 2, green: 1, blue: 1 ( #221111 in hex color notation, brown)
|
||||
* color1 would be red: e, green: e, blue: e ( #eeeeee in hex color notation, white )
|
||||
* color2 would be red: e, green: b, blue: 2 ( #eebb22 in hex color notation, amber )
|
||||
* color3 would be red: f, green: 8, blue: e ( #ff88ee in hex color notation, pink )
|
||||
* color0 would have: red: 2, green: 1, blue: 1 (#221111 in hex color notation, brown)
|
||||
* color1 would be red: e, green: e, blue: e (#eeeeee in hex color notation, white)
|
||||
* color2 would be red: e, green: b, blue: 2 (#eebb22 in hex color notation, amber)
|
||||
* color3 would be red: f, green: 8, blue: e (#ff88ee in hex color notation, pink)
|
||||
|
||||
if we run the program now we'll see a brown screen, instead of black as what we had before.
|
||||
|
||||
|
@ -208,7 +210,7 @@ try changing the values of color0, i.e. the first column, and see what happens :
|
|||
|
||||
# the screen device
|
||||
|
||||
as a recap: we mentioned that the screen device can only show four different colors at a given time, and that these colors are numbered from 0 to 3. we set these colors using the corresponding ports in the system device.
|
||||
the screen device can only show four different colors at a given time, and these colors are numbered from 0 to 3. we set these colors using the corresponding ports in the system device.
|
||||
|
||||
now let's discuss the screen device and start using it!
|
||||
|
||||
|
@ -217,15 +219,17 @@ now let's discuss the screen device and start using it!
|
|||
in uxntal programs for the varvara computer you will be able to find the labels corresponding to this device ports as follows:
|
||||
|
||||
```
|
||||
|20 @Screen [ &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ]
|
||||
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|
||||
```
|
||||
|
||||
=> https://wiki.xxiivv.com/site/varvara.html#screen XXIIVV — varvara screen device
|
||||
|
||||
these are the ports in list format:
|
||||
|
||||
* vector (2 bytes)
|
||||
* width of the screen (2 bytes)
|
||||
* height of the screen (2 bytes)
|
||||
* auto (1 byte)
|
||||
* auto byte (1 byte)
|
||||
* x coordinate (2 bytes)
|
||||
* y coordinate (2 bytes)
|
||||
* memory address (2 bytes)
|
||||
|
@ -238,11 +242,11 @@ we will cover the rest of the ports today!
|
|||
|
||||
## foreground and background
|
||||
|
||||
the screen device has two overlayed layers of the same size, the foreground and the background.
|
||||
the screen device has two overlaid layers of the same size, the foreground and the background.
|
||||
|
||||
whatever is drawn over the foreground layer will cover anything that is drawn in the same position in the background layer.
|
||||
whatever is drawn in the foreground layer will cover anything that is drawn in the same position in the background layer.
|
||||
|
||||
in the beginning the foreground layer is completey transparent: a process of alpha blending makes sure that we can see the background layer.
|
||||
in the beginning, the foreground layer is completey transparent: a process of alpha blending makes sure that we can see the background layer.
|
||||
|
||||
# drawing a pixel
|
||||
|
||||
|
|
Loading…
Reference in New Issue