Search the Community
Showing results for tags 'fastbasic'.
-
I'm running into an issue with the TIME command. I'm using Ver. 4.6. I've been running some benchmarks in fastbasic, and on a couple of the really long ones, the output is dramatically off. One example, I had a process running for 30 min's, and TIME/60/60 reported that about 8 min's had elapsed! I just ran another process as a test, for 35 min's, and TIME/60 reports 224.816666 seconds (3.7 min's). The coding pattern I've used with it is I start off the process with TIMER, to reset the registers, let the process run, and then get TIME at the end. I do not include TIMER in any loops. It seems like the value is rolling over. Is the command only intended for processes that might run for 10 min's?
-
Hi all, something in the FastBasic 4.6 cross compiler for Windows doesn't like quoted paths with "embedded spaces" and such. This can be a pita to avoid with some cloud storages like Google Drive: G:\My Drive>G:Projects\FastBasic46\fb "G:Projects\My crap\Matrix3.bas" BAS compile 'G:Projects\My crap\Matrix3.bas' to 'G:Projects\My crap\Matrix3.asm' ASM assemble 'G:Projects\My crap\Matrix3.asm' to 'G:Projects\My crap\Matrix3.o' ca65: Don't know what to do with 'crap\Matrix3.lst' fastbasic: can't assemble file G:\My Drive>cd "Projects\My crap" G:\My Drive\Projects\My crap>"G:\My Drive\Projects\FastBasic46\fb" Matrix3.bas BAS compile 'Matrix3.bas' to 'Matrix3.asm' ASM assemble 'Matrix3.asm' to 'Matrix3.o' ca65: Don't know what to do with 'Matrix3.asm' fastbasic: can't assemble file G:\My Drive\Projects\My crap>"G:..\FastBasic46\fb" Matrix3.bas BAS compile 'Matrix3.bas' to 'Matrix3.asm' ASM assemble 'Matrix3.asm' to 'Matrix3.o' LINK Matrix3.xex G:\My Drive\Projects\My crap>
- 6 replies
-
- fastbasic
- fastbasic 4.6
-
(and 2 more)
Tagged with:
-
Hi all! Finally I published the new FastBasic 4.5 release!! From the 4.5 beta, I added: - The "ADR()" function and the "&" operator now allow taking the address of a variable, so this code will print 123: " A = 1 : DPOKE &A, 123 : ? A ". - The "EXEC" statement can be abbreviated to a "@", this makes calling procedures more natural, this will also print 123: " PROC Test A : ? A : ENDPROC : @Test 123 " This in addition to the added features of the 4.5 beta: - Parameters for the PROC/EXEC, see the test-release docs, - Arbitrary characters in string constants by using the hex value, like: PRINT "Hello"$9B"World", - Added PAUSE without a parameter, this is the same as PAUSE 0, "wait for vsync", - PROC has a shorter abbreviation: PR., - The parser is more robust to syntax errors, I discovered some erroneous inputs that could slow down the parser a lot. Many improvements to the editor: - Much faster COPY/PASTE operations, - Restores left-margin value on exit to DOS, - Remove P/M graphics when returning to the editor from user programs. And improvements to the cross-compiler: - Better error messages from some syntax errors, and fixes in parsing of big numbers. - Check for PROC and EXEC parameters mismatch. - An option to write an expanded and indented listing from an abbreviated listing, "-l" After a lot of optimizations, I managed to keep the integer IDE at 8192 bytes and the floating-point IDE at 9457 bytes. EDIT: Current release is 4.5.2, adds a few bugfixes and minor optimizations, now the integer IDE is 8166 bytes. As always, you can download the ATR, the manual and the cross-compiler from github: https://github.com/dmsc/fastbasic/releases/ Have Fun!
- 110 replies
-
- 20
-
Hi all, I think that the Atari 5200 is under-represented in the BASIC 10-liners competition, so here is a new easy way to write games for the console: Just released a new beta version of FastBasic, with one big addition: With the help of @vitoco, the PC compiler now supports the Atari 5200! You can read the details in the manual at https://github.com/dmsc/fastbasic/blob/master/a5200.md , and the compiler usage in https://github.com/dmsc/fastbasic/blob/master/compiler/USAGE.md Basically, the Atari 5200 target supports: - All the integer and string functions, including compatible STICK() and STRIG(). - Graphic modes 0, 1, 2, 7 to 13 and 15, with PLOT and DRAWTO support. - DLI and P/M. - PRINT to screen and GET for reading the Atari 5200 keypads. To implement the Atari 5200 support, there are a lot of changes to the compiler under the hood, now the compiler supports multiple targets, and the old "integer only" and "floating-point" compilers are simply different targets now, the targets currently implemented are: Atari 8-bit computers binary loadable files (XEX, with and without floating point), Atari 8-bit computers Cartridge images (CAR, with and without floating point) and the new Atari 5200 Cartridge images (BIN). Also, for advanced users, now the language can be extended without modifying the compiler sources, by writing new target files, there is an example in the compiler manual for writing a new statement and a new function, see https://github.com/dmsc/fastbasic/blob/master/compiler/USAGE.md#extending-the-language There is a few new language extensions: - TAB() function inside PRINT, moves to a column multiple of a number. - DIM can be used to declare normal variables (like "DIM X$, Z"), the variables are automatically initialized to 0 or empty strings. - The comma in prints now uses the TAB function internally, so it behaves more consistently in screen output (but in a different way that Atari BASIC). Well, you can download all the usual files from Github: https://github.com/dmsc/fastbasic/releases/tag/v4.6-beta Attached is a test program, the "joyas" game ported to the Atari 5200 Have Fun! EDIT: final 4.6 version is released: joyas.bas joyas.bin
- 35 replies
-
- 18
-
Hi! After the long beta period, FastBasic version 4.6 is out! Over the last beta, there are many bug-fixes and optimizations, and also there is a new COLOR() function to PRINT, so you can easily alter the text color in graphics modes 1 and 2: GR.1 : X = 123 ? #6, X ? #6, COLOR(32) X+1 ? #6, COLOR(128) X+2 ? #6, COLOR(160) X+3 This also works in graphics 0, but the only available option is using COLOR(128) to print in inverse video. As always, you can download the ATR, the manual and the cross-compiler from github: https://github.com/dmsc/fastbasic/releases/tag/v4.6 . This is the full list of changes from version 4.5: FastBasic 4.6: The Atari 5200 release! A new major feature: now the FastBasic PC compiler can produce Atari 5200 cartridge images. This version uses a new PC compiler, rewritten to support multiple targets with one binary, you can specify the target with the new option -t:, the available targets are: atari-fp: produces Atari 800 XEX programs, with support for floating-point. atari-int: the old "integer only" version, produces Atari 800 XEX programs that don't use the floating-point package. a5200: produces cartridges for the Atari 5200 atari-cart: the same as atari-fp, but producing cartridge images for the Atari 800. atari-cart-int: the same as atari-int, but producing cartridge images for the Atari 800. Read more about the Atari 5200 port in https://github.com/dmsc/fastbasic/blob/master/a5200.md New language additions There are now PRINT functions that allows formatting the output for PRINT command: TAB() function, moves to a column multiple of a number. RTAB() function to right-align the next argument to a specified column. COLOR() function to specify the text color (or inverse mode) of the text, see #47. DIM can be used to declare normal variables (like DIM X$, Z), the variables are automatically initialized to 0 or empty strings. DATA statements can be placed in ROM instead of RAM (useful for Atari 800 cartridges or Atari 5200). Allows writing to more than one register in a DLI, see #45 Changes in the runtime The comma in prints now uses the TAB function internally, so it behaves more consistently in screen output (but in a different way that Atari BASIC). MOVE and -MOVE are faster, using code in zero-page. Fixes crash when setting DLI, #49 More size optimizations, integer IDE is still less than 8kB of size. Changes to the cross-compiler Rewritten to allow multiple targets by configuration files. Allows building Windows version native and ports the cross-compiler test-suite to Windows. Prints better compiler error messages. Allows defining symbols for the linker and passing arbitrary arguments. Have Fun!
-
Hi All! As @777ismyname said, I just published a test version for the new FastBasic release. Please, help me testing it so I can make a new release in time for the BASIC 10 liner contest There is a big new feature: parameters for the PROC/EXEC, like this example: exec Test 1, 2 for i=1 to 4 exec Test 5 - i, i next proc Test a b ? "Testing: "; a, b endproc Notice that in the EXEC the parameters are separated with commas, but in the PROC the corresponding variables are separated with spaces. Also, the variables in the proc are not "local" like most languages, as all variables in FastBasic are global and the parameters are simply variables, the above code is basically equivalent to: a=1 : b=2 : exec Test for i=1 to 4 a=5-1 : b=i : exec Test next proc Test ? "Testing: "; a, b endproc Also, in the Atari IDE the parser does not verify that the number of arguments passed to the EXEC is the same as received by the PROC, I plan to add a check to the floating-point version in a future version. In addition to the above, there are other changes to the language: - You can include arbitrary characters in string constants by using the hex value, like: PRINT "Hello"$9B"World" . So, now you can easily include he EOL character in strings directly, and in the cross compiler you can write Atari characters in strings simply by the ATASCII code. - Added PAUSE without a parameter, this is the same as PAUSE 0, "wait for vsync". - PROC has a shorter abbreviation: PR., - The parser is more robust to syntax errors, I discovered some erroneous inputs that could slow down the parser a lot. Many improvements to the editor: - Much faster COPY/PASTE operations, - Restores left-margin value on exit to DOS, - Remove P/M graphics when returning to the editor from user programs. And improvements to the cross-compiler: - Better error messages from some syntax errors, and fixes in parsing of big numbers. - Check for PROC and EXEC parameters mismatch. - An option to write an expanded and indented listing from an abbreviated listing, "-l" Adding the support for PROC parameters while keeping the integer IDE under 8kb was a lot harder than expected, but I finally managed to squeeze a few bytes from the editor and made it fit, currently the "FBI.XEX" file is 8189 bytes! As always, you can download the ATR, the manual and the cross-compiler from github: https://github.com/dmsc/fastbasic/releases/tag/v4.5-rc I plan to do a few extra commits before the release, but nothing big. Have Fun!
- 59 replies
-
- 11
-
I finally managed to finish the DLI work, so here is the new FastBasic version, ready for the 2020 tenliners! You can now create a DLI with a simple syntax, capable of changing registers at multiple locations in the screen. The full documentation is in the manual at https://github.com/dmsc/fastbasic/blob/master/manual.md#display-list-interrupts , but here is a little sample of the DLI support, showing how to multiplex two P/M to create 4 moving two-color sprites: ' Player shapes DATA p1() BYTE = $E7,$81,$81,$E7 DATA p2() BYTE = $18,$3C,$3C,$18 ' Players horizontal positions DATA pos() BYTE = $40,$60,$80,$A0 ' Players colors DATA c1() BYTE = $28,$88,$C8,$08 DATA c2() BYTE = $2E,$80,$CE,$06 ' Our DLI writes the position and ' colors to Player 1 and Player 2 DLI SET d3 = pos INTO $D000, pos INTO $D001, DLI = c1 INTO $D012, c2 INTO $D013 ' Setup screen GRAPHICS 0 : PMGRAPHICS 2 ' Setup our 4 DLI and Players FOR I = 8 TO 20 STEP 4 POKE DPEEK(560) + I, 130 MOVE ADR(p1), PMADR(0)+I*4+5,4 MOVE ADR(p2), PMADR(1)+I*4+5,4 NEXT ' Activate DLI DLI d3 ? "Press a Key" ' Move objects! REPEAT PAUSE 0 pos(0) = pos(0) + 2 pos(1) = pos(1) + 1 pos(2) = pos(2) - 1 pos(3) = pos(3) - 2 UNTIL KEY() ' Disable DLI and ends DLI Attached is the resulting XEX, this is the resulting screen: The new release is over github, download at: https://github.com/dmsc/fastbasic/releases/tag/v4.3 Have Fun! dlitest.xex
- 34 replies
-
- 20
-
Hello, I have question - when I want to load data from disk to my code I have to specify location of memory where it will start loading. Question is - how I know what locations of RAM are free so I can load there data ? Another question - how to create binary file with level data on PC so I can load it up in FastBasic code ? I mean I can convert decimal numbers to binary and paste it for example to notepad but how convert for example PC text file with binary data to binary file ready to load up in FastBasic?
-
Hello, could someone explain why we poke value 130 when we wanna do DLI in this example ? Why when I try to use GRAPHICS 18 instead of GRAPHICS 0 in this example don't work? What should I do if I want use this example with GRAPHICS 18 ? ' Define the DLI: set background 2 ' color to $24 = dark red. 3 DLI SET d1 = $24 INTO $D01A 4 ' Setups screen 5 GRAPHICS 0 6 ' Alter the Display List, adds 7 ' a DLI at line 11 on the screen 8 POKE DPEEK(560) + 16, 130 9 ' Activate DLI 10 DLI d1 11 ' Wait for any keyu 12 ? "Press a Key" : GET K 13 ' Disable the DLI 14 DLI
-
Hi all! I have a new beta (test) version of the next FastBasic release (4.4), I need your help testing the IDE - specially the editor, as it has many changes under the hood to make it smaller. The changes in this version are: - Adds BREAK key handling to the IDE - this was long overdue, now you can press BREAK key to return to the IDE from your program. - Adds COPY/PASTE to the editor, you need to press CONTROL-M to "mark" a line in the editor, then when you press CONTROL-C that line is copied after the current one. Pressing CONTROL-C multiple times copies multiple lines. Changes to the language: - Adds "CLR" statement, that un-dimension arrays and sets all variables to 0. Changes to the cross-compiler: - Allows to compile to code that can be put in a cartridge - by removing all uses of self-modifying-code and adding a stub to copy the zeropage interpreter from ROM to RAM at startup. - Allows accessing to DATA's from external assembly files. - The CC65 tools are included in the distribution, you don't need to install CC65 to use the cross-compiler anymore. Have Fun! EDIT: See newer beta version at: fastbasic-v4.4-beta-macosx.zip fastbasic-v4.4-beta-win32.zip fastbasic-v4.4-beta.atr fastbasic-v4.4-beta-linux64.zip
- 39 replies
-
- 17
-
UPDATE: There is now a new version at: Hi all! To start the new year, and to provide a better Basic for all the new ten-liners, I'm releasing version 4.0 of FastBasic. The major changes in this version are under the hood: The interpreter has been changed from a stack-base virtual machine to a register plus stack, this makes the interpreter from 10% to 20% faster depending in the program. In the SIEVE.BAS benchmark, the Atari version is 13% faster and in the cross-compiler is 19% faster, but programs depending on fast PEEK and POKE should be much faster. There is now a full test-suite to automatically catch regressions in the parser and interpreter, ensuring that bugs don't re-appear. Also, there are some user visible changes: There is now a command-line compiler "FBC.COM", this allows compiling large programs that don't fit in the full editor. Currently, "FBC" accepts the full floating-point syntax. Added minimal support for Player/Missile graphics: PMGRAPHICS (abbreviated PM.) statements setups P/M, PMHMOVE (abbreviated PMH.) horizontal moving a a player/missile, PMADR() returns the address of the given player/missile data. Many small bugs fixed. In this version the integer IDE is 8188 bytes in size (we still have 4 bytes less than 8K), and the floating-point IDE is 9405 bytes. As always, full sources and binaries for Atari, Linux, Windows and MacOS are available over Github: https://github.com/dmsc/fastbasic/releases
- 51 replies
-
- 25
-
Hi all! As you may have read in the thread Merge 3 Games , with the help of @MrFish I expanded my tenliner "joyas" to a full game. I ported the game from TurboBasic to FastBasic to include as an example in the distribution, so it is written completely in FastBasic, and the source is available to expand and modify. The game is a variation on the match-three pieces kind of game, there are 3 main game modes with two difficulty levels each: - Moves: in this mode, you start with 15 moves and gain one move at each power of two points (2, 4, 8, 16, etc.). When you run out of moves, the game ends. - Timer: In this mode, you start with 15 seconds, and you gain one second for each three pieces matched, two seconds for each four-match, three seconds for five-match, etc. After the time runs out, the game ends. - Hard: This is a combination of both above, you start with 15 moves and *loose* one move each second, but gain moves on matches. Also, there are "+" versions of the moves with increased difficulty: the pieces that match at the start of the game don't add to the points. Attached is the XEX and the source, you can compile it with the fastbasic cross compiler or type in the Atari IDE. All the graphics are drawn by MrFish, the code is by me. (simple) suggestions welcomed! joyas.bas joyas.xex