Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:22 20 May 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Portable MMBasic

     Page 2 of 3    
Author Message
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 11:15pm 15 May 2026
Copy link to clipboard 
Print this post

  thwill said  Hi folks,

I thought I should show signs of life since MMB4L and I have been name-checked twice. I'm still here but real life has been a killer for the last month and will probably be for a month more - no free time at all.

Impressive work @jvanderberg, looks like you and Claude have been burning the midnight tokens. Good luck to you trying to keep in-synch with the mainline features  . I have largely given up that struggle as MMB4L's file organisation and conventions have diverged.

If you do look at MMB4L then I suggest the https://github.com/thwill1000/mmb4l/commits/mmb4l-windows-6/ branch, but it's been too long now and I can't remember if I "parked" it terribly well.

Best wishes,

Tom


Even with Claude and Codex it's been a good amount of work. I do a good amount of planning, and then sometimes find that the LLM hasn't done what I asked. They are almost uniquely suited to just moving code around and splitting up files, but their own native ideas of the 'right' way to do it isn't always the best, and sometimes they get lazy and don't what was planned.

So it's taken about two months to get here. Likely would have taken a year or more on my own. I will also say that using an LLM encourages you to do things that you probably should not do, and to move too fast. In a complex interrelated code base like this, not a good idea.

I will take a look at MMB4L repo and see how you've approached things.  

As v6 of mmbasic is already amazingly competent, I think even if I mostly stopped taking new features this fork would still be incredibly useful. But I do want to track any big new features as they come along.
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 12:16am 16 May 2026
Copy link to clipboard 
Print this post

  homa said  WOW! REALLY COOL PROJECT!
It only works for me in Edge; Firefox on Windows 11 doesn't work.

The demos are impressive. The 'new' command doesn't clear the memory?!

Matthias

Addendum:
Firefox is working after all; I just had to restart it once. The "new" problem remains.


It works for me in Chrome and Firefox on MacOS, I can't really try native firefox on windows 11 - I might have to borrow one of my kid's laptop.

'NEW' is now fixed, there was a bug in how the WASM build emulates flash.
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 619
Posted: 02:54am 16 May 2026
Copy link to clipboard 
Print this post

Still on chemo but i like the idea and concept so i chime in here .
A bytecodecompiler is a great idea. Like and cant wait !
Plasma
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 619
Posted: 02:54am 16 May 2026
Copy link to clipboard 
Print this post

Works on safari with iphone 16e

Edited 2026-05-16 12:59 by Plasmamac
Plasma
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 04:12am 16 May 2026
Copy link to clipboard 
Print this post

  Plasmamac said  Still on chemo but i like the idea and concept so i chime in here .
A bytecodecompiler is a great idea. Like and cant wait !


The bytecode compiler is in the WASM demo, just use 'FRUN' instead of RUN. Try it with 'mand.bas'.  With a slowdown (click the gear) of about 10us, it should approximate device speeds. FRUN will be 10x faster than RUN.

It really only works for math heavy loops, for most other things mmbasic has a native C implementation of the slow stuff. Heck, it even recently got a mandelbrot function (not used in this demo).

And then there's the issue that creating bytecode native VM syscalls for every single basic statement just was not a realistic target, it would have meant basically re-implementing the entire mmbasic function surface area. So the bytecode compiler 'thunks' down to the interpreter for most functions, which means it has to dummy up the interpreter globals and any other variables in scope, and cart around tokenized versions of the code, call the interpreter function, and then re-sync the results with the vm. So that slows things down a bit and tends to cancel out any speedup.

But where it can really shine is in tight math loops. It will try to auto optimize and run them in a special zero dispatch kernel with a slimmed down instruction set focused on math. And in fact the compiler allows you to hand write such loops with the same slimmed down instruction set in 'assembly'.  See 'mand_asm.bas' in the demo, though that version has some issues that make it not as fast as the auto optimized mand.bas.
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 04:19am 16 May 2026
Copy link to clipboard 
Print this post

  Plasmamac said  Works on safari with iphone 16e


So it does, that's surprising. How do you type? I think I need to provide some sort of keyboard mechanism for mobile.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4369
Posted: 10:22am 16 May 2026
Copy link to clipboard 
Print this post

  jvanderberg said  I will take a look at MMB4L repo and see how you've approached things.


