Skip to content

KenDesigns/MacNIST68000

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

MacNIST68000 by KenDesigns

MacNIST68000 is an interactive demo showcasing a neural network (specifically a multilayer perceptron) that will run on the original Macintosh line. You may draw a digit with the mouse, and then allow the neural network to infer what digit you have drawn. This app has been written with a new bare metal SDK I am developing for the original 68000 based Macs, called Mac68000 SDK. This SDK is still under development and is not released yet.

How do I run it?

Remember that this is a boot disk, you load it at system startup instead of a MacOS/System Software disk! Do NOT try loading this disk while you are in MacOS/System Software.

Real Hardware:

You MUST have one of the following models:

  • Macintosh 128K
  • Macintosh 512K
  • Macintosh 512Ke
  • Macintosh Plus
  • Macintosh SE
  • Macintosh SE FDHD
  • Macintosh Classic

This WILL NOT run on any other Macintosh models. Do NOT try running this on a SE/30 or a Classic II or whatever, it will NOT work.

For a Macintosh 128K you MUST use the provided 400K disk image. For a Macintosh 512K, it is recommended to use the 400K disk image, although the 800K image will work with an external 800K FDD (no ROM upgrades are necessary thanks to custom bootloader magic). For all other models, it is recommended to use the 800K disk image.

You can load the program either using a FloppyEMU, or off a real floppy disk. If using the FloppyEMU, you must first format the SD card you are going to use with it, and then copy the disk image FIRST, before any other disk images. This is due to a bug in the FloppyEMU that causes bit-stream timing issues with fragmented files in a way that is incompatible with my custom bootloader. Copying the disk image first on a formatted disk guarantees no file fragmentation.

If you want to make a real floppy disk of this, you will need a FloppyEMU and a floppy disk. First, follow the directions above to copy the application disk image to the SD card. Then AFTER doing so, copy the "Copy II" application to the SD card. Use this Copy II application to then copy the image from the FloppyEMU to a real floppy disk (I recommend doing this with the "bit copy" setting although the sector copy with format should also work). Depending if you are using the 400K or 800K disk image, make sure to select the correct copy setting.

Emulator:

Currently, as of August 2025, there are only 2 emulators accurate enough to run programs written bare metal with my SDK.

Snow

Make sure you are using the LATEST version of Snow. Snow has only very recently been updated to fix some bugs that made applications with my SDK unusable, so be sure to be on the latest version. After this, when setting up the emulated system, make sure to change "Mouse emulation" from "Absolute (memory patching)" to "Relative (hardware emulation)". You MUST make this change, or else the mouse will not work and worse, the emulated program will eventually crash.

It is also recommend to emulate a pre SE machine, like the Plus or the 512Ke. The SE and later used ADB for the mouse which still has slightly buggy emulation in Snow. Earlier models with the DB-9 mouse do not have such issues when emulated.

By the way, if you are using literally any other Macintosh emulator (especially something like MiniVMac), I would HIGHLY, recommend ditching it for Snow. It is literally indescribably more accurate than those other emulators, which should only be used if your still on a Pentium II and Snow runs to slowly on that.

MAME

Honestly despite MAME being a little bit more accurate than Snow (as of August 2025), I would not recommend it due to the difficulty of setup. Assuming you have it setup, no tweaks are needed, except make sure not to use the emulated Mac Plus configuration specifically, as it has a bug where the keyboard doesn't work (I have no idea how they managed this when the rest of the earlier models have the same keyboard and work fine???). Also, try not to move the mouse until after the application is loaded, there is a bug where moving it before causes the mouse to lock up (doesn't happen in Snow or on real hardware so probably another bug).

Acknowledgements

twvd - Developer of the Snow Macintosh emulator, put up with my incessant bug reporting and better yet, managed to fix said bugs, giving us all a much nicer emulator to run bare metal software in!

Emmanuel Marty - Wrote a slick ZX0 decompression routine for the Motorola 68000 in just 88 bytes(!!!) of code, which I use in my bootloader for disk payload decompression

Marco Paland - Author of "A printf / sprintf Implementation for Embedded Systems", as you might of guessed, I use his implementation in my SDK for string generation.

About

A neural network for the original Macintosh (1984) line from Apple

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published