Macintosh Programmer's Workshop (mpw) compatibility layer
Go to file
Kelvin Sherlock 84ff99c177 Squashed commit of the following:
commit f4807cd071ba5c4ce9ba4aa8c906ba335da07a2d
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Feb 13 16:09:55 2015 -0500

    merge in missing tool calls

commit 6830ab51ce7c48e3d0d1352f04df8df914146b3e
Merge: 1675a47 24c17a9
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Feb 13 16:06:05 2015 -0500

    Merge branch 'feature_trap_address_2015' into merge_dispatcher

    Conflicts:
    	bin/loader.cpp
    	toolbox/rm.cpp
    	toolbox/toolbox.cpp

commit 24c17a9a88
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Feb 13 13:22:07 2015 -0500

    SetOSTrapAddress stub

commit b255937e6c
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sat Jan 24 14:40:45 2015 -0500

    Use the $Commands environment variable as a list of directories where commands may be located.

    Conflicts:
    	bin/loader.cpp

commit a3925747ce
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Jan 23 10:26:52 2015 -0500

    HWPriv OS Trap

commit 16d0038fd1
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Jan 23 10:26:40 2015 -0500

    HWPriv OS Trap

commit bf92f80632
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Wed Jan 21 17:34:30 2015 -0500

    RM::GetNamedResource

commit 540490d0c5
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Wed Jan 21 14:31:03 2015 -0500

    GetNamedResource trap

commit 09aa8d0f26
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Jan 20 19:32:04 2015 -0500

    Set ApplZone global (ARMCFront)

commit 45fa54abca
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Jan 20 13:58:24 2015 -0500

    update test makefile

commit b1e6635630
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Jan 20 13:35:07 2015 -0500

    SysEnvirons ($a090) OS Trap

commit a5126544b8
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Mon Jan 19 15:02:29 2015 -0500

    undo HGetVolume cwd, for now

commit 912c874825
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Mon Jan 19 10:55:58 2015 -0500

    Fix SetPtrSize

commit c0fe74c1b8
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun Jan 18 17:31:09 2015 -0500

    support the auto-pop bit for tool calls (MPW Pascal IIgs 1.0b1)

commit 2e9ab5200c
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun Jan 18 15:20:38 2015 -0500

    update dispatch code...

commit c7c548e5ac
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun Jan 18 14:48:22 2015 -0500

    add back new tool calls.

commit cbb554174e
Merge: 44d19f7 5e616d3
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun Jan 18 14:43:58 2015 -0500

    Merge branch 'feature_trap_address' into feature_trap_address_2015

    Conflicts:
    	toolbox/CMakeLists.txt
    	toolbox/os.cpp
    	toolbox/toolbox.cpp

commit 5e616d353b
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Sun Dec 14 18:01:38 2014 -0500

    new dispatcher.

commit ea5f213921
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Mon Dec 8 11:42:23 2014 -0500

    get ready for trap overrides.

commit 17c5b40ac8
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Dec 5 14:39:17 2014 -0500

    remove dead code

commit fc7df738cc
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Dec 5 14:32:18 2014 -0500

    display trap name for GetToolTrap, etc.
2015-02-13 16:11:55 -05:00
bin Squashed commit of the following: 2015-02-13 16:11:55 -05:00
cpu
cxx
macos
mplite
mpw Smarter handling of : after a variable. 2015-02-08 14:49:08 -05:00
test
toolbox Squashed commit of the following: 2015-02-13 16:11:55 -05:00
verbatim Smarter handling of : after a variable. 2015-02-08 14:49:08 -05:00
.gitignore
CHANGELOG.text changeling, bump version 2015-02-12 20:14:15 -05:00
CMakeLists.txt
README.md
README.text
TODO.txt

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.