Jump to content

Photo

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

Intellivision IntyBASIC

247 replies to this topic

#26 GroovyBee OFFLINE  

GroovyBee

    Games Developer

  • 9,736 posts
  • Busy bee!
  • Location:North, England

Posted Wed Sep 30, 2015 4:38 PM

Shouldn't  this constant CONST DISC_SOUTH_WEST = $0025 be $0019 ?
 
You fixed DISC_SW in the same way


Well spotted. Fixed in my version.

#27 nanochess OFFLINE  

nanochess

    River Patroller

  • Topic Starter
  • 4,631 posts
  • Coding something good
  • Location:Mexico, Mexico

Posted Wed Sep 30, 2015 5:01 PM

Shouldn't  this constant CONST DISC_SOUTH_WEST = $0025 be $0019 ?

 

You fixed DISC_SW in the same way

 

GroovyBee is in charge of maintaining the constants.bas file. I'll check it for next update.



#28 freewheel OFFLINE  

freewheel

    River Patroller

  • 2,861 posts

Posted Sat Oct 17, 2015 5:25 PM

Feature request: music synthesizer support. I really, really want to play with this now :)



#29 artrag OFFLINE  

artrag

    Dragonstomper

  • 652 posts

Posted Sun Oct 18, 2015 12:13 AM

Feature request : volume for music.
It could be used to fade in and out songs and to lower the music in case of relevant sfx or speech (from intellivoice)

Edited by artrag, Sun Oct 18, 2015 12:14 AM.


#30 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 9,790 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Sun Oct 18, 2015 6:07 AM

Feature request : volume for music.
It could be used to fade in and out songs and to lower the music in case of relevant sfx or speech (from intellivoice)

 

I second that.  I would actually request for per-note volume control.  That way, performance control can be simulated, like in MIDI.



#31 cmart604 OFFLINE  

cmart604

    Quadrunner

  • 11,051 posts
  • Location:Vancouver

Posted Sun Oct 18, 2015 10:19 AM

Feature request: music synthesizer support. I really, really want to play with this now :)


Lol! You've had one for fifteen minutes that you got from the back of some guy's car in an underground garage and you already want to program with it. 😂😂😂😂

#32 freewheel OFFLINE  

freewheel

    River Patroller

  • 2,861 posts

Posted Sun Oct 18, 2015 11:26 AM

 

I second that.  I would actually request for per-note volume control.  That way, performance control can be simulated, like in MIDI.

 

I third this.

 

(I eight the sandbox?)



#33 intvnut OFFLINE  

intvnut

    River Patroller

  • 2,750 posts
  • Location:@R6 (top of stack)

Posted Sun Oct 18, 2015 11:39 PM

Feature request: music synthesizer support. I really, really want to play with this now :)

 

Attached is an example of how to interface my scan_syn assembly code to IntyBASIC.  If you're willing to put up with a few inline assembly statements to get things initialized, you can hook up a pair of routines to receive synth key-down and key-up events.  You just need to arrange fro SCAN_SYN to get called regularly.

 

If nanochess wants to integrate this more cleanly into IntyBASIC, by all means do so.

 

This code steals a few bytes from the top of ECS RAM to do its work.  As far as I can tell, IntyBASIC doesn't even know about the 2K of ECS RAM from $4040 - $47FF.

 

I haven't tested it on the ECS just yet, but I will soon.

 

All this code is released into the public domain.  If nanochess or someone else wants to adapt it into IntyBASIC, great.  If you want to just use it as is, also great.

 

The BASIC side of things is really, really simple.  Sure there's a dozen lines of inline ASM, but after that, it's all BASIC.

.

