# Start here: the compact Macintosh in one page Phase 0 notes for `mac-python`. No emulator code exists yet. Every fact names its source with a key from [sources.md](sources.md) and an evidence tag (DOC, OBSERVED, HYPOTHESIS, ...). "DOC: IM3 III-18" is Inside Macintosh Volume III, page III-18; "GMFH p. 124" is the Guide to the Macintosh Family Hardware (2nd ed.) by its printed page. Apple's documents carry no licence: we cite them and copy nothing. ## The machines | Row | ROM (checksum = first long word) | RAM | Floppy | New | MAME driver | | --- | --- | --- | --- | --- | --- | | **Macintosh 128K** (1984) | 64K, `28BA61CE` | 128K | internal 400K single-sided, speed set by the Mac's PWM (the ASG reads the disk-speed buffer) | the base design: 68000 at 7.8336 MHz, 512x342 bitmap, PWM sound, VIA, SCC, IWM, RTC 343-0040 (20 bytes PRAM), keyboard M0110 (Intel 8021) | `mac128k` | | **Macintosh 512K** | 64K, `28BA4E50` | 512K | as 128K | RAM only (screen and sound buffers move up by $60000, DOC: IM3 III-19, III-21) | `mac512k` | | **Macintosh 512K enhanced** | 128K, `4D1F8172` (v3; v1 `4D1EEEE1`, v2 `4D1EEAE1`) | 512K | 800K double-sided, self-speed-controlled (it ignores the PWM, DOC: IM4 IV-251) | ROM and drive (DOC: IM4 IV-245) | `mac512ke` | | **Macintosh Plus** (1986) | 128K, as 512Ke | 1, 2, 2.5, 4 MB in SIMMs, set by two board resistors | 800K internal, external 400K or 800K | **NCR 5380 SCSI** (no IRQ wired, pseudo-DMA by address), RTC 343-0042 (more PRAM), keyboard M0110A (8048 per MAME), Mini-8 serial ports (DOC: IM4 IV-245..253) | `macplus` | | **Macintosh SE** (1987), a later row | 256K, `B2E362A8` | 1-4 MB | 800K (IWM on C16M, divided by two), optional second internal drive | the **BBU** custom chip replaces the PALs; video reads **two words per access** (the CPU gets more RAM time); **ADB** through a transceiver MCU (342S0440-B, whose 1 KB ROM MAME lists; MAME runs ADB as HLE, "Mac ADB HLE", and names a GI PIC1654S under its `adbmodem` device: the part is U5) instead of the keyboard port; SCSI IRQ maskable through VIA PB6; overlay leaves on the first access to $400000-$5FFFFF instead of a VIA bit (DOC: GMFH pp. 124-126, 160, 168, 401) | `macse` | | SE FDHD, Classic | 256K / 512K | | SWIM and the 1.44 MB SuperDrive | out of scope here (SWIM is another chip: open decision) | `macsefd`, `macclasc` | All five first rows are one board with machine rows: same CPU, same clocks, same video, same IWM; the differences are ROM size, RAM size and decode, the drive type and two chips (SCSI on the Plus, the BBU and ADB on the SE). ## Clocks and frames - One crystal: 15.6672 MHz (C16M), the pixel clock. The 68000 and the IWM's FCLK run at C8M = 7.8336 MHz; the SCC's PCLK and RTxC at 3.672 MHz (DOC: IM3 III-17, III-25; GMFH ch. 3 for the SE's derivation); the VIA's phase 2 is the 68000's E clock, CLK/10 = 783.36 kHz (DOC: GMFH ch. 4, "VIA"; MAME's device list: "MOS 6522 VIA @ 783.36 kHz"). - **A line is 704 pixel clocks: 512 shown, 192 of horizontal blanking; 44.93 µs, 22.25 kHz. A frame is 370 lines: 342 shown, 28 of vertical blanking; 16,625.8 µs, 60.15 Hz** (DOC: IM3 III-18..19; GMFH p. 400). In CPU clocks: 352 a line, 352 x 370 = **130,240 a frame**. OBSERVED: MAME 0.285's `macplus` reaches CPU cycle 15,628,793 at frame 120, 130,240 a frame ([mame-oracle.md](mame-oracle.md)). - **RAM is shared** with the video (one word per 16 pixels, i.e. per 8 CPU clocks, during the shown part of a line) and with the sound/disk-speed fetch (one word, "the first access after each scan line", 370 a frame). "The MC68000 accesses to RAM are interleaved (alternated) with the video display's accesses during the active portion of a screen scan line"; ROM is always at full speed (DOC: IM3 III-18; GMFH ch. 5, "RAM access cycles"). This is the board's cycle-exactness point: [memory-and-bus.md](memory-and-bus.md). - **VIA accesses wait for the E clock** (synchronous 6800-style cycles, /VPA), about 1.0 µs on average (DOC: GMFH ch. 4). Interrupts are autovectored through /VPA (DOC: GMFH p. 91). ## The family pieces it uses | Piece | Repository | For | Needs | | --- | --- | --- | --- | | MC68000 | [m68000-python](../../m68000-python) `M68000CPU` | every row | a stall hook inside bus callbacks, and VPA data cycles (requests R1, R2 in [cores.md](cores.md)) | | 6522 VIA | none yet: `mos6522-python` is the shared core decided for the C64/VIC-20/BBC/Apple boards; it does not exist on 2026-11-26 | VIA on every row | the core, plus the Mac's wiring (CB1/CB2 to the keyboard shift register, CA1 VBL, CA2 one-second) | | Intel 8021 / 8048 | [mcs48-python](../../mcs48-python) (lists the 8021 and 8048 among its parts) | the keyboards' MCUs, only if the keyboard is modelled at chip level (open decision) | the player's keyboard ROM by SHA-1 | | Z8530 SCC | none in the family | serial ports, the mouse's X1/Y1 interrupts | stays in the board (chip rule) until a second family board wants it | | NCR 5380 | none in the family | Plus SCSI | stays in the board | | IWM | none: apple2-python plans it as a later IIc/IIgs row | floppy | a second consumer exists on paper: open decision 4 | New chips in this board, under the chip rule: the PAL/BBU glue (decode, interleave, video and sound fetch), the video shifter, the ASG (PWM to drive speed), the RTC, the IWM, the 3.5" drives, the 5380, the SCC, the keyboard port, the mouse. Their other family users are listed in [cores.md](cores.md). ## Modelling level (charter axis B), proposed | Component | Level | Why | | --- | --- | --- | | 68000 | cycle (the core's own: every bus access placed at its clock) | the interleave decides when each RAM access lands | | Bus glue | per CPU clock, 4-clock RAM slots against the video's slots | stalls are visible to software that counts cycles (the ROM's own timing loops, copy protections, sound players) | | Video | per word fetch (one per 8 CPU clocks while shown) | the screen buffer is read live; writes ahead of or behind the beam show in the picture | | Sound and disk speed | one word fetched per line | PWM sound is cycle-timed by the buffer and VIA timer 1 can gate it | | VIA | per E-clock tick (783.36 kHz), from the shared core | timers, shift register, interrupts | | IWM | per FCLK clock (7.8336 MHz) while the drive is enabled, catch-up otherwise | the data separator's windows are counted in FCLK periods (DOC: IWMSPEC p. 4) | | Drive | per bit cell, the spindle speed a function of the PWM duty (400K) or of the track zone (800K) | variable speed is how the format packs 12..8 sectors per track | | SCC | register level with the external-status (DCD) interrupts exact | the mouse rides on DCD | | RTC, keyboard | serial protocol level with its timing (DOC: IM3 III-30, III-37) | | | SCSI | register level with phases; devices behind a socket | | ## The order to read 1. [memory-and-bus.md](memory-and-bus.md), [video-and-sound.md](video-and-sound.md), [floppy.md](floppy.md), [peripherals.md](peripherals.md), [cores.md](cores.md). 2. [domains-and-speed.md](domains-and-speed.md). 3. [sources.md](sources.md), [provenance.md](provenance.md), [validation.md](validation.md), [mame-oracle.md](mame-oracle.md), [census.md](census.md). 4. [handoff-brief.md](handoff-brief.md): scope, names, unknowns, milestones, open decisions.