Hallo Besucher, der Thread wurde 24k mal aufgerufen und enthält 210 Antworten

letzter Beitrag von FeralChild am

BBC BASIC for the MEGA65?

  • Hi all,


    First of all... I don't want to open a can of worms here, and I'm aware that there's great work being done on the OPEN ROMs, and under no circumstances I want to belittle or discourage this work.


    Having said that, I thought it maybe worth mentioning that BBC BASIC for the 6502 is available as source code here:


    http://mdfs.net/Software/BBCBasic/BBC/Basic2.zip


    ...and what's more, there even has some work been done of porting it to the C64 in the past (there's a C64 "target" in there).


    Now I don't want to raise any false hopes... those sources won't build on any modern assembler without lots of work (in their present form, they have to be built on a RISC OS 3.1 host with BASIC65 patches). And all the graphics stuff won't work without someone writing the VDU drivers for it.


    But... having worked with BASIC10 and the dev board for two months now (you may check out yaped32, hopalong and lemonade, if you like...;-) and on the original C65 ~20 years ago, I feel I can safely say, there's an urgent need for a reasonably modern programming language on the MEGA65.


    BASIC10 surely is interesting from an archaeological point of view... but as a tool to create new programs that make use of the MEGA65's advanced features, it just simply and plainly sucks. Floating-point-only arithmetic, GOTO/GOSUB hell, no named functions and procedures and variable names limited to two characters simply don't belong on such a beautiful machine.


    So... just a little food for thought: for an experienced 6502 coder, I think the BBC BASIC sources are definitely some sweet and juicy low hanging fruit. Who knows, maybe someone feels called to have a closer look at it. I think the MEGA65 as a platform would benefit considerably. Maybe it would even be possible to combine OPEN ROMs and a port of BBC BASIC!


    Kind regards,

    Stephan


    P.S.: RISC OS (of which BBC BASIC is now a part) is -- since October 2018 -- released under the Apache 2.0 license.


    P.P.S.: There's some information on porting here: http://mdfs.net/Software/BBCBasic/6502/

  • Wow, that's interesting. I played with the Z80 version of BBC-BASIC which is/was a project of R.T.Russell as his own (and since then released under an open source license) porting BBC-BASIC to Z80, but I had no information about the actual (or some) 6502 version is available as source code. Though by looking the source, it's not clear for me, what kind of license applies on this.

  • KickC is very nice, but it would be even more nice to have something reasonably inspiring and structured running natively on the M65 (not least because the keyboard is ultra nice ;-))


    Of course BASIC10 is nice for what it is. But what it is is a rewarmed take on a rewarmed take on a rewarmed take of Microsoft BASIC 1.0. It was already ancient by 1992. There were better and faster and more structured solutions even by the time BASIC7 was conceived. But then again of course tastes are different... and as I said, for archaeological purposes, it's absolutely fine... ;)

  • there's an urgent need for a reasonably modern programming language on the MEGA65.

    How about KickC? "Modern" and BASIC ... something bites ...?;)


    I like BASIC 10, because it's the BASIC of the C65.

    Indeed, but the nature of open source projects, that everybody can has his own/specific dreams and can even do it, if really want :)

  • ubik BBC Basic to fully use MEGA65 features? Quite a lot of work. It's not just adapting to modern assembler and CBM Kernal API:


    - code should be reviewed and adapted to utilize MEGA65 CPU instruction set (which is extended compared to 6502)

    - one would need to rethink and rewrite the whole sound & graphics support; I bet MEGA65 is much different than BBC Micro

    - variable/array support would have to be rewritten to support MEGA65 extended memory

    - to be able to run existing assembler software, text binary format should be reviewed and made CBM-like - otherwise such a ROM wouldn't be able to run even anything like "10 SYS 2084"

    - the CBM BASIC floating point routines (and some others) are used by various software quite often - to be reasonably compatible, you would need to provide these APIs too

  • There's also BBC Basic 5 --- it's a backport of the really superb Basic 5 for the Archimedes to the 65c02 by TubeLink; I don't know if it shares any source with the Sophie Wilson's original Acorn Basic, so it may not be as fast, but it adds things like multiline if, case while on top of the existing BBC Basic features:


    - named procedures with local variables

    - disk-based libraries

    - built-in 65c02 assembler


    It's a completely different beast to the simple Microsoft Basic which Commodore licensed. The downside is that BBC Basic is big: it expects to live in a 16kB ROM, with the OS in a different 16kB ROM. OTOH the C64 port of Basic II, even loaded into RAM, runs with 42kB free, which is about twice as much as you'd get on a BBC Micro. http://mdfs.net/Software/BBCBasic/C64/dev/demo3.gif


    http://mdfs.net/Software/BBCBasic/BBC/AdvBasic/Tubelink.txt

  • Thanks! :) I did quite a few things in BBC BASIC myself (I have a RISC PC and a BBC Master here... and for example my Daleks game for RISC OS is written entirely in BBC BASIC... ;-)) ... which is why I'm absolutely certain it would be a much more fitting companion for the M65 than BASIC10.


    But I can also understand that people are nostalgic and want to experience the 'Commodore style' of things...


    I think/hope in time there will be several programming languages to choose from on the M65. Until then, it's cross-compiling and somehow coping with BASIC10 ;-)

  • I think porting BBC BASIC to the MEGA65 would be a fantastic idea, for someone with the skills to do it. It really is a fantastic version of BASIC; probably the best ever released in many ways. What's more, MANY versions now exist – more than most people realise – and so to have a good version on this new platform would be a real potential positive.


    Obviously there are major questions about how to handle the particular machine's unique features, and there's also a lot of work to be done if the implementation is to give access to the machine's full capabilities. Nevertheless, the fact remains that BBC BASIC is a superb language and would be a real asset on this system.


    Of course, BBC BASIC is best known from the BBC Micro and Master series, and later the 32-bit RISC OS computers. And those versions are obviously 6502- and ARM-based. However, let's not forget that BBC BASIC was also included in a Z80 implementation on Sinclair's Cambridge Z88 portable/laptop computer (which still has a cult following), and other versions have been made available separately. There are Z80 versions of BBC BASIC for CP/M, the Amstrad 8-bit machines and even the Tatung Einstein(!).

    There's even a third party version of BBC BASIC for the Sinclair Spectrum – and Richard Russell supplies BBC BASIC for Windows, and now SDL2, I see, for running on just about any modern platform in a browser. Indeed, I see there are various spin-offs like an Android Application Generator, which can create Android apps from BBC BASIC programs (an iOS version of that would be cool…).

    And other third party efforts include Brandy BASIC, which is a multi-platform version of BBC BASIC VI with optional SDL graphics. I'm also aware of a chap who's working on a new BBC BASIC-compatible interpreter/compiler for macOS, which should be able to generate stand-alone applications.

    I myself have written quite a number of multitasking RISC OS applications purely in BBC BASIC over the years – and you'd never know that they weren't written in C or some other compiled language. It's a FANTASTIC version of BASIC (both very powerful and very fast, and a real pleasure to use), so if someone ported it to the MEGA65 I think it could be a real asset to the machine.

  • FWIW, I just tested it, the C64 version does run on the Mega65 xemu. Of course without any support for advanced stuff.

  • FWIW, I just tested it, the C64 version does run on the Mega65 xemu. Of course without any support for advanced stuff.

    Thank you! :) Yep, I'm perfectly sure it's possible to conjure something up that will work with the open ROMs... now we'll just have to find the valiant hero who will undertake this big adventure and some fine day deliver us from the foul curse that BASIC10 is...


    (Oh well, I've been playing too much Phantasie & Ultima on my DevKit...)

  • Is there a reason why it should be BBC BASIC or is it just an example of a "more modern BASIC"?


    If you already have the chance, you could also develop a "new" BASIC from scratch, which offers the possibilities of the C65/MEGA65 with maximum convenience. Then you would have the advantage that you can specify exactly what you want. ;)

  • Just an example. Of course something developed specifically for the m65 would be even better (but BBC BASIC is already there, so that would probably be easier to start with...)


    Commodore had a very thorough internal document about the state of their implementation of BASIC and what should be done to improve things. I'll attach it to this post...


    Some key quotes:




    ...and much more. Unfortunately, only a very, very small subset of the suggestions was tackled in BASIC10.


    The document is from 1988... it's nice to know that there was an awareness for the need of the improvements I am talking about, 32 years ago already :)


    But it's ok if people are reluctant to change anything. I've done quite a lot of advocating for a modern programming language on the M65 here & on discord... and so far have been met with little approval and much skepticism. To be completely honest, it gets tedious with time... so I think I'll rest my case and instead do whatever *I* can do to make the machine more approachable...

  • Is there a reason why it should be BBC BASIC or is it just an example of a "more modern BASIC"?

    I think BBC BASIC is key here, because:

    • it's exceptionally good (really, far better than any of the other alternatives from its era);
    • it's very widespread, meaning that there's a lot of software out there, written in BBC BASIC, that could be ported easily;
    • there are already versions of BBC BASIC for many different systems and architectures (including 6502, Z80 and ARM);
    • BBC BASIC's graphics, sound and I/O commands are inherently very flexible and largely platform-independent; and
    • because of these considerations, there are already very many people who know this language intimately.

    Also:

    • BBC BASIC also has its own inline assembler, by which machine code routines can be intermingled with BASIC very easily (or, indeed, you can write entire machine code programs with all the advantages of the BASIC editor). Since the BBC Micro series and the Commodore 8-bit machines were both 6502-based, porting the inline assembler as part of the project would make particularly good sense.

    Having it available on the MEGA65 would widen the machine's appeal to users who would otherwise be less interested in a Commodore system – not least because Commodore was notorious for having, shall we say (to be kind), not a particularly nice version of BASIC built in. I don't want to offend any fans of Commodore BASIC, but BBC BASIC really is an awful lot better.

    If you already have the chance, you could also develop a "new" BASIC from scratch, which offers the possibilities of the C65/MEGA65 with maximum convenience. Then you would have the advantage that you can specify exactly what you want. ;)

    But… doesn't that (or shouldn't that) describe the version of BASIC that's built into the MEGA65? I'd have thought so…


    Look at what's happened 'over the fence' on the Spectrum Next (which is very much in the same class as the MEGA65, but for Sinclair fans). The Sinclair Spectrum already had a very good version of BASIC, but for the Next one particularly talented and industrious developer has (among many other things) VASTLY extended Sinclair BASIC both to expand its features as a language and to fully cover all the new capabilities of the hardware. He's done an amazing job, and it's exactly what that machine needs: the ability to continue running all the BASIC programs that have been written for it, but also to allow users to take advantage of the full facilities of the system with new commands.


    For existing Commodore fans, who will surely comprise the large majority of MEGA65 users, the machine's inbuilt BASIC should ideally be something equivalent: i.e. familiar Commodore BASIC that runs old software, but updated to provide access to the new features of the machine.


    However, if an alternative version of BASIC were to be provided for the machine, then it only really makes sense if there are compelling reasons to port the alternative across. In the case of BBC BASIC, I think there are indeed such compelling reasons. Aside from its extremely high quality and widespread adoption on multiple systems, its flexible graphics commands in particular should offer some cross-platform compatibility for at least basic graphical features. (Sound and interfacing too, in fact.) Of course, extending its existing features and maybe adding new commands to support the specifics of the MEGA65 wouldn't be exactly trivial, but it would be FAR less work than writing a whole new version of BASIC from scratch.


    And, quite honestly, I can't see the appeal of writing a new BASIC from scratch anyway. Why bother? To do it well would be an immense amount of work and I don't see many people making much use of it, because it'd just be another incompatible BASIC variant with no existing users or software to back it up. (And it'd also require comprehensive documentation and lengthy, in-depth bug-testing.)


    However, porting BBC BASIC would bring to the table one of the best versions of the language ever devised – not to mention its very welcome inline 6502 assembler features – along with potentially significant extra user interest and loads of software to adapt easily to the new machine. And whilst I don't downplay the amount of work needed to port it, I can see plenty of justification for doing so. Supporting the MEGA65's powerful features may require a fair amount of extra work on the language, BUT… perhaps not as much as you might imagine. BBC BASIC was always pretty well future-proofed, and its I/O syntax is very flexible.


    Don't forget, it wasn't just the default language of the 8-bit BBC Micro; it was also the default language of the 32-bit Archimedes and its successors (albeit in an enhanced later version). The Archimedes had incomparably better graphics and sound capabilities than the BBC Micro, yet its version of BASIC was backwards-compatible, which made porting BBC software very easy (indeed, much of it ran without alteration if you didn't want to use the features of the newer machine). The language syntax was flexible enough to cope with the newer machines' features, and I'm sure that a bit of careful planning could make it sensibly adaptable to a machine like the MEGA65 in most ways, too.

  • But it's ok if people are reluctant to change anything. I've done quite a lot of advocating for a modern programming language on the M65 here & on discord... and so far have been met with little approval and much skepticism. To be completely honest, it gets tedious with time... so I think I'll rest my case and instead do whatever *I* can do to make the machine more approachable...


    I think it's quite understandable that people prefer to have Basic 10 as a default. It's just what people with a Commodore background expect.

    Having the machine more open to Newbies with no Commodore background (like me ;-) ) is a worthy goal, but how many can really be expected to buy the finished Mega 65, especially at the price that is to be expected?

    I have somewhat of a background in compilers, which is why this topic interests me (unfortunately, absolutely no clue about 6502 assembler...), but it's very difficult to even define what a more "modern" programming language on the Mega65 would even look like. It can't be a real modern programming language, due to constraints of the architecture, but even if we look at what prior work has already been done that could be utilized, it gets difficult. There's the guy on the forum who has an Ada-like compiler, there's neslisp for the C64, these are already two widely different approaches (which I personally like, because I like Ada and Lisp). But those are not compatible with anything, so why would anyone learn a dialect of a language not used anywhere else? Most people would probably prefer something Basic-like, this is where BBC Basic comes in, but then BBC basic isn't modern as well. If the "modern" programming language is targeted at a modern audience shouldn't it be something Python-Like?


    It is an interesting topic, but it is difficult to get to a conclusion.

  • Commodore had a very thorough internal document about the state of their implementation of BASIC and what should be done to improve things.

    This is all very interesting, and it would be great to see such work go into enhancing BASIC 10 – in a backwards-compatible way – in line with the work that Commodore evidently planned to do itself. That would be very much in keeping with this whole project, in fact. The default language that comes in this machine really should be the latest and best version of Commodore BASIC, ideally improved along the lines that Commodore itself was planning and with the ability to access the new features of the new machine.


    But this is a different issue to the question of porting an alternative language, namely BBC BASIC. If it could be done at all, then it would be particularly wonderful to be able to actually built it into ROM as an alternative to Commodore BASIC; I don't know whether that's technically feasible or not.


    Either way, see my previous post just above. BBC BASIC is an absolutely superb language – fabulously well structured and flexible – and if a good port were made of it for the MEGA65 it'd turn it into a programmer's dream machine.