Jump to content
IGNORED

Colecovision recharged BASIC compiler: CVBasic v0.4.0 (now with compression and MSX support!)


Recommended Posts

Hi all.

 

Now available the version 0.4.0 of CVBasic, the Colecovision BASIC compiler.

 

New changes in this version v0.4.0:

 

* Added DEF FN statement so you can create macros for commonly used code.

* Added VARPTR support in expressions, to get pointers to arrays and variables (required for the VGM player)

* Added VARPTR support in DEFINE, so you can make easily animations of sprites and bitmaps.

* Added a new example: VGM.bas a simple VGM player for SN76489 VGM files (VGM files not included!)

* Added a new example: oscar_compressed.bas the same as oscar.bas but compressed with Pletter!

* Support for Pletter compression both in TMSColor and CVBasic. Now you can fit even more in a 32K ROM!

* Added MSX support. Just compile with the --msx switch, and it will create an MSX compatible ROM! (after assembly of course).

* New SOUND [5-9] statements to handle the MSX AY-3-8910 sound chip.

* Includes Raspberry Pi executables!

 

New changes in this version v0.4.1:

 

* Solved bug in gasm80 when using INCBIN on Windows platforms.

* Solved bug in PRINT when using only PRINT AT expr

* Solved bug when using multiplication by zero.

* Solved bug in CONT handling.

* Optimization of constants in multiplication, division, and modulo.

* Optimization of expression trees of additions/subtractions.

* Added ASCII character constant access in expressions.

* Added the LEN function to get the length of strings (useful with DEF FN)

* Added the POS(0) function to get the current position of the cursor.

* Added the SGN function.

 

New changes in this version v0.4.2:

 

* Solved optimization bugs.

* MSX target now can use the whole 32K of ROM.

* Solved a bug where CONT and CONT2 didn't worked on MSX.

* Solved a bug where the music player would fail depending on the final program size.

* Solved a bug where ON GOTO/GOSUB would trigger a debugging message.

 

New changes in this version v0.4.3:

 

* DATA statements can now use constant expressions.

* Support for DATA VARPTR (creating tables of addresses).

* Optimized access to arrays when using constant index (so fast as variables).

* Implemented USR and CALL to simplify calling assembler language.

* Added support for formatted PRINT with leading zeros or spaces, for example, PRINT AT 5,"Score:",<5>#score

* Emits warnings for unused variables.

* Emits warnings for GOTO jumping to PROCEDURE, or GOSUB to non-PROCEDURE.

* Generates error codes for automated builds.

* Super Game Module support added (using --sgm option on compilation). This is 24 KB. of RAM! And compatible with Coleco ADAM ;)

* It includes the CVBasic source code in the ASM output so you can see how things are compiled.

* Background color default is transparent, so you can use BORDER to change the color of the full screen.

* Updated manual.

 

New changes in this version v0.4.4:

 

* Binaries are the same, only changed cvbasic_prologue.asm and cvbasic_epilogue.asm

* Random numbers are more random because the video interrupt increments the lfsr.

* Reduced size of the prologue, saves at least 140 bytes.

* Speed up of mode setup, and VRAM copying.

* Sega SG-1000 ROMs save around 32 bytes.

 

Enjoy it!

 

CapturadePantalla2024-03-08ala(s)1_45_42.thumb.png.d1b248a5ad31e5c3df9c0d7ec8399bc0.png

 

cvbasic_v0.4.0.zip

cvbasic_v0.4.1.zip

cvbasic_v0.4.2.zip

cvbasic_v0.4.3.zip

cvbasic_v0.4.4.zip

  • Like 13
  • Thanks 3
Link to comment
Share on other sites

43 minutes ago, Révo said:

Good job! Thank you for adding the VGM player, I tried with Alex Kidd, but the music crash after 2 sec ??

Maybe something not handled. Please give me the name of the track to give it a look.

Link to comment
Share on other sites

1 hour ago, Révo said:

Any track I try do the same (on CV and SG-1000).

There is a bug in my assembler, for some reason it shortens the included binaries. Try tniASM v0.45.

 

Edit: I just found the bug, I forgotten to open the binary file using "rb" mode in Windows. So it worked in every single platform except Windows. It will update the package in the next version. In the meanwhile everyone can use tniASM v0.45 if using INCBIN in Windows.

 

Just built it with an Alex Kidd track, it isn't perfect but it works.

 

vgm.rom

  • Like 1
Link to comment
Share on other sites

6 hours ago, nanochess said:

Just released v0.4.1 solving several tiny bugs found while testing (including the gasm80 one).

 

See the first post.

 

 

Wow, I go away to Japan for 2 weeks and I come back to this amazing surprise! Congratulations and Thanks!

 

I can't wait to try it on the weekend.

 

One note so far regarding the manual and the SPRITE command to aid Colecovision newbies. The X range is listed (0-255) but the Y range isn't. 

 

 

The first parameter indicates the number of the sprite (0-31).

     Y contains the Y-coordinate for the top row of the sprite.
     The final result is one pixel below the expect pixel row, so you
     typically must subtract one pixel.

 

     X contains the X-coordinate for the sprite (0-255)

 

 

 

  • Thanks 1
Link to comment
Share on other sites

1 minute ago, Tarzilla said:

Wow, I go away to Japan for 2 weeks and I come back to this amazing surprise! Congratulations and Thanks!

 

I can't wait to try it on the weekend.

 

One note so far regarding the manual and the SPRITE command to aid Colecovision newbies. The X range is listed (0-255) but the Y range isn't. 

 

 

