Jump to content

Recommended Posts

vwBASIC Beta 1.0 Released

 

EDIT:

Here is the latest version of vwBASIC for the SuperCharger, with a logic bug fixed:vwBASIC.zip

The CD download on the site is also updated.

Flashback Portable Edition:

 

The vwBASIC Flashback Portable Edition is now in Beta and will be available soon!!! :)

See 13th post for questions to help decide what features vwBASIC should bring to the Portable console platform!!

___________________________________________________________________

 

vwBASIC

 

VirtualWorld BASIC is a Tiny BASIC implementation for the 2600 that features large tile mapped virtual worlds and a playfield camera:

 

post-30777-0-82701000-1434208895_thumb.jpg

A programmer can start plotting pixels and sprites and then move the camera around, and the graphical subsystem repositions every element :)

With VirtualWorld BASIC you can make awesome scrolling games and demo's with tons of on-screen and off-screen action, like this game/demo here.

 

vwBASIC also has cool programming features like Nybble arrays and typcasting functions :)

 

vwBASIC has a very tiny footprint that will output 6K and 12K ROM binaries, targeting 1982 and 1983 specific retro technologies - the 6K ROM images are SuperCharger compatible for making games on Tape, CD or Cart, and the 12k ROM images use the CBS RAM (double Super Chip) Cart format.

 

The vwBASIC compiler is a command line shell application (PowerShell) and could be wrapped in a Visual IDE, but it's not necessary because like bB's playfields and sprites, vwB allows the large virtual worlds and sprites to be drawn with ASCII art right inline with the code.

 

vwBASIC is approaching the beta release, thoughts and ideas are welcome! :)

Edited by Mr SQL
  • Like 6
Link to comment
Share on other sites

It would be cool if vwBasic forces the programmer to name all their variables. It always annoyed me that bB gives you defaults of a-z. Everybody just uses them because it's easier and then the programs are harder to read than they should be.

 

A proper if/then/else/endif implementation would be nice too. You should be able to construct an if statement without using goto.

Link to comment
Share on other sites

It would be cool if vwBasic forces the programmer to name all their variables. It always annoyed me that bB gives you defaults of a-z. Everybody just uses them because it's easier and then the programs are harder to read than they should be.

 

A proper if/then/else/endif implementation would be nice too. You should be able to construct an if statement without using goto.

 

vwBASIC has similar defaults for 8-bit variables (about 30) and 20 4-bit vars in a pre-defined nybble array.

 

I too prefer to use default vars but will add an alias command so friendly names can be used :)

 

If/then/else/endif is implemented, but via the : concatenator and end of line as in Tiny BASIC, leading to some horizontal constructs:

 

10 If e>=100 and vwPixel(50,18,poll) = 1 then e=0: vwPixel(50,18,flip): r=25 else r=37:g=5

 

Lot of programmers nowadays prefer:

 

If e>=100 and vwPixel(50,18,poll) = 1 then

e=0

vwPixel(50,18,flip)

r=25

else

r=37

g=5

End If

 

I really miss those long horizontal constructs, imo they make it easier to read larger sections of code with continuity.

  • Like 1
Link to comment
Share on other sites

vwBASIC Beta 1.0 Release

vwBASIC.zip program.bin

(vwBASIC compiler and sample program) (compiled ROM of sample program)

 

UPDATE: vwBASIC is out of Beta! Download the 1.0 release with source level debugging, sample programs and examples.

 

How to use the vwBASIC compiler:

Put the three files (the compiler, a support file and the sample program) in a folder, preferrably c:\vwBASIC, so you don't have to change the paths.

 

To compile the sample program (program.txt) just run the compiler. The compiler is a PowerShell application. (You may have to authorize it; it is safe and just compiles BASIC to 6502, you can peruse it and see, and even make changes to the open architecture). It outputs program.asm which is ready to be assembled to a ROM binary by dasm ("dasm program.asm -oprogram.bin -f3" to produce the ROM).

 

Description of the sample program:

The sample program illustrates the Tiny BASIC syntax and shows you how to work with the high level objects and their functions:

post-30777-0-26458700-1434722623_thumb.jpg

 

1.Move your character around the virtual world, the other character is pinned to the virtual world and

will vanish as you move away and reappear when you return to that portion of the virtual world.

 

2.The other sprite character illustrates virtual world binding and sprite scrolling - some graphical characters and a phrase scroll smoothly through it.

 

