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).
The VIC-I draws a fixed 22x23 character window, centered in the picture.
The emulator used the VIC-II's display window registers, so the window was
placed at a garbage offset: the first character column was clipped in half
and the whole picture was shifted 24 pixels to the right to hide it.
- the new emulator core (chips) centers the window and takes its vertical
position from the ROM, so NTSC and PAL ROMs both work
- the 24 pixel video shift is gone
- the platform loads res/vic20/vic20.bios (a real ROM set) when it is
available, and falls back to the stub BIOS otherwise
- a regression test checks the geometry of the rendered frame