The first parameter indicates the number of the sprite (0-31).

     Y contains the Y-coordinate for the top row of the sprite.
     The final result is one pixel below the expect pixel row, so you
     typically must subtract one pixel.

 

     X contains the X-coordinate for the sprite (0-255)

 

 

 

I hope you had a nice trip to Japan!

 

You got me! I missed that information in the manual.

 

The Y-coordinate visible range for sprites is 240 to 255, and 0 to 190. 240-254 allows the sprite to enter smoothly from the top, 255 is the top pixel row of the screen, and 0-190 is the whole vertical range of the screen (190 being the bottom pixel row of the screen). Values 191-239 makes the sprite invisible.

 

Additionally, the value 208 for the Y-coordinate disables sprite processing starting on that very sprite. For example, SPRITE 0,$d0,0,0,0 forces SPRITES 1-31 to disappear even if active.

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, nanochess said:

I hope you had a nice trip to Japan!

 

You got me! I missed that information in the manual.

 

The Y-coordinate visible range for sprites is 240 to 255, and 0 to 190. 240-254 allows the sprite to enter smoothly from the top, 255 is the top pixel row of the screen, and 0-190 is the whole vertical range of the screen (190 being the bottom pixel row of the screen). Values 191-239 makes the sprite invisible.

 

Additionally, the value 208 for the Y-coordinate disables sprite processing starting on that very sprite. For example, SPRITE 0,$d0,0,0,0 forces SPRITES 1-31 to disappear even if active.

 

Well, that is pretty simple ;-)

 

Japan was awesome, great people, great food, and way too many things to buy!

  • Like 1
Link to comment
Share on other sites

9 hours ago, Tarzilla said:

Well, that is pretty simple ;-)

 

Japan was awesome, great people, great food, and way too many things to buy!

Cool! Someday I want to go to visit Japan.

 

BTW, talking about Japan, currently, the MSX games are limited to 16K because I have forgotten the bank switching code to enable the upper 16K for 32K games.

 

Link to comment
Share on other sites

1 hour ago, nanochess said:

BTW, talking about Japan, currently, the MSX games are limited to 16K because I have forgotten the bank switching code to enable the upper 16K for 32K games.

I think this is what you're looking for:

https://konamiman.github.io/MSX2-Technical-Handbook/md/Chapter5b.html

https://www.msx.org/wiki/Develop_a_program_in_cartridge_ROM

 

  • Like 2
Link to comment
Share on other sites

13 hours ago, 5-11under said:

Now MSX can use the 32K of ROM and several small bugs solved. CVBasic updated to v0.4.2 in first post.

 

  • Thanks 1
Link to comment
Share on other sites

If you add segment management for mapped megaroms you can enable transparent cross development of large projects using colecovision Megacart mapper and ascii 8 msx mapper without changing the source code.

You could also add 32kram support for colecovision (sgm) and this would make games totally portable without any effort

  • Like 2
Link to comment
Share on other sites

Posting here too!

 

I've been able to use it within Notepad++, by using NppExec.

Then executing the following...

 

NPP_CONSOLE 0
cd "$(CURRENT_DIRECTORY)"
$(CURRENT_DIRECTORY)\cvbasic.exe "$(FILE_NAME)" "$(NAME_PART).asm"
$(CURRENT_DIRECTORY)\gasm80.exe "$(NAME_PART).asm" -o "$(NAME_PART).rom"
Npp_run $(CURRENT_DIRECTORY)\CoolCV.exe "$(NAME_PART).rom"

 

This will compile your cvbasic code and pop out a .rom file, then run in CoolCV for you to test!

 

NOTE: You have to put all three .exe files in the same folder.

 

Hope this helps!

Edited by Kamshaft
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

1 hour ago, drfloyd said:

Nano, can we expect a GUI version for the future final version ?

I think there are already very good and dedicated editors replicating an integrated development environment, and these can call CVBasic, gasm80 and CoolCV, as @Kamshaft just have shown with Notepad++.

 

 

Link to comment
Share on other sites

Which is the recommended extension for CvBASIC programs? I tend to use .BAS for IntyBASIC though I know that is a very generic extension. Perhaps one can use .BAS here as well, and just set up the environment to handle those as required.

 

Also, are there any command line settings for verbosity of the compiler and list file of the assembler? I didn't find neither.

Edited by carlsson
Link to comment
Share on other sites

Anyway, I made a quick and dirty conversion of intybasic-mode.el into cvbasic-mode.el, and for testing compiled one of Oscar's sample programs and verified in emulation that it runs. It seems CvBASIC + gasm80 have quite a few less arguments that can applied than what IntyBASIC + as1600 have, so a few of the settings in this mode are bogus for the moment being.

 

Yes, you need to have Emacs 22.x or newer installed in order to use it.

cvbasic-mode.zip

  • Like 1
Link to comment
Share on other sites

9 hours ago, carlsson said:

Which is the recommended extension for CvBASIC programs? I tend to use .BAS for IntyBASIC though I know that is a very generic extension. Perhaps one can use .BAS here as well, and just set up the environment to handle those as required.

 

Also, are there any command line settings for verbosity of the compiler and list file of the assembler? I didn't find neither.

CVBasic official extension is also BAS 😁

 

There are no verbosity commands for the compiler or the assembler.

Link to comment
Share on other sites

Not to say that I'll make games or anything crazy like that, but how does building tile graphics work on the ColecoVision? Instead of each 8x8 tile being two colors like it is on the Spectrum, each horizontal line of an 8x8 tile can be two colors? That's kind of weird.

 

Also, does anyone have a direct link to a PNG converter? There's some software on ColecoVision.dk, but a lot of those links are broken, and the file I did manage to find was in .TAR format. That's a Linux thing... I was looking for Windows software.

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