|
Forum Index : Microcontroller and PC projects : A MMbasic editor, compiler and runtime for Windows and Linux
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11824 |
# pc3host 0.8.0 - the Pico Computer 3's BASIC, on a PC https://github.com/UKTailwind/pc3host/releases/tag/v0.8.0 Two packages, one for Linux and one for Windows. Both carry the same thing: Based on the the Pico Computer 3's own Fuzix toolchain, built from the machine's own sources, running on a PC. You write MMBasic using the standard MMBasic editor `mmbedit`, `cc` compiles it, and it runs in a window that is the PC3's screen - the kernel's display code, its keyboard decoder and its sound engine, compiled into a small server that plays the part the kernel plays on the board. A program that runs here runs on the board, and it draws the same pixels: the graphics tests are compared against images captured from the machine itself. | `pc3host_0.8.0_amd64.deb` | Debian, Ubuntu, Mint and their kin | | `pc3host-0.8.0-win64.zip` | Windows 10 or later, 64-bit | ## Linux ``` sudo dpkg -i pc3host_0.8.0_amd64.deb ``` Everything but the display server is statically linked, so it installs on any distribution of that age or newer; the server needs the X11 libraries, which a desktop already has. It puts itself under `/opt/pc3` and links the names a PC has no other use for into `/usr/bin`. The compiler is called `cc`, as it is on the board, and that name is deliberately not taken from your system. Use `pc3` to get a shell with the PC3's tools first on the PATH, or `pc3cc` to call the compiler directly: ``` pc3 # a shell with the tools first cc -r /opt/pc3/share/examples/gfx1.bas ``` ## Windows Unpack the zip anywhere - your Documents folder is fine - and run **`install.cmd`** inside it. It puts the tools on your account's PATH and tells Windows that a `.bc` file is a program. No administrator rights are needed, nothing is copied into Windows itself, and `uninstall.cmd` beside it undoes both. **Open a new command prompt afterwards**: the one you have still holds the old environment. To try it without changing anything, run `pc3.cmd` instead, which opens a prompt with the tools on its PATH for as long as that window is open. Windows will not know the programs and will say so the first time: they carry no signature. Right-click the zip, tick **Unblock** in its Properties before extracting, and you will be asked less. A machine running Smart App Control, or under a Device Guard policy, refuses unsigned programs outright and there is nothing in the package that can change that. ## The first five minutes, on either ``` cc -r hello.bas build it and run it cc hello.bas build it: hello.bc bcrun hello.bc run what you built mmbedit hello.bas the editor; F2 saves, builds and runs ``` On Windows a built program is also `.\hello.bc` in a command prompt, or a double click in Explorer. It will not run as a bare `hello`: a `.bc` is not a Windows executable, it is a file that `bcrun` runs, the way the `#!` line has the board run it. The editor is `mmbedit`, not `mmedit`: MMEdit is Jim Hiley's Windows IDE for MMBasic and this is not it. Things to try, wherever the package put its examples (`/opt/pc3/share` or `share\` in the folder you unpacked): ``` cc -r share/examples/gfx1.bas a picture cc -r share/examples/keydemo.bas the keyboard cc -r share/examples/pc3bench.bas what each kind of thing costs here cc -r share/examples/samples/breakout.bas breakout game using tilemap cc -r share/examples/samples/bubble.bas bubble universe ``` The Windows package also has **`selftest.cmd`**: it compiles the eclipse predictor - 3,213 lines of real astronomy - with the shipped compiler, checks its output to the last digit, and then opens the window. ## What is in box The compiler and its passes, the BASIC translator, the bytecode runtime, the editor, the image loaders, the four audio players and the display server. Beside them: 83 sample programs, the 112 test programs with the output each must produce, the whole translator source, the manuals, and the test scripts. ## What is not The board's hardware. There are no pins on a PC, so `SETPIN`, `PIN`, `I2C`, `SPI`, `PWM`, the counting inputs and the real-time clock registers answer "not available" rather than pretending. Everything else - graphics, sound, the keyboard, files, and the `WEB` family over your machine's own network - is real. Timing is the other difference worth knowing. Frame pacing is a timer rather than a monitor's vertical blanking, and a graphics statement here is a message to the display server where on the board it is a register write, so a program that races the frame will feel slightly different. `pc3bench.bas` measures it on the machine in front of you. |
||||
| tgerbic Senior Member Joined: 25/07/2019 Location: United StatesPosts: 122 |
Just get a 404 on that link. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11824 |
works for me and I've checked it is definitely public |
||||
| homa Guru Joined: 05/11/2021 Location: GermanyPosts: 684 |
Hello Peter, I’ve tried this on win11: ...\pc3host>pc3.cmd ")" kann syntaktisch an dieser Stelle nicht verarbeitet werden. Translated: ")" cannot be processed syntactically at this point. The selftest.cmd file worked perfectly. Matthias |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3876 |
Works for me in Canada: What a world we live in. (MMBasic World) ~ Edited 2026-09-07 04:33 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
| javavi Guru Joined: 01/10/2023 Location: UkrainePosts: 603 |
I wish it were possible to program the world of TIC-80 in MMBasic. https://tic80.com/ It understands a variety of scripting languages, but so far it's only unknown about MMBasic. DISPLAY 240x136 pixels, 16 colors palette. INPUT 4 gamepads with 8 buttons / mouse / keyboard. SPRITES 256 8x8 tiles and 256 8x8 sprites. MAP 240x136 cells, 1920x1088 pixels. SOUND 4 channels with configurable waveforms. CODE 64KB of lua, ruby, js, moon, fennel, scheme, squirrel, wren, wasm, janet or python. https://github.com/nesbox/TIC-80 The TIC-80 community says that with enough determination and skill, you can add support for your favorite programming language to this fantasy computer project. I like MMBasic and would like to make a couple of demos for the TIC-80 using it too. Edited 2026-09-07 05:14 by javavi |
||||
| tgerbic Senior Member Joined: 25/07/2019 Location: United StatesPosts: 122 |
Can reach it now. Charter/Spectrum is in the middle of a network upgrade in my area. Maybe a DNS problem. |
||||
| gadgetjack Senior Member Joined: 15/07/2016 Location: United StatesPosts: 236 |
I have tried it on a few programs and games. It works on picovaders but chokes on frogger and gnr. Has problem with redefined character sets and defining "Break". Pretty cool so far. |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6602 |
Windows11 pro Print Time$ returns UTC instead of local time. Calculating Pi to 2000 decimal places MMBdos 688mS to calculate and 62mS to format and print MMB4W 372mS to calculate and 29mS to format and print PC3host 126mS to calculate and 105mS to format and print. All 3 use similar CPU time when running in a DO : LOOP UNTIL Inkey$ <>"" Jim Edited 2026-09-07 17:24 by TassyJim VK7JH MMedit |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11824 |
There is a basic file picofrog.bas that should work. One gotcha is that the transpiler comments out any basic lines it doesn't understand - could be things like "WII NUNCHUCK OPEN". Normally this is OK, however, if it forms part of a block structure then commenting it out can break the program logic causing various C compilation errors. In this case the program needs editing properly before running CC. |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |