Jump to content
IGNORED

IntyBASIC compiler


nanochess

Recommended Posts

Good stuff! Just took a very quick look at one of the demo games final output and I have some suggestions :-

 

- How about using cart.mac? Its the modern way ;)

 

The user can change intybasic_prologue.asm to his/her taste.

 

- Maybe including tighter integration with the sdk1600 library code to make use of printing, memory copy, memory fill, voice etc.

 

Currently I want to keep it simple and fast. Minimum library required to leave most space possible for user.

 

- Sound code seems to wait for the ISR to trigger. How about updating it in the ISR instead? That way you can play sounds and "do work" at the same time.

 

The SOUND statement works immediately. It doesn't wait for ISR.

 

- Looking at your ISR "display kernel" it'd be an ideal candidate to allow fractional positioning in the game's main loop as I outlined here.

The programmer can use 16-bits variables in his program along with the divide per 16 operator (optimized to logical shift) and the SPRITE statement.

 

So ISR can be keep simple.

 

- Move GRAM reprogramming to after the MOBs have been updated. During VBLANK you are allowed to access GRAM/GROM for longer than the STIC's MOB registers (see interrupts.txt in the sdk1600 programming folder for more info).

 

This is an excellent suggestion.

 

- Maybe add kernel build options to call the Inty tracker routines, hand controller button handling etc.

 

Fairly complex. I need to research it.

 

In particular controller buttons support will have to wait until I've a real Intellivision.

 

- Any plans to support on cart RAM?

 

Currently not. Probably this would require arrays enhancement to the language.

 

Anyways... Its a brilliant addition to the Inty game development tools and I'm looking forward to seeing where you take it.

Thanks! :)

Link to comment
Share on other sites

Do I have the option to use a different emulator than JZIntv to run compiled software? Because that one is, uh, not very user-friendly. Nostalgia won't run the software at all; it gives me a "configuration error."

I only have tested JZIntv but I'll check into this.

Link to comment
Share on other sites

Oh baby, you know what I like!

 

Just promise me you won't do what that Martijn Wenting guy did and announce a BASIC compiler without actually releasing one. God, it's been years and I'm STILL pissed about that!

 

I actually bought a Vectrex solely for the purpose of his BASIC compiler. Not mad at him but pretty disappointed with the situation.

Link to comment
Share on other sites

The user can change intybasic_prologue.asm to his/her taste.

It also affects how you allocate the RAM you use too.

 

Currently I want to keep it simple and fast. Minimum library required to leave most space possible for user.

You can pick and choose what routines are used from the library.

 

The SOUND statement works immediately. It doesn't wait for ISR.

OK. I was looking at the final *.asm file and didn't look at the original BASIC version.

 

The programmer can use 16-bits variables in his program along with the divide per 16 operator (optimized to logical shift) and the SPRITE statement.

Sure but spriteX=spriteX+1.5 being "magically converted" into

mvi spriteX, r0
addi #$8001, r0
adcr r0
mvo r0, spriteX
Is much more readable to the BASIC coder and you don't have to worry about taking care of the carry before you do the addition.

 

In particular controller buttons support will have to wait until I've a real Intellivision.

No worries.

 

Currently not. Probably this would require arrays enhancement to the language.

Or you could have some sort of command prefix to put them in cart RAM.

  • Like 1
Link to comment
Share on other sites

Do I have the option to use a different emulator than JZIntv to run compiled software? Because that one is, uh, not very user-friendly. Nostalgia won't run the software at all; it gives me a "configuration error."

 

Just I've checked and Nostalgia 5.0 can run fine the IntyBASIC programs. Copy both game.bin and game.cfg files to your Nostalgia roms folder.

 

Alternatively use the utility bin2rom included with jzintv like this:

bin2rom game.bin

And it will generate an unique game.rom file that is useable by Nostalgia.

 

Do you have a TV that can except NTSC nanochess? I'm sure one of us could donate a little something something.

 

Yep, I've a NTSC TV. Don't worry. I'll try to get one Intellivision in next months or maybe...

 

Yah it's on my to do list :)

 

...cmart604 Intellivision comes first :). Thanks!

Link to comment
Share on other sites

Someone had recommended a different build; one with a GUI included. That seemed to get the job done!

 

Anyway, I ran my first program, which looks like this:

starters:
a = rand
cls
print a
goto starters

I thought this would display a stream of random numbers at the top left of the screen (from 0 to 255). Instead, it showed a stream of different characters in different colors. I'm not sure what's going on with that.

 

Also, is there a way to print characters in specific areas of the screen? That way I wouldn't have to keep using CLS.

  • Like 1
Link to comment
Share on other sites

Nice job Nanochess!

 

Has anyone tried the samples on the Cuttle cart?

 

I'm waiting for someone to do that :)

 

Someone had recommended a different build; one with a GUI included. That seemed to get the job done!

 

Anyway, I ran my first program, which looks like this:

starters:
a = rand
cls
print a
goto starters

I thought this would display a stream of random numbers at the top left of the screen (from 0 to 255). Instead, it showed a stream of different characters in different colors. I'm not sure what's going on with that.

 

Also, is there a way to print characters in specific areas of the screen? That way I wouldn't have to keep using CLS.

 

Technically you shouldn't do that because PRINT can overwrite the stack if you exceed the screen.

 

Also PRINT is primitive for game purposes (check game2.bas source code,) it cannot display numbers unless you select the right GROM card. For example:

 

PRINT (A/8+16)*8+(A AND 7)

 

