I've put the IntyBASIC compiler v1.0 out of the oven, this compiler has made a long way since its first release in Jan/28/2014
I wanted to put every suggested feature into it, but I went for the most useful first over the ones that were another way of doing things.
- PRINT finally allows to display decimal numbers, the library for this was provided by intvnut (many thanks!)
- Everyone wanted it, so now there is Intellivoice support using the VOICE statement, the library also provided by all-powerful intvnut. (note: not yet tested in real hardware, but it should work)
- Added --jlp switch in command line for using 16-bits RAM memory (almost 8000 words for arrays/variables) and also for multiplicacion/division acceleration via hardware. (for JLP boards)
- Added ABS function (I'm almost sure freeweed suggested this)
- Support for READ A(x) (requested by CrazyBoss)
- Added USR function to call easily assembler functions (what you need DZ-Jay )
- Added DEFINE ALTERNATE so now you can define two separate GRAM blocks in one frame. (Tarzilla asked for this?)
- Optimization of code generation in several ways so code will be slightly smaller and faster (specially PRINT with strings)
- Removes extra RETURN at end of procedure if the statement combination RETURN/END is used
- MUSIC statement alone doesn't activate the tracker module. Only if PLAY is used.
- Warns if PROCEDURE is used without ending previous PROCEDURE.
- Also warns of END used without starting PROCEDURE.
- Intvnut also provided the IntySmap utility for mapping assembly code to BASIC source and easing debugging with jzintv.
- DZ-Jay provided the intbas.pl script for structuring your projects.
I think this will be more than enough for a long time, because this has taken me a long time!
Two pretty small updates one hour after this post was published, please download again. Thanks!
Edit: IntyColor allows to generate BITMAP statements instead of DATA ones
Edit: (Dec/15/2014) And some more improvements to IntyBASIC v1.0.1, I think these are way very useful
- Statements DEFINE, SCREEN and PLAY allow the use of an array as reference, in order to ease dynamic modification of data.
- DEFINE statement allows VARPTR syntax to ease choosing a bitmap from a definition using expressions
- Corrected total of free variables, it indicated one more than available.
- Further optimization of code generation for PRINT.
- Optimization of code generation for array access and PEEK.
- Optimization of code generation for trees of addition and substraction with constant (PRINT AT and others)
- Uses an ultra-optimized macro for multiplication up to 127 (provided by DZ-Jay, I had to implement this!! )
- Speed up of code for keypad decoding (it was using way too much processor power)
- Wind*ws version of IntySmap (I forgot to include it before)
- Many thanks to Kiwi for contributing Apple Catcher as a game sample.
- Many thanks to catsfolly for contributing Clowns&Ballons as a game sample.
Edit: (Jan/25/2015) More enhancements for IntyBASIC v1.0.2
- Support for changing title of compiled programs (via --title option in arguments)
- Support for Cuttle Cart 3, same as JLP but no hardware acceleration for multiplication/division (via --cc3 option)
- New CONT.* syntax, allows to check both controllers at same time!
- Support for ON FRAME GOSUB, kind of interrupt support calling IntyBASIC code.
- New sample frame.bas
- Added usage instructions when running IntyBASIC without arguments.
- Manual available in Spanish.
Edit: (Feb/18/2015) More enhancements for IntyBASIC v1.0.3
- Added support for SGN() function (returns -1, 0, or 1 per sign of argument)
- Added statements WHILE/WEND for loops
- Added PLAY NONE statement to deactivate music player when needed (reactivate with PLAY SIMPLE/FULL) so you can finally use the noise channel to create big explosions.
- Added sample of vertically scrolling a large bitmap over screen.
- Solved bug where some alone statements were taken as labels if followed by colon.
- Returns status to command line for batch scripts.
- IntyColor: Support for images of any size (but multiple of 8 in X and Y directions) to support scrolling maps.
- IntyColor: Added option for base offset in number of GRAM cards.
- IntyColor: Returns status to command line for batch scripts.
- IntyColor: Shows current color number and stack color numbers when "choking" in Color Stack mode.
Edit: (Apr/23/2015) Mostly fixes and enhancements for IntyBASIC v1.0.4
- Added support for secondary PSG in ECS (SOUND 5-9). Using it will activate code to deactivate ECS ROM.
- Added RAND(limit) for getting a random number in the range 0..limit-1 (note it includes mult. routine)
- Added intvnut routine for fast multiplication, used and included only for expressions saying var * var.
- Slight optimization when using PRINT with spaces as output.
- Modulus operator optimizes every power of 2.
- Multiplication by 32, 64 and 128 is now optimized.
- Division by 32, 64 and 128 is now optimized.
- Solved bug where constant in left side of multiplication operator wasn't optimized.
- Solved bug where if last statement inside last IF was RETURN, PROCEDURE wouldn't insert final RETURN.
- Solved bug in space counting for 8-bits and 16-bits variables.
- Solved bug in IntyColor where "wide" bitmaps (longer than 160px) where badly processed.