3.If you hold the button, you can draw designs on the virtual world and drag the other character around with you. When you let up the other character will be pinned to that location and stay there as you move away.

 

4.If you move over the other character the screen color will change - this is a virtual collision (unlike the standard hardware collisions can even happen offscreen, far off in the virtual world).

 

 

vwBASIC Arcitecture:

post-30777-0-62736200-1434722668_thumb.jpg

The vwBASIC beta only populates the init section and the top GameLoop; future versions will let you add code to the bottom gameloop and add big code (timewise) to the "kitchen sink" loop after you raise an event (the sample program raises an event for the kitchen sink loop everytime it sets

scrollvirtualworldtoggle to 1).

 

Specific coding ideosyncracies (these may change):

All statements require linenumbers (or unique labels).

"if" can only be used at the start of a line. And, and or, cannot be mixed in the same if.

Two numbers/variables per equation term max; d=5*3 is ok, d=5*r+4 must be broken up into :D=5*r:d=d+4

28 8 bit variables are available: e-z, var1,var2,bx,by,px,py

sprite0x,sprite0y...missile0x,missile1x vars are populated when their sprites are bound to virtual world tiles and can be nudged for fine movment, or set directly for traditional non-relative (to the virtual world) x,y positioning.

No bounds checking and no compile-time error checking (code will break or not compile properly with errors).

 

Pending additions:

Support for the second joystick, adding "step" support to for/next, adding division and modulus (maybe), adding the nybble array variables and typecasting functions. Adding an alias command for friendly variable names.

 

post-30777-0-03233100-1434722657_thumb.jpg

vwBASIC is a lot of fun, hope everyone enjoys! :)

Edited by Mr SQL
  • Like 1
Link to comment
Share on other sites

vwBASIC now has Indexed Arrays

 

Added indexed Array variables. Any table in ROM can be read or modified as an indexed array of variables. There is an example in the sample program reading foreground colours from a table and updating the table values so they are different the next time around.

Link to comment
Share on other sites

It would be cool if vwBasic forces the programmer to name all their variables.

ZackAttack,

this was a great idea - I've implemented this with array variables; they behave more like static RAM because the array variables must be dimensioned and initialised as well as requiring names. From the updated sample program:

 

2010 data mazecolours 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19

 

I thought about using the keyword array instead of data but wanted to keep it close to BASIC spec though BASIC data arrays weren't named and were read only.

Link to comment
Share on other sites

Thank you for this Mr SQL! Er, what tools and what command line statements are needed to convert the result to an actual StarPath SuperCharger .WAV?

You're welcome loon, thank you - our programming discussions helped inspire me to build this! :)

 

The dasm assembler turns the output into a ROM binary with the following command:

dasm c:\vwbasic\program.asm -oprogram.bin -f3

 

Makewav is a command line utility that can convert the ROM binary to a SuperCharger wav file, the command is:

makewav program.bin -ts

 

I've just updated the compiler with a lot of cool enhancements, the sample program now includes ascii art graphics and chiptunes inline:

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

