|
Forum Index : Microcontroller and PC projects : MMBasic ANSI - MMBasic on Mac/Windows/Linux in a terminal
| Page 1 of 2 |
|||||
| Author | Message | ||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
As part of my MMBasic Anywhere work to make MMBasic more portable, I made a version that compiled and ran locally on my mac, for testing purposes. But that was only text mode, which is a bit boring. So I did something a bit silly and made a version with full graphics mode, in a terminal. It uses half-block rendering, so each text block is two pixels, vertically stacked. This works better in modern terminals, and with a terminal font that's as close as possible to being twice as tall as it is wide. And you have to zoom way out. ![]() The current working directory is shared as the B: drive in MMBasic. Most stuff should work, but I am sure some things are broken. Video of MMBasic ANSI Terminal in action You can download them here: Windows/Linux/MacOS binaries Sound does not work because figuring out native sound on all three platforms is non-trivial. If you want sound, you can use the Desktop binaries, which are a lot bigger Electron based desktop app |
||||
| al18 Senior Member Joined: 06/07/2019 Location: United StatesPosts: 237 |
Assuming the MacOS universal works on Intel Macs and Mx series Macs. Will the program run on MacOS Catalina? Looking forward to trying your program out. Edited 2026-05-25 05:56 by al18 |
||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
The macOS build is intended for modern macOS. Catalina support has not been verified yet. It may work. It's a terminal app that doesn't use much in the way of fancy APIs. |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
hello. i am not a terminal expert... or i am to silly. |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
perhaps ist not correct to use "sudo" with "./" i try further... |
||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
I've updated it to make it executable by default, something got lost in the build. But you will face another hurdle, the mac really does not want you to run sus software from the internet, so run this after you download: xattr -dr com.apple.quarantine mmbasic_ansi-macos-universal chmod +x mmbasic_ansi-macos-universal/mmbasic_ansi The first line removes the internet quarantine from the directory, the second make double sure the executable is well, executable. This is now documented in the readme that comes in the zip file. |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2524 |
have downloaded mmbasic_ansi-linux-x64.zip on a couple of machines running 64-bit Linux Mint and was able to run it with 'varying' success. first problem was a series of GLIBC error messages: ./mmbasic_ansi: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./mmbasic_ansi) ./mmbasic_ansi: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./mmbasic_ansi) ./mmbasic_ansi: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by ./mmbasic_ansi) ./mmbasic_ansi: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./mmbasic_ansi) this is caused by the binary being built in such a way that it will only run on a machine having the same or later version of libc (GLIBC) installed as was on the machine it was built on. you can check the installed version by typing ldd --version. there are a couple of solutions to this problem: 1. when linking, specify to use unversioned or base GLIBC symbols, or, 2. build the binary on a VM that is running an older version of Linux. Mint 19.3 is a good choice (uses libc version 2.27) that i have used in the past. second problem (on another machine) was getting open a terminal window that was (a) large enough and (b) using a small enough font, such that i could view the graphic rendition of the font in half-block characters. while i made some small progress, on the whole i failed abysmally here! i did get some readable text, but not in a way that the editor was usable or with the whole area used by mmbasic was viewable. is there any chance you could create a build that is non-graphical and just uses the terminal screen as normal text at 80x24? this would allow for easily testing out the rest of the (non-graphics) features of your version of mmbasic. the third problem, which i only briefly encountered, is that pressing ctrl-Z at the end of an autosave command just pushes mmbasic into the background. can/have you mapped the ctrl-Z key function to another keycode? despite the above problems, i was still pretty impressed with your efforts! cheers, rob :-) Edited 2026-05-26 01:11 by robert.rozee |
||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
Ok, I've rebuilt it so it should be more libc version tolerant. I don't really have the means to test this well without some trouble, so let me know what you think. --console-only launches mmbasic_ansi with a console only terminal, no graphics. Any graphics programs will just appear to hang at the console until the program exits. The editor works just fine, and the environment responds to terminal resizes. I think I addressed the control-Z issue, let me know. Just re-download it. |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
@jvanderberg: i followed your instruction: ... bad cpu type (i have an intel mac) |
||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
There was an issue with the build, it should now create a universal binary - I am not at all sure it will run on very old MacOS, but let me know how it goes. |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
i have a macbook retine 2017 with macos 13 ventura... |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
first successful tests... |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
i will further try to get better resolutions etc. @jvanderberg: thanx a lot... |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2524 |
libc problems fixed, it now runs happily under linux mint 19.3 and using the --console-only parameter produces usable output. but while ctrl-Z is fixed, both ctrl-C and ctrl-D are not handled and terminate mmbasic. the problems with ctrl-C and -D, as well as the original with ctrl-Z can all be fixed by placing the terminal in RAW mode. the following pascal (FPC) code does this, taken from a serial-over-TCP/IP VT102 emulation hack i wrote a few years back: program talkto; uses sysutils, termIO, BaseUnix; var tios, SAVEDtios:termios; begin TCGetAttr(0, tios); SAVEDtios:=tios; CFMakeRaw(tios); TCSetAttr(0, TCSANOW, tios); // place console in RAW mode repeat // main loop, use break to exit until false; TCSetAttr(0, TCSANOW, SAVEDtios) // restore console state end. hopefully converting this into C should be simple! btw, option list seems to not work. i tested by setting and resetting option colourcode on/off where option list produced no output no matter what the setting was. if desired, you could make options persistent by saving them in a .ini file of the same name and location as the mmbasic binary. this .ini file could then also hold settings such as --console-only. but this is all just a suggestion! cheers, rob :-) Edited 2026-05-26 21:49 by robert.rozee |
||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
I want to point out that though this appears a kind of novelty, the point here is that the core interpreter is running the exact same code as the microcontroller version. It's a single code base that builds a web emulator, a console version, and PicoCalc/PicoMite builds, HDMI/VGA builds, the ESP32 build, and now even a port to the pocket386. |
||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
Thanks for the feedback. These should now be fixed. Edited 2026-05-27 03:59 by jvanderberg |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2524 |
Thanks for the feedback. These should now be fixed. unfortunately autosave now appears (under Linux) to no longer work, when pasting in a large basic program it appears to only save the last half dozen or so lines of what is pasted in (and indeed, these last dozen lines are the only ones displayed on screen). also: - pressing ctrl-C should terminate an autosave without saving anything. instead, the ctrl-C appears to be ignored; - after pressing ctrl-Z the message "Error : Invalid character:" or "Error : Unknown command" is displayed, although this message seems to have no effect. using autosave and just typing at the keyboard appears to work, with everything accepted and saved. although the error message when you press ctrl-Z still comes up. cheers, rob :-) Edited 2026-05-28 00:37 by robert.rozee |
||||
| jvanderberg Regular Member Joined: 06/05/2026 Location: United StatesPosts: 45 |
Thanks for the feedback. These should now be fixed. unfortunately autosave now appears (under Linux) to no longer work, when pasting in a large basic program it appears to only save the last half dozen or so lines of what is pasted in (and indeed, these last dozen lines are the only ones displayed on screen). also: - pressing ctrl-C should terminate an autosave without saving anything. instead, the ctrl-C appears to be ignored; - after pressing ctrl-Z the message "Error : Invalid character:" or "Error : Unknown command" is displayed, although this message seems to have no effect. using autosave and just typing at the keyboard appears to work, with everything accepted and saved. although the error message when you press ctrl-Z still comes up. cheers, rob :-) Ok. Sorry. These should now really be fixed. I added a test suite around them and manually tested as well. An issue is that this gets into shared code with the MCU versions. It can be a bit brittle. |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2524 |
all seems to be working correctly now ![]() cheers, rob :-) |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1100 |
Unfortunately, I'm having problems with my Linux Mint. I have to set the console to full screen and the font size so small that I can't read it anymore just to be able to start the program in 640x480 resolution. Then it runs very slowly. If I launch it without specifying a “resolution,” I still have to expand the window to full screen, and the font in MMBASIC is then much too large... Frank |
||||
| Page 1 of 2 |
|||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |