Search the Community
Showing results for tags 'Tiny BASIC'.
Found 3 results
As a Tiny BASIC implementation vwB has a somewhat familiar feel to bB but a different object set, most notably the large virtual world and playfield camera. There is no visual IDE, so you have to write programs like the one below in an editor, and the graphics definitions are defined inline using ASCII art (WYSIWYG) much like bB. Here's a sample listing to show some of the things you can do, and a link to the compiler and specs. The programmers on this forum have made a ton of awesome games and demos with bB! I'm looking forward to playing what you build with vwB! 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 ---------------
I've been working with DLI's on the Atari 8-bit/5200 - a fascinating and powerful technology for doing really cool things with the display! I have decided to add them to the next release of Virtual World BASIC for the 2600! Here's a BASIC Display List Interrupt Demo for the Atari 2600, the program listing and the DLI chapter from the manual to discuss. DLI_Demo4.bin Display_List_Interrupt_demo4.txt The BASIC DLI demo is only 20 lines of code, easy to review (I reused code from 9LineBlitz). Note: This DLI code won't compile until the next version of vwB is released (soon, along with other enhancements). Draft of the new chapter on DLI's: Display List Interrupts ------------------------------- Display list interrupts run during the vertical blank and provide the ability to split the screen up into multiple horizontal sections, each of which can contain a vertically, horizontally or diagonally scrolling playfield with free floating or tile-mapped sprites. The DLI demo program (DLI_Demo.txt) demonstrates setting up display lists to scroll the top half of the screen vertically while scrolling the bottom half of the screen horizontally at different speeds. The demo actually uses 4 DLI calls to do this but arranges them to create two contiguous scroll zones. Syntax for calling the DLI is simple: "gosub DLI" two rows (1/5) of the screen will be updated based on the value you store in scrollvirtualworldtoggle (it's reused for DLI's; just don't use zero). Put in an 8, and the bottom two rows of the screen will be updated: 100 scrollvirtualworldtoggle=8:gosub DLI:scrollvirtualworldtoggle=0: rem call DLI, update tile rows 9 and 10. Put in a 1 and rows 2 and 3 will be updated near the top of the screen: 100 scrollvirtualworldtoggle=1:gosub DLI:scrollvirtualworldtoggle=0: rem call DLI, update tile rows 2 and 3. Trick to span three rows (about 1/3 of the screen) - use "3" as a prefix before the start row. Put in a 37 and the bottom three rows of the screen will be updated: 100 scrollvirtualworldtoggle=37:gosub DLI:scrollvirtualworldtoggle=0: rem call DLI, update tile rows 8,9 and 10. Put in a 30 and the top 3 rows will be updated. 100 scrollvirtualworldtoggle=30:gosub DLI:scrollvirtualworldtoggle=0: rem call DLI, update tile rows 1,2 and 3. It's no more complex than setting the x,y coordinates for the playfield camera to pan the view about the virtual world, you're just able to do that independantly for each section of the screen you define with a DLI! You can call a DLI from each gameloop with different camerea settings; each game loop runs on one of the vertical blanks so one of your DLI calls will happen "before" (called from the top blank) the display is drawn and one will happen after the display is drawn, the one called from the bottom blank (gameloop2). DLI Overhead: 3 row DLI's will occuply nearly the entire top blank, and cannot fit in the bottom blank while 2 row DLI's leave plenty of space for your own program code. Just like raising an event to scroll the entire screen, A DLI need be called only as frequently as you need to update it's target section of the screen (pan the camera). Exercises for setting up multiple DLI's and setting their animation rates: 1. Increase the scrolling speed of the top half of the screen to match the bottom, so they are both animated at 30 FPS (every other frame). 2. Change the demo to show three visible scroll zones; try to set up two zones scrolling horizontally in opposite directions or at different speeds, while the third "larger" zone (comprised of two zones) scrolls vertically or diagonally.
I've been experimenting with a new type of artifacting using some of the same techniques we leveraged in the 80's to render 4 and 7 color displays with the CoCo's 256x192 monochrome graphics mode. In conjunction with 30 FPS full screen animation I'm getting plasma effects like these: As well as the familiar CoCo artifacting we are used to: And no artifacting as expected dependant on wavelength: The plasma effect is materializing at 30 FPS from a pure 30 hz signal without the alternating field; the Atari has a unique signal that can paint the entire screen at 30 hz instead of half of it which is also part of it. The effects vanish rendering 30 hz over 60 hz objects and are maximized at 30 FPS of animation; the extra phosphor and increased contrast (30 hz objects over nothing, not even a subcarrier) seems to potentiate the plasma effects. The video of the game shows these effects also merging with the traditional CoCo effects and some others that didn't show up as well - gives a good idea but you really have to see it on a tube television. What do programmers who have worked with artifacting think? If anyone wants to check out the source or try rendering other artifacting tricks with the code, it's Tiny BASIC, similar to the original TRS-80. The compiler is included in the download site As a related subtopic, composite mod's break the artifacting on Atari just like they did initially to the CoCo; I wonder if CoCo specialists like Boisey could create a composite mod for the Atari that would bring back the artifacting and really turn it up, like John did for Tandy when he had to revise his composite mod. Not all Atari's are equal here - the Vader has fantastic artifacting capabilities but the Jr is barely able to do CoCo artifacting and cannot do the plasma effects.