Jump to content
IGNORED

Colecovision wonder-tastic BASIC compiler: CVBasic v0.5.0 (now with bank-switching support!)


Recommended Posts

11 hours ago, Jess Ragan said:

Silly question, but I might as well ask. Programs written with CVBasic 4.0 are entirely compatible with 5.0, right?

That's right, and you get the immediate advantage of extra optimization, fewer bugs in the compiler, and new statements that you can apply in your game.

 

 

20 minutes ago, drfloyd said:

Hello

 

Why the result is 0 ?????

 

t$="HELLO"
print at 0,t$

Because it doesn't have string variables. The $ character is ignored in the second line, and in the first line it should be throwing an error.

 

35 minutes ago, ZippyOasys said:

@nanochess Is there a limit for how big a .VGM file should be?

Yes, you cannot exceed 30 KB in a simple ROM, and 15 KB in a bank-switched ROM.

 

Unless you enhance the VGM player to advance the bank number.

 

Just out of curiosity, how long would a VGM melody have to be to reach 15K?

 

(I used one of the sample programs to make the ColecoVision play the theme song from Alex Kidd in Miracle World. That was a little freaky!)

2 hours ago, Jess Ragan said:

Just out of curiosity, how long would a VGM melody have to be to reach 15K?

 

(I used one of the sample programs to make the ColecoVision play the theme song from Alex Kidd in Miracle World. That was a little freaky!)

In fact, a VGM file can reach that limit pretty fast because it has a lot of overhead.

 

For example, turning on a channel in 440 hz is: $8e $0f $93 (or equivalent SOUND 0,$FE,12) these 3 bytes are each prefixed each one with $50 in the VGM file format. So putting a tone in one channel requires 6 bytes in a VGM file, plus one extra byte to signal the end of the sound frame.

 

Now supposing the worst case where it turns on the three channels in one frame (3*6 + 1 = 19 bytes), and then turns off the three channels in the next frame (3*2 + 1 = 7 bytes) then it is 780 bytes per second, or 19.69 seconds of music in 15K.

 

A "normal" song could easily run for 60 or 90 seconds in 15K.

 

Noob question incoming: Does the VGM format have anything to do with the sound-related routines in the ColecoVision BIOS?

 

I'm asking because I recall Newcoleco's presentations at ADAMCon about using the BIOS for generating music, and the actual data structure was rather compact. I may be misremembering though...

 

1 hour ago, Pixelboy said:

Noob question incoming: Does the VGM format have anything to do with the sound-related routines in the ColecoVision BIOS?

 

I'm asking because I recall Newcoleco's presentations at ADAMCon about using the BIOS for generating music, and the actual data structure was rather compact. I may be misremembering though...

 

The Coleco BIOS isn't used for CVBasic, except for the SGM missing message.

 

CVBasic includes a music player that is pretty efficient in terms of space usage for music and also uses the same music format as IntyBASIC.

 

  • Like 1
Posted (edited)
4 minutes ago, nanochess said:

Of course not. It is the maximum you can use with almost no code.

So, how long would a song be with game code for 30kb?

Edited by ZippyOasys
14 minutes ago, ZippyOasys said:

So, how long would a song be with game code for 30kb?

Haha, are you kidding? It is just estimations.

 

32k - 30k = 2k

32k / 120 seconds = 0.26k per second (estimated)

2k / 0.26 = 7 seconds.

 

Please note that these are estimated values.

 

You would be better doing music with the integrated music player. As I said before VGM is overloaded, half of the file is composed by $50 bytes.

 

So... I'm working on an MSX version of Whack 'Em Smack 'Em Byrons. After moving the SOUND channels from 2 and 3 to 7 and 8, everything works fine in OpenMSX, except! The fiery explosion that happens when you hit a bomb is no longer there. Are the frequencies I'm using (67-237) too low for the MSX? Will I need to move over to the MIX channel (channel 9) for rumbly explosions? Furthermore, there's talk in the manual that if I don't use specific values (80-191) with MIX, the MSX will hold and catch fire (!!!).

 

I guess it wouldn't be a big deal in an emulator... the worst case scenario is that the emulator would crash and need to be restarted. However, in the unlikely event that someone puts this on a real MSX, that's going to be a big problem.

 

(Good lord, it's hard to believe hold and catch fire is even a thing in consumer technology.)

Hi,

I understand the lake of STRING$ in CVBASIC, not usefull for Arcade games (99% of the games)

 

Not easy for me as I try to do a big role game on Coleco... but it is an exception :) I will do with special routines.... (thanks Nano for your routine)

 

But for MSX games, this lack is not a problem ???? Seems strange a basic without string for big codes.

9 hours ago, Jess Ragan said:

So... I'm working on an MSX version of Whack 'Em Smack 'Em Byrons. After moving the SOUND channels from 2 and 3 to 7 and 8, everything works fine in OpenMSX, except! The fiery explosion that happens when you hit a bomb is no longer there. Are the frequencies I'm using (67-237) too low for the MSX? Will I need to move over to the MIX channel (channel 9) for rumbly explosions? Furthermore, there's talk in the manual that if I don't use specific values (80-191) with MIX, the MSX will hold and catch fire (!!!).

 

I guess it wouldn't be a big deal in an emulator... the worst case scenario is that the emulator would crash and need to be restarted. However, in the unlikely event that someone puts this on a real MSX, that's going to be a big problem.

 

(Good lord, it's hard to believe hold and catch fire is even a thing in consumer technology.)

Be aware that the ay8910 works differently by the sn789 of the colecovision.

The tones have a wider range of periods (12bits vs 10 bits) but the noise is added (by xor, so it in multiplied rather than added) to one, two or three tone channels. The mixer is in charge to select which channels will have noise, tone or both.

If you do not set the mixer you do not get noise.

Colecovision has a separate noise channel whose volume is set by one of the other tone channels.

 

7 hours ago, drfloyd said:

Hi,

I understand the lake of STRING$ in CVBASIC, not usefull for Arcade games (99% of the games)

 

Not easy for me as I try to do a big role game on Coleco... but it is an exception :) I will do with special routines.... (thanks Nano for your routine)

 

But for MSX games, this lack is not a problem ???? Seems strange a basic without string for big codes.

When you have 1k of ram, having strings in ram can be very tricky.

About the msx, where you have ram, you can manage with arrays the same functions you would have with strings.

You only need to implement the functions you need.

One thing you can use to make your code more readable, is to access to DATA BYTE using the array sintax.

 

TestArray:

DATA BYTE 65,66,67,0,68,69,70,0

 

varptr TestArray[0]  is aiming to ABC

varptr TestArray[5] is aiming to DEF

 

 

 

 

 

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