Jump to content
IGNORED

Extended BASIC Compiler


senior_falcon

Recommended Posts

Greetings:

 

I have been working on upgrading my BASIC compiler to include display at, accept at and sprites. I have made some very good progress. All the sprite routines from XB are fully implemented. Input, Linput and Accept are done, complete with all the bells and whistles such as BEEP, ERASE ALL, VALIDATE, etc. I am now working out DISPLAY and should be done with that part of the compiler in a couple of weeks. After cleaning up the loaders a bit it will then be ready for release. Retrospect (aka Texas Joe) has a beta copy with the sprite routines and has been having fun with it - you've seen some of the results here.

 

It's been almost 20 years since I wrote the compiler. I looked at the compiler a couple of years ago but couldn't figure out how it worked and gave up. This time around I had a different attitude. I didn't have to know everything about how it works - only how the parts work that I wanted to change! That insight and a little patience has made all the difference.

  • Like 4
Link to comment
Share on other sites

Yep, hopefully it's legit. I've pretty much done all I can do with BASIC / XB. I kind of lost interest in doing anything since... I have no interest in learning Forth and no time, really, to start with Assembly. This way I can be productive.

 

The gcc compiler has some interest for me as well...

 

-H

Edited by unhuman
Link to comment
Share on other sites

Making good progress on the DISPLAY AT routines. In principle this is easy, but it is complicated by all the optional stuff that can be used. DISPLAY without AT behaves differently. DISPLAY AT at row 24 will not scroll the screen, but instead goes up to row 1. Plus all the comma, semi, colon and tab controls have to work right. It's all written now and so far has passed some preliminary tests. Time to pour a glass of wine and forget there are such things as TI-99/4A's.

  • Like 1
Link to comment
Share on other sites

Cheers !

 

CALL CHARPAT and CALL CHARSET would be nice additions too.

 

To get a feel for it (the compiler) I’ve got an arcade and an adventure in the pipe. The arcade could benefit from a few sprite effects. The adventure could have a sprite touch in the title screen. Actually I don’t see any need for DISPLAY AT in these two projects, that’s not saying it dispensable at all. When you release the compiler with sprite support, I’ve got a 2600 arcade port/remake with enhanced graphics in mind.

 

A cross compiler seems possible. You’d write XB code in Notepad, compile and get an EA5 file. Compiler would catch syntax errors, so you’d actually go directly to the compiled version for testing (as in no need for testing and developing with non-compiled versions).

 

:thumbsup:

Link to comment
Share on other sites

CHARPAT and CHARSET look quite straightforward to implement. CHARSET doesn't seem all that useful to me, but since it's just a couple lines of code it'll be added. I will look into loading directly with the EA loader instead of using the XB loader which is written in GPL. This would speed up the testing process a bit. Also, that loader lets you use the C option when you assemble which makes smaller files. I don't know if it assembles any faster though.

 

As far as a cross compiler goes - as Shel Silverstein sang: "It's a wonderful chance for somebody,

But it's got to be somebody else, not me."

  • Like 1
Link to comment
Share on other sites

CHARSET doesn't seem all that useful to me, ...

 

I don’t think I’ve used it myself, but seen it in a few games. I think it might be useful in compiled games, like you have all these graphics in a game, and then for a page of scoring and other information, it resets easily, of course you have to set all graphics again for the game, but then that’s already there in the code, and then something the compiled version can do so quickly. Again, when already with a compiled version, doing your own font isn’t all that difficult, except if you’re maybe running low on memory. Do you know the size of the biggest Basic program you can successfully compile, loosely estimated in kilobytes ?

Link to comment
Share on other sites

Do you know the size of the biggest Basic program you can successfully compile, loosely estimated in kilobytes ?

 

This depends. The actual compiled code is quite a bit more compact than the original XB code. But on the other hand the compiler runtime routines are loaded in high memory along with the compiled program and use up some of the available memory. Also string variables are kept in high memory, not in VDP memory where they are in XB. In my tests years ago the break even point was somewhere around 40 sectors - that is to say if the original program was about 10K long then the compiled one would also be around 10K. So probably memory will not be a limiting factor - the compiled version of a maximum size (24K long) XB program should be smaller than that. Arcade games should be fine, but you may have memory issues with a large program that uses mostly strings such as a text adventure,

Link to comment
Share on other sites

Any ETA on sharing? I've got (very minor) surgery on 12/20 (with a pretty long recovery), so it would be nice to have this to play with in my down time.

 

It ought to be done by then. The DISPLAY stuff is challenging - I realized that I had some errors in how it was printing to the screen. Annoying... it passed all the preliminary tests. I'm hoping no more than a week to get that debugged. The rest is pretty straightforward.

Link to comment
Share on other sites

I've been dreaming of a decent XB compiler. Got pretty good with programming in XB but of course the console execution speed was always the detracting factor from making decent games.

 

I'm one of the guys that prefers the real hardware over emulation, so getting a new reason to go touch my silver machine is pretty exciting.

  • Like 2
Link to comment
Share on other sites

Very excited about this project - I feel this has been our "missing link" for some time. I can hack my way through XB enough to get my ideas across, but have not been able to make the time to learn assembly, well, ever. Being free to focus on design and gameplay, and letting the compiler do the heavy lifting to make the thing run at acceptable speed... talk about a dream come true! :)

  • Like 1
Link to comment
Share on other sites

It looks like the coding is done on the compiler. Display and Accept work just like they do in XB with all the bells and whistles. DISPLAY AT can use tabs, semicolons, commas, and colons with the same results as in XB. Also, just to make it a bit more useful, there is a (very minimal) routine to display on the screen using the full 32 column screen width. There is an A/L subroutine that can be loaded along with XB for program development and testing. When you compile, the compiler knows what to do with that line of code to give the same results on the screen. Oh yes, there's another routine that lets you use the sprite early clock.

 

Now to polish up the loaders and the documentation.....

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