Jump to content
IGNORED

IntyBASIC compiler v1.2.9: The good things are now better!


Recommended Posts

Hi guys.

 

I got extra inspiration for this version after fighting with complex IF in one line, now you can use block structured IF while preserving the old-style IF, even better the new DO/LOOP statement construct and a way to exit loops with EXIT. Check the manual for the full syntax.

 

Also some enhancements to DEF FN to make it more powerful. The IntyColor utility got a much needed revamp, now it allows to use MOBs in your images for extra graphics definition, automatically or with an instructions file provided by you ;)

 

Note: if you have downloaded version 1.2 before, download now latest one, it solves a bug when compiling the multiline IF statement.

 

Changes, enhancements and fixes in version 1.2:

  • Support for multiline IF/ELSEIF/END IF
  • Added statement DO WHILE expr...LOOP, DO UNTIL expr...LOOP, DO...LOOP WHILE expr, DO...LOOP UNTIL expr.
  • Added statement EXIT, use as: EXIT FOR, EXIT WHILE or EXIT DO.
  • Added #BACKTAB array to access screen directly (without using PEEK/POKE)
  • DEF FN now accepts strings in definition.
  • New LEN() function to get size of string.
  • New POS() function to get current screen position.
  • Initializes ECS sound generator.
  • Added automatic seed of pseudorandom generator with RAM trash (courtesy of GroovyBee)
  • Warnings now can be disabled with option -w
  • Macro replacement now accepts string as arguments.
  • Shows file causing error or warning when inside INCLUDE. (some very big programs developed in IntyBASIC were needing this ;) )
  • Optimized generation of code for plus constant followed by minus constant.
  • Optimized generation of code for POKE.
  • Solved bug where nested macros doesn't worked.
  • Solved several bugs in macros for multiplication by constant (not so used numbers)
  • Added a new contribution (tcg.bas) by Catsfolly.
  • Superb enhancements for IntyColor utility: (run without arguments to see usage)
    • Option -m for creating MOB automatically (for third/fourth color in same block)
    • Option -c to not include constants.c (option -m)
    • Option -r to create BMP report colored (error/GRAM/GROM)
    • Option -g to indicate how to use the MOB (use with -m)
    • Options -fx and -fy to flip in X and Y directions.
New in version 1.2.2:
  • Support for reading/writing JLP in-flash memory using the FLASH statement, now you can make your game to save your high-score tables, achievements, current position in game, etc. (new sample flash.bas)
  • Stack is now always allocated to system memory, some things moved in intybasic_epilogue.asm.
  • Generates warnings when using constants bigger than 8 bits for assignment to 8-bits variables or for TO value.
  • Generates errors if labels are redefined, undefined and warnings if never used. (instead of waiting for assembler pass to catch them)
  • New contribution 42k.bas by GroovyBee, shows how to make a maximum-sized IntyBASIC program.
New in version 1.2.3:
  • Added SIGNED statement to indicate arrays or variables of 8-bits signed. At start of your program, for example, add SIGNED a,my_array,b,c
  • SPRITE statement now allows expression on MOB index. So it's easy to write FOR A=0 TO 7:SPRITE A,0:NEXT A
  • SCREEN allows for sixth argument to support a wide origin screen, useful for horizontal scrolling or to display a fraction of a big map. (check landscape.bas)
  • Solved bug where warnings were treated as errors for final return code of command line. (it interrupted SDK compilation)
  • Solved bug where some warnings couldn't be disabled.
  • Solved bug where 16-bits variables counting was wrong.
  • New sample: landscape.bas (additional SCREEN syntax)
New in version 1.2.4:
  • Optimizes sequences of ANDI/XORI instructions.
  • Gives warning in case of assignment to variable previously declared as CONST.
  • Solved bug where ELSEIF had to be finished with ELSE.
  • A few warnings returned wrongly an error code in command-line.
  • Warns about assignment to variables reserved for IntyBASIC use.
  • Updated constants.bas
  • IntyColor: Updated for new SCREEN syntax.
  • IntyColor: MOB data for assembler mode output is now in hardware order and generates better data.
  • IntyColor: Solved color bug introduced in 1.2.1
