home *** CD-ROM | disk | FTP | other *** search
-
- REM all library routines that return values must be declared as functions
-
- DECLARE FUNCTION HAMEOpenScreen& LIBRARY
- DECLARE FUNCTION HAMEGetClip& LIBRARY
-
- REM other library routines that do not return values should not be declared
- REM as functions
-
- REM Inform BASIC about the hame library
- LIBRARY "hame.library"
-
-
- REM Open a 640 x 200 non-interlace register mode hame screen
- sHPort& = HAMEOpenScreen&(0,0,640,200)
-
- REM Check to make sure it opened
- if sHPort& = 0 then end
-
- REM Set up a simple GREY, RED, GREEN and BLUE shaded palette
- FOR i& = 1 TO 63
- CALL HAMESetRGB8&(sHPort&, i&, i& * 4, i& * 4, i& * 4 )
- CALL HAMESetRGB8&(sHPort&, i&+64, i& * 4, 0, 0 )
- CALL HAMESetRGB8&(sHPort&, i&+128, 0, i& * 4, 0 )
- CALL HAMESetRGB8&(sHPort&, i&+192, 0, 0, i& * 4 )
- NEXT
-
- REM Draw a bunch of different colored lines
-
- for y& = 0 to 199
- CALL HAMESetAPen&(sHPort&, y&+1 )
- CALL HAMELine&(sHPort&, 0, y&, 319, y& )
- next
-
- REM Grab a clip from the screen
- cl& = HAMEGetClip&(sHPort&, 1, 4, 20, 64, 0 )
-
- REM Check to make sure it took
- if cl& = 0 then Cleanup
-
- REM Put it down a few times
- for y& = -10 to 200
- CALL HAMEPutClip&(sHPort&, cl&, y&, y& )
- next
-
- CALL HAMEDisposeClip(cl&)
-
- REM Draw a bunch of shaded BALLS
-
- for y& = 1 to 63
- CALL HAMESetAPen&(sHPort&, y& )
- CALL HAMEEllipse&(sHPort&, 64, 100, 64-y&, 64-y&, 1 )
- CALL HAMESetAPen&(sHPort&, y&+192 )
- CALL HAMEEllipse&(sHPort&, 254, 100, 64-y&, 64-y&, 1 )
- CALL HAMESetAPen&(sHPort&, y&+64 )
- CALL HAMEEllipse&(sHPort&, 124, 100, 64-y&, 64-y&, 1 )
- CALL HAMESetAPen&(sHPort&, y&+128 )
- CALL HAMEEllipse&(sHPort&, 194, 100, 64-y&, 64-y&, 1 )
- next
-
- REM Draw a series of concentric filled Boxes
-
- for y& = 1 to 63
- CALL HAMESetAPen&(sHPort&, y& )
- CALL HAMEBox&(sHPort&, y&-1, y&+3, 320-y&, 200-y&, 1 )
- next
-
- REM unfortunately, the user must find the basic command window and
- REM click in it to exit.
-
- WaitForClick:
- SLEEP
- IF MOUSE(0) = 0 THEN WaitForClick
-
- Cleanup:
-
- REM Closing the screen frees everything
-
- HAMECloseScreen(sHPort&)
- END
-