Created
December 14, 2020 18:19
-
-
Save omiq/c006b3bac6bc5144f65fad1c7ef51bdd to your computer and use it in GitHub Desktop.
TRSE vic 20 hello world bounce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program MainProgram; | |
/* | |
Vic 20 8K Vic Bitmap Mode template | |
- can utilize up to 35K RAM under project settings | |
------------------- | |
Dev Note: Zero Page addresses have been defined in project settings | |
for the Vic 20 build. | |
_memoryzp - all zero page variables and resources | |
_constants - game constants & parameters | |
_memory - all main RAM variables | |
_lookup - read only look up tables | |
*/ | |
var | |
//@define DEBUG 1 // uncomment to show debugging timings | |
// ------------------------------------------------------------------------------- | |
@include "_constants.ras" // GAME PARAMETERS and CONSTANTS | |
@include "_memoryzp.ras" // variables in Zero Page and binary data | |
// ------------------------------------------------------------------------------- | |
@startblock $2000 "GAME" | |
// ------------------------------------------------------------------------------- | |
// look up data | |
@include "_memory.ras" // variables in main RAM | |
@include "_lookup.ras" // read only lookup tables | |
// ------------------------------------------------------------------------------- | |
// source files // add your include files here | |
@include "vbl.ras" // vertical blank interrupt | |
// ------------------------------------------------------------------------------- | |
// **** MAIN PROGRAM **** | |
begin | |
Vbl_Init(); // call before set display mode | |
vbmSetDisplayMode( 0 ); | |
vbmclear( 0 ); | |
vbmClearColor( BLUE ); | |
AUX_COLOR_AND_VOLUME := %00000010; | |
SCREEN_BG_COLOR := BLACK + SCREEN_BG_BLACK; | |
// main game loop | |
while (true) offpage do | |
begin | |
vbmDrawSmallTextE( #strTitle, #font4, 8, y, 8 ); | |
vbmDrawTextE( #strDesc, #font8, 0, y+10, 8 ); | |
waitforraster(150); | |
y:=y+ydir; | |
if (y > SCREEN_MAX and ydir = 1) then | |
begin | |
ydir:=-1; | |
end; | |
if (y < 1 and ydir = -1) then | |
begin | |
ydir:=1; | |
end; | |
vbmDrawSmallTextE( #strTitle, #font4, 8, y, 8 ); | |
vbmDrawTextE( #strDesc, #font8, 0, y+10, 8 ); | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment