Jump to content
IGNORED

IntyBASIC compiler v1.0 wish list and 'contrib' dir


Recommended Posts

Hi guys.

 

I'll publish a new version of IntyBASIC in some months, namely the full-blown v1.0 version.

 

Already some features in place (not yet published):

 

  • Warns of PROCEDURE start without ending previous PROCEDURE
  • Warns of END used without starting PROCEDURE
  • Removes extra RETURN at end if the statement combination RETURN/END is used.
  • MUSIC statement alone doesn't activate tracker module. Only if PLAY is used (useful to deactivate music)

 

Features in the work:

  • The intvnut routine to print numbers. Just I'm checking for an adequate and easy syntax.
  • Still checking for balance over a full-blown division/multiplication routine and the current additive/substraction routine.
  • The page flipping routine, this will wait until the LTO-Flash cartridge is in my hands.
  • Official cart.mac support.
  • Not yet official or probable, but an instruction size counter for code generation, this would make automatic the bank selection using cart.mac. It would include also a new statement BLOCK to structure data/graphics/music.

Also this is a call to all IntyBASIC programmers to suggest your dream feature for IntyBASIC. ;)

 

What are the requirements? specifiy the keyword or statement syntax of your dream feature and justify why would it be needed or how it would apply to your current game.

 

If you're lucky it would find its way into IntyBASIC v1.0

 

Finally, I would like to create a 'contrib' directory in the main distribution, where I would put sample source codes created by the community, in order to help new programmers.

 

If you want to include one of your games or examples, just put me a link to the source code or annex the file in this thread, and I'll put it in my distribution file with your proper credit.

 

Thanks for all your help!

 

  • Like 1

How about a MAKEGAME command that will allow me to vaguely describe my game idea and IntyBasic does the rest? That shouldn't be too hard to implement, I'm sure.

 

The new stuff sounds great! I'll definitely drop in any specific ideas I might have. Right now, I just want a way to get more space out of the ROMs, but that will probably come down to encoding and other stuff that's not really in IntyBasic's realm to implement directly. Oh, well.

  • Like 2

Sample code is a fantastic idea. The samples that came with IntyBASIC have been invaluable to get me started.

 

A few things that would help de-spaghettify my code, no idea what is practical/possible:

 

CASE statements. I find myself, and I see others, doing a lot of IF x=1 THEN do this, IF x=2 THEN do that, etc.

 

Blocked IF statements (brain is breaking on what these are called) - ie: IF expr then { multiple lines of code }. The instr1:instr2:instr3 syntax is handy as hell and i don't want to lose it, but sometimes it's not quite enough. Right now I find I branch just a little too much, for code that only executes once. FOR loops already have this structure built in with NEXT, it'd be nice for IF. Maybe just ENDIF instead of C-style brackets if that works easier?

 

I personally don't see a need for WHILE (it can always be re-written using FOR), but some might. I presume IntyBASIC lets me prematurely break out of a FOR by modifying the FOR variable mid-loop? Haven't tested it, to be honest :P

 

Anything that makes math easier/faster, I'm all over. Full-blown mult/divide. Same with the printing of large numbers. I used your method of an array of digits, it works damned nice actually and is very extensible, but it can introduce some ugly value checking.

 

As for MUSIC - is it possible to "disable" the tracker module.. or have it only activate when needed.. if that makes sense? ie: it would be cool to be able to use the whole thing in say an intro screen, but then be able to use all 3 sound channels within a game - and then MUSIC again in an intermission? I'm not sure this works based on what I'm reading about the PSG, but it would be swell.

 

I'd also like to help out fleshing out the documentation more, if I had some more spare time. This is often the hardest thing to maintain in a project like this.

 

Oh - and a TITLE command to write over what's in prologue.asm. I know I mentioned this before - not sure if it's even possible to do in the way I mean. Or if you'd rather it has the IntyBASIC tag in there for most programs.

 

Another couple of small ones that come to mind: var++ is a convention I use a LOT. var+=2 is something I don't use as much, but others find handy. But man, I do a lot of var=var+1 in IntyBASIC.

Edited by freeweed
  • Like 1

Agreed. var+= and var-= would be nice for the sake of convenience, but it's something that's pretty far down the list.

 