I've taken a brief look this morning and parked the code better: https://github.com/thwill1000/mmb4l/commits/develop-v0.8-7/

My highest priority when normality resumes is to get a v0.8 released and burn all these working branches.

Tom 
Edited 2026-05-16 20:33 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1453
Posted: 04:30pm 16 May 2026
Copy link to clipboard 
Print this post

It's looking pretty good already

I've had a bit of a go :-)
The keyboard is a bit slow to respond and the keystrokes aren't being recognised yet.
Edited 2026-05-17 02:52 by Martin H.
'no comment
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 578
Posted: 04:46pm 16 May 2026
Copy link to clipboard 
Print this post

It would be great if this refactoring of the interpreter architecture could be merged into the main version. This can help to avoid the nightmare of bringing the new releases changes to this version.
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 05:03pm 16 May 2026
Copy link to clipboard 
Print this post

  Martin H. said  It's looking pretty good already

I've had a bit of a go :-)
The keyboard is a bit slow to respond and the keystrokes aren't being recognised yet.


Looks great!  Do you have the source available?

They keyboard being a bit slow I think is my overaggressive matching of the slower key repeat on the PicoCalc - I should perhaps make that adjustable. What do you mean by the keystrokes not being recognized? Could be a need to create some onscreen helpers for device keycodes.
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 05:15pm 16 May 2026
Copy link to clipboard 
Print this post

  LeoNicolas said  It would be great if this refactoring of the interpreter architecture could be merged into the main version. This can help to avoid the nightmare of bringing the new releases changes to this version.


I am ok with it being a slightly different thing that perhaps doesn't perfectly track the upstream.  If for example, this is the only way to get an esp32 port, I am not sure people will care that it doesn't have all the latest and greatest.

One of the issues is that the upstream isn't really following a git workflow that easily allows PRs and merges, as files are added via bulk upload by Peter Mather. Again, no shade, I don't want to step on toes or break a workflow that works for him.

But I've also radically restructured things in a way that just doesn't easily allow for sharing, even if the upstream had a more traditional approach to git. If it had it might be easier to merge or cherrypick a change to a file that hadn't changed much in either of our repos, but I've changed most everything, for better or for worse.

There was perhaps an approach where I tried to minimize code base disruption while maximizing portability, I did not take that path :)
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1453
Posted: 05:16pm 16 May 2026
Copy link to clipboard 
Print this post

  jvanderberg said  
Looks great!  Do you have the source available?

Of course. The source code can be found here

You can also find an overview of Picomite Games with relevant links here
Cheers
Martin
Edited 2026-05-17 03:17 by Martin H.
'no comment
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 07:06pm 16 May 2026
Copy link to clipboard 
Print this post

  Martin H. said  
  jvanderberg said  
Looks great!  Do you have the source available?

Of course. The source code can be found here

You can also find an overview of Picomite Games with relevant links here
Cheers
Martin


Found it, I've got a patched version that works better, mind if I include it (with attribution in the source) in the webasm demo?

This version also exposed some holes in the bytecode compiler. MMBasic really is an amazing language with a very liberal syntax.
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1453
Posted: 07:33pm 16 May 2026
Copy link to clipboard 
Print this post

  jvanderberg said  mind if I include it (with attribution in the source) in the webasm demo?

Feel free to adapt the code to suit your needs and publish it alongside the demos.
One thing I noticed was that your Basic doesn't recognise the “Mode” command, so you basically have to switch the screen "externally" to 320x240 for it to run properly (as it does on the Pico).
Cheers,
Martin
'no comment
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 07:36pm 16 May 2026
Copy link to clipboard 
Print this post

  Martin H. said  
  jvanderberg said  mind if I include it (with attribution in the source) in the webasm demo?

Feel free to adapt the code to suit your needs and publish it alongside the demos.
One thing I noticed was that your Basic doesn't recognise the “Mode” command, so you basically have to switch the screen "externally" to 320x240 for it to run properly (as it does on the Pico).
Cheers,
Martin


Thanks, I'll put it in there.

Thanks for reminding me on MODE, it's more that webasm port doesn't have the mode command compiled in. My VGA/HMDI version does - but there's no reason I shouldn't compile it in and have it switch the web resolutions.
Edited 2026-05-17 05:38 by jvanderberg
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 03:00am 17 May 2026
Copy link to clipboard 
Print this post

  Martin H. said  