New in version 1.2.5:
  • Added UNSIGNED statement, allows to make unsigned comparisons.
  • Added PLAY VOLUME statement.
  • Added NO DRUMS syntax to PLAY.
  • Added MUSIC JUMP statement.
  • Added MUSIC.PLAYING expression.
  • Added CALL statement (like USR but outside expressions)
  • DATA allows for string literal.
  • DO statement followed by colon now isn't taken as label.
  • Corrected bug in PAL detection.
  • Updated constants.bas (corrections and new constants for Coloured Squares mode) and keypad.bas sample.
  • Added contrib/ColouredSquares.bas a sample of drawing lines in Coloured Squares mode by GroovyBee.
  • Added samples/bats.bas (animated bats)
  • Added samples/envelope.bas (using envelope sounds)
New in version 1.2.6:
  • Detects when PROCEDURE isn't finished at end of source code. Also starting a new PROCEDURE without closing the previous one now is an error instead of a warning.
  • Added DATA VARPTR to allow arrays of pointers to arrays and/or variables.
  • Generates warning when using DEFINE and requesting more than 16 GRAM to define.
  • Internal: the mode_select variable now preserves in bit 0 the actual mode.
  • Solved bugs in multiplication by 126 and 127.
  • Solved bug in usage of JLP acceleration. (wrongly cached registers)
  • Corrected contrib/clowns.bas (catsfolly) it broke with a change in constants.bas
  • Added contrib/Gram2GromFont.bas (GroovyBee) showing how to take the GROM font and creating an entirely new font.
  • Added contrib/TinyFont.bas (GroovyBee) showing how to display 40 columns using a 4 pixel wide font.
  • Added manual notes about assembly language conventions for USR and CALL.
New in version 1.2.7:
  • Allows to concatenate lines using the character \ at the end of a line. (suggested by GroovyBee)
  • Now optimizes access to arrays when using same index even if different array or offset. (double speed in common cases!!! intvnut suggested it a long of time ago)
  • Solved bug where DEFINE VARPTR swallowed one extra lexical component.
  • Solved bug where 1024-x*x generated wrong code.
  • Solved bug where PRINT "string" as first statement would write in non-screen memory.
  • Minor edit in manual (definition of BORDER)
New in version 1.2.8:
  • Added DATA PACKED for strings, same as DATA but fits two characters per word.
  • Added OPTION EXPLICIT to force declaration of variables using DIM (without index), for example DIM A,B
  • Added OPTION WARNINGS to disable compilation warnings.
  • Warns about strange use of constants in FOR/NEXT
  • Changed CC3/JLP memory flags to "=RM" for as1600 (needed for LTO-Flash)
  • Solved three minor bugs. (optimization: reused register already trashed, weird expression a<5>b crashing, array optimization would trigger as1600 error because of "big" constant)
New in version 1.2.9:
  • Moved screen clearing at the very start of program to avoid brief title screen in Sears Intellivision.
  • Added missing C7 note in internal tables.
  • Solved MUSIC.PLAYING failing with MUSIC JUMP.
  • More optimization saving flags state across instructions.
  • Solved bug in PEEK optimization when source address was incremented between two PEEKs.
  • More indications in manual, including documenting CONT3 and CONT4.
  • VOICE.AVAILABLE for checking Intellivoice available.
  • VOICE.PLAYING for checking Intellivoice playing.
  • Solved several bugs in IntyColor and added some new features (replacement of color, generation of cards without checking duplicates, and process of images in chunks of 16 pixel high for MOB generation)
Enjoy it! ;)

intybasic_compiler_v1.2.1.zip

intybasic_compiler_v1.2.2.zip

intybasic_compiler_v1.2.3.zip

intybasic_compiler_v1.2.4.zip

intybasic_compiler_v1.2.5.zip

intybasic_compiler_v1.2.6.zip