I'm not sure if there are BREAK or CONTINUE commands. If there aren't, they would be nice additions, though I think that you can just GOTO out of an IF statement to serve as a BREAK or GOTO a label right before the NEXT to simulate a CONTINUE.

 

For the IF blocks, it would be nice, but since you can just reverse the logic and use a GOTO to create a block, I doubt that we'll see it implemented. i.e.

IF var1 = 0 AND var2 = 0 THEN
x = 5
y = 6
ENDIF

Is the same as

IF var1 <> 0 OR var2 <> 0 THEN GOTO skip_if
x = 5
y = 6

skip_if:

CASE statements can be simulated with ON var GOTO or ON var GOSUB, except that relies on the values always being 0, 1, 2, ... It WOULD be kind of nice.

  • Like 1

IF/ENDIF blocks would be nice, but not essential

Case would be nice

 

IntyColor enhancement to optionally save a file with individual BITMAP statements (for converting a sprite strip BMP quickly)

 

Conditionally use the Music Player. For instance, if I'm not playing music while DEFINEing and SCREENing, we shouldn't lose 2 cards per WAIT. Maybe MUSIC OFF skips the music player code.

The auto memory map hole stuffing would be nice, but ASM ORG has worked for me.

 

I've been trying to find a MIDI to PLAY convertor of some kind. Knowing nothing about music has not made using the PLAY command easy :-) .

  • Like 1

I've been trying to find a MIDI to PLAY convertor of some kind. Knowing nothing about music has not made using the PLAY command easy :-) .

That would be awesome!

 

Could you maybe add a way to break up a line in the code editor without it counting as a line break in the compiled code? For instance...

ON level GOTO level1, level2, level3,_
level4, level5, level6, level7, level8,_
level9, level10, level11, level13

The _ would combine the following line with the current line before compilation. I recall seeing this in another language, but I forget which. Anyway, it would be very handy and allow for long lines to be broken up into more readable chunks.

  • Like 2

Add a request for Intellivoice support in there.

 

.

FWIW, there is an Intellivoice driver along with all the AL2 allophone samples in SDK-1600. General Instrument graciously provided permission to use them with the Intellivoice, as long as you acknowledge that Microchip owns the samples.

 

The Intellivoice driver is pretty simple. It has a routine that needs to be called periodically, such as from an ISR (named, cleverly, IV_ISR). It needs a couple words of 16-bit memory, and 11 bytes of 8-bit memory to keep track of the current "queue of phrases." You could probably reduce the queue depth from 8 to 4 pretty easily and buy back some 8-bit memory. The IV_INIT function detects whether the Intellivoice is present, and if absent, sets a flag so that none of the other IVxxx calls hang.

 

If IntyBASIC does get Intellivoice support, you could make its ROM/RAM impact only affect games that use it by putting the driver behind an "IF DEFINED UseIntellivoice" type of directive in the intybasic_epilogue.asm file. That way, the code and data footprint only affect games that use the feature.

 

The SDK-1600 Intellivoice driver is based around a two-level data table. One table gives pointers to phrases (IV_PHRASE_TBL). To speak, you tell the driver to say a phrase by number. Phrases 1..42 play a sample in the RESROM (ie. samples built into the Intellivoice), and 43 onward look up a pointer in the IV_PHRASE_TBL. The second level consists of lists of pointers to samples to send to the Intellivoice (or invocations of RESROM samples, such as the often useful "pause" samples used for silence between words, or to adjust allophone timing to give a more natural speech cadence).

 

For example, Tag Along Todd 2V has the following phrase data:

.

;; ======================================================================== ;;
;;  IV_PHRASE_TBL -- These are phrases that will be spoken.                 ;;
;; ======================================================================== ;;
IV_PHRASE_TBL PROC
            DECLE       PHRASE.title
            DECLE       PHRASE.letsplay
            DECLE       PHRASE.gameover
            DECLE       PHRASE.finalscor
            ENDP

PHRASE      PROC
@@title     DECLE       _JH, _OW, RESROM.pa2
            DECLE       _ZZ, RESROM.pa1, _BB1, _EY, _CH, _EH, _KK1, RESROM.pa2
            DECLE       _PP, _RR1, _IY, _ZZ, _ZH, _EH, _NN1, _TT1, _SS, _SS
            DECLE       RESROM.pa2
            DECLE       _TT2, _AX, _GG3, RESROM.pa1
            DECLE       _AX, _LL, _AO, _NG1, _GG2, RESROM.pa2
            DECLE       _TT2, _AO, _AO, RESROM.pa1, _DD1, RESROM.pa2
            DECLE       _TT2, _UW2, RESROM.pa2
            DECLE       0

