Jump to content
GroovyBee

BASIC on the jag - Is it feasible?

Recommended Posts

After 10 minutes of work (mainly having to wait for a machine reboot after installing software) it appears the answer is "Yes!" but it needs a bit more work. As these things do :lol:. So....

 

I downloaded BCX from here. BCX is a BASIC to "C" converter. Its a modern dialect of BASIC but I haven't looked at anything beyond that. Its an 11M download but that does include several editors, a form generator, help etc. as well as the command line tool of interest bc.exe.

 

A quick look at help and a conversion of s00.bas using the command line :-

 

bc.exe s00.bas -x -n -f:s00.c

 

Results in a "C" file that relies on being linked to an BCX external support library for some of the commands used in the basic language like locate, cls etc. and has minimal header file requirement too.

 

At this stage you'd need a 2nd tool to work on the "C" file to automatically comment out the win32 header files that aren't on the jag (for obvious reasons) and to also include a yet to be written header file (using bcx.ini might go some way towards this goal). The new header file would contain a selection of #defines for the functions in the BCX external library. Over time those #define'd functions could be replaced with real code to achieve the expected functionality.

 

Once the 2nd tool has done its job the end result could be compiled for the jag using the VBCC or GNU compiler systems, linked to the removers standard "C" library, the "BCX2JAG library" (to be written) and then downloaded to the jag.

 

I'm guessing that BCX won't care about functions not within its known set (provided they parse correctly) so calling custom written jag hardware specific functions to handle sprites, music etc. shouldn't be a problem. Hmmmmm... BASIC + RAPTOR anybody? :lolblue:

  • Like 6

Share this post


Link to post
Share on other sites

So what will happen if you have the time to, say, install windows xp on a old PC with slow hard drive? ;)

Share this post


Link to post
Share on other sites

The other thing I forgot to mention is that BCX is written in the BCX language and can convert itself to "C". So the 2nd tool may not be required if the BCX source code can be changed to make it more jag specific with respect to headers and such.

Share this post


Link to post
Share on other sites

So what will happen if you have the time to, say, install windows xp on a old PC with slow hard drive? ;)

 

You too can program in BASIC on the jag! ;)

Share this post


Link to post
Share on other sites

Thanks for the link. I'll take a look at it later. The website says that its based on GFA syntax which I used a lot (on the ST) back in the day.

 

Yep, I've converted a couple of programs with minor syntax changes and they worked flawlessly. It would be nice to have!

Share this post


Link to post
Share on other sites

It'll still need support libraries to link against for execution on the jag so that you can handle sprites, graphics, sounds and the like. Once RAPTOR has a "C" wrapper that will be a much easier task.

  • Like 1

Share this post


Link to post
Share on other sites

I once considered trying to write a FORTH interpreter for the Jag, it should be fairly easy, since 90% of FORTH is written in FORTH, and you only need a handful of assembly routines to bootstrap it onto new hardware... but then I realised the hassles of trying to hook up a keyboard to the Jag (Skunkboard USB maybe?) and forgot about the whole thing. Besides, everyone would have to learn FORTH then, and they'd still be better off with assembly.

Share this post


Link to post
Share on other sites

I actually did the same thing, Tyrant, I was going to port a nice little kernel that had been written for the TI, all indications were that it'd fit nicely in the GPU and could run out of there. But.. yeah. Learning Forth works for some people but not others, and still needs all the libraries and an input device...

Share this post


Link to post
Share on other sites

Very, very cool! I'll definitely be lurking in this thread to see how BCX turns out. If it can be ported to Jag then the XBOX360 gets ripped from its roost and my Jag goes back where it belongs.

 

UPDATE: Er, better yet, is there any way a BASIC snob like me can help? Can I butter up GroovyBee with gifts or money?

  • Like 1

Share this post


Link to post
Share on other sites
UPDATE: Er, better yet, is there any way a BASIC snob like me can help?

 

Learn enough "C" to patch the output of BCX into something useful and then forget it all and continue in basic ;).

 

Can I butter up GroovyBee with gifts or money?

 

:rolling: :lolblue:

  • Like 2

Share this post


Link to post
Share on other sites

Personally I'd avoid C++ on the jag due to the extra overhead in the parameter passing in classes. You'd be better served enabling VBCC's C99 compatibility mode instead.

  • Like 1

Share this post


Link to post
Share on other sites
UPDATE: Er, better yet, is there any way a BASIC snob like me can help? Can I butter up GroovyBee with gifts or money?

 

I'm not helping unless I get gifts too! :P

  • Like 6

Share this post


Link to post
Share on other sites

I think people are missing the point of this and taking it seriously now.

 

:lol: I'm certainly not taking it seriously.

Share this post


Link to post
Share on other sites

Serious enough to send gifts? :D

 

Sorry, didn't know this was a joke topic. I haven't delved deep enough into C or BCX to be of any testing help. Gifts were the only other way I could think of to assist. Some argue that ease of coding leads to poor games. I say more beginners leads to more experts. Thus a clear need for higher level languages like BASIC.

  • Like 2

Share this post


Link to post
Share on other sites

Sorry, didn't know this was a joke topic.

 

Just because some of us aren't taking it seriously doesn't mean its a joke topic. For BCX to be any use on the jag it needs a hardware specific library to hook into for handling controllers, sprites, collision detection, sound and so on. Which in turn means that same library has to be accessible in "C" otherwise it's a project that isn't going to fly. The easiest way to do that is for someone to add a "C" wrapper onto Reboot's RAPTOR and also the U235 Sound Engine. I have already done the "C" wrapper for the U235 Sound Engine and I'm pencilled in for the RAPTOR one as well. Once those are done its a matter of a few example mini games in "C" to show coders what they need to do to make 2D games. Then a layer for BASIC needs to be done. After that BCX is truly viable as a development for jag game creation because any deficiencies in language conversion and the overhead of "C" in general can be traded against the speed of RAPTOR. That way "C"/BASIC can be used for the game's AI and logic while the speed critical stuff is in 68K, GPU and DSP assembly languages.

 

I haven't delved deep enough into C or BCX to be of any testing help.

 

But is you took on the project you'd get help from a few of us. Thats what its all about ;).

 

Gifts were the only other way I could think of to assist.

 

Its very kind to offer but gifts don't motivate me or the guys from either Reboot or U235. If a project is fun/difficult/interesting/simple/quick (fun is always mandatory :P) to do then that is more likely to work. We also have lives outside the forums so some things take time to get done too.

Share this post


Link to post
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.

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