' Really simple demonstration of interfacing the Intellivision Synth
' to IntyBASIC with a small external assembly routine.
'
' This demo doesn't play any music.  Rather, it simply fills 3 rows of
' the screen with squares indicating which of the 49 synth keys are 
' currently pressed.  
'
' J. Zbiciak, 2015
' Hereby released to the public domain.

            CONST   syn_key_addr = $47F4 
            DEF FN  syn_key = PEEK( syn_key_addr )

            ASM     INCLUDE "scan_syn.asm"

            CLS

            ' Initialize the synthesizer code.
            ASM     CALL    INIT_SYN        ;' clear all the state vars

            RESTORE my_syn_dn
            ASM     MVI     _read, R0       ;'\   Call 'my_syn_dn' for 
            ASM     MVO     R0, SYNDN       ;' |_ key-down events.  The key
            ASM     SWAP    R0              ;' |  pressed is in syn_key
            ASM     MVO     R0, SYNDN+1     ;'/

            RESTORE my_syn_up
            ASM     MVI     _read, R0       ;'\   Call 'my_syn_up' for 
            ASM     MVO     R0, SYNUP       ;' |_ key-up events.  The key
            ASM     SWAP    R0              ;' |  released is in syn_key
            ASM     MVO     R0, SYNUP+1     ;'/

            ' For this simple demo, just keep repeatedly scanning the 
            ' synthesizer keyboard

forever:    ASM     CALL    SCAN_SYN
            GOTO    forever


            ' On key-down, go put a '#' on the screen according to the 
            ' key number.  Keys 0-15 go in row 5, keys 16-31 go in row 6 
            ' and keys 32-48 go in row 7.
my_syn_dn:  PROCEDURE
            ofs = syn_key
            IF ofs >= 32 THEN ofs = ofs + 4
            IF ofs >= 16 THEN ofs = ofs + 4
            PRINT AT ofs + 102 COLOR 7, "#"
            END 

            ' On key-up, go put a ' ' on the screen according to the 
            ' key number.  Keys 0-15 go in row 5, keys 16-31 go in row 6 
            ' and keys 32-48 go in row 7.
my_syn_up:  PROCEDURE
            ofs = syn_key
            IF ofs >= 32 THEN ofs = ofs + 4
            IF ofs >= 16 THEN ofs = ofs + 4
            PRINT AT ofs + 102 COLOR 0, " "
            END 


Attached Files



#34 intvnut OFFLINE  

intvnut

    River Patroller

  • 2,750 posts
  • Location:@R6 (top of stack)

Posted Sun Oct 18, 2015 11:47 PM

And yes, this is a massive hack because I didn't see an equivalent to VARPTR to get the address of a label associated with a PROCEDURE.  Otherwise this could have been a couple POKE statements:

.

            RESTORE my_syn_dn
            ASM     MVI     _read, R0       ;'\   Call 'my_syn_dn' for 
            ASM     MVO     R0, SYNDN       ;' |_ key-down events.  The key
            ASM     SWAP    R0              ;' |  pressed is in syn_key
            ASM     MVO     R0, SYNDN+1     ;'/


#35 freewheel OFFLINE  

freewheel

    River Patroller

  • 2,861 posts

Posted Mon Oct 19, 2015 12:03 AM

*drool*. Can't wait till I get home and have some spare time. The ECS etc will work just fine with a model 1 console, right? I don't think I want to be timing the reset button that much, so my dev setup may end up being frankenkit.

 

I assume that a synth-based game is simply detecting keypresses, and playing an appropriate tone for as long as it's depressed. It only now occurs to me that there's no actual "music" generation happening here; this is simply a 49 button controller. All the magic has to happen within the ROM itself.

 

Need to brainstorm some random and wacky ideas for this thing. Yay, a piano player! And um... what the hell other kinds of games/programs can you really do with something like this? No wonder no one else made one of these :lol:



#36 intvnut OFFLINE  

intvnut

    River Patroller

  • 2,750 posts
  • Location:@R6 (top of stack)

Posted Mon Oct 19, 2015 12:09 AM

The ECS etc will work just fine with a model 1 console, right?

 

Yep, works just dandy!  I do a lot of my testing with various combinations of Inty1 or Inty2, ECS and Intellivoice.  They may not all match in appearance, but they're all compatible.

 

 

I assume that a synth-based game is simply detecting keypresses, and playing an appropriate tone for as long as it's depressed. It only now occurs to me that there's no actual "music" generation happening here; this is simply a 49 button controller. All the magic has to happen within the ROM itself.

 

