03-27-2003, 12:32 AM
A% = 26 * 5 / 10
' A% = 26 * 1/2
' A% = 13
B% = &H9FFF
SCREEN A%
' SCREEN 13
DEF SEG = B% + 1
' B% + 1 = &H9FFF + 1 = &HA000, screen 13 segment.
DO WHILE NOT C& = ( (7999.375) * 8 ) + 5
' 7999.375 * 8 = 6395
' 63995 + 5 = 64000, number of pixels in screen 13, 320x200.
D& = (COS(270) * 4) - SIN(180) + SIN(180)
' COS(270) = .98. COS(270) * 4 = 3.94, or 4 as integer.
' SIN(180) + SIN(180) = 0, 3.94 + 0 = 3.94.
POKE C&, D&
' C& = offset, D& = 3.94, which is interpreted as 4, red,
' since POKE takes integer arguements.
C& = C& + (2 - ((2 * 2) - 3))
' 2 * 2 = 4
' 4 - 3 = 1
' 2 - 1 = 1
' C& = C& + 1
LOOP
So it sets screen 13, points to video memory, loops thru every pixel and plots a red dot, making all the screen red.
There you go
' A% = 26 * 1/2
' A% = 13
B% = &H9FFF
SCREEN A%
' SCREEN 13
DEF SEG = B% + 1
' B% + 1 = &H9FFF + 1 = &HA000, screen 13 segment.
DO WHILE NOT C& = ( (7999.375) * 8 ) + 5
' 7999.375 * 8 = 6395
' 63995 + 5 = 64000, number of pixels in screen 13, 320x200.
D& = (COS(270) * 4) - SIN(180) + SIN(180)
' COS(270) = .98. COS(270) * 4 = 3.94, or 4 as integer.
' SIN(180) + SIN(180) = 0, 3.94 + 0 = 3.94.
POKE C&, D&
' C& = offset, D& = 3.94, which is interpreted as 4, red,
' since POKE takes integer arguements.
C& = C& + (2 - ((2 * 2) - 3))
' 2 * 2 = 4
' 4 - 3 = 1
' 2 - 1 = 1
' C& = C& + 1
LOOP
So it sets screen 13, points to video memory, loops thru every pixel and plots a red dot, making all the screen red.
There you go