mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-10-25 00:02:16 +00:00
Cherry-pick the upstream bug fixes that apply to the old-generation chip
headers this fork still carries (13 commits, one per fix, each with a
"(cherry picked from commit ...)" trailer):
m6502: wrong irq/nmi pipeline bit positions (NMI timing), the NMI
instruction hijacking fix (nmi_pip widened to 32 bits), and the
matching codegen template/gen.py changes
m6526: PA/PB input latch, port B reads, latch writes in the reload
cycle, timer B interrupt flags, ICR mask write in the underflow
cycle, and ICR bit 7 vs. the /IRQ output line
zx: Sinclair joystick fire button (was wired to "right")
cpc: z80_reset() when loading a .sna, upd765 assert that fired in
the CRTC demo
ay38910: envelope shape 15
i8255: port output pin mask (used by the CPC)
Left alone (needs a real port, not a cherry-pick): the am40010 CCLK/READY
phase fixes and mode 3, because this fork's am40010_tick() was restructured
to take a tick count for the instruction-stepped Z80 with WAIT accounting.
The fork's probe hooks (logStackPush/Pop, logExec) and the SID register
read-back stay intact.
Also fixed c64 stuck joystick problem:
The keyboard matrix lines are driven by the CIA output latch, not
by the external pin level: since the port read model lets a
grounded joystick line pull an output pin low, using the raw pins
here makes joystick 2 hold a keyboard scan line active (and the
IDE feeds arrow keys to both the joystick and the cursor keys).
Use the latch for output bits, the pin only for input bits.
res/<platform>/*.wasm are rebuilt from chips/wasm/*.c. Note the c64/cpc/zx
blobs also move to a newer clang than the ones previously committed
(109771/93695/84361 bytes), so part of their size change is toolchain, not
this patch.
Verified: base-vs-new screenshots are byte-identical for c64 (hello,
scroll1, test_setirq, musicplayer, allow joymove+key), vic20 (siegegame),
zx (hello, cosmic) and cpc.464 (easy_mode_strings); test-platforms,
test-cli and test-node pass (the one test-node failure, urust
include_bytes!, reproduces with the old wasm).
res/ — machine firmware and BIOS images
Per-platform firmware blobs and resources, loaded by fetch().
res/<platform>/<name>.wasm machine core compiled to wasm (c64, cpc, vic20, zx)
res/<platform>/<name>.bios default BIOS/kernel ROM for that core
res/atari8/altirra/ Altirra kernels (.rom) and their debug listings
res/x86/ SeaBIOS/VGA BIOS and the FreeDOS floppy image
res/common/ files shared by platforms
How files are loaded
| Directory | Loaded by |
|---|---|
c64/, cpc/, vic20/, zx/ |
src/common/wasmplatform.ts fetches res/<prefix>/<prefix>.{wasm,bios} |
atari8/altirra/ |
src/platform/atari8.ts |
x86/ |
src/platform/x86.ts |
common/ |
src/platform/basic.ts |
The browser IDE serves this directory as static files; the VS Code extension
ships it in the base asset pack. Everything except the Altirra debug listings,
the x86 images and the CPC and VIC-20 files is included (see src/tools/exclusions.ts).
Provenance
-
c64.bios, vic20.bios — built from open-roms:
git clone https://github.com/MEGA65/open-roms cd open-roms && make && cd build cat basic_generic.rom chargen_openroms.rom kernal_generic.rom > c64.bios -
atari8/altirra/* — kernels and listings from the Altirra emulator
-
zx.bios -- SEBASIC 3.1.2 open source ROMs
-
cpc.bios — from https://github.com/floooh/chips
-
x86/* — SeaBIOS, VGA BIOS and FreeDOS image; x86 is not offered by the VS Code extension.