Feel free to adapt the code to suit your needs and publish it alongside the demos.
One thing I noticed was that your Basic doesn't recognise the “Mode” command, so you basically have to switch the screen "externally" to 320x240 for it to run properly (as it does on the Pico).
Cheers,
Martin


Ok, I've updated the emulator to support 'mode' - you can edit which mode is associated with which resolution in the config. There's also a key repeat setting now, so your original, unmodified version of Picovaders should run well if you edit the settings in the wasm emulator.

But I made a slightly updated version to handle the typical key repeat speed and fix some key handling issue, it's include in the demo - you might need to click the 'refresh' button to reload the files. There's also a Picovaders_fastgfx.bas - which used a lightweight framebuffer to provide faster graphics without flicker. Fastgfx is a bit like FRAMEBUFFER, but with a much simpler api.

You can also attempt to run the original Picovaders in the byte code compiler with the lightning icon. It does run quite a bit faster. Your game found like 5 bugs in the bytecode compiler, so thank you.
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 632
Posted: 03:55am 17 May 2026
Copy link to clipboard 
Print this post

  jvanderberg said  
  LeoNicolas said  jvanderberg

Do you have the code on a git repo where we can contribute for?


Sorry, it's kind of linked by the demo, but yes, the repo is https://github.com/jvanderberg/PicoMiteAllVersions

I will likely change the name, as it's not really PicoMite any longer, just the pico port is 'PicoMite'.

It's a bit of a mess with some half finished plans and audits, but it should be in reasonably good shape, the Pico builds are usable on real hardware.


I can't seem to compile for linux. I get a lot of output then this:

/usr/bin/ld: /home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/build/FileIO.o:/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/FileIO.c:270: multiple definition of `FileTable'; /home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/build/host_runtime.o:/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/host_runtime.c:95: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/Makefile:113: /home/tom/Downloads/PicoMiteAllVersions-jvanderberg/host/mmbasic_test] Error 1
make[1]: Leaving directory '/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/host'
make: *** [Makefile:16: all] Error 2
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 06:31pm 17 May 2026
Copy link to clipboard 
Print this post

  toml_12953 said  

I can't seem to compile for linux. I get a lot of output then this:

/usr/bin/ld: /home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/build/FileIO.o:/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/FileIO.c:270: multiple definition of `FileTable'; /home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/build/host_runtime.o:/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/host_runtime.c:95: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/ports/host_native/Makefile:113: /home/tom/Downloads/PicoMiteAllVersions-jvanderberg/host/mmbasic_test] Error 1
make[1]: Leaving directory '/home/tom/Downloads/PicoMiteAllVersions-jvanderberg/host'
make: *** [Makefile:16: all] Error 2


I've updated it to compile and build on Linux, this was needed to support linux tests and build artifacts anyway, so it was good to get done.

If you want to run it on Linux, there are three ways:

- the WASM build with a local server, which will launch a python server that runs a website to host the WASM build.
- the mmbasic-ansi build, which is kind of wild. You'll need to run it in a browser zoomed way out, as it uses half block rendering for pixels. It runs in full graphics mode, just using text for pixels. So if you want 320x320, you'll need a 320x160 terminal.
- then finally there's the 'stdio' version, which is really just for testing. It just runs a program and outputs text to stdout - no graphics.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1098
Posted: 09:15am 18 May 2026
Copy link to clipboard 
Print this post

@jvanderberg

Your HTML version is very cool!
Is there a way to use it offline as well? That would be great!

Frank
 
jvanderberg
Newbie

Joined: 06/05/2026
Location: United States
Posts: 34
Posted: 02:03pm 18 May 2026
Copy link to clipboard 
Print this post

  Frank N. Furter said  @jvanderberg

Your HTML version is very cool!
Is there a way to use it offline as well? That would be great!

Frank


https://jvanderberg.github.io/PicoMiteAllVersions/

Will install as a PWA - the help instructions walk you through it for all major browser versions. It will work offline, and get a desktop icon.

I could build binaries for various platforms, but for a simulator, it's just easier to target web. I imagine I could create an Electron app if there's some demand, but that's yet another build to support, and there are a lot of builds in here, all wanting to break at the drop of a hat :)
Edited 2026-05-19 00:04 by jvanderberg
 
     Page 2 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026