Jump to content
IGNORED

CVBasic Target


Tursi

Recommended Posts

Over in the Coleco forums, @nanochess released a basic compiler for Z80-based machines, and then added a 6502 target. Not to be left out, I added a TI-99/4A target. ;) it took a bit more than I expected, but it's finally working for the most part. Even has some optimizations (though more are possible, I think.)

 

Right now it just outputs EA#3 programs, but it does work. Next update I'll get it building bank switched cartridges, since that's supported in there. But I've kind of blown my time budget on getting this far. 

 

That said! If anyone would like to take a peek at it, it has a small unpack function in it called Pletter. It's completely undocumented as far as I've found, and exists solely in assembly language source code for the Z80 (and now 6502 as well). I took a stab at porting it over but getting the ROLs, ASLs and carry bits right feels really tricky, and my code doesn't work. Still, people are using it to make their graphics fit, so if we want it to run the games other people are starting to make, we'll need it. ;)

 

Anyway, here's a link to the thread and I'll crosspost the video here too...

 

 

 

  • Like 16
  • Thanks 5
Link to comment
Share on other sites

Hey @Tursi

  

Not exacty sure what I'm doing wrong, but cannot run any of the examples with js99er.

 

./cvbasic --ti994a $1.bas $1.a99
../../xdt99/xas99.py -R $1.a99 -L $1.lst
../../xdt99/xdm99.py -X sssd work.dsk -a $1.obj -f df80

 

I load the disk into js99er, put the Editor/Assembler cartridge, use 3 LOAD/RUN, enter the program name, press Enter, and type START, and the screen becomes green.

 

Any ideas?

Edited by nanochess
Link to comment
Share on other sites

10 minutes ago, nanochess said:

I just made Viboritas to work :)

 

CapturadePantalla2024-08-31ala(s)9_53_39.thumb.png.4364f79b9c37b073d793894d021e8676.png

"Windito."  I love it.  So, if I understand this correctly, this is a BASIC programming environment from which you can take the same source and build for ColecoVision and TI-99/4A, yeah?

  • Like 3
Link to comment
Share on other sites

23 minutes ago, OLD CS1 said:

"Windito."  I love it.  So, if I understand this correctly, this is a BASIC programming environment from which you can take the same source and build for ColecoVision and TI-99/4A, yeah?

That's right, and also another nine platforms :)

 

* MSX

* Sega SG-1000/SC-3000.

* Spectravideo SVI-318/328.

* Creativision.

* Sord M5.

* Memotech MTX.

* Tatung Einstein.

* Casio PV-2000.

* Hanimex/Soundic Pencil II.

 

 

Edited by nanochess
  • Like 7
Link to comment
Share on other sites

2 minutes ago, jedimatt42 said:

I can find documentation on the compiler, but I can't seem to find documentation on the language it compiles? Is CVBasic bespoke to this compiler, or is a spec borrowed from another project?

The CVBasic language is specified in the file manual.txt and technically is derived from my previous IntyBASIC.

 

The syntax is Qbasic-alike

Edited by nanochess
  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, Tursi said:

Thanks, yes, that's the same code I already have. There's no additional information in there.

Oh, sorry. Thought you were trying to work off the embedded assembly decoder in the cvbasic code rather than the c encoder.

 

 

Link to comment
Share on other sites

31 minutes ago, Tursi said:

ooh... does that mean you got pletter to work?

Viboritas doesn't use Pletter. It was generating a BNE instruction (changed to JNE) and a small bug in constant 8-bit multiply where SLA moved trash bits into the high 8-bit value.

 

So far I've revised half of your Pletter translation, forgot that TMS9900 doesn't have rotation through carry.

  • Like 2
Link to comment
Share on other sites

28 minutes ago, nanochess said:

Viboritas doesn't use Pletter. It was generating a BNE instruction (changed to JNE) and a small bug in constant 8-bit multiply where SLA moved trash bits into the high 8-bit value.

 

So far I've revised half of your Pletter translation, forgot that TMS9900 doesn't have rotation through carry.

Oh, my bad... I don't know why I thought it did. Nice work on the fixes so far!

 

Yeah, not carrying rotate through carry, and the fact that most of the flags are set by most 9900 instructions - those two things make raw ports tricky. It's really cool of you to just dive into it :)

 

  • Like 3
Link to comment
Share on other sites

32 minutes ago, nanochess said:

Viboritas doesn't use Pletter. It was generating a BNE instruction (changed to JNE) and a small bug in constant 8-bit multiply where SLA moved trash bits into the high 8-bit value.

 

So far I've revised half of your Pletter translation, forgot that TMS9900 doesn't have rotation through carry.

I was perusing the source code a bit this afternoon. I sit in awe.  Really really cool.

 

One question, How does the sub-routine linkage work.

Is see   BL @JSR   following by a data label with the name.

Link to comment
Share on other sites

2 hours ago, TheBF said:

I was perusing the source code a bit this afternoon. I sit in awe.  Really really cool.

 

One question, How does the sub-routine linkage work.

Is see   BL @JSR   following by a data label with the name.

It is a subroutine that saves the return address into the stack, jumps to the subroutine (the data label with the name), and then returns back using the stack.

 

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

1 hour ago, nanochess said:

It is a subroutine that saves the return address into the stack, jumps to the subroutine (the data label with the name), and then returns back using the stack.

 

Cool, would you ever consider reserving a register to hold "JSR".

Link to comment
Share on other sites

48 minutes ago, TheBF said:

Cool, would you ever consider reserving a register to hold "JSR".

You could, I think there are one or two that the code doesn't touch. But you don't really need to - it's not used often enough that you'd see a benefit. 

 

As a for instance - you'd get bigger bang-for-the-buck shoving the VDP write address address into a register, as that IS used a lot. ;)

 

But I think the performance is pretty decent as it stands.

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

1 hour ago, JasonACT said:

No need for a C version then :)

Try.zip 1.09 kB · 2 downloads

I appreciate the effort though, thanks! I went all over the internet, even deep into the MSX forums, hunting for something like that. But seems @nanochess knows the algorithm well enough to even fix the port on an unfamiliar architecture! :)

 

  • Like 3
  • Thanks 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...