intybasic_compiler_v1.2.7.zip

intybasic_compiler_v1.2.8.zip

intybasic_compiler_v1.2.9.zip

Edited by nanochess
  • Like 15
Link to comment
Share on other sites

  • 2 weeks later...

Updated to version 1.2.1, it solves an important bug in multiline IF statement also avoids to get stuck when processing macro call with syntax errors.

 

New things:

 

o Added #BACKTAB array (direct access to screen)
o Optimized code generation for POKE.
o Optimized plus constant followed by minus constant.

o New options -fx and -fy for IntyColor, flips image in X and Y directions. (suggested by First Spear)

o Updated tcg.bas contribution by catsfolly

  • Like 1
Link to comment
Share on other sites

 

This doesn't consume valuable memory, does it? :) I assume you're just doing some clever lookups under the covers like we've all done manually up till now.

 

Doesn't use extra memory. It's a shadow over the real BACKTAB buffer, you can write directly to screen like an array.

 

Given the small memory capacity of Intellivision (although a lot more than Atari VCS) I'm very careful to not add new variables and instead trying to reduce memory footprint.

  • Like 2
Link to comment
Share on other sites

Updated to version 1.2.2 with support for erasing/reading/writing JLP Flash memory ;) (check first post)

 

Now you can make your games to save high-score tables, achievements, positions and so.

 

BTW, forgot to put this in manual:

    Don't forget to use the option --jlp in jzintv and --jlp-savegame=file
I remember promising this support more than one year ago :grin:
  • Like 3
Link to comment
Share on other sites

I might be missing something, but inspired by atari2600land's thread, I compiled this very simple program:

 

 

score = 0

 

On both IntyBASIC 1.1 and 1.2.1, the output says the program uses 1 8-bit variable of 228 available and 0 16-bit variables of 47 available.

On IntyBASIC 1.2.2, the output says the program uses 1 8-bit variable of 228 available and 1 16-bit variable of 47 available.

 

Further testing suggests that with 1.2.2, for each 8-bit variable declared, the number of 16-bit variables also is increased, but for each 16-bit variable, the counter on 8-bit variables is untouched as it should. Has anyone else noticed this?

Link to comment
Share on other sites

I might be missing something, but inspired by atari2600land's thread, I compiled this very simple program:

score = 0

On both IntyBASIC 1.1 and 1.2.1, the output says the program uses 1 8-bit variable of 228 available and 0 16-bit variables of 47 available.

On IntyBASIC 1.2.2, the output says the program uses 1 8-bit variable of 228 available and 1 16-bit variable of 47 available.

 

Further testing suggests that with 1.2.2, for each 8-bit variable declared, the number of 16-bit variables also is increased, but for each 16-bit variable, the counter on 8-bit variables is untouched as it should. Has anyone else noticed this?

 

A bug, just I'm uploading v1.2.3 ;)

  • Like 3
Link to comment
Share on other sites

The new Sprite and Landscape stuff is really, really good. Thank you!

 

[snip]

  • Added SIGNED statement to indicate arrays or variables of 8-bits signed. At start of your program, for example, add SIGNED a,my_array,b,c
  • SPRITE statement now allows expression on MOB index. So it's easy to write FOR A=0 TO 7:SPRITE A,0:NEXT A
  • SCREEN allows for sixth argument to support a wide origin screen, useful for horizontal scrolling or to display a fraction of a big map. (check landscape.bas)
  • Solved bug where warnings were treated as errors for final return code of command line. (it interrupted SDK compilation)
  • Solved bug where some warnings couldn't be disabled.
  • Solved bug where 16-bits variables counting was wrong.
  • New sample: landscape.bas (additional SCREEN syntax)

 

Enjoy it! ;)

  • Like 1
Link to comment
Share on other sites

While testing the last features of version 1.2.3, I went to this statement:

 

	WAIT
	if (s=0) then
		SCREEN screen_0+wframe*(11*15),0,2,15,11,15
		wframe = (wframe+1) and 3
	end if		

