An experimental emulator
Go to file
Mihai Parparita 1f7edfdb3b Make Emscripten build not depend on SDL2 or cubeb
While Emscripten has an SDL compabtility layer, it assumes that the
code is executing in the main browser process (and thus has access to
them DOM). The Infinite Mac project runs emulators in a worker thread
(for better performance) and has a custom API for the display, sound,
input, etc. Similarly, it does not need the cross-platform sound support
from cubeb, there there is a sound API as well.

This commit makes SDL (*_sdl.cpp) and cubeb-based (*_cubeb.cpp) code be
skipped when targeting Emscripten, and instead *_js.cpp files are used
instead (this is the cross-platform convention used by Chromium[^1], and
could be extended for other targets).

For hostevents.cpp and soundserver.cpp the entire file was replaced,
whereas for videoctrl.cpp there was enough shared logic that it was
kept, and the platform-specific bits were moved behind a Display class
that can have per-platform implementations. For cases where we need
additional private fields in the platform-specific classes, we use
a PIMPL pattern.

The *_js.cpp files with implementations are not included in this
commit, since they are closely tied to the Infinite Mac project, and
will live in its fork of DingusPPC.

[^1]: https://www.chromium.org/developers/design-documents/conventions-and-patterns-for-multi-platform-development/
2023-10-25 22:25:53 -07:00
.github Improve Github actions. 2022-05-21 15:14:30 +02:00
benchmark Clean up build scripts. 2023-01-08 23:29:25 +01:00
cmake Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
core Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
cpu/ppc Fix spelling. 2023-10-02 15:06:51 +02:00
debugger ofnvram: support CHRP style OF config partition. 2023-02-25 18:14:42 +01:00
devices Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
machines Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
thirdparty Manage Windows build dependencies with vcpkg. 2023-01-08 22:27:13 +01:00
utils Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
zdocs Improve zdoc/bmac documentation. 2023-09-22 00:10:19 +02:00
.clang-format clang-format everything 2020-05-12 23:55:45 +05:00
.gitignore Ignore Xcode project files. 2023-01-11 01:17:12 -08:00
.gitmodules Add Capstone submodule. 2020-12-03 00:53:28 +01:00
CMakeLists.txt Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
CONTRIBUTING.md CONTRIBUTING: Use code blocks for code examples. 2020-03-05 11:53:28 +01:00
LICENSE Initial commit 2019-07-01 19:13:30 -07:00
README.md Compilation fix for VS 2023-06-19 22:36:09 -07:00
_config.yml Set theme jekyll-theme-minimal 2020-03-26 23:30:27 -07:00
dppcicon.ico More fixes, plus a temp icon 2019-07-19 14:24:39 -07:00
endianswap.h Clean up previous commit. 2022-11-23 20:28:09 +01:00
icon.rc More fixes, plus a temp icon 2019-07-19 14:24:39 -07:00
main.cpp Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
main.h Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
main_sdl.cpp Make Emscripten build not depend on SDL2 or cubeb 2023-10-25 22:25:53 -07:00
memaccess.h Clean up previous commit. 2022-11-23 20:28:09 +01:00
vcpkg.json Manage Windows build dependencies with vcpkg. 2023-01-08 22:27:13 +01:00

README.md

DingusPPC

Written by divingkatae and maximumspatium

Be warned the program is highly unfinished and could use a lot of testing. Any feedback is welcome.

Philosophy of Use

While many other PowerPC emus exist (PearPC, Sheepshaver), none of them currently attempt emulation of PPC Macs accurately (except for QEMU).

This program aims to not only improve upon what Sheepshaver, PearPC, and other PowerPC mac emulators have done, but also to provide a better debugging environment. This currently is designed to work best with PowerPC Old World ROMs, including those of the PowerMac G3 Beige.

Implemented Features

This emulator has a debugging environment, complete with a disassembler. We also have implemented enough to allow Open Firmware to boot, going so far as to allow audio playback of the boot-up jingles.

How to Use

This program currently uses the command prompt to work.

There are a few command line arguments one must enter when starting the program.

-r, --realtime

Run the emulator in runtime.

-d, --debugger

Enter the interactive debugger.

-b, --bootrom TEXT:FILE

Specifies the Boot ROM path (optional; looks for bootrom.bin by default)

-m, --machine TEXT

Specify machine ID (optional; will attempt to determine machine ID from the boot rom otherwise)

As of now, only the Power Macintosh G3 Beige is implemented.

How to Compile

You need to install development tools first.

At least, a C++20 compliant compiler and CMake are required.

You will also have to recursive clone or run

git submodule update --init --recursive

This is because the CubeB module is not included by default. All other components are already included in the thirdparty folder and compiled along with the rest of DingusPPC.

For example, to build the project in a Unix-like environment, you will need to run the following commands in the OS terminal:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make dingusppc

You may specify another build type using the variable CMAKE_BUILD_TYPE.

Future versions may drop SDL 2 as a requirement.

For Raspbian, you may also need the following command:

sudo apt install doxygen graphviz

Testing

DingusPPC includes a test suite for verifying the correctness of its PowerPC CPU emulation. To build the tests, use the following terminal commands:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make testppc

Intended Minimum Requirements

  • Windows 7 or newer (64-bit), Linux 4.4 or newer, Mac OS X 10.9 or newer (64-bit)
  • Intel Core 2 Duo or better
  • 2 GB of RAM
  • 2 GB of Hard Disk Space
  • Graphics Card with a minimum resolution of 800*600

Compiler Requirements

  • GCC 4.7 or newer (i.e. CodeBlocks 13.12 or newer)
  • Visual Studio 2013 or newer