THIS FILE IS THE CORE (the .cor you flash). BASIC and the KERNAL moved onto the SD card in v0.56 and have their own history now -- see version_basic.txt in this folder. Anything about the POKE map, BASIC itself or .rvk loading belongs there, not here. Core v0.98 - C64 tapes, CORE_VERSION (vixen32-r6-v098.cor, 2026-11-14, md5 448a075b...) The C64's tape: a Datasette's READ line into CIA 1's FLAG from pulses the RISC-V queues (512 in half a block RAM), cycle for cycle, PLAY and the motor on the 6510's port, so turbo loaders load; c64hw b20 plays .TAP files. CORE_VERSION ($3A00023C, read-only, BCD: v0.98 = $00000098), set by the build from the label. Power LED green. RTL d06279a. Block RAM 357 of 365, LUT RAM 4,034, LUTs 33,381, DSPs 50. Setup +0.616 ns, hold +0.048 ns (try pb3_35_EarlyBlockPlacement_60). Release notes: ../vixen32-r6-v098.txt. Core v0.97 - C64: the CIAs never stand (vixen32-r6-v097.cor, 2026-11-12, md5 008ed48e...) The C64's two CIAs count every C64 cycle, also while the 6502 waits for c64hw to answer a trapped access (a cartridge bank, drive 8); they stood with it before while the VIC-II went on, which moved Wormhole's raster NMI for good. Stopped (the HELP menu) they stand as before. Power LED green. The RTL of C64-T11 (b25cb7d, board-tested as a test core). Block RAM 356.5 of 365, LUT RAM 4,034, LUTs 33,284, DSPs 50. Setup +0.504 ns, hold +0.048 ns (try pb3_30_EarlyBlockPlacement_50). Release notes: ../vixen32-r6-v097.txt. Core v0.96 - A Commodore 64 in the 8-bit CPU block, cartridges, paddles (vixen32-r6-v096.cor, 2026-11-06, md5 29bae58e...) Our own VIC-II (6569, PAL), two 6526 CIAs and the PLA beside the 6502, on VIXEN-32's SID (OSC3 and ENV3 now read back). 16 KBytes of cartridge ROM, a second ROMH bank for Zaxxon and a trap map for $DE00-$DFFF. C64 POTX / POTY on control port 1 or 2, VIC-20 $9008 / $9009. No Commodore ROMs in the core. Power LED green. The RTL of C64-T10 (c0da22f). Block RAM 356.5 of 365, LUT RAM 4,034, LUTs 33,262, DSPs 50. Setup +0.379 ns, hold +0.042 ns (try pb3_40_EarlyBlockPlacement_50). Release notes: ../vixen32-r6-v096.txt. Core v0.95 - Our own core throughout, the 8-bit CPU block, hi-res text (vixen32-r6-v095.cor, 2026-10-29, md5 0b37f045...) No third-party copyleft code left: our own SD card controller (25 MHz bus), SDRAM controller and SID; the core is closed, all rights reserved. New: the 8-bit CPU block (6502, Z80, two 6522 VIAs, the VIC 6561, YM2151, page map, context switch) with 64 KBytes at $000C0000; 8 x 256 palettes; hi-res 80 x 24 text; HDMI zoom (16:9) and scanlines, soft CRT scanlines while zoomed. The picture and the sprites now sit exactly on their coordinates (GFX x scroll 1 workarounds must go back to 0). A 32-bit CPU store to chip or Zorro RAM is one SDRAM burst: clearing 1 MByte 113 -> 62 ms. PCM samples no longer distort after long use with resets. Power LED green. Release notes: ../vixen32-r6-v095.txt; details: mega65/NOM2M.md. Core v0.94 - Without M2M: own top level, HDMI with sound, KERNEL.BIN (vixen32-r6-v094-nom2m.cor, 2026-10-26, md5 ee67382e...) The MiSTer2MEGA65 framework (QNICE, OSD, HDMI scaler, HyperRAM frame buffer) is removed; rtl/mega65/vixen_r6_top.sv wires the board to the machine. Block RAM 345.5 -> 289 of 365, LUTs 36,511 -> 23,838, DSPs 110 -> 50. Build: mega65/nom2m_build.sh (the M2M build files are deleted). 15 kHz analog PAL: unchanged, proven pin for pin against M2M's pipeline (sim/run_vga_m2m.sh) and confirmed on the 1084S. Keyboard, joysticks, audio jack: our own drivers, proven clock for clock against M2M's (sim/run_io_m2m.sh). HDMI: 720x576 50 Hz (VIC 17, 4:3), 624 lines locked to the PAL output, all 384 pixels across the 720, 48 kHz sound (sim/run_hdmi.sh decodes it as a TV would). The bootstrap loads /VIXEN-32/KERNEL.BIN (BOOT.BIN for v0.93 and older) and reads only its boot image. Drive LED = network on. No F12 menu: OSD_STATUS/OSD_SIZE read 0, virtual drives are never mounted by the core. Details: mega65/NOM2M.md. (v0.77-v0.93 are logged in ../vixen32-r6-v093.txt.) Core v0.76 - The unmount blip no longer blanks the menu for two seconds (vixen32-r6-v076.cor, 2026-08-22) QNICE firmware only, again. v0.75's hold between the zero-size strobe and the real mount was written assuming one cycle per QNICE instruction; QNICE spends about four, so "tens of milliseconds" ran for ~1.6 seconds and the OSD visibly vanished while it waited. The hold is ~80 ms now -- still a hundredfold margin over the kernel's poll -- and the menu no longer blinks. Behaviour otherwise identical to v0.75; disk-swap detection verified working there. Core v0.75 - Replacing a disk image now looks like a disk change (vixen32-r6-v075.cor, 2026-08-22) QNICE FIRMWARE ONLY -- not one line of RTL changed, and the internal CORE_VERSION register still reads 127; the .cor name is what identifies this build. THE BUG: the core derives "drive mounted" from the image-size registers being non-zero. REPLACING an image in the F12 menu writes the new size without ever passing through zero, so the mounted signal never blipped and no software could know the disk changed -- BASIC's FatFs kept the old disk's FAT and DIR printed garbage. Ejecting first (SPACE) always worked, and PEEK(45330) on BOOT.BIN 115 is what proved the difference: eject counted 2 edges, replace counted none. THE FIX (m2m-shell.asm, our fork): every vdrive mount now strobes a ZERO-SIZE mount first -- a real unmount -- holds it for ~10M QNICE cycles so the RISC-V poll cannot miss it, then mounts the new image. A fresh mount gets a redundant unmount, which is harmless. Needs BOOT.BIN 114+ to act on the edge; on older kernels behaviour is unchanged. Core v0.74 - SD reads ~3-4x faster: BURST2 on the register bridge (NUMBERING NOTE: this file had no v0.73 entry; the user's board already reports v0.73, so the burst2 core is v0.74 and the missing v0.73 log entry is a gap in this file, not in the cores.) SD_CMD (0x1F4) bit 20 = burst2: ONE clock-domain crossing fetches TWO buffer bytes ({N+1,N} in STATUS[15:0]), with the cursor sequencing done on the 50 MHz side (vih_sd_cdc.sv). A 512-byte sector is 256 crossings instead of ~1024. WHY: full-screen video streaming hit the ~520 KB/s ceiling -- high-motion Cinepak frames could not be read inside their 40 ms slot, so busy scenes played in slow motion while the audio ran on (vidplay, 2026-08-20). NOTHING ELSE CHANGED, and nothing existing can notice: the status-word layout is identical, bit 20 was previously ignored-as-zero, and every single-access command behaves exactly as on v0.72. All new logic is in the qnice clock domain -- zero new clk_sys paths, deliberately, because clk_sys timing is the tight one. SOFTWARE: fatfs/diskio.c now probes for burst support after its first successful classic read (on an old core the burst word decodes as a harmless ADDR_LO read; the probe writes a complement value there so the two answers can never be confused) and switches f_read streaming to burst2. Binaries built before this stay classic and run unchanged; new binaries also run correctly on old cores, just slower. vih_sd.h is UNTOUCHED (bootstrap tier stays classic-only). MEASURE with sdbench_b3+: RAW row = classic path, CHUNK rows = f_read = burst path -- the A/B is on one screen. Core v0.72 - The copper list holds 1024 entries (was 256) Nothing else changed. Everything that ran on v0.71 runs here unaltered: any list of 256 entries or fewer is indexed, counted and executed exactly as before. WHY IT HAD TO GROW. Since v121 the copper applies EVERY entry due on a scanline, not one per line -- which is what makes real per-line effects possible, and which quietly changed the budget from "one per line" to "entries per line x lines". A four-layer starfield that sets a sprite's X on each of 192 visible lines needs 768 entries on its own. 256 was the first ceiling you met, and it was met. VIH_COPPER_WR_ADDR now takes 0..1023, VIH_COPPER_CNT 0..1024. vih_copper_set() / vih_copper_run() in vih_regs.h are updated; no source change is needed for existing lists. ARM NO MORE ENTRIES THAN YOU WROTE. Unwritten entries read as zero, and a zero entry means "line 0, register 0, value 0" -- register 0 is BORDER_DIMS, so an over-long count blanks all four borders. Before v0.72 an over-long count harmlessly replayed early entries instead, so this is the one way a badly behaved program could notice the change. Cost: about 6 KB more block RAM (68% used, was 66%) and a little timing margin -- setup slack +0.085 ns -> +0.049 ns, still comfortably positive. The size is one constant, COPPER_ENTRIES in rtl/native_video_reader.sv; every index and mask derives from it, so it can be put back with a one-line edit. Core v0.71 - Virtual floppy drives A: and B: Mount a disk image from the F12 menu, the way every other MEGA65 core does it. Two drives, labelled A: and B:, read AND write, 512-byte sectors. .IMG files now show in the browser alongside .RVK/.BAS/.PRG. MOUNTING IS INSTANT. The framework normally copies the whole image into a RAM buffer at mount time (that is what the progress bar in other cores is). A 1.44 MB image needs 1.44 MB of QNICE-addressable RAM, which this machine does not have and cannot get. So the QNICE side was rewritten: mounting opens the file, and each sector is a seek into it. Writes go into the image file as they happen and are flushed immediately -- there is no cache to lose. VIH_DISK_A_LBA 0x3A0002A0 RISC-V only, write; sector number VIH_DISK_A_CTRL 0x3A0002A4 RISC-V only, write; 1=read 2=write VIH_DISK_A_STATUS 0x3A0002A8 RISC-V only, read; [0]=busy [1]=mounted [2]=read-only VIH_DISK_A_SIZE 0x3A0002AC RISC-V only, read; bytes Drive B: is the same block at 0x3A0002B0..0x3A0002BC. Sector buffers: 0x3A101000 (A:), 0x3A101200 (B:), 512 bytes each, 32-BIT ACCESSES ONLY -- same rule as the Ethernet packet buffers, and for the same reason. C API: vih_disk.h -- vih_disk_read(drv, lba, buf) / vih_disk_write(drv, lba, buf), 0 = OK. Test app: disktest. A write returning means the sector reached QNICE and was flushed, not that the card has finished its own housekeeping. Speed: every sector is a QNICE round trip. Right for a directory, a LOAD or a boot block; the SD path (vih_sd.h) is still the one for streaming assets. Core v0.70 - Two hangs fixed, both older than they looked F12 NO LONGER KILLS THE KEYBOARD. Closing the OSD walked every virtual drive's write cache in a loop that used one register both as the drive index and as the value read back, so the index never advanced and QNICE spun forever. It only terminates when a core has exactly one virtual drive, which is why it survived upstream and why VIXEN hit it with two (and earlier with three). Settings now save and survive a power cycle with the drives present. A COMMAND COULD BE SWALLOWED BY THE CONTROL BRIDGE (fixed in v0.71, listed here because it is the same investigation). The bridge raised its ready line while still finishing a tile-map write, which on this bus means "accepted" -- but nothing serviced the command. A read then waited for a response that never came and the CPU froze; a write was silently dropped. It needed the arbiter to grant in exactly that cycle, so it was a race that had been in the machine for a long time, hitting anything that read a register on the instruction right after a tile-map write. Costs one clock on a tile-map write. Timing margin went UP (+0.015 ns -> +0.085 ns): the fix removes logic. Core v0.69 - Superseded by v0.70/v0.71, do not use First build with the drives wired up. The two hangs above make it unusable; kept only so the bisect step exists. Core v0.56 - The machine boots from the SD card THE KERNEL IS NO LONGER IN THE CORE. The bitstream now holds a small bootstrap whose only job is to load /VIXEN-32/BOOT.BIN off the card and hand over to it. BASIC, the KERNAL and everything else live on the card. Changing them is a FILE COPY. No Vivado, no reflash, no 40-minute build. That was the whole point of the exercise. BOOT.BIN MUST BE ON THE CARD. There is no fallback: a missing or unusable image gets a red-bordered screen saying what failed, and the machine STOPS. Fix the card and power cycle. A machine that quietly booted something else would be worse, because you would think your BOOT.BIN had loaded. Error codes E01..E09 and the border-colour meanings are in the Chipset Reference, chapter 10. Briefly: E01 no card E02 no filesystem E03 BOOT.BIN not found E05 card read failed E06/E08 image bad or damaged Once the handover happens the border is the only diagnostic left -- BRAM, and with it the screen code and the font, is wiped. Red = started, orange = RAM cleared, cyan = unpacked and jumping. Sitting on a colour means it stopped there. ALSO: BL_LOCK (RAM word 0x0C) now RESETS open, so the bootstrap can write all of BRAM including the top 8KB -- which it must, to put the kernel there. THE MACHINE YOU ACTUALLY GET IS UNCHANGED: the top 8KB is locked again before the kernel or any .rvk is given control, exactly as on every earlier core. Nothing an app sees has moved. Worth knowing in general: a locked block does NOT fault. The write is silently discarded and reads still pass, so it looks like RAM that accepts writes and forgets them. (v0.51 to v0.55 were steps along the way and are superseded.) Core v0.50 - SD card: the machine can read its own card VIXEN-32 can now read the SD card directly, without asking QNICE for anything. That is what lets a program open a file and read from it -- and what lets the machine boot from the card instead of from the image baked into the core. VIH_SD_CTRL 0x3A0001F0 RISC-V only, write; bit 0 = claim VIH_SD_CMD 0x3A0001F4 RISC-V only, write; one access VIH_SD_STATUS 0x3A0001F8 RISC-V only, read C API: vih_sd.h -- vih_sd_claim(), vih_sd_reset(), vih_sd_read_block(lba, buf). Sector-level, 512 bytes. On top of that, vih_fat.h is a read-only FAT16/FAT32 layer: fat_mount(), fat_find("/VIXEN-32/FILE.DAT"), fat_read() with a byte offset -- so random access into a big data file works, which is what game assets need. Short 8.3 names only. VIXEN has its OWN SD controller rather than sharing QNICE's, and only one may drive the card's pins at a time. Claim it, use it, RELEASE IT. A program that keeps it locks QNICE out and the F12 file browser stops finding files. Speed: ~360 KB/sec raw, ~383 KB/sec through the filesystem. Fine for loading; the limit is that every byte crosses the register interface, not the card. Do not design a streaming asset loader around this figure without widening it first. Test app: sdtest -- hex sector viewer, F1 checksum-compares 500 sectors across passes, F2 times a 16 MB read, F3 mounts and read-tests the filesystem. BOOTING FROM THE CARD: risc/sdboot loads /VIXEN-32/BOOT.BIN, zeroes all 512 KB of BRAM and unpacks the image into it, so the kernel can be changed by copying a file -- no core rebuild. It runs as an ordinary .rvk for now; a reset always brings back the image baked into the core. (v0.48 and v0.49 were development steps and are superseded.) Core v0.47 - Amiga mouse on port 1 (and paddles are gone) A 3-button Amiga mouse plugged into joystick port 1 now works, with smooth quadrature movement on both axes. VIH_MOUSE 0x3A0001EC RISC-V only, read. [7:0] X, [15:8] Y -- FREE-RUNNING counters that wrap at 256, exactly like the Amiga's JOY0DAT: subtract your previous reading to get the movement since then. Nothing is cleared by reading, so a read cannot land between two steps and lose a count. C API: vih_mouse() and vih_mouse_delta(). [16] left, [17] right, [18] middle. Left and right are solid; middle depends on the mouse and did not assert on the optical one tested here, so do not make it the only way to do something. [19]..[25] expose the raw DB9 pin states live, for diagnosing a mouse that misbehaves. THE CATCH, and it is a real one: PADDLES ARE NOW DISABLED ON BOTH PORTS. The MEGA65 framework's paddle sampler runs all the time whether or not anyone wants a paddle, pulling DB9 pins 5 and 9 low for 256us out of every 514us to discharge the paddle capacitor. An optical mouse drives those same pins from its own MCU, so the two fight: no button worked at all, and the X axis stalled and jittered while Y was perfect. Turning the drain off fixed every symptom at once. Paddles and a mouse cannot share the machine, and the mouse was judged worth more. A joystick in port 1 still works exactly as before -- only the paddle drain was removed, nothing else about the port changed. Test app: joytest.rvk -- both joystick ports, mouse position, buttons, and a mouse pointer sprite. Core v0.43 - Joystick port 2, and both ports now read the same way The MEGA65 has two joystick ports; only port 1 ever reached the core. Port 2 is now wired up and readable. VIH_JOYSTICK2 0x3A0001E8 RISC-V only, read; 1 = pressed. Same bit order as port 1 (down=0 up=1 fire=2 right=3 left=5), so both ports are read identically. It is not next to port 1 at 0x180 because 0x184..0x1D4 were already taken. C API: vih_joystick1() / vih_joystick2(), both returning the same vih_joystick_t. The older VIH_JOYSTICK and vih_joystick() still work, so existing programs are unaffected and need no change. Internally port 1 no longer detours through the video reader (a leftover from when it came off asynchronous pins) -- both ports now take the same, shorter path. No visible difference, but it removed logic: timing margin went UP, not down. Test app: joytest.rvk -- shows both ports live, border turns green while any direction or fire is held. Core v0.42 - New character set: MEGA65 font, and the V32 boot logo The built-in character ROM is no longer the Commodore C64 set. It is now the MEGA65 8x8 ASCII font BY DEFT, used with kind permission -- greetings and thanks, deft. It brings REAL LOWERCASE, which the C64 uppercase charset has none of, so lowercase used to come out as capitals. Every character you read on this machine is deft's work. Codes $A0-$D4 hold the V32 logo, cut into 8x8 cells: the boot logo is ordinary TEXT, printed with per-cell colours, so it scrolls away like anything else. Codes $D5-$F7 are still free. The C64 block graphics that used to sit at $80-$FF are gone; nothing in the machine drew them. Boot screen: V32 logo with the machine banner beside it, and EhBASIC's start-up chatter (the (C)old/(W)arm prompt, memory size, bytes free, version line) is hidden. "Ready" appears directly under the logo, spelled as EhBASIC spells it. Default BORDER COLOUR is now yellow (7), was light blue (14). Console text is now WHITE (1), was light blue (14). No register changes; all programs run unmodified. A program that uploads its own BRAM font is unaffected either way. NOTE: v0.40 and v0.41 were intermediate builds of the above and should not be used -- v0.41 in particular cannot load any .rvk at all (see below). v0.42 is the first good one. Fixed in v0.42: every .rvk failed to launch with "?RVK TOO BIG" / "?RVK SDRAM BLOCK TOO BIG" regardless of its size. The resident BASIC's .bss had grown past the RVK staging base, and both size checks refuse everything once it does. Staging moved 0x20000 -> 0x21000 (code cap 292KB -> 288KB). Core v0.38 - CPU upgrade 2: single-cycle barrel shifter A shift now takes 1 clock regardless of distance (was 1 clock PER BIT: a shift by 16 cost ~16 clocks). Biggest win for Q16.16 fixed-point math (Out Run road, 3D code). Combined with v0.37: 42% fewer cycles than v0.36 on the CPU benchmark, identical results proven in simulation. No register changes; all programs run unmodified, just faster. Core v0.37 - CPU upgrade 1: result forwarding An instruction can now use the previous instruction's result immediately instead of stalling several clocks (36% fewer cycles measured on dependent-code benchmark). No register changes; all programs run unmodified, just faster. Core v0.36 - SDRAM cache timing fix (cache storage moved to true block RAM). First core where the whole design meets timing with real margin. No functional change vs v0.34/v0.35. Core v0.35 - Instant boot: removed a dead 2-second wait at power-on (leftover poll of a MiSTer-era "Boot Mode" flag that is hard-wired 0 on the MEGA65). BASIC now starts immediately. The old ARM/MiSTer target was fully removed from the project. Core v0.34 - CPU data cache for SDRAM: chip RAM as normal pointers 0x40000000 16 MB window: SDRAM readable/writable directly by the CPU (32 KB cache, write-through). uint8_t *p = (uint8_t*)0x40000000; p[x] = ... VIH_CACHE_INVAL 0x3A0001E4 RISC-V only, write; any value invalidates the cache. Needed ONLY after the BLITTER writes memory the CPU may have cached (CPU writes are always visible immediately). Old vih_sdram_read() path unchanged and still available. C API in vih_regs.h: VIH_SDRAM_MEM, vih_sdram_ptr(), vih_cache_invalidate(). Test app: cachetest.rvk (green border = pass). Core v0.33 - Add blitter textured RECT (one-op scaled sprite) BLIT_CTRL 0x3A0001B0 bit [17] = rect mode on a textured span Draws DIMS.height rows in one op: u restarts at BLIT_TEXU each row, v steps by BLIT_TDV per ROW (not per pixel), dst advances by width + dst_mod bytes per row. Colour key / CBASE / LUT as on a normal textured span. A whole zoomed sprite = ONE blit instead of one per pixel row. Old programs unaffected (new bit, everything else unchanged). Core v0.32 - Add blitter one-deep op queue BLIT_STATUS 0x3A0001B4 bit [1] = pend (op queue occupied), bit [0] = busy as before A blit started while the blitter is busy is no longer ignored: its parameters are latched and it auto-starts when the current blit ends. Wait for pend = 0 instead of busy = 0 to overlap CPU and blitter. Old programs that wait for busy = 0 work exactly as before. Core v0.31 - Add blitter BLIT_LUT (color remap table) BLIT_LUT 0x3A0001D4 RISC-V only, write; [31] = 1: enable = [0], [31] = 0: lut[[15:8]] = [7:0] 256-byte lookup applied after BLIT_CBASE on COPY/TEXSPAN pixels: value stored in FB = lut[pixel + BLIT_CBASE] Lets a 0-15 valued bob land on any entries in the 256 color palette (global palette schemes). Disabled at boot = v0.30 behaviour. Core v0.30 - Add blitter BLIT_CBASE BLIT_CBASE 0x3A0001D0 RISC-V only, write; [7:0] = base added to drawn pixels, 0 = legacy Blitter can now add color offset to a pixel value. Ex. If pixel value is 0x40 and BLIT_CBASE = 0x10 then value stored in FB = 0x10 + 0x40 Without this then Out Run would have had a hard time running. Core v0.29 - First release