I wanted to flip 4 blocks of 15x11 from ROM, but the compiler gives a strange warning, aborting compilaton:

 

IntyBASIC compiler v1.2 Sep/01/2015
© 2014-2015 Oscar Toledo G. http://nanochess.org/
Warning: invalid extra characters in line 45
23 used 8-bit variables of 228 available
1 used 16-bit variables of 47 available
Compilation finished
IntyBASIC compilation failed.
Program build aborted.
It seems that no expression is allowed on the label parameter and that the compiler does not report correctly the error.
I ended to use this:

		on  wframe goto f0,f1,f2,f3
f0:			SCREEN screen_0,0,2,15,11,15: goto f4
f1:			SCREEN screen_1,0,2,15,11,15: goto f4
f2:			SCREEN screen_2,0,2,15,11,15: goto f4
f3:			SCREEN screen_3,0,2,15,11,15
f4:		wframe = (wframe+1) and 3

I was wandering about having as parametric expression the label where the screen has been stored.

Is it possible somehow ?

 

[ Maybe something like VARPTR label(expr) as in DEFINE may work ;-) ]

 

 

dzgorf.rom

Edited by artrag
  • Like 2
Link to comment
Share on other sites

While testing the last features of version 1.2.3, I went to this statement:

 

	WAIT
	if (s=0) then
		SCREEN screen_0+wframe*(11*15),0,2,15,11,15
		wframe = (wframe+1) and 3
	end if		

I wanted to flip 4 blocks of 15x11 from ROM, but the compiler gives a strange warning, aborting compilaton:

 

IntyBASIC compiler v1.2 Sep/01/2015
© 2014-2015 Oscar Toledo G. http://nanochess.org/
Warning: invalid extra characters in line 45
23 used 8-bit variables of 228 available
1 used 16-bit variables of 47 available
Compilation finished
IntyBASIC compilation failed.
Program build aborted.
It seems that no expression is allowed on the label parameter and that the compiler does not report correctly the error.
I ended to use this:

		on  wframe goto f0,f1,f2,f3
f0:			SCREEN screen_0,0,2,15,11,15: goto f4
f1:			SCREEN screen_1,0,2,15,11,15: goto f4
f2:			SCREEN screen_2,0,2,15,11,15: goto f4
f3:			SCREEN screen_3,0,2,15,11,15
f4:		wframe = (wframe+1) and 3

I was wandering about having as parametric expression the label where the screen has been stored.

Is it possible somehow ?

 

[ Maybe something like VARPTR label(expr) as in DEFINE may work ;-) ]

 

 

 

I think that all statements that take a label should accept a VARPTR() expression as well. I know that Oscar has been adding this in some statements, so maybe it's just a matter of time.

 

About the error, are you using "include"? Because the compiler tends to report the line number of the final composite source stream, instead of the local line of the specific source file that caused the exception. That's not very helpful, but it has been reported already as a bug, so perhaps it'll be fixed soon.

 

The ROM looks good, although it does not have my name this time. ;)

 

(Just kidding, artrag! It's looking cool.)

Link to comment
Share on other sites

While testing the last features of version 1.2.3, I went to this statement:

 

	WAIT
	if (s=0) then
		SCREEN screen_0+wframe*(11*15),0,2,15,11,15
		wframe = (wframe+1) and 3
	end if		

I wanted to flip 4 blocks of 15x11 from ROM, but the compiler gives a strange warning, aborting compilaton:

 

IntyBASIC compiler v1.2 Sep/01/2015
© 2014-2015 Oscar Toledo G. http://nanochess.org/
Warning: invalid extra characters in line 45
23 used 8-bit variables of 228 available
1 used 16-bit variables of 47 available
Compilation finished
IntyBASIC compilation failed.
Program build aborted.
It seems that no expression is allowed on the label parameter and that the compiler does not report correctly the error.
I ended to use this:

		on  wframe goto f0,f1,f2,f3
f0:			SCREEN screen_0,0,2,15,11,15: goto f4
f1:			SCREEN screen_1,0,2,15,11,15: goto f4
f2:			SCREEN screen_2,0,2,15,11,15: goto f4
f3:			SCREEN screen_3,0,2,15,11,15
f4:		wframe = (wframe+1) and 3

I was wandering about having as parametric expression the label where the screen has been stored.

Is it possible somehow ?

 

[ Maybe something like VARPTR label(expr) as in DEFINE may work ;-) ]

 

 

 