Yep, it's a big 49-button controller.  It's got a full complement of diodes so there's zero ghosting.  All 49 keys are fully independent.  The SCAN_SYN code I posted uses a callback architecture to deliver keyup/keydown events back to the host program from the main scanning routine that's meant to be called periodically.  If you want a different architecture, you'll have to modify the code.

 

All tone generation and association between tones and keys is up to the ROM itself.  If you dig through the programming forum archives, I believe you can find my original synth program which does play notes. 

 

The SCAN_SYN code I posted above is nearly identical to the SCAN_SYN driver in that demo.  I made a couple minor modifications to integrate it into IntyBASIC.  I've placed both versions in the public domain.  Folks, go nuts!


Edited by intvnut, Mon Oct 19, 2015 12:10 AM.


#37 artrag OFFLINE  

artrag

    Dragonstomper

  • 652 posts

Posted Mon Oct 19, 2015 7:21 AM

Just thinking out loud...
What are the capabilities of the intellivoice?
Could it be used for music or sfx (in addition to the psg)?

Edited by artrag, Mon Oct 19, 2015 7:30 AM.


#38 nanochess OFFLINE  

nanochess

    River Patroller

  • Topic Starter
  • 4,631 posts
  • Coding something good
  • Location:Mexico, Mexico

Posted Mon Oct 19, 2015 8:30 AM

Feature request: music synthesizer support. I really, really want to play with this now :)

 

I was scratching my head reading this, but you mean music keyboard! :)

 

I didn't knew it was called music synthetizer.

 

Feature request : volume for music.
It could be used to fade in and out songs and to lower the music in case of relevant sfx or speech (from intellivoice)

 

Oh yes! I've this in my list since First Spear requested it.

 

 

I second that.  I would actually request for per-note volume control.  That way, performance control can be simulated, like in MIDI.

 

That would require a change in music format.

 

Lol! You've had one for fifteen minutes that you got from the back of some guy's car in an underground garage and you already want to program with it.

 

:) :) :)

 

 

I third this.

 

(I eight the sandbox?)

 

:) :thumbsup:

 

 

 

Attached is an example of how to interface my scan_syn assembly code to IntyBASIC.  If you're willing to put up with a few inline assembly statements to get things initialized, you can hook up a pair of routines to receive synth key-down and key-up events.  You just need to arrange fro SCAN_SYN to get called regularly.

 

If nanochess wants to integrate this more cleanly into IntyBASIC, by all means do so.

 

This code steals a few bytes from the top of ECS RAM to do its work.  As far as I can tell, IntyBASIC doesn't even know about the 2K of ECS RAM from $4040 - $47FF.

 

I haven't tested it on the ECS just yet, but I will soon.

 

All this code is released into the public domain.  If nanochess or someone else wants to adapt it into IntyBASIC, great.  If you want to just use it as is, also great.

 

The BASIC side of things is really, really simple.  Sure there's a dozen lines of inline ASM, but after that, it's all BASIC.

.

' Really simple demonstration of interfacing the Intellivision Synth
' to IntyBASIC with a small external assembly routine.
'
' This demo doesn't play any music.  Rather, it simply fills 3 rows of
' the screen with squares indicating which of the 49 synth keys are 
' currently pressed.  
'
' J. Zbiciak, 2015
' Hereby released to the public domain.

            CONST   syn_key_addr = $47F4 
            DEF FN  syn_key = PEEK( syn_key_addr )

            ASM     INCLUDE "scan_syn.asm"

            CLS

            ' Initialize the synthesizer code.
            ASM     CALL    INIT_SYN        ;' clear all the state vars

            RESTORE my_syn_dn
            ASM     MVI     _read, R0       ;'\   Call 'my_syn_dn' for 
            ASM     MVO     R0, SYNDN       ;' |_ key-down events.  The key
            ASM     SWAP    R0              ;' |  pressed is in syn_key
            ASM     MVO     R0, SYNDN+1     ;'/

            RESTORE my_syn_up
            ASM     MVI     _read, R0       ;'\   Call 'my_syn_up' for 
            ASM     MVO     R0, SYNUP       ;' |_ key-up events.  The key
            ASM     SWAP    R0              ;' |  released is in syn_key
            ASM     MVO     R0, SYNUP+1     ;'/

            ' For this simple demo, just keep repeatedly scanning the 
            ' synthesizer keyboard