This way it selects the GROM character (number are in cards 16 to 25) and adds the color.

 

In order to put something at a position in screen (0-239 sequentially starting in top-left,) use this: (string only for clarification)

 

PRINT AT 0,"A" ' for upper-left corner

PRINT AT 19,"B" ' for upper-right corner

PRINT AT 220,"C" ' for bottom-left corner

PRINT AT 239,"D" ' for bottom-right corner

 

Only for strings you can use COLOR, by example with your random value:

 

PRINT AT 84 COLOR (A AND 7),"HELLO WORLD"

  • Like 1
Link to comment
Share on other sites

This is amazing! Colecovision has C programming and Atari has AtariBASIC. Intellivision definitely need a BASIC program such as this.

I got the test program to compile, so I'm all set to learn the basic. One of my challenge as right now is to make a tileset made and have it displayed. Also learn the GROM set as well. I will have to PEEK and POKE around to get that working.

Link to comment
Share on other sites

This is amazing! Colecovision has C programming and Atari has AtariBASIC. Intellivision definitely need a BASIC program such as this.

 

I got the test program to compile, so I'm all set to learn the basic. One of my challenge as right now is to make a tileset made and have it displayed. Also learn the GROM set as well. I will have to PEEK and POKE around to get that working.

 

There is a dumping GROM program included with jzintv, it generates a grom.txt file will every figure.

 

Check sprites.bas and game2.bas to see how to define tilesets, they are shared by sprites. And then you can use PRINT "/256/257/258" upto /319 (note change slash to inverted slash, I couldn't type it)

 

Check manual for DEFINE statement and PRINT statement with string.

 

I hope to put soon a BASIC sample of tile definition.

Link to comment
Share on other sites

main:
cls
wait
PRINT AT 84 COLOR 5,"HELLO WORLD"
PRINT AT 0 COLOR 1, "\69"
for c=1 TO 79
PRINT COLOR 1, c
next c
end:
goto end

post-24767-0-92002100-1391060395_thumb.jpg

 

I played around with the PRINT statement a bit. I got the unique tile from the GROM to print. I also attempt to make it write out all the GROM. I'm confident that I'll be able to get the unique tiles uploaded soon. :thumbsup:

  • Like 4
Link to comment
Share on other sites

I uploaded a video of the sample programs running from an Intellivision using a Cuttle Cart 3.

 

 

Nice Ed! I'm still trying to track down my Cuttle Cart. When you added it to the cart was there anything special you needed to do? I recall the process of updating the cart to be a bit quirky and using a database to check CRCs values for known carts. With these obviously not being the database I was wondering what was needed. Thanks!

Link to comment
Share on other sites

This is an example IntyBASIC program for creating a title screen using a defined and animated tile, it will be included in future versions of IntyBASIC:

	REM
        REM Animated title screen
        REM Demo for IntyBASIC
        REM by Oscar Toledo G.  http://nanochess.org/
        REM Jan/30/2014
        REM
        WAIT
	DEFINE 0,1,bitmaps0
	WAIT
	CLS
	PRINT COLOR 6
	PRINT AT   4,"\256\256\000\000\256\256\256\000\256\256\256"
	PRINT AT  24,"\256\000\256\000\000\256\000\000\256\000\000"
	PRINT AT  44,"\256\256\000\000\000\256\000\000\256\000\256"
	PRINT AT  64,"\256\000\256\000\000\256\000\000\256\000\256"
	PRINT AT  84,"\256\256\000\000\256\256\256\000\256\256\256"
	
	PRINT AT 122,"\256\256\256\000\256\256\256\000\256\000\256\000\256\256\256"
	PRINT AT 142,"\256\000\000\000\256\000\256\000\256\256\256\000\256\000\000"
	PRINT AT 162,"\256\000\256\000\256\256\256\000\256\256\256\000\256\256\000"
	PRINT AT 182,"\256\000\256\000\256\000\256\000\256\000\256\000\256\000\000"
	PRINT AT 202,"\256\256\256\000\256\000\256\000\256\000\256\000\256\256\256"
loop:
    WAIT
	WAIT
	DEFINE 0,1,bitmaps1
	WAIT
	WAIT
	DEFINE 0,1,bitmaps2
	WAIT
	WAIT
	DEFINE 0,1,bitmaps3
	WAIT
	WAIT
	DEFINE 0,1,bitmaps0
	GOTO loop

bitmaps0:
	BITMAP "11111110"
	BITMAP "11111110"
	BITMAP "11111110"
	BITMAP "00000000"
	BITMAP "11101111"
	BITMAP "11101111"
	BITMAP "11101111"
	BITMAP "00000000"

bitmaps1:
	BITMAP "11111110"
	BITMAP "00000000"
	BITMAP "11101111"
	BITMAP "11101111"
	BITMAP "11101111"
	BITMAP "00000000"
	BITMAP "11111110"
	BITMAP "11111110"

bitmaps2:
	BITMAP "11101111"
	BITMAP "11101111"
	BITMAP "11101111"
	BITMAP "00000000"
	BITMAP "11111110"
	BITMAP "11111110"
	BITMAP "11111110"
	BITMAP "00000000"

bitmaps3:
	BITMAP "11101111"
	BITMAP "00000000"
	BITMAP "11111110"
	BITMAP "11111110"
	BITMAP "11111110"
	BITMAP "00000000"
	BITMAP "11101111"
	BITMAP "11101111"


  • Like 3
Link to comment
Share on other sites

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...