No description
Find a file
2025-08-10 19:25:40 -05:00
.github Continue improving defs 2025-07-31 15:52:17 -05:00
docs docs: start adding some m68kmac specific docs 2025-07-18 15:26:11 -05:00
drivers drivers/esp-hosted: Replace EVENT_POLL_HOOK with mp_event_wait_ms. 2025-06-16 16:36:39 +10:00
esp-idf@8153bfe412 m68kmac: Add a port to m68k Macintosh. 2025-07-06 16:42:28 +01:00
examples examplemodule: Cast arguments to printf. 2025-07-05 16:34:37 +01:00
extmod fix get_struct_desc 2025-08-10 19:25:40 -05:00
lib lib/berkeley-db-1.xx: Update submodule to latest. 2025-06-10 11:24:50 +10:00
logo all: Prune trailing whitespace. 2024-03-07 16:25:17 +11:00
mpy-cross mpy-cross/main: Document emit=host option in help. 2025-06-04 12:07:30 +10:00
ports add two new tests for regressions reported by @smallsco 2025-08-10 19:25:23 -05:00
py Continue improving defs 2025-07-31 15:52:17 -05:00
shared m68kmac: Add a port to m68k Macintosh. 2025-07-06 16:42:28 +01:00
tests add two new tests for regressions reported by @smallsco 2025-08-10 19:25:23 -05:00
tools check %r format strings 2025-07-31 17:24:28 -05:00
.git-blame-ignore-revs top: Update .git-blame-ignore-revs for latest format/spell commits. 2024-03-07 16:29:46 +11:00
.gitattributes extmod/asyncio: Add ssl support with SSLContext. 2023-12-14 12:20:19 +11:00
.gitignore gitignore: Add ffi_lib.so to the gitignore list. 2024-09-23 11:47:18 +10:00
.gitmodules Use our own fork of multiverse. 2025-07-07 19:07:34 +01:00
.pre-commit-config.yaml pre-commit: let ruff auto-fix. 2025-07-17 20:45:46 -05:00
ACKNOWLEDGEMENTS ACKNOWLEDGEMENTS: Remove entry as requested by backer. 2019-07-12 12:57:37 +10:00
CODECONVENTIONS.md CODECONVENTIONS: Document the static naming conventions. 2025-04-22 11:06:04 +10:00
CODEOFCONDUCT.md top: Add CODEOFCONDUCT.md document based on the PSF code of conduct. 2019-10-15 16:18:46 +11:00
CONTRIBUTING.md top: Update contribution and commit guide to include optional sign-off. 2020-06-12 13:32:22 +10:00
LICENSE LICENSE,docs: Update copyright year range to include 2025. 2025-01-22 18:25:20 +11:00
pyproject.toml don't be dogmatic about formatting in examples 2025-08-10 17:13:54 -05:00
README.md Doc improvements, build improvements 2025-07-06 17:15:20 +01:00

m68k-micropython

This is a fork of the MicroPython project, which aims to put an implementation of Python 3.x on m68k Macintosh computers.

You can find the official micropython website at micropython.org.

WARNING: this project is in alpha stage and is subject to changes of the code-base, including "git rebasing", project-wide name changes and API changes.

MicroPython implements the entire Python 3.4 syntax (including exceptions, with, yield from, etc., and additionally async/await keywords from Python 3.5 and some select features from later versions). The following core datatypes are provided: str(including basic Unicode support), bytes, bytearray, tuple, list, dict, set, frozenset, array.array, collections.namedtuple, classes and instances. Builtin modules include os, sys, time, re, and struct, etc.

Mac specific functionality is limited:

  • os.VfsMac for interacting with filesystems
  • qd, a dirty wrapper around QuickDraw

MicroPython can execute scripts in textual source form (.py files) or from precompiled bytecode (.mpy files), in both cases either from an on-device filesystem or "frozen" into the MicroPython executable.

Getting started

Grab a release image and use it with your favorite mac emulator, including the website Infinite Mac.

See micropython's online documentation for the API reference and information about using MicroPython and information about how it is implemented. TODO: Document modules specific to m68k-micropython.

We use GitHub Discussions as our forum, and Mastodon (#m68kMicroPython) for chat. These are great places to ask questions and advice from the community or to discuss your MicroPython-based projects.

For bugs and feature requests, please raise an issue and follow the templates there.

Full-screen Editor

A full-screen editor is frozen in: import editor; editor.edit("code.py")

This editor does not use the mouse, instead it uses arrow keys or emacs-like ctrl+n/p, ctrl-f/b, ctrl-a/e for cursor motion.

Launching Programs

Double click a file of type "mupy" and it is run as a Python program. I've found it convenient to create a file "edit_code.py" that invokes the full-screen editor on "code.py", which gives a quick-ish turnaround for development as long as you're not loading the Micropython program from a real floppy.

Contributing

MicroPython is an open-source project and welcomes contributions. To be productive, please be sure to follow the Contributors' Guidelines and the Code Conventions. Note that MicroPython is licenced under the MIT license, and all contributions should follow this license.

About this repository

This repository contains the following components:

  • py/ -- the core Python implementation, including compiler, runtime, and core library.
  • mpy-cross/ -- the MicroPython cross-compiler which is used to turn scripts into precompiled bytecode.
  • ports/m68kmac -- platform-specific code for the Macintosh port
  • lib/ -- submodules for external dependencies.
  • tests/ -- test framework and test scripts.
  • docs/ -- user documentation in Sphinx reStructuredText format. This is used to generate the online documentation.
  • extmod/ -- additional (non-core) modules implemented in C.
  • tools/ -- various tools, including the pyboard.py module.
  • examples/ -- a few example Python scripts.

"make" is used to build the components, or "gmake" on BSD-based systems. You will also need Retro68, bash, gcc, and Python 3.3+ available as the command python3. yamllib must be installed via pip3.

The easiest way to get Retro68 is by using docker and invoking the make docker-build target.

A goal of this project is to keep differences from micropython to a minimum, and to rebase onto it from time to time. However, at present there are a couple of nasty hacks in py/.

Supported platforms & architectures

The main targets are 4MB Mac with System 6 or System 7.

The MicroPython cross-compiler, mpy-cross

Most ports including m68kmac require the MicroPython cross-compiler to be built first. This program, called mpy-cross, is used to pre-compile Python scripts to .mpy files which can then be included (frozen) into the firmware/executable for a port. To build mpy-cross use:

$ cd mpy-cross
$ make

External dependencies

The core MicroPython VM and runtime has no external dependencies, but a given port might depend on third-party drivers or vendor HALs. This repository includes several submodules linking to these external dependencies. Before compiling a given port, use

$ cd ports/name
$ make submodules

to ensure that all required submodules are initialised.

Development status

The project owner (@jepler) occasionally develops and maintains this project for fun. Pull requests are appreciated. There are many bugs. Noting them with issues may be helpful, but do not expect rapid response. Feature requests are not likely to be acted on. The project is seeking co-maintainer(s).