Macintosh Programmer's Workshop (mpw) compatibility layer
Go to file
Kelvin Sherlock 8c9e50cd8f Add backtrace support to the debug console.
Squashed commit of the following:

commit b3afbbf15839d5ad9343d4540674510cbd6cd16d
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Wed Dec 24 17:44:20 2014 -0500

    improve the debugger help a little bit

commit 82e1e4e3e4d802defbf49c965500ffc72c7be1af
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Wed Dec 24 17:32:21 2014 -0500

    prevent filename tab completion in the debugger.

commit 8765e5f428562e5ab6f8d59ec0e0460a834c66b5
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Wed Dec 24 16:06:21 2014 -0500

    skip macsbug names when disassembling via ;list

commit 9b87cfb3851fedc6423629608f53076741116991
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Wed Dec 24 15:43:13 2014 -0500

    improved backtracing.

commit f8e364d7c568fe6728c8efd5587f7edeb49f5816
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Wed Dec 24 15:17:28 2014 -0500

    BackTrace support
2014-12-24 17:44:48 -05:00
bin Add backtrace support to the debug console. 2014-12-24 17:44:48 -05:00
cpu updates to match current fellow cpu code 2014-12-04 16:09:18 -05:00
macos add tool_return pair for returning error or value. 2014-12-20 12:20:18 -05:00
mplite
mpw use mpw_errno_from_errno() 2014-12-21 08:25:40 -05:00
toolbox fix CloseResFile with refNum 0. 2014-12-24 10:17:23 -05:00
verbatim verbatim code 2013-08-21 21:30:06 -04:00
.gitignore
CHANGELOG.text update change log for version 0.7.2 2013-10-30 21:48:44 -04:00
CMakeLists.txt move debugger code into bin, clean up dispatch 2013-07-07 23:42:27 -04:00
README.md Update README.md 2013-08-16 22:51:28 -04:00
README.text updated readme 2013-08-16 22:53:04 -04:00
TODO.txt todo update 2013-08-21 21:28:50 -04:00

MPW Emulator

by Kelvin W Sherlock, et alia

Please check the wiki for useful information.

System compatibility

Currently, only OS X 10.8 with case-insensitive HFS+ is supported.

License

The 680x0 CPU code is from WinFellow and is licensed under GPL v2 or later. Consequently, the rest of the code is licensed under the GPL v2 as well.

The memory allocator (NewHandle/NewPointer) code is from mempoolite, which is a fork of the SQLite zero-alloc allocator by Jefty Negapatan and D. Richard Hipp. It, as is SQLite, is in the public domain.

Building

Compiling requires cmake, ragel, lemon, and a recent version of clang++ with c++11 support. It has only been built and tested with OS X 10.8.

mkdir build cd build cmake .. make

This will generate bin/mpw and bin/disasm.

Installation

Certain configuration and execution files are generally useful. They are stored in an mpw directory, which may be located:

$MPW (shell variable)
~/mpw/ (your home directory)
/usr/local/share/mpw/
/usr/share/mpw/

The layout is reminiscent of actual MPW installations.

mpw/Environment.text
mpw/Tools/...
mpw/Interfaces/...
mpw/Libraries/...
mpw/Help/...

Environment file

The Environment.text file is new; it contains MPW environment variables (many of them set the library and include file locations). The format is fairly simple.

# this is a comment

#this sets a variable
name = value

# this sets a variable if it is undefined.
name ?= value

# values may refer to other variables
Libraries=$MPW:Libraries:Libraries:
Libraries=${MPW}:Libraries:Libraries:

Usage

mpw [mpw flags] command-name [command arguments]

you may also create shell aliases:

alias AsmIIgs='mpw AsmIIgs'

or create a shell script (in /usr/local/bin, etc)

/usr/local/bin/AsmIIgs:

#!/usr/bin/sh

exec mpw AsmIIgs $@

mpw looks in the current directory and then in the $MPW:Tools: directory for the command to run. The MPW $Commands variable is not yet supported.