forever:    ASM     CALL    SCAN_SYN
            GOTO    forever


            ' On key-down, go put a '#' on the screen according to the 
            ' key number.  Keys 0-15 go in row 5, keys 16-31 go in row 6 
            ' and keys 32-48 go in row 7.
my_syn_dn:  PROCEDURE
            ofs = syn_key
            IF ofs >= 32 THEN ofs = ofs + 4
            IF ofs >= 16 THEN ofs = ofs + 4
            PRINT AT ofs + 102 COLOR 7, "#"
            END 

            ' On key-up, go put a ' ' on the screen according to the 
            ' key number.  Keys 0-15 go in row 5, keys 16-31 go in row 6 
            ' and keys 32-48 go in row 7.
my_syn_up:  PROCEDURE
            ofs = syn_key
            IF ofs >= 32 THEN ofs = ofs + 4
            IF ofs >= 16 THEN ofs = ofs + 4
            PRINT AT ofs + 102 COLOR 0, " "
            END 


 

I'm amazed by this.

 

I suspect the INCLUDE "scan_syn.asm" should be at end of the IntyBASIC program.

 

Hmmmm! a new feature request for IntyBASIC, procedure addresses ;)

 

To play notes, you can create "music" data in internal 16-bit RAM, first word would be speed, next word would be the note.

 

Then use PLAY varptr(my_music(0))

 

The other way would be to extract the frequency table from intybasic_epilogue.asm and play the simple notes.



#39 intvnut OFFLINE  

intvnut

    River Patroller

  • 2,750 posts
  • Location:@R6 (top of stack)

Posted Mon Oct 19, 2015 8:53 AM

I suspect the INCLUDE "scan_syn.asm" should be at end of the IntyBASIC program.

 

 

You noticed!  :D  Actually, if you look at scan_syn.asm, there's a big branch-around.  I did this so I wouldn't get warnings about forward references to SET/EQU symbols. (SYNDN, SYNUP and so on.)  So, yeah, the INCLUDE belongs at the top, not the bottom.



#40 intvnut OFFLINE  

intvnut

    River Patroller

  • 2,750 posts
  • Location:@R6 (top of stack)

Posted Mon Oct 19, 2015 8:54 AM

Hmmmm! a new feature request for IntyBASIC, procedure addresses ;)

 

BTW... do you like my hack for working around it?  :D



#41 intvnut OFFLINE  

intvnut

    River Patroller

  • 2,750 posts
  • Location:@R6 (top of stack)

Posted Mon Oct 19, 2015 10:03 AM

 

I was scratching my head reading this, but you mean music keyboard! :)

 

I didn't knew it was called music synthetizer.

 

Yep.  I'm guessing you didn't / don't have one.  It says "Music Synthesizer" right on the keyboard, at least here in the US.

 

synth.jpg



#42 nanochess OFFLINE  

nanochess

    River Patroller

  • Topic Starter
  • 4,631 posts
  • Coding something good
  • Location:Mexico, Mexico

Posted Mon Oct 19, 2015 10:29 AM

 

 

You noticed!  :D  Actually, if you look at scan_syn.asm, there's a big branch-around.  I did this so I wouldn't get warnings about forward references to SET/EQU symbols. (SYNDN, SYNUP and so on.)  So, yeah, the INCLUDE belongs at the top, not the bottom.

 

Oh! I see. If there is a branch then there is no problem ;)

 

 

BTW... do you like my hack for working around it?  :D

 

Impressive and very well thought! :)

 

 

Yep.  I'm guessing you didn't / don't have one.  It says "Music Synthesizer" right on the keyboard, at least here in the US.

 

attachicon.gifsynth.jpg

 

Okie-dokie! now I'll not forget it :)



#43 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 9,790 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Tue Oct 20, 2015 3:18 AM

 