@@letsplay  DECLE       _LL, _EH, _EH, RESROM.pa1, _TT2, _SS, RESROM.pa2
            DECLE       _PP, _LL, _EH, _EY, RESROM.pa2
            DECLE       0

@@gameover  DECLE       RESROM.pa5
            DECLE       _GG3, _EY, _MM, RESROM.pa2
            DECLE       _OW, _VV, _ER1, RESROM.pa5
            DECLE       0

@@finalscor DECLE       _FF, _AY, _NN2, _AX, _LL, RESROM.pa2
            DECLE       _SS, _SS, RESROM.pa1, _KK3, _OR, RESROM.pa3
            DECLE       0
            ENDP

.

You could easily see a set of IntyBASIC keywords that declare phrases in terms of allophones and pauses that results in IntyBASIC generating such a table. ie. something like this:

.

LetsPlay    IVPHRASE  LL, EH, EH, PA1, TT2, SS, PA2, PP, LL, EH, EY, PA2
GameOver    IVPHRASE  PA5, GG3, EY, MM, PA2, OW, VV, ER1, PA5
FinalScore  IVPHRASE  FF, AY, NN2, AX, LL, PA2, SS, SS, PA1, KK3, OR, PA3

.

And then to speak, you could add a few more keywords:

.

            IVPLAY  LetsPlay        : REM Plays the phrase.  Phrase gets dropped if the queue is full.  Useful for 'optional' voice messages such as "Good shot!"
            IVPLAYW GameOVer        : REM Plays the phrase, waiting for room in the queue if needed.  Better for 'unconditional' voice messages such as "Game Over."
            IVWAIT                  : REM Wait for the Intellivoice to finish speaking, useful for synchronizing the game to the Intellivoice at transitions.

.