You can accomplish exactly the same using:

 

 

SCREEN screen_0,wframe*(11*15),2,15,11,15

 

It's not obvious immediatly but the parameter following screen_0 is added to screen_0 ;)

Link to comment
Share on other sites

Great! Thanks.

 

PS

This segment of code:
for n=0 to 7
WAIT:DEFINE DEF00+n*8,8,sprites+(n*64)
next

generates the very same warning I had above with SCREEN:

 

IntyBASIC compiler v1.2 Sep/01/2015
© 2014-2015 Oscar Toledo G. http://nanochess.org/
Warning: invalid extra characters in line 24

where line 24 is the DEFINE statement.

 

 

PS
More extra nasty aliens in this rom

 

dzgorf.rom

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

Great! Thanks.

 

PS

This segment of code:
for n=0 to 7
WAIT:DEFINE DEF00+n*8,8,sprites+(n*64)
next

generates the very same warning I had above with SCREEN:

 

IntyBASIC compiler v1.2 Sep/01/2015
© 2014-2015 Oscar Toledo G. http://nanochess.org/
Warning: invalid extra characters in line 24

where line 24 is the DEFINE statement.

 

 

PS

More extra nasty aliens in this rom

 

 

From the manual definition for DEFINE :) rewrite as this:

for n=0 to 7
WAIT:DEFINE DEF00+n*8,8,VARPTR sprites(n*32)
next

It's 32 because two BITMAP statements fit in one word of memory, so each sprite of 8x8 uses 4 words of memory. So 4 words * 8 sprites = 32

 

BTW, you really really should enter in the IntyBASIC contest with this current demo at least :)

  • Like 1
Link to comment
Share on other sites

Just found a small bug in syntax parsing, the following code will generate an error in assembly:

 

    IF expr THEN
    ELSEIF expr THEN
    END IF

This can be solved including an extra ELSE before END IF, you don't need to put any code:

 

    IF expr THEN
    ELSEIF expr THEN
    ELSE
        ' Bug patch
    END IF

It will be solved in next IntyBASIC version.

Link to comment
Share on other sites

I've used 'on frame' for the first time today. I used it as a sound effect player.

on frame gosub SoundFXEn

And my current sound function.

SoundFXEn:procedure
if SL=0 then sound 0,0,0 else SOUND 0,sound(SL+SPointer),V:SL=SL-1
if SL2=0 then sound 1,0,0 else SOUND 1,sound2(SL2+SPointer2),V2:SL2=SL2-1
return
end

I no longer have to reserved 16 words for sound data. I don't have to worry about having sound statement in the gameloop and outside of it, have the sound frozen, or have the sound play slower due to slowdown.

  • Like 1
Link to comment
Share on other sites

PS

does the music command set somehow the register that mix noise and tunes ? I think that play music and sound could "interfere" each other on the setting on the mixer register (on AY8910 it is register 7, it should be the same on AY8912)

 

PPS

According to the manual, PLAY SIMPLE should reserve the 3rd channel to sfx

Nevertheless in this test in attach the sound of the bullets seems to interfere with the music.

dzgorf.rom

dzgorf.bas

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

PS

does the music command set somehow the register that mix noise and tunes ? I think that play music and sound could "interfere" each other on the setting on the mixer register (on AY8910 it is register 7, it should be the same on AY8912)

 

PPS

According to the manual, PLAY SIMPLE should reserve the 3rd channel to sfx

Nevertheless in this test in attach the sound of the bullets seems to interfere with the music.

The music player always use the noise channel.

Link to comment
Share on other sites

  • 2 weeks 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...