18 loadplayer0(: rem load 2nd sprite definition

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

30 for i = 7 to 9:rem outer loop

40 for j = 4 to 7: rem inner loop

50 vwpixel(i,j,flip)

60 next i,j

105 rem end init section -------------------------------

115 rem ------------------------------------------------

117 rem ---:the next comment line is used by the compiler

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:rem

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

138 if l>104 then l=0

140 if f=4 and joy1fire=1 then goto 152: rem double speed!

142 if f=8 then f=0 : g=g+1:l=l+1 else vwpixel(u,v,bindplayer1):vwpixel(x,y,bindplayer0): return

152 rem ---scroll sprite library section containing message

155 loadplayer1(l)

190 rem read/write array elements in named array variables:

200 if g<19 then read i(mazecolours,g):COLUPF=i:i=i+1:write i(mazecolours,g)

380 rem --player1 can move around onsceen or off like Tails; camera only follows player0

390 if joy1fire=1 then COLUP1=64:p=50:scrollvirtualworldtoggle=1:rem raise event to call draw box (time intensive routine)

400 if joy1up=1 and v>0 then v=v-1

410 if joy1down=1 and v< 19 then v=v+1

420 if joy1left=1 and u>0 then u=u-1

430 if joy1right=1 and u<91 then u=u+1

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

556 if joy0down=1 and y<19 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<91 then COLUP1=$84:COLUP0=$80:x=x+1
560 rem ---bind player1 to virtual world game grid at player0s location if button is pressed

565 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

572 rem if vwpixel(0,0,poll)>0 then COLUBK=255: pixel polling example (other args: on,flip)

700 rem ------pan the camera to follow the player about the virtual world:

710 if x-BITIndex > 14 and BITIndex < 72 then BITIndex=BITIndex+1:scrollvirtualworldtoggle=1

714 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: rem "read i(fastyindex,y)" is faster (12 step lookup table for virtual world y values)

730 if BYTErowoffset<120 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 

765 rem if w & %11110000 = s^t then COLUP0=255

770 rem if joy0fire=1 then BITIndex=72:scrollvirtualworldtoggle=1

774 rem ------------------------------------------------

775 rem end game loop-----------------------------------

776 rem ------------------------------------------------

777 rem ---:the next comment line is used by the compiler

780 rem ---gameloop2 subroutine, runs every frame:    --

782 rem ------------------------------------------------

784 o=o+1: rem test code for gameloop2

785 if o=150 then read i(mazecolours,18):COLUP0=i:o=0

790 rem end gameloop2-----------------------------------

800 rem ------------------------------------------------

805 rem ---:the next comment line is used by the compiler

810 rem ---KITCHENSINK subroutine, runs when scrollvirtualworldtoggle=1

812 rem ------------------------------------------------

814 if p=50 then gosub 20:p=0:rem call draw box routine in init

900 rem end KITCHENSINK---------------------------------

2000 rem Dynamic RAM array variables are initialised in data statements:

2010 data mazecolours 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19

2015 data samplearray 0,56,100,23,48,77,11,15,12

virtualworld
X.....................................X...X..X.........X..XXXX.....XXXXXX......XXXXXXXXXXXXX
.X.......XXXXX........................X...X..X.........X..X..X....X......X.....X..........XX
..XX.........X........................X...X...X...X...X...XXXXX..X..X..X..X....X...XXXXXXXXX
....X........X.........................X.X.....X.X.X.X....X....X.X........X....X............
.....X.......X..........................X.......X...X.....XXXXXX.X.X....X.X....XXXXXXXXXX...
......X......X..........XXXXXXXXXX...............................X..XXXX..X.............X...
.......X......X..................X................................X......X..............X...
........X.....X..................X.................................XXXXXX...............X...
.........X.....X.............X...X..............................................XXXXXXXXX...
..........X...X..............X...X..........................................................
...........X.X...............X...X..................................................XXXXXXXX
............X................X...XXXXXXXXX........................................XXX......X
X............................X....................................................X........X
.X.......XXXXX...............XXXXXXXXXXXXX........................................X...XXXXXX
..XX.........X........................................................................X.....
....X........X........................................................................X.....
.....X.......X........................................................................X.....
......X......X........................................................................X.....
.......X......X.......................................................................X.....
X.......X.....XXXX....................................................................XXXXXX

sprites
..XXX...
..XXX...
XXXXX.X.
..XX.XX.
XXXX.X..
X.XXX...
XX.XXX..
.XX.XXXX
X.X.X..
..XXXX..
X..XX...
XXXXXX..
...XX.XX
...XX...
X.X..X.X
.X....X.
.......
XX...XX.
XX...XX.
XXXXXXX.
XXXXXXX.
XX...XX.
XX...XX.
........
.......
..XXX...
.X...X..
.XXXXX..
.X......
.X......
..XXXX..
........
.......
.XX.....
.XX.....
.XX.....
.XX.....
.XXXXX..
.XXXXX..
........
.......
.XX.....
.XX.....
.XX.....
.XX.....
.XXXXX..
.XXXXX..
........
.......
..XXXX..
.XXX.XX.
.XX..XX.
.XX..XX.
.XX.XXX.
..XXXX..
........
.......
........
........
........
........
........
........
........
.......
X......X
X......X
X..XX..X
X..XX..X
X.X..X.X
XX....XX
........
.......
..XXXX..
.XXX.XX.
.XX..XX.
.XX..XX.
.XX.XXX.
..XXXX..
........
.......
.XXXX...
.XX..X..
.XXXX...
.XX.X...
.XX..X..
.XX..XXX
........
.......
.XX.....
.XX.....
.XX.....
.XX.....
.XXXXX..
.XXXXX..
........
.......
.XXXX...
.XX.XX..
.XX..XX.
.XX..XX.
.XX..XX.
.XXXXX..
........
chiptunes
7,30,0,0,8
7,24,0,0,8
7,20,0,0,8
7,24,0,0,7
30,0,0,8,7
24,0,0,8,7
20,0,0,8,7
24,0,0,8,7
22,0,0,8,7
22,0,0,8,7
22,0,0,8,7
24,0,0,8,7
27,0,0,8,7
30,0,0,8,7
30,0,0,8,7
24,0,0,8,7
20,0,0,8,7
24,0,0,8,7
30,0,0,8,7
24,0,0,8,7
20,0,0,8,7
24,0,0,8,7
22,0,0,8,7
22,0,0,8,7
22,0,0,8,7
24,0,0,8,7
27,0,0,8,7
30,0,0,8,12
24,0,0,8,12
24,0,0,8,12
19,0,0,8,12
15,0,0,8,12
24,0,0,8,12
15,0,0,8,12
24,0,0,8,12
19,0,0,8,7
30,0,0,8,7
24,0,0,8,7
20,0,0,8,7
30,0,0,8,7
24,0,0,8,7
20,0,0,8,7
30,0,0,8,7
24,0,0,8,7
20,0,0,8,24
0,0,0,0,0



  • Like 2
Link to comment
Share on other sites

  • 1 year later...

I... don't understand what this is exactly. Is it a new BASIC compiler for the 2600, a virtual environment, or what? Can you make games that will run on a 2600 or an emulator, or does it just simulate the look and feel of 2600 games?

 

 

Papa is right on, this is another BASIC for making Atari VCS games! :)
KC Munchkin Monster Maze and StarBlitz were both written in this BASIC, so was the JAMOUT demo with 800 variables.
Check out the source code to StarBlitz on Pouet to see what this BASIC looks like:
There is an IDE with a Play button that compiles and launches your game program in Stella, or you can use the command line if you prefer.
Your game Solar Plexus is awesome (and on my Harmony cart), I'd love to see what kind of games you could build with this! :)
  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Virutal World BASIC For the SuperCharger latest Edition:

 

