Page 3 of 4

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Fri Jul 19, 2024 12:50 pm
by mgkaiser
What's runtime ERROR2? That one isn't documented.

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Fri Jul 19, 2024 12:52 pm
by mgkaiser
In the attached file if the "BVLOAD" statements are present, it fails with runtime ERROR2. If I remove them it works as expected.

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Fri Jul 19, 2024 12:55 pm
by unartic
It is a out of string space error, but given what you're doing that is not the case. Can you include de bin files? Then I'll have a look asap

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Fri Jul 19, 2024 5:20 pm
by unartic
mgkaiser wrote: Fri Jul 19, 2024 12:52 pm In the attached file if the "BVLOAD" statements are present, it fails with runtime ERROR2. If I remove them it works as expected.
I did a test replacing the sprites with a different sprite. I did not get the error. I was testing with the to-be-released version, so it might be workingn now because of something i've changed. Allthough I can't relate it to what I did change. Or its something with your bin-files. Feel free to send them, then I'll have a look.

Looking at the code there are a few things to consider:
- You are loading the sprites in a memory area which overlaps with the screen 128 bitmap layer (in case you plan to use it)
- You are loading the screen.bin sprite into text mode tilemap area. This might be deliberate, just let you know
- ADDSPRITE expects an existing filename. By supplying an empty tring the BVLOAD (that is called in the background) will fail and will make the led be lit constantly.

I do not know what your endgoal is, but I think its worth considering having nxtBasic handle the memorylocation by using ADDSPRITE to add them all.

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Fri Jul 19, 2024 5:48 pm
by mgkaiser
unartic wrote: Fri Jul 19, 2024 5:20 pm
mgkaiser wrote: Fri Jul 19, 2024 12:52 pm In the attached file if the "BVLOAD" statements are present, it fails with runtime ERROR2. If I remove them it works as expected.
I did a test replacing the sprites with a different sprite. I did not get the error. I was testing with the to-be-released version, so it might be workingn now because of something i've changed. Allthough I can't relate it to what I did change. Or its something with your bin-files. Feel free to send them, then I'll have a look.

Looking at the code there are a few things to consider:
- You are loading the sprites in a memory area which overlaps with the screen 128 bitmap layer (in case you plan to use it)
- You are loading the screen.bin sprite into text mode tilemap area. This might be deliberate, just let you know
- ADDSPRITE expects an existing filename. By supplying an empty tring the BVLOAD (that is called in the background) will fail and will make the led be lit constantly.

I do not know what your endgoal is, but I think its worth considering having nxtBasic handle the memorylocation by using ADDSPRITE to add them all.
I moved the sprites to $13000 instead of $11300. That was always my intent and I just made a mistake. I am, in fact, loading "screen.bin" into the text screen tilemap because that is what that file contains and "char.bin" contains a redefined character set so I am loading that at $1f000.

I was purposely using empty string to avoid loading the tile in ADSPRITE, but I also tried to load "newtiles.bin" with the same result. The intent is to cycle through frames of an animation by changing the image the sprite points to.

What is error 2? It's the only one you don't document.

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Fri Jul 19, 2024 5:56 pm
by unartic
Its out of string space error. There must be something else going on as you are hardley doing any string manipulation. If you can post the other files I'm happy to take a look :-)

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Sun Jul 21, 2024 4:44 pm
by unartic
nxtBasic 0.3b is now released and ready to download.

Whats new?

Bug fixes:
  • Fixed several double used labels on the assembly side of nxtBasic
  • Fixed incorrect compile time error when using array as function param
  • Fixed bug with INPUT# returning a null-byte when eof was reached
  • Fixed bug with 4bpp color depth in ADDSPRITE method
  • Fixed bug in LEN-function
  • Fixed bug where there are comments on the same line on a CONST definition

Added:
  • Support for MacOS
  • CURSCREENMODE: returns the current screen-mode
  • GETROWS: returns number of text mode rows
  • GETCOLS: returns number of text mode columns
  • OPENFILE: an easier way to open files for reading and writing: handle=OPENFILE("Filename",READ)
  • SETDEVICE {devicenr}: sets the device all file i/o related function should use (only needed if device is not 8)
  • SETCOL: locate for column only
  • SETINDENT: sets a default indentation for the PRINT command
  • CURDIR$ - returns the current directory
  • DIRLIST/DIRITEM: to retrieve directoy listing
  • New example programs:
  • - tetris.bas - a text mode tetris clone
  • - browse-dir.bas - browse through your directory structure using DIRLIST/DIRITEm functions

Improved:
  • Changed the internal True and False statements to True=-1 and False=0, altered the AND OR and NOT operators. They now (also) function as bitwise operators
  • Changed all (but OPEN)-statements to use the SETDEVICE or device 8.
  • PLAYZCM and PLAYZSM do not longer require a filehandle, that'll be automaticly arranged by nxtBasic
  • Changed the Modulus operator from % to MOD, because it was interfering with binary assignment: a=%00110110
Docs and download:
https://github.com/unartic/nxtBasic/

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Wed Jul 24, 2024 2:03 pm
by funkheld
hello, good day.
in Germany, at 76, I can only play with the x16 emulator.

the emulator is great...great, thank you.
and this nxtbasic (compiler) is great...great, thank you.

I've just discovered this nxtbasic.
I took a break from the x16 emulator because I'm not really into the speed of this basic.
a new era is beginning now...(kamala harris......) for the x16/emulator.
is this nxtbasic for the x16 always free to use?

thanks.

greeting

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Wed Jul 24, 2024 2:40 pm
by unartic
funkheld wrote: Wed Jul 24, 2024 2:03 pm hello, good day.
in Germany, at 76, I can only play with the x16 emulator.

the emulator is great...great, thank you.
and this nxtbasic (compiler) is great...great, thank you.

I've just discovered this nxtbasic.
I took a break from the x16 emulator because I'm not really into the speed of this basic.
a new era is beginning now...(kamala harris......) for the x16/emulator.
is this nxtbasic for the x16 always free to use?

thanks.

greeting
Guten tag!

Yes, nxtBasic will be open source when it is 'finished' and will be property of the community. So it will always be free to use.

Re: nxtBasic: A New Compiler for Basic Code on the X16

Posted: Wed Jul 24, 2024 4:36 pm
by funkheld
thanks for the answer.

thank you for your work on this.

thanks.
greetings