Yep.  I'm guessing you didn't / don't have one.  It says "Music Synthesizer" right on the keyboard, at least here in the US.

 

attachicon.gifsynth.jpg

 

Ah, I also got confused by that.  "Why are people calling it a synthesizer? shirley they must know it's just a keyboard..."



#44 intvnut OFFLINE  

intvnut

    River Patroller

  • 2,750 posts
  • Location:@R6 (top of stack)

Posted Tue Oct 20, 2015 1:57 PM

 

Ah, I also got confused by that.  "Why are people calling it a synthesizer? shirley they must know it's just a keyboard..."

 

shirley.jpg ;) ;) ;) ;) ;) ;)

 

Yeah, the actual synthesizer is the Intellivision itself (specifically, its PSGs).  :P

 

Otherwise, I've just been calling it by whatever name it has on the label, even if the name on the label doesn't quite make sense.  :)


Edited by intvnut, Tue Oct 20, 2015 1:58 PM.


#45 freewheel OFFLINE  

freewheel

    River Patroller

  • 2,861 posts

Posted Wed Oct 21, 2015 8:45 PM

I call it the synthesizer so that people don't get it confused with a) the Keyboard component, or b) the ECS keyboard.

 

nanochess, my thinking is that it would be cool to have this available as "only" a controller - and *what* happens in response to a key press is entirely up to the programmer. As opposed to tying it into the MUSIC stuff, or whatever.

 

A 49 key controller is ridiculously impractical. But I do have ideas. Think Ferris Buhler as a tease.



#46 nanochess OFFLINE  

nanochess

    River Patroller

  • Topic Starter
  • 4,631 posts
  • Coding something good
  • Location:Mexico, Mexico

Posted Wed Oct 21, 2015 9:20 PM

I call it the synthesizer so that people don't get it confused with a) the Keyboard component, or b) the ECS keyboard.

 

nanochess, my thinking is that it would be cool to have this available as "only" a controller - and *what* happens in response to a key press is entirely up to the programmer. As opposed to tying it into the MUSIC stuff, or whatever.

 

A 49 key controller is ridiculously impractical. But I do have ideas. Think Ferris Buhler as a tease.

 

I don't know who is Ferris Buhler...



#47 freewheel OFFLINE  

freewheel

    River Patroller

  • 2,861 posts

Posted Wed Oct 21, 2015 9:47 PM

 

I don't know who is Ferris Buhler...

 

Well, without totally ruining the surprise - let's just say I may want "other" sounds to come from the keyboard, not just musical notes :)



#48 nanochess OFFLINE  

nanochess

    River Patroller

  • Topic Starter
  • 4,631 posts
  • Coding something good
  • Location:Mexico, Mexico

Posted Wed Oct 21, 2015 9:51 PM

 

Well, without totally ruining the surprise - let's just say I may want "other" sounds to come from the keyboard, not just musical notes :)

 

Just I searched for the name, I've saw the movie ;) for some reason I didn't remember the name of the character but of course Matthew Broderick.



#49 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 9,790 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Thu Oct 22, 2015 3:15 AM

I call it the synthesizer so that people don't get it confused with a) the Keyboard component, or b) the ECS keyboard.

 

nanochess, my thinking is that it would be cool to have this available as "only" a controller - and *what* happens in response to a key press is entirely up to the programmer. As opposed to tying it into the MUSIC stuff, or whatever.

 

A 49 key controller is ridiculously impractical. But I do have ideas. Think Ferris Buhler as a tease.

 

Ahh... I see you're thinking 1980s sampler-synth combo!  Welcome to Euro-pop and Elektro! :lol:



#50 freewheel OFFLINE  

freewheel

    River Patroller

  • 2,861 posts

Posted Thu Oct 22, 2015 6:06 PM

 

Ahh... I see you're thinking 1980s sampler-synth combo!  Welcome to Euro-pop and Elektro! :lol:

 

Yup. And then some. :D

 

But first I gotta talk to Joe about a dangling conversation that came up with Cra-cra-cra-crazybus.







Also tagged with one or more of these keywords: Intellivision, IntyBASIC

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users