├── icon.rc
├── icon.png
├── dppcicon.ico
├── zdocs
└── developers
│ ├── aboutthis.md
│ ├── ibmpower.md
│ ├── motorolaatlas.md
│ ├── keylargo.md
│ ├── amic.md
│ ├── valkyrie.md
│ ├── cpu
│ └── powerpc
│ │ └── mmu.md
│ ├── atirage.md
│ ├── mesh.md
│ ├── awacs.md
│ ├── adb.md
│ ├── swim3.md
│ ├── bebox.md
│ ├── dbdma.md
│ ├── grackle.md
│ └── memorymaps.md
├── .gitmodules
├── thirdparty
└── loguru
│ └── CMakeLists.txt
├── vcpkg.json
├── debugger
├── CMakeLists.txt
└── debugger.h
├── utils
├── CMakeLists.txt
├── imgfile.h
├── profiler.h
├── imgfile_sdl.cpp
└── profiler.cpp
├── core
├── CMakeLists.txt
├── mathutils.h
├── coresignal.h
└── bitops.h
├── machines
├── CMakeLists.txt
├── machine.h
├── romidentity.h
├── machinebase.h
├── machinefactory.h
└── machinebase.cpp
├── cpu
└── ppc
│ ├── CMakeLists.txt
│ ├── ppcdisasm.h
│ └── test
│ └── testdisasm.cpp
├── cmake
└── PlatformGlob.cmake
├── .gitignore
├── main.h
├── CREDITS.md
├── devices
├── common
│ ├── nubus
│ │ └── nubusutils.h
│ ├── mmiodevice.h
│ ├── i2c
│ │ ├── i2cprom.h
│ │ ├── i2cprom.cpp
│ │ └── i2c.h
│ ├── adb
│ │ ├── adbapplejack.h
│ │ ├── adbdevice.h
│ │ ├── adbmouse.h
│ │ ├── adbbus.h
│ │ ├── adbdevice.cpp
│ │ └── adbapplejack.cpp
│ ├── nvram.h
│ ├── pci
│ │ ├── pcidevice.h
│ │ ├── dec21154.h
│ │ ├── pcidevice.cpp
│ │ ├── pcibridgebase.h
│ │ └── dec21154.cpp
│ ├── ata
│ │ ├── atapibasedevice.h
│ │ ├── atapicdrom.h
│ │ ├── atahd.h
│ │ ├── idechannel.h
│ │ └── atabasedevice.h
│ ├── scsi
│ │ ├── scsicdrom.h
│ │ ├── scsihd.h
│ │ └── scsibusctrl.h
│ ├── clockgen
│ │ └── athens.h
│ ├── hwinterrupt.h
│ ├── hwcomponent.h
│ └── nvram.cpp
├── sound
│ ├── soundserver.h
│ ├── burgundy.h
│ └── burgundy.cpp
├── video
│ ├── rgb514defs.h
│ ├── saa7187.cpp
│ ├── pdmonboard.h
│ ├── display.h
│ └── atimach64gx.h
├── deviceregistry.cpp
├── deviceregistry.h
├── CMakeLists.txt
├── storage
│ ├── blockstoragedevice.h
│ └── cdromdrive.h
├── memctrl
│ ├── aspen.h
│ └── psx.h
├── serial
│ └── chario.h
├── floppy
│ └── floppyimg.h
└── ethernet
│ └── mace.h
├── CONTRIBUTING.md
├── .github
└── ISSUE_TEMPLATE
│ └── bug_report.md
├── main_sdl.cpp
├── main_sdl.m
├── .clang-format
├── README.md
└── endianswap.h
/icon.rc:
--------------------------------------------------------------------------------
1 | MAINICON ICON "dppcicon.ico"
2 |
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dingusdev/dingusppc/HEAD/icon.png
--------------------------------------------------------------------------------
/dppcicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dingusdev/dingusppc/HEAD/dppcicon.ico
--------------------------------------------------------------------------------
/zdocs/developers/aboutthis.md:
--------------------------------------------------------------------------------
1 | This folder contains hardware and software documentation, much of which the developers
2 | used during the development of DingusPPC.
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "thirdparty/cubeb"]
2 | path = thirdparty/cubeb
3 | url = https://github.com/DingusDevOrg/cubeb.git
4 | [submodule "thirdparty/capstone"]
5 | path = thirdparty/capstone
6 | url = https://github.com/maximumspatium/capstone.git
7 | branch = next
8 |
--------------------------------------------------------------------------------
/thirdparty/loguru/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(CMAKE_CXX_STANDARD 11)
2 |
3 | include_directories("${PROJECT_SOURCE_DIR}")
4 |
5 | file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/loguru.cpp"
6 | "${CMAKE_CURRENT_SOURCE_DIR}/loguru.hpp")
7 |
8 | add_library(loguru OBJECT ${SOURCES})
9 |
--------------------------------------------------------------------------------
/vcpkg.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dingusppc",
3 | "version-string": "0.01-pre",
4 | "homepage": "https://github.com/dingusdev/dingusppc",
5 | "description": "Experimental Power Macintosh emulator",
6 | "license": "GPL-3.0-or-later",
7 | "dependencies": [
8 | "sdl2"
9 | ]
10 | }
--------------------------------------------------------------------------------
/zdocs/developers/ibmpower.md:
--------------------------------------------------------------------------------
1 | The following document is intended primarily as a documentation on how the IBM Personal Power series (and similar computers) operates. It is currently not implemented in DingusPPC.
2 |
3 | ## Sources
4 |
5 | * http://ps-2.kev009.com/rs6000/redbook-cd/sg245120.pdf
6 | * http://ps-2.kev009.com/rs6000/rs6000_ps_pdf/Graphics/RS6000_Graphics_Handbook.pdf
--------------------------------------------------------------------------------
/debugger/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories("${PROJECT_SOURCE_DIR}"
2 | "${PROJECT_SOURCE_DIR}/thirdparty/loguru/"
3 | "${PROJECT_SOURCE_DIR}/thirdparty/capstone/include")
4 |
5 | file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
6 | "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
7 |
8 | add_library(debugger OBJECT ${SOURCES})
9 |
--------------------------------------------------------------------------------
/zdocs/developers/motorolaatlas.md:
--------------------------------------------------------------------------------
1 | The following document is intended primarily as a documentation on how the Motorola Atlas operates. It is currently not implemented in DingusPPC.
2 |
3 | ## General
4 |
5 | The computer generally follows the PReP standard, but there is some x86 emulation for using the VGA BIOS.
6 |
7 | ## Sources
8 |
9 | * https://cdn.preterhuman.net/texts/computing/chrp_prep/ambih.pdf
--------------------------------------------------------------------------------
/utils/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
2 | include(PlatformGlob)
3 |
4 | include_directories("${PROJECT_SOURCE_DIR}"
5 | "${PROJECT_SOURCE_DIR}/thirdparty/loguru/"
6 | )
7 |
8 | platform_glob(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
9 |
10 | add_library(utils OBJECT ${SOURCES})
11 | target_link_libraries(utils PRIVATE)
12 |
--------------------------------------------------------------------------------
/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories("${PROJECT_SOURCE_DIR}"
2 | "${PROJECT_SOURCE_DIR}/thirdparty/loguru/"
3 | )
4 |
5 | platform_glob(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
6 |
7 | add_library(core OBJECT ${SOURCES})
8 | if (EMSCRIPTEN)
9 | target_link_libraries(core PRIVATE)
10 | else()
11 | target_link_libraries(core PRIVATE SDL2::SDL2)
12 | endif()
13 |
--------------------------------------------------------------------------------
/machines/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(CMAKE_CXX_STANDARD 20)
2 |
3 | include_directories("${PROJECT_SOURCE_DIR}"
4 | "${PROJECT_SOURCE_DIR}/devices"
5 | "${PROJECT_SOURCE_DIR}/thirdparty/loguru/")
6 |
7 | file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
8 | "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
9 | )
10 |
11 | add_library(machines OBJECT ${SOURCES})
12 | target_link_libraries(machines PRIVATE)
13 |
--------------------------------------------------------------------------------
/zdocs/developers/keylargo.md:
--------------------------------------------------------------------------------
1 | The KeyLargo ASIC is an intergrated I/O controller designed for use in New World Power
2 | Macintosh G3 and iMac computers.
3 |
4 | It would later be succeeded by the K2 ASIC
5 |
6 | ## PCI configuration space registers
7 |
8 | | Register name | Default value |
9 | |:-------------:|:--------------:|
10 | | VendorID | 0x106B (Apple) |
11 | | DeviceID | 0x0019 |
12 | | RevisionID | 0x01 |
13 | | Class code | 0xFF0000 |
14 |
15 | ## Additions
16 |
17 | * USB support
18 | * MPIC support
19 |
--------------------------------------------------------------------------------
/cpu/ppc/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories("${PROJECT_SOURCE_DIR}"
2 | "${PROJECT_SOURCE_DIR}/thirdparty/loguru/")
3 |
4 | file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
5 | "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
6 | )
7 |
8 | # The use of volatile is deprecated, but we still need it to avoid function
9 | # parameters being clobbered when using setjmp/longjmp.
10 | if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
11 | add_compile_options(-Wno-deprecated-volatile)
12 | endif()
13 |
14 | add_library(cpu_ppc OBJECT ${SOURCES})
15 |
--------------------------------------------------------------------------------
/zdocs/developers/amic.md:
--------------------------------------------------------------------------------
1 | The AMIC is the I/O controller used in the Power Mac 6100. Physically, it's located at 0x50F00000.
2 |
3 | It also:
4 |
5 | * Controls the video timing signals
6 |
7 | ## Subdevices
8 |
9 | | Subdevice | Range |
10 | |:--------------:|:--------------------:|
11 | | VIA 1 | 0x0 - 0x1FFF |
12 | | SCC | 0x4000 - 0x5FFF |
13 | | MACE | 0xA000 - 0xBFFF |
14 | | SCSI | 0x10000 - 0x11FFF |
15 | | AWACS | 0x14000 - 0x15FFF |
16 | | SWIM III | 0x16000 - 0x17FFF |
17 | | VIA 2 | 0x26000 - 0x27FFF |
18 | | Video | 0x28000 - 0x29FFF |
19 | | DMA | 0x31000 - 0x32FFF |
20 | | Mem Control | 0x40000 - 0x41FFF |
--------------------------------------------------------------------------------
/zdocs/developers/valkyrie.md:
--------------------------------------------------------------------------------
1 | The Valkyrie video chip is included in some Quadras and Performas. The Marathon games (2 and Infinity, at least) use this chip to blit 16-bit video.
2 |
3 | | Register Name | Offset |
4 | |:-------------------------:|:------:|
5 | | CLUT Address | 0x4000 |
6 | | CLUT Graphic | 0x4004 |
7 | | CLUT Video Data | 0x4008 |
8 | | CLUT Color Key | 0x400C |
9 | | Subsystem Config | 0xA00C |
10 | | Video In Control | 0xA020 |
11 | | Window X Start | 0xA060 |
12 | | Window Y Start | 0xA064 |
13 | | Window Width | 0xA070 |
14 | | Window Height | 0xA074 |
15 | | Video Field X Start | 0xA080 |
16 | | Video Field Y Start | 0xA084 |
17 |
--------------------------------------------------------------------------------
/cmake/PlatformGlob.cmake:
--------------------------------------------------------------------------------
1 | # Detect platform suffix
2 | if (EMSCRIPTEN)
3 | set(PLATFORM_SUFFIX "_js$")
4 | else()
5 | set(PLATFORM_SUFFIX "_sdl|_cubeb$")
6 | endif()
7 |
8 | # Function to perform a platform-specific glob
9 | function(platform_glob RESULT_VAR)
10 | set(PLATFORM_SOURCES)
11 | foreach(GLOB_PATTERN ${ARGN})
12 | file(GLOB GLOB_RESULT ${GLOB_PATTERN})
13 | foreach(FILE_PATH ${GLOB_RESULT})
14 | get_filename_component(BASE_NAME ${FILE_PATH} NAME_WE)
15 | if("${BASE_NAME}" MATCHES ${PLATFORM_SUFFIX} OR NOT "${BASE_NAME}" MATCHES "_js$|_sdl|_cubeb$")
16 | list(APPEND PLATFORM_SOURCES ${FILE_PATH})
17 | endif()
18 | endforeach()
19 | endforeach()
20 | set(${RESULT_VAR} ${PLATFORM_SOURCES} PARENT_SCOPE)
21 | endfunction()
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore binary files
2 | out/
3 | vcpkg/
4 | *.bin
5 |
6 | # Ignore compiled object files
7 | .vs/
8 | .vscode/
9 | *.o
10 | *.out
11 | *.obj
12 | *.d
13 |
14 | # Ignore CMake system files
15 | CMakeFiles
16 | cmake_install.cmake
17 |
18 | # Ignore Visual Studio configuration files
19 | CMakeSettings.json
20 | *.vcxproj
21 | *.vcxproj.filters
22 |
23 | # Ignore Visual Studio auto-save recovery folder
24 | enc_temp_folder/
25 |
26 | # Ignore CodeLite configuration files
27 | *.workspace
28 | *.workspace.*
29 | compile_commands.json
30 | *.session
31 | *.tags
32 |
33 | # Ignore generated executables
34 | dingusppc
35 | dingusppc.exe
36 |
37 | # Ignore system files
38 | .DS_Store
39 | Thumb.db
40 | ehthumbs.db
41 |
42 | # IDE ignores
43 | build
44 | build-*
45 | *.dir
46 | *.user
47 | DerivedData
48 | *.xcodeproj/project.xcworkspace
49 | *.xcodeproj/xcuserdata
50 |
--------------------------------------------------------------------------------
/main.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-23 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | /** @file Platform-specific main functions. */
23 |
24 | bool init();
25 | void cleanup();
26 |
--------------------------------------------------------------------------------
/CREDITS.md:
--------------------------------------------------------------------------------
1 | # DingusPPC
2 |
3 |
4 | ## Developers
5 |
6 | - divingkatae
7 | - maximumspatium
8 | - joevt
9 | - mihaip
10 | - kkaisershot
11 |
12 | ## NT4/PPC fork
13 |
14 | - Wack0
15 |
16 | ## DevOps
17 |
18 | - Waqar144
19 | - webspacecreations
20 | - leap0x7b
21 | - sdkmap
22 | - dressupgeekout
23 | - kth5
24 | - dyharlan
25 | - roytam1
26 | - mrpapersonic
27 | - Randrianasulu
28 | - lefp
29 | - mathstuf
30 | - seanm
31 | - erichelgeson
32 | - alicela1n
33 |
34 | ## Testing
35 |
36 | - LagLifeYT
37 |
38 | ## 3rd Party Libraries
39 |
40 | - [Capstone](https://github.com/capstone-engine/capstone)
41 | - [CLI11](https://github.com/CLIUtils/CLI11)
42 | - [Loguru](https://github.com/emilk/loguru)
43 | - [SDL 2](https://github.com/libsdl-org/SDL)
44 |
45 | ## Thanks
46 |
47 | - 68kmla
48 | - AppleFritter
49 | - Archive.org
50 | - Bitsavers
51 | - Blitter.net
52 | - Emaculation
53 | - GitHub
54 | - PenguinPPC
55 | - VirtuallyFun
56 | - The makers of Loguru, SDL2, Capstone, and CLI11
57 | - The developers of other PowerPC Mac emulators, past and present
58 | - All those preserving the software and source code of 68k and PowerPC Macs
59 |
--------------------------------------------------------------------------------
/devices/common/nubus/nubusutils.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-24 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | #ifndef NUBUS_UTILS_H
23 | #define NUBUS_UTILS_H
24 |
25 | #include
26 | #include
27 |
28 | int load_declaration_rom(const std::string rom_path, int slot_num);
29 |
30 | #endif // NUBUS_UTILS_H
31 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | General
2 | =======
3 |
4 | * Test your contributions to assure they do not break existing functionality.
5 | * Commits to the repo should be done by portions; that is, by individual functionalities of the program.
6 | * Don't use any disrespectful language.
7 |
8 | Code
9 | =======
10 |
11 | * Make sure the code can compile for all target systems - Windows, Linux, and macOS/Mac OS X.
12 | * All code must be compatible with at least C++11.
13 | * Minimize the amount of redundant code.
14 | * Avoid using absolute paths for the headers.
15 | * Code should maintain vertical alignment for better readability, for example:
16 |
17 | ```C
18 | one_hundred = 100;
19 | one_thousand = 1000;
20 | two_thousand = 2000;
21 | ```
22 |
23 | * CamelCase for class names, lowercase for variables, UPPERCASE for enumerations
24 | * Avoid redundancy in namespaces (i.e. use ViaCuda::read() instead of ViaCuda::cuda_read())
25 |
26 | Issues
27 | =======
28 |
29 | * When creating an issue ticket, note which version you are using.
30 | * If possible, reference the git hashes for the relevant commits.
31 | * Once an issue is closed, do not re-open it. Instead, reference it in a new issue ticket.
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[BUG]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 | **Device Information (please complete the following information):**
26 |
27 | - Device Type: [e.g. Desktop, Smartphone]
28 | - Host OS: [e.g. Linux 4.4, Mac OS X 10.12, Windows 7]
29 | - Host Processor: [e.g. Intel Core 2 Duo, AMD Phenom II]
30 | - Host RAM: [e.g. 4 GB]
31 | - Guest OS: [e.g. Mac OS 8.6]
32 | - Guest Processor: [e.g. PowerPC G3 (750 v.1)]
33 | - Guest ROM: [e.g. Power Mac G3 Beige]
34 | - Guest RAM: [e.g. 64 MB]
35 | - Build Date [e.g. 22/7/2019 (dd/mm/yyyy format)]
36 | - Version [e.g. 22]
37 |
38 | **Additional context**
39 | Add any other context about the problem here.
40 |
--------------------------------------------------------------------------------
/zdocs/developers/cpu/powerpc/mmu.md:
--------------------------------------------------------------------------------
1 | ## Disabling BAT translation
2 |
3 | BAT translation can be disabled by invalidating BAT registers. This is somewhat CPU specific.
4 | MPC601 implements its own format for BAT registers that differs from the PowerPC specification.
5 |
6 | MPC601-specific lower BAT registers has the "V" bit. If it's cleared, the corresponding BAT pair
7 | is invalid and won't be used for address translation. To invalidate BATs on MPC601, it's enough
8 | to write NULL to lower BAT registers. That's exactly what Power Mac 6100 ROM does:
9 | ```
10 | li r0, 0
11 | mtspr ibat0l, r0
12 | mtspr ibat1l, r0
13 | mtspr ibat2l, r0
14 | ```
15 |
16 | PowerPC CPUs starting with 603 uses the BAT register format described in the PowerPC specification.
17 | The upper BAT registers contain two bits: Vs (supervisor state valid bit) and Vp (problem/user state valid bit).
18 | PowerPC Architecture First Edition from 1993 gives the following code:
19 |
20 | ```BAT_entry_valid = (Vs & ~MSR_PR) | (Vp & MSR_PR)```
21 |
22 | If neither Vs nor Vp is set, the corresponding BAT pair isn't valid and doesn't participate in address translation.
23 | To invalidate BATs on non-601, it's sufficient to set the upper BAT register to 0x00000000.
24 |
--------------------------------------------------------------------------------
/zdocs/developers/atirage.md:
--------------------------------------------------------------------------------
1 | The ATI Rage is a video card that comes bundled with early Power Mac G3s and New World Macs (like the first revisions of the iMac G3). Its predecessor was the ATI Mach 64 GX, used in earlier Old World Macs.
2 |
3 | # Memory Map
4 |
5 | The ATI Rage can usually be located at IOBase (ex.: 0xF3000000 for Power Mac G3 Beige) + 0x9000. However, the video memory appears to be at 0x81000000 and is capped at 8 MB.
6 |
7 | # Register Map
8 |
9 | | Register Name | Offset |
10 | |:-------------------:|:------:|
11 | | BUS_CNTL | 0xA0 |
12 | | EXT_MEM_CNTL | 0xAC |
13 | | MEM_CNTL | 0xB0 |
14 | | MEM_VGA_WP_SEL | 0xB4 |
15 | | MEM_VGA_RP_SEL | 0xB8 |
16 | | GEN_TEST_CNTL | 0xD0 |
17 | | CONFIG_CNTL | 0xDC |
18 | | CONFIG_CHIP_ID | 0xE0 |
19 | | CONFIG_STAT0 | 0xE4 |
20 | | DST_CNTL | 0x130 |
21 | | SRC_OFF_PITCH | 0x180 |
22 | | SRC_X | 0x184 |
23 | | SRC_Y | 0x188 |
24 | | SRC_Y_X | 0x18C |
25 | | SRC_WIDTH1 | 0x190 |
26 | | SRC_HEIGHT1 | 0x194 |
27 | | SRC_HEIGHT1_WIDTH1 | 0x198 |
28 | | SRC_CNTL | 0x1B4 |
29 | | SCALE_3D_CNTL | 0x1FC |
30 | | HOST_DATA0 | 0x200 |
31 | | HOST_CNTL | 0x240 |
32 | | DP_PIX_WIDTH | 0x2D0 |
33 | | DP_SRC | 0x2D8 |
--------------------------------------------------------------------------------
/zdocs/developers/mesh.md:
--------------------------------------------------------------------------------
1 | The MESH is a SCSI controller used in Power Mac machines.
2 |
3 | # Registers
4 |
5 | | Register Name | Number |
6 | |:----------------:|:------:|
7 | | R_COUNT0 | 0x0 |
8 | | R_COUNT1 | 0x1 |
9 | | R_FIFO | 0x2 |
10 | | R_CMD | 0x3 |
11 | | R_BUS0STATUS | 0x4 |
12 | | R_BUS1STATUS | 0x5 |
13 | | FIFO_CNT | 0x6 |
14 | | EXCPT | 0x7 |
15 | | ERROR | 0x8 |
16 | | INTMASK | 0x9 |
17 | | INTERRUPT | 0xA |
18 | | SOURCEID | 0xB |
19 | | DESTID | 0xC |
20 | | SYNC | 0xD |
21 | | MESHID | 0xE |
22 | | SEL_TIMEOUT | 0xF |
23 |
24 | # Commands
25 |
26 | | Command Name | Number |
27 | |:----------------:|:------:|
28 | | NOP | 0x0 |
29 | | ARBITRATE | 0x1 |
30 | | SELECT | 0x2 |
31 | | COMMAND | 0x3 |
32 | | STATUS | 0x4 |
33 | | DATAOUT | 0x5 |
34 | | DATAIN | 0x6 |
35 | | MSGOUT | 0x7 |
36 | | MSGIN | 0x8 |
37 | | BUSFREE | 0x9 |
38 | | ENABLE_PARITY | 0xA |
39 | | DISABLE_PARITY | 0xB |
40 | | ENABLE_RESELECT | 0xC |
41 | | DISABLE_RESELECT | 0xD |
42 | | RESET_MESH | 0xE |
43 | | FLUSH_FIFO | 0xF |
44 | | SEQ_DMA | 0x20 |
45 | | SEQ_TARGET | 0x40 |
46 | | SEQ_ATN | 0x80 |
--------------------------------------------------------------------------------
/debugger/debugger.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-25 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | #ifndef DEBUGGER_H_
23 | #define DEBUGGER_H_
24 |
25 | #include
26 |
27 | class DppcDebugger {
28 | public:
29 | static DppcDebugger* get_instance() {
30 | if (!debugger_obj) {
31 | debugger_obj = std::unique_ptr(new DppcDebugger());
32 | }
33 | return debugger_obj.get();
34 | }
35 |
36 | void enter_debugger();
37 |
38 | private:
39 | inline static std::unique_ptr debugger_obj{nullptr};
40 | explicit DppcDebugger(); // private constructor to implement a singleton
41 | };
42 |
43 | #endif // DEBUGGER_H_
44 |
--------------------------------------------------------------------------------
/zdocs/developers/awacs.md:
--------------------------------------------------------------------------------
1 | AWACS is an audio controller present on several Old World Macs and can usually be located at IOBase (ex.: 0xF3000000 for Power Mac G3 Beige) + 0x14000.
2 |
3 | New World Macs have a Screamer chip, which is backwards compatible with the AWACS chip, but with some additional capabilities.
4 |
5 | # Register Maps
6 |
7 | ## NuBus Macs
8 | | Register | Offset | Length
9 | |:-----------------:|:------:|:------:|
10 | | Codec Control | 0x0 | 3 |
11 | | Codec Status | 0x4 | 3 |
12 | | Buffer Size | 0x8 | 2 |
13 | | Phaser | 0xA | 4 |
14 | | Sound Control | 0xE | 2 |
15 | | DMA In | 0x12 | 1 |
16 | | DMA Out | 0x16 | 1 |
17 |
18 | ## PCI Macs
19 |
20 | All registers are 32-bit here.
21 |
22 | | Register | Offset |
23 | |:-----------------:|:------:|
24 | | Sound Control | 0x0 |
25 | | Codec Control | 0x10 |
26 | | Codec Status | 0x20 |
27 | | Clipping Count | 0x30 |
28 | | Byte Swapping | 0x40 |
29 | | Frame Count | 0x50 |
30 |
31 | ## Sound Control Register bits
32 |
33 | | Register | Bit Mask |
34 | |:-------------------------:|:--------:|
35 | | Input Subframe Select | 0x000F |
36 | | Output Subframe Select | 0x00F0 |
37 | | Sound Rate | 0x0700 |
38 | | Error | 0x0800 |
39 |
40 |
41 | Separate volume controls exist for the CD drive and the microphone.
42 |
43 | The DMA buffer size is set to be 0x40000 bytes, while the DMA hardware buffer size is set to be 0x2000 bytes.
44 |
--------------------------------------------------------------------------------
/cpu/ppc/ppcdisasm.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-21 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | #ifndef PPCDISASM_H
23 | #define PPCDISASM_H
24 |
25 | #include
26 | #include
27 | #include
28 |
29 | typedef struct PPCDisasmContext {
30 | uint32_t instr_addr;
31 | uint32_t instr_code;
32 | std::string instr_str;
33 | bool simplified; /* true if we should output simplified mnemonics */
34 | std::vector regs_in;
35 | std::vector regs_out;
36 | } PPCDisasmContext;
37 |
38 | std::string disassemble_single(PPCDisasmContext* ctx);
39 |
40 | int test_ppc_disasm(void);
41 |
42 | /** sign-extend an integer. */
43 | #define SIGNEXT(x, sb) ((x) | (((x) & (1 << (sb))) ? ~((1 << (sb)) - 1) : 0))
44 |
45 | #endif /* PPCDISASM_H */
46 |
--------------------------------------------------------------------------------
/utils/imgfile.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-23 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | /** @file Image file abstraction for floppy, hard drive and CD-ROM images
23 | * (implemented on each platform). */
24 |
25 | #ifndef IMGFILE_H
26 | #define IMGFILE_H
27 |
28 | #include
29 | #include
30 | #include
31 |
32 | class ImgFile {
33 | public:
34 | ImgFile();
35 | ~ImgFile();
36 |
37 | bool open(const std::string& img_path);
38 | void close();
39 |
40 | uint64_t size() const;
41 |
42 | uint64_t read(void* buf, uint64_t offset, uint64_t length) const;
43 | uint64_t write(const void* buf, uint64_t offset, uint64_t length);
44 | private:
45 | class Impl; // Holds private fields
46 | std::unique_ptr impl;
47 | };
48 |
49 | #endif // IMGFILE_H
50 |
--------------------------------------------------------------------------------
/zdocs/developers/adb.md:
--------------------------------------------------------------------------------
1 | The Apple Desktop Bus is a bit-serial peripheral bus, Apple themselves cited a 2-MHz Motorola 68HC11 microcontroller as an example platform to implement the ADB standard with. Its transfer speed is usually around 10.0 kilobits per second, roughly comparable to a PS/2 port at 12.0 kilobits per second.
2 |
3 | The device commands are in the form of single byte strings. The first four bits are to signal which of the 16 devices are to be used. The next two bits are for which action to execute (talk, listen, flush, or reset). These are followed by two bits which determine the register to reference (register 0 is usually a communications register, while register 3 is used for device info).
4 |
5 | Heathrow and Paddington-based Macintoshes have a Master Cell, which is a fully-featured ADB implementation for hardware, but isn't used by Mac OS itself.
6 |
7 | # Commands
8 |
9 | | Command Name | Number |
10 | |:---------------------------:|:-------:|
11 | | DEVCMD_CHANGE_ID_AND_ENABLE | 0x00 |
12 | | DEVCMD_CHANGE_ID | 0xFD |
13 | | DEVCMD_CHANGE_ID_AND_ACT | 0xFE |
14 | | DEVCMD_SELF_TEST | 0xFF |
15 |
16 | # Devices
17 |
18 | | Device Type | Example | Default Address |
19 | |:-----------------:|:-------------:|:---------------:|
20 | | Protection | | 0x1 |
21 | | Encoded | Keyboard | 0x2 |
22 | | Relative-position | Mouse | 0x3 |
23 | | Absolute-position | Tablet | 0x4 |
24 | | Data transfer | Modem | 0x5 |
25 | | Other | | 0x6 |
26 | | Other | | 0x7 |
--------------------------------------------------------------------------------
/main_sdl.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-23 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | /** @file SDL-specific main functions. */
23 |
24 | #include
25 | #include
26 | #include
27 |
28 | #ifdef __APPLE__
29 | extern "C" void remap_appkit_menu_shortcuts();
30 | #endif
31 |
32 | bool init() {
33 | if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER)) {
34 | LOG_F(ERROR, "SDL_Init error: %s", SDL_GetError());
35 | return false;
36 | }
37 |
38 | int num_joysticks = SDL_NumJoysticks();
39 | for (int i = 0; i < num_joysticks; ++i) {
40 | if (SDL_IsGameController(i)) {
41 | SDL_GameControllerOpen(i); /* only support one controller for now */
42 | break;
43 | }
44 | }
45 |
46 | #ifdef __APPLE__
47 | remap_appkit_menu_shortcuts();
48 | #endif
49 |
50 | return true;
51 | }
52 |
53 | void cleanup() {
54 | SDL_Quit();
55 | }
56 |
--------------------------------------------------------------------------------
/machines/machine.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-25 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | #ifndef MACHINE_H
23 | #define MACHINE_H
24 |
25 | #include
26 |
27 | class Machine : virtual public HWComponent
28 | {
29 | public:
30 | Machine() { supports_types(HWCompType::MACHINE); }
31 | ~Machine() = default;
32 |
33 | // Machine methods
34 |
35 | virtual int initialize(const std::string &id) = 0;
36 |
37 | template
38 | static std::unique_ptr create_with_id(const std::string &id) {
39 | std::unique_ptr machine = std::unique_ptr(new T());
40 | if (machine && 0 == machine->initialize(id))
41 | return machine;
42 | return nullptr;
43 | }
44 |
45 | template
46 | static std::unique_ptr create() {
47 | return Machine::create_with_id("");
48 | }
49 | };
50 |
51 | #endif /* MACHINE_H */
52 |
--------------------------------------------------------------------------------
/devices/common/mmiodevice.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-21 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | #ifndef MMIO_DEVICE_H
23 | #define MMIO_DEVICE_H
24 |
25 | #include
26 |
27 | #include
28 | #include
29 |
30 | /** Abstract class representing a simple, memory-mapped I/O device */
31 | class MMIODevice : public HWComponent {
32 | public:
33 | MMIODevice() = default;
34 | virtual uint32_t read(uint32_t rgn_start, uint32_t offset, int size) = 0;
35 | virtual void write(uint32_t rgn_start, uint32_t offset, uint32_t value, int size) = 0;
36 | virtual ~MMIODevice() = default;
37 | };
38 |
39 | #define SIZE_ARG(size) (size == 4 ? 'l' : size == 2 ? 'w' : \
40 | size == 1 ? 'b' : '0' + size)
41 |
42 | #endif /* MMIO_DEVICE_H */
43 |
--------------------------------------------------------------------------------
/machines/romidentity.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-25 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | /** @file Rom identity maps rom info to machine name and description.
23 | */
24 |
25 | #ifndef ROM_IDENTITY_H
26 | #define ROM_IDENTITY_H
27 |
28 | #include
29 |
30 | typedef struct {
31 | uint32_t firmware_version;
32 | uint32_t firmware_size_k;
33 | uint32_t ow_expected_checksum;
34 | uint32_t nw_product_id;
35 | uint32_t nw_subconfig_expected_checksum; // checksum of the system config section but without the firmware version and date
36 | const char *id_str; // BootstrapVersion of NKConfigurationInfo
37 | const char *nw_firmware_updater_name;
38 | const char *nw_openfirmware_name;
39 | const char *dppc_machine;
40 | const char *dppc_description;
41 | const char *rom_description;
42 | } rom_info;
43 |
44 | extern rom_info rom_identity[];
45 |
46 | #endif /* ROM_IDENTITY_H */
47 |
--------------------------------------------------------------------------------
/core/mathutils.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-22 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | #include
23 |
24 | #ifndef MATH_UTILS_H
25 | #define MATH_UTILS_H
26 |
27 | inline void _u32xu64(uint32_t a, uint64_t b, uint32_t &hi, uint64_t &lo)
28 | {
29 | uint64_t p0 = (b & 0xffffffff) * a;
30 | uint64_t p1 = (b >> 32) * a;
31 | lo = p0 + (p1 << 32);
32 | hi = (p1 >> 32) + (lo < p0);
33 | }
34 |
35 | inline void _u32xu64(uint32_t a, uint64_t b, uint64_t &hi, uint32_t &lo)
36 | {
37 | uint64_t p0 = (b & 0xffffffff) * a;
38 | uint64_t p1 = (b >> 32) * a;
39 | lo = (uint32_t)p0;
40 | hi = (p0 >> 32) + p1;
41 | }
42 |
43 | inline void _u64xu64(uint64_t a, uint64_t b, uint64_t &hi, uint64_t &lo)
44 | {
45 | uint32_t p0h; uint64_t p0l; _u32xu64((uint32_t)b, a, p0h, p0l);
46 | uint64_t p1h; uint32_t p1l; _u32xu64(b >> 32, a, p1h, p1l);
47 | lo = p0l + ((uint64_t)p1l << 32);
48 | hi = p0h + p1h + (lo < p0l);
49 | }
50 |
51 | #endif // MATH_UTILS_H
52 |
--------------------------------------------------------------------------------
/devices/common/i2c/i2cprom.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-25 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | /** @file Generic PROM device programmable over I2C. */
23 |
24 | #ifndef I2C_PROM_H
25 | #define I2C_PROM_H
26 |
27 | #include
28 |
29 | #include
30 | #include
31 |
32 | class I2CProm : public I2CDevice {
33 | public:
34 | I2CProm(uint8_t dev_addr, int size);
35 | ~I2CProm() = default;
36 |
37 | // I2CDevice methods
38 | void start_transaction();
39 | bool send_subaddress(uint8_t sub_addr);
40 | bool send_byte(uint8_t data);
41 | bool receive_byte(uint8_t* p_data);
42 |
43 | // data management methods
44 | void fill_memory(int start, int size, uint8_t c);
45 | void set_memory(int start, const uint8_t* in_data, int size);
46 |
47 | private:
48 | std::unique_ptr data;
49 |
50 | int rom_size = 0;
51 | int pos = 0;
52 | uint8_t my_addr = 0xA0;
53 | };
54 |
55 | #endif // I2C_PROM_H
56 |
--------------------------------------------------------------------------------
/devices/sound/soundserver.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-21 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | /** @file Sound server definitions.
23 |
24 | This class manages host audio HW. It's directly connected
25 | to a sound abstraction API (libsoundio in our case).
26 |
27 | Sound server provides a way to select between various
28 | host input and output devices independendly of emulated
29 | sound HW.
30 |
31 | Emulated sound HW only need to process sound streams.
32 | */
33 |
34 | #ifndef SOUND_SERVER_H
35 | #define SOUND_SERVER_H
36 |
37 | #include
38 |
39 | #include
40 |
41 | class DmaOutChannel;
42 |
43 | class SoundServer : public HWComponent {
44 | public:
45 | SoundServer();
46 | ~SoundServer();
47 |
48 | int start();
49 | void shutdown();
50 | int open_out_stream(uint32_t sample_rate, DmaOutChannel *dma_ch);
51 | int start_out_stream();
52 | void close_out_stream();
53 |
54 | private:
55 | class Impl; // Holds private fields
56 | std::unique_ptr impl;
57 | };
58 |
59 | #endif /* SOUND_SERVER_H */
60 |
--------------------------------------------------------------------------------
/machines/machinebase.h:
--------------------------------------------------------------------------------
1 | /*
2 | DingusPPC - The Experimental PowerPC Macintosh emulator
3 | Copyright (C) 2018-22 divingkatae and maximum
4 | (theweirdo) spatium
5 |
6 | (Contact divingkatae#1017 or powermax#2286 on Discord for more info)
7 |
8 | This program is free software: you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation, either version 3 of the License, or
11 | (at your option) any later version.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with this program. If not, see .
20 | */
21 |
22 | /** @file Base class for managing different HW components of a machine.
23 |
24 | Author: Max Poliakovski
25 | */
26 |
27 | #ifndef MACHINE_BASE_H
28 | #define MACHINE_BASE_H
29 |
30 | #include