A partial, cross-platform implementation of the Macintosh Toolbox C API
Go to file
Jim Huang 86d35caf94 Rewrite __frsqrte with Arm/NEON counterpart
__frsqrte is the intrinsic for floating reciprocal square root estimate.
In Arm64, we can implement it with NEON intrinsics. Since Armv8.2,
instruction "FRSQRTE" [1] is provided to calculate an approximate square
root for each vector element in the source SIMD and FP register.

With -O3, generated assembly on Apple Silicon M1:

[original]
	fsqrt	s0, s0
	fmov	s1, #1.00000000
	fdiv	s0, s1, s0

[neon]
	dup.4s	v0, v0[0]
	frsqrte.4s	v0, v0

[1] https://developer.arm.com/documentation/100076/0100/a64-instruction-set-reference/a64-simd-scalar-instructions/frsqrte--scalar-
2022-01-31 09:59:08 +01:00
src Rewrite __frsqrte with Arm/NEON counterpart 2022-01-31 09:59:08 +01:00
.editorconfig .editorconfig 2021-02-21 17:56:37 +01:00
.gitignore CMakeLists.txt: fixes for Visual Studio's built-in CMake 2021-03-21 11:54:09 +01:00
CMakeLists.txt Split SoundFormats/SoundMixer 2021-08-15 12:43:05 +02:00
LICENSE.md Import QD3D/3DMF code from Nanosaur's new renderer 2021-02-19 18:55:12 +01:00
README.md README.md: Mention Otto Matic 2021-08-21 11:34:28 +02:00

README.md

Pomme

A cross-platform implementation of the Macintosh Toolbox C API

Pomme is a partial, cross-platform implementation of the Macintosh Toolbox C API. It is designed to ease the porting of 90's games written for MacOS 7-9 to modern operating systems. You can think of it as a cross-platform reimagining of Apple's own Carbon, albeit at a much reduced scope.

The goal isn't to achieve 100% source compatibility with old Mac C programs, but rather, to make it a bit easier to port them. I only intend to implement the bare minimum functionality required to keep a reasonable level of source code compatibility with the games I'm interested in porting.

Games ported with Pomme

License

Please see LICENSE.md

Features

Files and resources:

  • Access files on the host's filesystem with FSSpec structures.
  • Read/write data forks.
  • Access resources inside AppleDouble files (transparently presented as resource forks to application code).

QuickDraw 2D:

  • Load images from QuickDraw 2D PICT resources and files.
  • Manipulate ports.
  • Basic draw calls: lines, rects, bitmap text, CopyBits.

Sound Manager:

  • Load audio from AIFF & AIFF-C files and snd resources.
  • Supported audio codecs: raw PCM, ima4, MAC3, ulaw, alaw.
  • Use SndChannels to output audio thanks to the built-in software mixer (requires SDL).

QuickDraw 3D-ish:

  • Basic QD3D geometry structures and math routines.
  • Load 3D model data from 3DMF files.
  • Please note: Accurate source compatibility with QD3D is out of scope for Pomme. For a faithful implementation of QD3D, look at Quesa.

Misc:

  • Memory management routines.
  • Limited playback of QuickTime moov files (only Cinepak is supported).
  • Byte-swapping routines inspired from Python's struct format strings to convert big-endian structs to little-endian.
  • Basic keyboard/mouse input via SDL.