Jump to content
ballyalley

Tiny BASIC on Atari 8-Bit?

Recommended Posts

In my opinion the only new Basic that makes sense is something like batariBasic for Atari 2600.

Thanks to IDE, multicolor virtual sprites, graphics, speed, awesome games are possible.

On the superior A8 machine those results are achievable only by Assembler.

Agree, batariBASIC is a TinyBASIC implementation that gets compiled to Assembly; it would be cool to see bB ported to the A8 like RevEng did for the 7800! :)

 

It's not the IDE (optional) but the rich Framework of abstracted objects (x,y addressable playfield pixels and sprites) that makes batariBASIC so powerful; I've been working on my own Tiny BASIC compiler for the 2600 to support the ASDK Frameworks object set.

  • Like 1

Share this post


Link to post
Share on other sites

In my opinion the only new Basic that makes sense is something like batariBasic for Atari 2600.

Thanks to IDE, multicolor virtual sprites, graphics, speed, awesome games are possible.

On the superior A8 machine those results are achievable only by Assembler.

 

Just released the beta for vwBASIC :)

 

ballyally,

your thread and the Astrocade newsletter with the TinyBASIC listings were really inspiring! :)

 

Here's the BASIC in ROM binary and source listing of the sample program:

Program.bin

 

1 rem *** Test program for vwBASIC compiler ***

5 rem ---------------------------------------

7 rem ---init section, runs once: -----------

8 rem ---------------------------------------

15 COLUP0=$40:COLUP1=100: h=0:g=0:l=0:f=0:u=5:v=5: rem init vars

20 rem draw a box of inverted pixels (gosub 20 to call routine again)

30 for x = 5 to 10:rem outer loop

40 for y = 3 to 8: rem inner loop

50 vwpixel(x,y,flip)

60 next x,y

105 rem end block for init section ---------------------

122 rem ------------------------------------------------

120 rem ---gameloop subroutine, runs every frame: ---

124 rem ------------------------------------------------

127 rem vars: x,y player0 virtual world coordinates (for sprite binding)

128 rem vars: g,l,f - frame based counters

129 rem vars: u,v player1 virtual world coordinates (for sprite binding)

130 scrollvirtualworldtoggle=0:f=f+1

131 if g<16 then read i(mazecolours,g):COLUPF=i: rem data/read example

132 if f=7 then g=g+1:l=l+1

133 if g<16 or g>48 then REFP0=1 else REFP0=255

135 if g<32 then loadplayer0(0) else loadplayer0upsidedown(0)

137 if g>64 then g=0:rem reset medium frame counter

138 if l>104 then l=0

139 if f=14 then f=0 else vwpixel(u,v,bindplayer1):vwpixel(x,y,bindplayer0):return

152 rem ---scroll sprite library section containing message

155 loadplayer1(l)

555 if joy0up=1 and y>0 then COLUP1=$40:COLUP0=$90:y=y-1

556 if joy0down=1 and y<18 then COLUP1=$64:COLUP0=$70:y=y+1

557 if joy0left=1 and x>0 then COLUP1=$55:COLUP0=$60:x=x-1

558 if joy0right=1 and x<90 then COLUP1=$84:COLUP0=$80:x=x+1

559 rem ---bind player1 to virtual world game grid at player0's location if button is pressed

560 if joy0fire=1 then u=x+1:v=y:vwpixel(x,y,flip):COLUP0=$E0:MUSICINDEX=MUSICINDEX+1

570 if u=x and v=y then COLUBK=$0E else COLUBK=0:rem virtual collision detection

700 rem ------pan camera horizontally (BITIndex) if player is near the edge of the playfield CAM

705 i=x-BITIndex

710 if i > 15 and BITIndex < 72 then BITIndex=BITIndex+1:scrollvirtualworldtoggle=1

712 if x < BITIndex+3 and BITIndex>0 then BITIndex=BITIndex-1:scrollvirtualworldtoggle=1

720 rem -----pan camera vertically (BYTErowoffset) if player is near the edge of the playfield CAM

725 i = y*12

730 if BYTErowoffset<108 and BYTErowoffset+36<i then BYTErowoffset=BYTErowoffset+12:scrollvirtualworldtoggle=1

735 if i>36 then i=i-36

740 if BYTErowoffset>i then BYTErowoffset=BYTErowoffset-12:scrollvirtualworldtoggle=1

1560 rem end block for game loop ---------------

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...