Scaling
This code from block 1190 is loaded into node 609. All it does in interface between the generic sin/cos node and the video node. This node is not necessary, but factors the problem nicely. It could plot more than one function, though this is easier done with the other color nodes.
go
An infinite loop:
- For 767 scan lines:
- Fetch the angle (dup) and send to left.
- Fetch the sin from left (610)
- Scale it conveniently, it must be positive
- Send to down (709) as dark delay
- Followed by short bright
- Send end-of-line
- Increment the angle. It must be masked to avoid going negative, which would switch to cos.
- Send the 768th end-of-line. Incrementing the angle only 767 times/frame produces a pleasant scroll.
init
In addition to loading the address registers, leaves end-of-line and angle on the stack.
ether
Notice that to load code into node 609, you can't go 0 r from node 608. Instead, you must go 1 d 1 r 0 u. 0 r is forbidden because it makes the path word zero.