The SP0256-AL2 allophones are available in a single file (examples/library/al2.asm) and broken out into separate files (examples/library/al2/*). You could wrap each of these in an "IF (DEFINED NeedAL2.blah)" type of compile directive so only the necessary allophones get linked into your game, and IntyBASIC could output a series of SET directives to cause the samples to come in.

 

SDK-1600 also has a routine (examples/library/saynum16.asm) that will speak a number up into the thousands using the RESROM samples, taking into account normal number-speaking conventions such as "-teen" and "-ty". That is 14934 becomes "Fourteen Thousand Nine Hundred Thirty Four." It tops out at 65535, although it could be modified to go higher, I'm certain. It would require sending a larger than 16-bit input to the routine though.

 

You could envision one more IntyBASIC keyword:

.

            IVNUM   Score           : REM Say the current score via the Intellivoice.

.

(FWIW, saynum16 implies PLAYW... ie. it always waits for room in the queue to speak so that no part of the number gets dropped. If it's important to your game to keep playing while speaking a number, then you don't want to shrink the queue depth for the speech queue, or you'll need to rewrite saynum to work on a number over multiple calls until it all gets said... That would require another small routine to see if there's space in the queue to say more, too, so saynum knows it's safe to push something on the queue.)

Edited by intvnut
  • Like 2

 

FWIW, there is an Intellivoice driver along with all the AL2 allophone samples in SDK-1600.

 

Also... that driver was written 12 years ago. If I were to write it today, I could probably make it a bit tighter.

 

The main things to manage are:

  1. Keep the speech FIFO as full as you can, as the Intellivoice runs asynchronously to the Intellivision once it starts talking.
  2. Send ALDs when needed to tell the SP0256 to start speaking the next sample. (In the context of the AL2 data, sample == allophone. For RESROM data, it could be a full word, phrase, or more.)
  3. Provide an abstraction that allows the programmer to build phrases out of much smaller speech samples, such as allophones.
  4. Handle mixing RESROM samples with samples you need to provide via the FIFO.
  5. Fail gracefully if the Intellivoice isn't present.

My code's there for all to see. Some (most?) of it could be crap. But, it does work. :-)

Edited by intvnut

How about a MAKEGAME command that will allow me to vaguely describe my game idea and IntyBasic does the rest? That shouldn't be too hard to implement, I'm sure.

 

The new stuff sounds great! I'll definitely drop in any specific ideas I might have. Right now, I just want a way to get more space out of the ROMs, but that will probably come down to encoding and other stuff that's not really in IntyBasic's realm to implement directly. Oh, well.

:lolblue: Yes!

  • Like 1

Has there been any communication with GroovyBee and William about including the nifty features of their boards/flash devices in IntyBASIC?

 

William has a flash device coming out too? He didn't tell me! ;-)

  • Like 1

Giving that LTO-Flash has been delayed there is a chance I can put out another improved IntyBASIC version before... I'm thinking about it.

 

It's not really delayed so much as progressing slowly. At least, that's how I look at it.

 

If there's any details you're waiting on me for, please PM me. Many things discussed are supported in jzIntv and even existing cartridge designs.

  • Like 1

Another feature request

Along with some of the discussion in another thread regarding the PRINT command's efficiency, it would be helpful to have strings as data such as

 

LevelEndMessage1:

StringData "Congratulations!"

LevelEndMessage2:

StringData "Great Job!"

 

Print at 64, LevelEndMessage1

 

Again, not a show stopper, but would make life easier and more organized

  • Like 1

 

It's not really delayed so much as progressing slowly. At least, that's how I look at it.

 

If there's any details you're waiting on me for, please PM me. Many things discussed are supported in jzIntv and even existing cartridge designs.

 

PM sent! :)

Another feature request

Along with some of the discussion in another thread regarding the PRINT command's efficiency, it would be helpful to have strings as data such as

 

LevelEndMessage1:

StringData "Congratulations!"

LevelEndMessage2:

StringData "Great Job!"

 

Print at 64, LevelEndMessage1

 

Again, not a show stopper, but would make life easier and more organized

 

I haven't tested this, but could CONST be used for this? Isn't it simply doing a find/replace before compilation?

 

Yes, it's been over a decade since I looked at a compiler, so I may be completely out to lunch here. :P

  • Like 1

 

I haven't tested this, but could CONST be used for this? Isn't it simply doing a find/replace before compilation?

 

Yes, it's been over a decade since I looked at a compiler, so I may be completely out to lunch here. :P

I haven't tried CONST for string either because of this entry from the IntyBasic manual:

 

  CONST [name]=[constant expression]
  
    Assigns a name to a constant expression, the compiler will replace this
    name in expressions with the number. These names have priority over
    variables.

I says "number" therefore I wouldn't have bothered trying a string. Other Basic's have various String functions like MID, LEFT, RIGHT etc. IntyBasic doesn't.

 

I haven't tried CONST for string either because of this entry from the IntyBasic manual:

 

  CONST [name]=[constant expression]
  
    Assigns a name to a constant expression, the compiler will replace this
    name in expressions with the number. These names have priority over
    variables.

I says "number" therefore I wouldn't have bothered trying a string. Other Basic's have various String functions like MID, LEFT, RIGHT etc. IntyBasic doesn't.

 

 

Yeah, I ran a few tests and it doesn't work. I end up with various GROM cards. Obviously it's just putting a number of some sort in the CONST construct. Oh well, I can dream :P

 

It *could* be implemented the way I described depending on exactly how IntyBASIC works. It's a bit of a hack, sure, but it'd work nicely. However if people are wanting any sort of string manipulation functionality, that's a whole different kettle of fish. Personally I can't imagine the need, but I guess if someone wanted to write a text-heavy adventure game or something...

What are the requirements? specifiy the keyword or statement syntax of your dream feature and justify why would it be needed or how it would apply to your current game.

 

 

I guess it has been already suggested, but a READMYMIND statement would be great!. It should not be too complicated because my brain is really simple. you would have read one or two neurones maximum.

 

More seriously , i didn't have time yet to really use your basic and i didn't follow in details the evolution , but i plan to use it as soon as i have complete my current colecovision projects.

 

It would be nice, if not here yet , To have a SAY command to drive the Intellivoice.

  • Like 3

 

I guess it has been already suggested, but a READMYMIND statement would be great!. It should not be too complicated because my brain is really simple. you would have read one or two neurones maximum.

 

 

:lol:

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