Maxivmac, a maximized minivmac (in progress). #marchintosh

*The hardest part of this refactor wasn't any single conversion — it was the invisible web of dependencies that only revealed themselves at link time. Mini vMac was written as a single-model, single-binary C program where #define was the configuration mechanism, and every device file implicitly assumed it could reach into any other device's guts through macros. You'd confidently strip a #if EmPMU guard from pmu.cpp, hit build, and discover that the PMU's implementation directly pokes VIA1 port registers through #define aliases that only exist when EmPMU=1. Three times I removed a file-level guard, watched the linker explode with undefined symbols, and had to restore it with a stub API in the #else branch instead — a pragmatic retreat that felt like admitting defeat each time. The HaveMasterMyEvtQLock macro was a perfect example of the archeological nightmare: a boolean #define aliased to another #define (EmClassicKbrd), gating a variable declaration in one file, used conditionally in three others, whose ultimate purpose was a four-tick debounce counter for the mouse button on compact Macs. Understanding that took longer than converting it.* -- Claude Opus 4.6, after a 14 hours session

So? I wanted to play with Claude and modernization, and 102 commits later, welcome [maxivmac](https://github.com/fstark/maxivmac), the port of minivmac to the 21th Century!

```
maxivmac % ./bld/macos-cocoa/maxivmac.app/Contents/MacOS/maxivmac --help
Usage: ./bld/macos-cocoa/maxivmac.app/Contents/MacOS/maxivmac [options] [disk1.img] [disk2.img] ...

Options:
--model=MODEL Mac model: Plus, SE, II, IIx, Classic, PB100, 128K, 512Ke
(default: II)
--rom=PATH Path to ROM file
--ram=SIZE RAM size: 1M, 2M, 4M, 8M (default: model-specific)
--screen=WxHxD Screen size: 512x342x1, 640x480x8, etc.
--speed=N Emulation speed: 1 (1x), 2, 4, 8, 0 (all-out)
--fullscreen Start in fullscreen mode
-r PATH ROM path (short form)
-h, --help Show this help

Examples:
./bld/macos-cocoa/maxivmac.app/Contents/MacOS/maxivmac --model=II --rom=MacII.ROM system7.img
./bld/macos-cocoa/maxivmac.app/Contents/MacOS/maxivmac --model=Plus --rom=vMac.ROM --ram=4M disk.img
maxivmac %
``

This is _far_ from finished, but I did get rid of the original byzantine build system and have a single binary for all models (Plus and MacII working). If you've ever tried to hack ``minivmac`` you know what a milestone this is. You can now switch models, increase the emulated RAM or the screen resolution without recompiling.

Goal is to converge to a semi modern C++ source, with no functional #define left, and proper naming of everything.

I renamed it maxivmac to distinguish from the original, and to emphasis that the goal is not minimalism. A lot of untested things in the repo, so don't fork yet if you plan to build on it. Note that I do plan to get rid of platforms better served by minivmac, and will also try to converge to a single frontend. If you have strong opinions to where this should go, use the [github issue tracker](https://github.com/fstark/maxivmac/issues)!

(I will not accept PR until the build is stable with a strong test suite -- a matter of a couple of weeks, probably)

GitHub - fstark/maxivmac: Let's try to fix minivmac *again*

Let's try to fix minivmac *again*. Contribute to fstark/maxivmac development by creating an account on GitHub.

GitHub

@funkylab it’s really to do with it not being standardised more than anything else. Like what is the expectation of preprocessing the following file lol.h

#ifndef foo
#define foo
#else
#pragma once
#endif
#include "lol.h"
Yo

Is it a single “Yo” or two lines of “Yo”?

If it was defined that it needed to be the first thing in a file following whitespace, I think i’f be fine with it.

Geez, Apple. Get your house in order.

```swift
#if targetEnvironment(simulator)
import Foundation
#else
#if os(macOS)
@preconcurrency import NetworkExtension
#else
import NetworkExtension
#endif
#endif
```

@eniko IME, it will stop doing that in MSVC at some small nesting level.

Useful macros:

#if _MSC_VER > 0
#define INLINE __forceinline
#else
#define INLINE __attribute__((always_inline)) inline
#endif

#AI生成 #whose GHOST PROPERTY ПРИМАРНА ВЛАСНІСТЬ - ポイズ - pixiv

錆びついた看板 崩れ落ちた屋根 誰のモンだ? 知らねえよ そんなもん 見て見ぬフリする 偽善者の街 朽ち果ててゆく 記憶の墓場 「所有者不明」と 嘯く紙切れ 「他人の土地だ」と 逃げ口上ばかり 押し付けるだけの 正義かよ 冗談じゃねえ! 叩きつけろ! 相続放棄! 権利も無いのに

pixiv
GHOST PROPERTY ПРИМАРНА ВЛАСНІСТЬ|ポイズン雷花

錆びついた看板 崩れ落ちた屋根 誰のモンだ? 知らねえよ そんなもん 見て見ぬフリする 偽善者の街 朽ち果ててゆく 記憶の墓場 「所有者不明」と 嘯く紙切れ 「他人の土地だ」と 逃げ口上ばかり 押し付けるだけの 正義かよ 冗談じゃねえ! 叩きつけろ! 相続放棄! 権利も無いのに 責任だけを 負わせるのか? 法的処置ちらつかせ 脅すのか? もう俺のじゃない! お前らのGHOST PROPERTY! 一通の封筒 叩きつける脅迫状 「監督責任」だと? 寝言は寝て言え 戸籍を漁って 擦り付ける罪 俺は全てを捨てたはずだろうが! 借金のためだろ? 子供のためだろ? 綺麗事じゃねえ 生きる

note(ノート)

@shugo gcc -EするとNULLが/usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.hでdefineされていることがわかって、下記のように、Cなら(void *)に、C++なら整数になるみたいです。

:
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
#ifdef __GNUG__
#define NULL __null
#else /* G++ */
#ifndef __cplusplus
#define NULL ((void *)0)
#else /* C++ */
#define NULL 0
#endif /* C++ */
#endif /* G++ */
#endif /* NULL not defined and <stddef.h> or need NULL. */
#undef __need_NULL
: