Jump to content
IGNORED

Colecovision-tastic BASIC compiler: CVBasic v0.2.0


Recommended Posts

Hi all.

 

I'm surprised and humbled by the success of CVBasic v0.1.0 (one hundred downloads in less than one week!), so here is a very much improved version of the compiler.

 

I've added macOS and Linux support. To do this, I had to write my own Z80 assembler, and it is included in the package as gasm80.

 

Changes in this version:

 

* Added CONST statement (for example, CONST A = 5, or CONST #BIG = 5000)

* Added ON GOTO / GOSUB statement.

* Added ON FRAME GOSUB statement (to call subroutines in each video frame).

* Added INCLUDE statement so you can make bigger programs.

* Added PLAY/MUSIC statements, and a music player.

* Added a new example music.bas to show how to use PLAY/MUSIC.

* Optimizes more extensively the compiled expressions.

* Support for Sega SG1000.

 

I need to implement a way to bring graphical screens. I have the tool, but we need a nice way of doing it with BASIC-style statements.

 

I'll keep working on this, and in the meantime: Enjoy it!

 

cvbasic_v0.2.0.zip

  • Like 7
  • Thanks 1
Link to comment
Share on other sites

I'm sure this can be improved but made a cvmake.bat that builds a Coleco ROM from a .bas that's in the same directory as the rest of the CVBasic files.  I've forgotten a ton of batch file techniques so the resultant ROM looks like: game.bas.rom  I use the START command to open the game.bas.rom afterwards in whatever emulator is associated with Coleco ROMs.

 

To be clear cvbasic and gasm80 need to be in the same directory as cvmake.bat.

You must associate Coleco ROMs with your favorite emulator in Windows first.

 

I would not be offended if someone makes this less hack-ey :)

 

Usage:

CVMAKE GAME.BAS

 

cvbasic %1 output.asm
gasm80 output.asm -o %1.rom
start %1.rom

 

  • Like 1
Link to comment
Share on other sites

Sorry to double post.  But, before anyone else asks..  SG-1000 support doesn't make Sega Master System or Mega Drive support much easier.

 

In particular I had a fever dream of using CVBasic to make z80 based Mega Drive games.  But, although the MD has the Zilog Z80 and SN76489.. well, the closest video mode supported is the SMS VDP mode 4.  So, if I took an SMS flash cart and put it on a power base converter the best that would happen is sound.

 

https://segadoes.wordpress.com/2016/04/25/power-base-converter/

  • Like 1
Link to comment
Share on other sites

1 hour ago, Gemintronic said:

Sorry to double post.  But, before anyone else asks..  SG-1000 support doesn't make Sega Master System or Mega Drive support much easier.

 

In particular I had a fever dream of using CVBasic to make z80 based Mega Drive games.  But, although the MD has the Zilog Z80 and SN76489.. well, the closest video mode supported is the SMS VDP mode 4.  So, if I took an SMS flash cart and put it on a power base converter the best that would happen is sound.

 

https://segadoes.wordpress.com/2016/04/25/power-base-converter/

Not really, because the Sega Master System video mode 4 isn't compatible as needed. However, SG1000 support means the ROM could be played at least in original Sega Master System consoles.

 

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, 5-11under said:

There's not much missing compared to IntyBASIC anymore.

The release schedule is kind of similar too:

 

IntyBASIC:

v0.1: Jan 28, 2014

v0.2: Feb 3, 2014 (+6 days)

v0.3: Feb 6, 2014 (+3 days)

v0.4: Feb 11, 2014 (+5 days)

v0.5: Feb 26, 2014 (+ 15 days)

v0.6: Mar 2, 2014 (+4 days)

 

CVBasic:

v0.1: Feb 28, 2024

v0.2: Mar 5, 2024 (+6 days)

v0.3: ?? (tentative March 8...)

Edited by carlsson
  • Like 1
  • Haha 1
Link to comment
Share on other sites

21 hours ago, carlsson said:

 

CVBasic:

v0.1: Feb 28, 2024

v0.2: Mar 5, 2024 (+6 days)

v0.3: ?? (tentative March 8...)

I would break your predictions because I just noticed CVBasic was released Feb, 29.

  • Like 1
Link to comment
Share on other sites

Thank you so much for adding SG-1000 support, but I'm missing something about the difference to do between assembling for CV and assembling for SG.

I've no problem assembling for CV but I don't know how to assemble for SG.

Link to comment
Share on other sites

6 hours ago, Révo said:

Thank you so much for adding SG-1000 support, but I'm missing something about the difference to do between assembling for CV and assembling for SG.

I've no problem assembling for CV but I don't know how to assemble for SG.

You need to pass the option --sg1000 to CVBasic, assemble as normal, and the generated ROM will be mapped at $0000.

 

In case of doubt generate a LST file with the gasm80 assembler (option -l output.lst).

  • Like 1
Link to comment
Share on other sites

I just released TMSColor, the utility for converting tiles and sprites to CVBasic format.

 

 
Don't worry if you don't know how to compile it because the executables will be in the CVBasic v0.3.0 release. I'm almost ready to release it, but I need to code some examples of the new features.
 
CapturadePantalla2024-03-08ala(s)1_45_42.thumb.png.c5956c05afe88fec85be6a55be57d1c0.png
  • Like 5
Link to comment
Share on other sites

On 3/5/2024 at 4:49 PM, nanochess said:

* Added ON FRAME GOSUB statement (to call subroutines in each video frame).

* Support for Sega SG1000.


Is it possible to do expressions like IF (FRAME AND 1) THEN… ?

 

Would programs made for the SG1000 need to consider any particular differences or restrictions vs Colecovision?

 

Your work is much appreciated Nanochess! I will probably start writing something once the 0.3 release comes out 🙂


Will functions be implemented eventually?

  • Like 1
Link to comment
Share on other sites

5 hours ago, cmadruga said:


Is it possible to do expressions like IF (FRAME AND 1) THEN… ?

 

Would programs made for the SG1000 need to consider any particular differences or restrictions vs Colecovision?

 

Your work is much appreciated Nanochess! I will probably start writing something once the 0.3 release comes out 🙂


Will functions be implemented eventually?

Some things are inherited from IntyBASIC like the internal variable FRAME, so yes, you can do these type of expressions.

 

Currently SG1000 is as capable as Colecovision, except there is no keypad in controllers.

 

I would be glad to see some of your amazing work on Colecovision.

 

Yes, there will be DEF FN, thanks for bringing it to my attention.

  • Like 1
Link to comment
Share on other sites

This is AWESOME! I've got all kinds of ideas for games but could never get into coding enough to learn it, but basic I think I can handle as I used to tinker with it on the TI 99/4A. 

This is getting ahead of myself but is it possible to send signals with it to the expansion port that could be used to control external hardware? I've had fantasies of making something to control lights, etc or a robot arm connected via that port. 

Edited by Tornadoboy
  • Like 1
Link to comment
Share on other sites

16 minutes ago, Tornadoboy said:

This is AWESOME! I've got all kinds of ideas for games but could never get into coding enough to learn it, but basic I think I can handle as I used to tinker with it on the TI 99/4A. 

This is getting ahead of myself but is it possible to send signals with it to the expansion port that could be used to control external hardware? I've had fantasies of making something to control lights, etc or a robot arm connected via that port. 

If you make the right expansion hardware then you can control it with the INP and OUT instructions.

 

Or if it is memory-mapped then you can use PEEK/POKE.

 

  • Like 1
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...