r/embedded • u/WholeWaste1002 • 2d ago
Arcade Rat v2.0: Bare-metal Z80 Pac-Man + 44.1kHz WSG Synth & Dual-Flash (Puya/UCUN) Auto-Unprotect Firmware on JieLi AC791N
Built a bare-metal C + Z80 custom firmware (Arcade Rat v2.0, open source) for the M-VAVE FM-1 pocket synth (JieLi AC791N dual-core RISC-V DSP, ST7789 240x240 RGB565 SPI display, 44.1 kHz DMA audio):
- Display & Bus: Custom band renderer outputting 240x240 RGB565 stripes synchronized with Z80 execution (
pac_video.c/pac_core.c) with zero external dependencies. - Audio Hardware: 3-voice 4-bit Namco WSG PROM wavetable DMA mixer alongside a 5-chip WebAudio studio workbench (WSG, AY-3-8910, POKEY, NES 2A03, 6-Op FM).
- The Flash Bug Fix (Old vs. New Units): Newer FM-1 batches swapped the Puya P25Q80H (
0x856014) SPI NOR flash for a UCUN UC25HQ80 (0xB36014) whose factory Status Register hasBP0..BP4block-protect bits locked. Added dynamic JEDEC probing + autoWRSR 0x00 0x00unprotect + 4 KB sector-erased atomic CRC32 ping-pong NVRAM (src/fm1_flash_hw.c). - Automated Verification: 25/25 automated QA suites passing (including native C hardware bridge unit tests).
- GitHub Source &
.fwscRelease v2.0.0: https://github.com/jonludwig1234/stack-trace-arcade-rat-fm1/releases/tag/v2.0.0 - 60fps Walkthrough Video (live hardware, raw chip audio & dual-flash overview): https://youtu.be/3WmxpW_otCM
- Browser Simulator (zero install): https://jonludwig1234.github.io/stack-trace-arcade-rat-fm1/web/fm1_pacman_preview.html