Virutal World BASIC latest edition for the SuperCharger is avaiable in the first post and on the site! (important update contains logic bug fix).

 

Virtual World BASIC for the Atari Flashback Portable Console is now in Beta and will be out soon!

 

The Beta edition has most of the features already, here is the beta of Warp Drive (minus the rating/scoring system) where the portable is able to render 30 FPS at 60 HZ with pleasant liquidy graphics for a fun gaming experience! :)

 

Holding down the BW button to activate the warp drive will make the game unplayable at 60FPS and 60 HZ, but support for that mode will be dropped because it doesn't display right on many modern TV's either, it literally overclocks an analog CRT Television, which was designed to render 480i, not 240p at 60 FPS.

 

WD_beta8.bin

 

help decide which remaining features (and how) to include below!

 

The Portable edition is not SuperCharger format but CBS RAM (RAM Plus) based so there are only 256 extra bytes instead of as many as needed (SuperCharger RAM can be allocated to as much of the available ROM space as needed).

 

What that means is everything still works - those arrays for the player sprites and the virtual world you can still manipulate, and as either 2d bit arrays or 1d byte arrays just as before.

 

However you can only declare ROM arrays - no more declaring additional RAM arrays that behave like the graphics objects arrays because there is no more RAM for it, however one fixed RAM array variable is available, a 20-bit nybble array. This is pretty nice because there are about 30 variables plus an extra 20 nybble variables which come in pretty handy.

 

There is no space to hold the color arrays for player0 and the screen so one solution is to:

 

1. Allow monochrome player 1 and backgrounds if no player0colors and rowcolors arrays are specified, like earlier versions of vwBASIC worked, and use a ROM array that you cannot change if they are specified.

 

That's not dynamic and letting a pointer point to different ROM color tables still needs an extra two bytes of RAM; how about this:

 

2. Allow monochrom player 1 and backgrounds if no player0colors and rowcolors array are specified, like earlier versions of vwBASIC worked, and allocate some of the Virtual world if they are specified:

 

post-30777-0-15308200-1485630833_thumb.jpg

 

The binary data for those color tables would show up as pixels on the virtual world, you could avoid using those portions or seal them off in your games (or interact with them - changing the bits individually of the screen and players row colors could create really interesting effects).

 

This would enable the color tables to act as ram arrays just as before when present in a BASIC program, and omitting those arrays from the program would free that area in the virtual world again (and you would have monochrome player 0 and playfield row colors via setting COLUP0 and COLUPF again) for more flexibility.

 

Ideas?

 

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...