VIXEN-32 kernel (kernel + EhBASIC) version history ================================================== The kernel is the machine's kernel, KERNAL and EhBASIC. From core v0.56 it lives on the SD card, NOT in the core, so it has its own version history -- this file. version.txt in this folder is the CORE. From core v0.94 the file is /VIXEN-32/KERNEL.BIN: the kernel image followed by VMOS, the file browser, the VIC-20, the commander and the C64. Cores up to v0.93 load the kernel image on its own as /VIXEN-32/BOOT.BIN, and that is the name the older entries below use -- the build numbers are the same. Copy KERNEL.BIN to /VIXEN-32/ on the card and power cycle. No core flash is needed for anything listed here. Which one do I need? Where an entry needs a newer core it says so. BASIC v1.8 - TFTP: the SD card never leaves the machine (BOOT.BIN build 89) TFTP ON start the server TFTP OFF stop it NET shows ON / BUSY and files moved From a PC: tftp -i 192.168.5.69 put game.rvk tftp -i 192.168.5.69 put boot.bin BOOT.BIN tftp -i 192.168.5.69 put data.bin tftp/DATA.BIN tftp -i 192.168.5.69 get README.TXT A:NAME and B:NAME go into the mounted disk images; a bare name goes on the SD card under /VIXEN-32/, subfolders included. A leading slash or ".." is refused, so a write from the network cannot land anywhere else on the card. Files are overwritten without asking -- re-uploading something you just rebuilt is what this is for. UPDATING BOOT.BIN NO LONGER MEANS TOUCHING THE CARD: upload it as BOOT.BIN, read it back, compare, power cycle. Measured 64-69 KB/s on a 1 MB file, verified byte for byte; an 80 KB BOOT.BIN takes about six seconds. The server lives in the network module and reaches files through the kernel table's disk entries -- one module calling another without either knowing the other exists. It serves from the same poll that answers pings, so no app is needed; a .rvk game takes the machine and stops it, like everything else BASIC-side. An abandoned transfer is dropped after ten seconds of silence, which every packet resets. Build 88 is byte-identical to 87 (a failed patch) -- use 89. BASIC v1.7 - The machine is on the network (BOOT.BIN build 85) SHIFT + POUND switches the network on, MEGA65-style. The machine boots with it DOWN and joins only when asked -- a retro computer should not reach the wire because someone turned it on. SHIFT+POUND on, and off again NET link, address, gateway, DNS, counters PING 192.168.5.1 round trip, in microseconds PING GOOGLE.COM ...or by name DHCP, DNS, ICMP, UDP, ARP and IPv4, living in SDRAM as a kernel module -- BASIC carries no network code at all and an app gets the stack without linking one. Kernel table entries -34..-44. TCP is not written yet. IT ANSWERS PINGS AT THE READY PROMPT, and while a BASIC program runs, with no effect on the screen: the video is hardware and a reply costs a few hundred microseconds of a 20 ms frame. /VIXEN-32/NETWORK.TXT configures it, and can be edited on a PC: ip: 192.168.5.77 or ip: dhcp mask: 255.255.255.0 gw: 192.168.5.1 dns: 8.8.8.8 mac: AA:AA:AA:AA:AA:A1 optional # hash comments are ignored No file means DHCP and the built-in MAC. THE MAC LINE MATTERS IF YOU HAVE TWO OF THESE: the built-in address is fixed, so two machines would clash on one network. An explicit dns: line beats the one a DHCP lease supplies. Measured on hardware: gateway ping a few hundred microseconds, Google 26 ms -- the same number Windows reports for the same host. Builds 57-84 are the steps that got here, kept for bisecting. BUILDS 78 AND 79 ARE BYTE-IDENTICAL TO 77 and should not be used: BASIC had outgrown the 48 KB compressed payload slot, the generator refused to emit a bigger one, and the build carried on packing the previous BASIC. The slot is 64 KB from build 80, taken from the KERNAL reserve. BASIC v1.6 - Bootable disks (BOOT.BIN build 56) MOUNT A DISK AND IT BOOTS. If sector 0 of a disk mounted in A: carries the signature "V32B" at offset 0x3E, the sector is copied to $A000 and entered at $A042. No prompt, no key to hold: the disk decides. A power cycle clears every drive, so a bad boot block costs one power cycle and nothing else. ONLY A: BOOTS. The same disk in B: is just data, so a bootable disk can be listed and copied from safely. Booting only happens while BASIC is idle at Ready -- a disk mounted during a running program is remembered and boots when the program ends, rather than killing it mid-run. THE BOOT BLOCK IS 6502 CODE, 450 bytes of it, and it reaches the drive through new registers in the POKE map: $B0B0 drive $B0B1-B3 sector (LBA) $B0B4 count $B0B5-B6 target $B0B7 bank: 0 = 6502 RAM, 1 = SDRAM staging (512-byte units), which is where a .RVK belongs $B0B8 write = go, read = result (0 = ok) So a boot block can load 6502 code and JMP to it, or stream a RISC-V .RVK into SDRAM and hand the machine over with POKE $B0F0,1. Both are demonstrated in risc/bootdisk/. THE DISK STAYS A NORMAL DISK. Only the boot sector's code area (0x3E on) is written, so the BPB survives and the disk mounts, DIRs and takes files as usual. In the .RVK example the payload is an ordinary FILE -- it shows up in DIR -- and the packer patches the boot sector with the file's first sector and length, so 450 bytes of 6502 can stream it with no filesystem code at all. Writing boot code? Two things that will catch you: $FFD2 is a C64 KERNAL address and does not exist here (character output is JMP ($0207)), and the console wants CR *and* LF. BASIC v1.5 - DIR, CD, DEL, MKDIR, MOVE, COPY (BOOT.BIN build 54) SIX NEW COMMANDS, and they are REAL KEYWORDS -- not typed lines intercepted before BASIC sees them, so CTRL slows a listing, NO SCROLL pauses it and RUN/STOP stops it, exactly as they do for LIST. DIR DIR B: DIR DATA CD DATA CD \ CD B: CD DEL NAME MKDIR NAME COPY SRC DST MOVE OLD NEW Arguments are separated by a SPACE, DOS style, so a filename cannot contain one. A destination that names no file takes the source's: COPY FILE B: keeps the name, and so does COPY FILE DOC when DOC is a directory -- that is DETECTED, so the trailing slash is optional. MOVE is a rename and stays on one disk; across drives it says so rather than silently copying megabytes. There is a CURRENT DRIVE now, as DOS has: a bare CD B: moves you there and everything without a drive letter follows. A drive letter on a command is a one-off -- DIR B: lists B: and leaves you where you are. CD on its own prints where you are; DOS has no PWD and neither does this. Each drive remembers its own directory. NO EXISTING TOKEN MOVED. EhBASIC's keywords end at $E5; these are $E6 upward in a VIXEN extension block with its own table, reached by ten bytes of added dispatch. Every .PRG saved before this still loads, and the next keyword costs two table lines and no interpreter change. $FF is reserved as an escape for the day the 26 spare tokens run out. HOW FAST ARE THE DRIVES? Two measured figures, an order of magnitude apart: raw sector read 37 KB/s 13 ms/sector COPY between images 3.5 KB/s ~140 ms/sector The first is a boot block reading 141,388 bytes in 3.7 s, timed by the machine's own jiffy clock; the second is a 790,148-byte COPY at 3 min 41 s. A copy pays for a read AND a write of every sector plus FatFs updating the FAT and the directory, which is where the difference goes -- not the drive itself. Raw reads are floppy-speed: between an Amiga drive (~25 KB/s) and a PC 1.44 MB drive (~30-45 KB/s). Bulk game data still belongs on the SD card via vih_fat/FatFs (~360 KB/s). BASIC v1.4 - LOAD and SAVE to a disk, and a kernel that has a filesystem (BOOT.BIN build 43) LOAD AND SAVE, FROM BASIC, TO A MOUNTED DISK. SAVE "TEST" to drive A: LOAD "TEST" LOAD "B:GAME" drive B: The file format is the same .PRG the F12 menu loads -- two bytes of load address, little-endian, then the bytes -- so a program saved from BASIC can be loaded from the menu and a .PRG dropped onto a disk image can be LOADed. LOAD DOES NOT RUN. It loads and lists, and you type RUN, exactly as the menu slot behaves. Errors say what happened: ?FILE NOT FOUND, ?FILENAME MISSING, ?NOTHING TO SAVE, ?WRITE ERROR. There is no DIR yet. EhBASIC has LOAD and SAVE as keywords already -- they were empty vectors waiting for a machine to fill in -- but it has no DIR keyword at all, so that one is a bigger change and comes later. THE KERNEL NOW HAS A FILESYSTEM, AND A TABLE TO REACH IT. Everything above goes through a kernel call table at the top of RAM: BASIC contains no filesystem code whatsoever. The table is the C64 KERNAL's idea, including the part that matters -- it is anchored at the TOP of memory and grows DOWNWARD, so an entry's address never changes as new calls are added. Disk services occupy the first 23 entries: sector read/write/status/size, whole-file read/write, exists, size, directory listing, open/read/write/seek/close, delete, rename, mkdir, label, free space. FatFs itself lives in SDRAM as a KERNEL MODULE, not in the 8 KB kernel: the last megabyte of chip RAM is now sixteen 64 KB module slots, and BOOT.BIN carries the module as a third block. It costs no BRAM at all. Four drive units are defined -- A:, B:, a hard-disk image that does not exist yet, and the SD card itself -- each a row in one table, so a physical floppy drive would be one more row. Long filenames, mixed case and subdirectories all work. RUN/STOP + RESTORE NOW RESETS THE WHOLE MACHINE, not just the colours. It used to leave sprites on screen over the Ready prompt. Now: all sixteen sprites off, bitmap layer off, tile layer on and in front, copper list dropped, font and tile map back to boot, scroll and border dimensions back to boot, the palette restored, and the PEEK shadows reset to agree with what is on screen. It also puts the INTERRUPT CODE back. The 6502's IRQ and NMI handlers live in RAM (page 2) where a program can overwrite them, and a warm start does not restore them -- so a program that installed its own handler used to leave a machine that crashed later for no visible reason. BASIC keeps a copy taken at start-up and puts it back. Builds 37-42 are the steps that got here and are kept in the archive for bisecting; 43 is the one to use. BASIC v1.3 - Load a .PRG, and a way out of a program that will not stop (BOOT.BIN build 36) LOAD PRG. The F12 menu has a third slot, "Load PRG:", which loads a C64-style .PRG: the first two bytes are the load address, little-endian, and the rest goes there. IT DOES NOT AUTO-RUN. It loads and lists like a program you typed in, and you type RUN yourself. If the file loaded at BASIC's start of program text ($0301), the kernel walks the line links and points start-of-variables just past the null link -- so LIST, RUN, SAVE and everything else behave exactly as if the lines had been typed. BASIC KNOWS NOTHING ABOUT MACHINE CODE ABOVE THAT, and that is deliberate. A .PRG may carry assembly after its BASIC text -- the classic stub-plus-code layout, 10 CALL $310 and the code at $0310 -- and BASIC's end-of-program covers ONLY the BASIC lines. Whatever later overwrites the machine code (a variable, a longer line) is the programmer's business, exactly as it was on the machines this imitates. Needs core v0.68 or newer: the .PRG menu slot is in the core. RUN/STOP + RESTORE, the C64 panic escape. Resets the border and background to the boot colours, clears the screen, and leaves you at a "Ready" prompt with the cursor below it. This is NOT Ctrl-C. RUN/STOP alone asks a BASIC program to stop and CONT can resume it. RUN/STOP + RESTORE does not ask: it jumps the 6502 to EhBASIC's warm start. So it also gets you out of MACHINE CODE THAT NEVER RETURNS -- an assembly routine looping forever, which nothing else could escape short of a power cycle. A paused LIST, a half-typed line and any keys BASIC had not read yet are all dropped on the way out, so what you get is a clean prompt rather than a prompt with yesterday's input still queued behind it. (Builds 33 to 35 were steps towards the above and are superseded.) BASIC v1.2 - The editor becomes a real C64-style editor (BOOT.BIN build 32) THE BLANK LINE BEFORE "Ready" IS BACK -- but only where a C64 has one. It belongs after NEW and after PRINT, and not after LIST. Both leave the cursor at column 0, so the difference is not in the Ready message at all: a C64's LIST does not end with a newline, so the cursor is still on the last listed line when Ready prints. EhBASIC printed its newline at the TOP of the listing loop, before checking whether another line existed, so the final pass emitted one and only then discovered it was finished. Testing for the end first makes that newline a separator BETWEEN lines instead of a terminator AFTER them. (An earlier attempt made Ready's own newline conditional, which removed the blank line everywhere -- right for LIST, wrong for everything else.) A COMMAND TYPED WITH LEADING SPACES NO LONGER EATS THE REPLY. Entering a line asks for the next N printed characters to be swallowed, since they are BASIC echoing back a line already on the screen. EhBASIC DISCARDS LEADING SPACES WITHOUT ECHOING THEM, so such a line echoes short and the leftover suppression ate the front of the next output: " LIST" answered "eady". The echo always ends with a newline, so anything still owed at that point is now dropped. INST AND DEL, and they work on the LOGICAL line, not the screen row. DEL pulls the rest of the line left; INST (SHIFT+DEL) opens a space and pushes it right, growing the line to a second row and shifting what is below down to make room. INST REFUSES once the line is full at 80 characters rather than pushing the last one off into nothing -- a lost character you would not notice until the line no longer said what you typed. Deliberately NOT copied: the C64 "insert mode", where control codes become reverse graphics until the opened space is filled. That is where the unprintable characters in C64 listings come from. You get the insert without the mode. A LOGICAL LINE STOPS AT TWO ROWS. It used to link rows forever, so 120 typed characters made one 120-character line and DEL dragged all three rows around together. Run off the end of the second row and a new line starts, as on a C64. TYPING off the end of a row pushes the lines below DOWN to make room instead of swallowing the next one. Only while typing: BASIC printing has to keep flowing, or LIST would shuffle the screen about as it went. NO MORE BLANK LINE BEFORE "Ready". This one was in the 6502 ROM: LAB_RMSG began with an unconditional CR/LF, so after LIST -- which already ends on a fresh line -- there was always a blank one. EhBASIC tracks the cursor column in TPos, so the newline is now printed only when the cursor is not already at column 0. Deleting it outright would have made "Ready" run onto the end of a line after PRINT "X";. NO MORE BLANK LINE UNDER AN EDITED LINE. Enter used to trim trailing spaces from the last screen row only, so shrinking a two-row line stored it PADDED to exactly 40 characters. LIST then printed 40, the row wrapped by itself, and BASIC's newline landed a row lower -- a blank line under that program line for the rest of its life. Trailing spaces now come off the end of the whole line. ALSO FIXED, and worth knowing about: the cursor is shown by sampling the 6502's PC to see whether BASIC is in its input loop, which means the console holds ROM ADDRESSES. Changing the ROM above moved them 11 bytes and the cursor began vanishing until the next keypress. They are now generated from the assembler listing, so they follow the ROM automatically. Needs core v0.56 or newer. BASIC v1.2 (earlier builds) - the same release, as it stood at build 22 THE SCREEN IS 25 ROWS, NOT 24. It always was -- the console only claimed 24 of them, so the bottom row was on screen but nothing could be printed there and the cursor could not be moved onto it. Screen geometry is UNCHANGED: border 32/32/12/12 and scroll (1,4) exactly as before, boot logo identical. The extra row appears at the bottom, where it already was. 80-CHARACTER LINES, like a C64's two-row logical line. The 40-column limit was the editor's, not BASIC's: RETURN fed it one screen row. It now tracks which rows are CONTINUATIONS of a line -- set when the cursor ran off the right edge, cleared when something printed a newline -- and submits the whole line. Works for LISTed lines too, so cursor up onto a long line, edit it, RETURN re-enters all of it. Backspace steps back onto the previous row, or an 80-character line could be typed but not corrected. This needed the 6502 ROM: EhBASIC's input buffer went from 71 to 80 bytes ($0221-$0270). ONE BYTE of the ROM changed, at $C26E. Rebuild it with 64tass 1.54.1900 -- rebuilding the UNCHANGED sources reproduces the old image byte for byte, which is the check to run before touching it. CURSOR KEYS WRAP AT THE SCREEN EDGE, on any line including an empty one, because the screen edge is not the edge of anything the cursor cares about. Right off the last column goes to column 0 of the next row; left off column 0 goes back to column 39 of the row above; down on the bottom row scrolls. Moving the cursor does NOT join two lines into one logical line -- only typing or printing past the edge does that. CTRL SLOWS "LIST", NO SCROLL PAUSES IT. RUN/STOP still breaks out of either, including out of a pause. The wait is per line, not per character: a jiffy is 20 ms and that is the finest delay available, so per character would be 50 characters a second -- unreadably slow rather than readably slow. HOME AND CLR WORK, and so does PRINT CHR$(147), which never did before: the output path only passed codes 32-126, so every clear-screen in every program so far was silently dropped. THE CURSOR MOVES BY NUMBER, NOT BY MAGIC CHARACTER. POKE 45220,col : POKE 45221,row put the cursor there POKE 45222,1 clear and home POKE 45222,0 home PEEK the same two addresses to find out where it is -- which a C64 cannot do at all. PEEK(45280)/PEEK(45281) = the last key code and whether it is still held. The MEGA65 sends 128 + C65 matrix keynum, NOT a PS/2 scancode, so this is how you find a key's code instead of deriving it and getting it wrong. risc/test_keys.bas. Test programs: test_80col.bas, test_home.bas, test_keys.bas, test_rows.bas. Needs core v0.56 or newer. BASIC v1.1 - BASIC IS NOW TWICE THE SPEED OF A C64 (BOOT.BIN build 11) The emulated 6502 went from 1.36 MHz to 3.08 MHz, and BASIC from 0.96x a C64 to 2.01x. Nothing about the machine changed -- the same EhBASIC, the same opcode behaviour, byte for byte. What changed is how the emulator is compiled. In order of what each was worth: - memory access was an out-of-line call costing 31 instructions to do one array load, 2-5 times per instruction. Now inline. - the tick counter was a 64-bit variable holding a number that never exceeds 8, on a 32-bit CPU. - the 6502's seventeen state variables were scattered, so the compiler spent SIX registers on base addresses. Packed into one struct: +30% on its own. - the state is now a local of the run loop, threaded through all 106 routines, so the 6502's registers live in the CPU's registers instead of in RAM: another +20%. HOW IT WAS PROVED SAFE. Rewriting a 6502 by hand is how you get a bug that surfaces months later inside somebody's program. So the change was applied by a script (tools/refactor_6502_state.py) and then checked, not argued about: risc/fake6502/difftest builds the old and new emulators against the real EhBASIC ROM, runs the same program in both, and hashes the FULL CPU state after every instruction. 80,000,000 instructions, identical state hash and identical memory hash. It found two real breakages on the way, both of which compiled perfectly. NEW READS. $B090/1 ($B090 first) 50 Hz jiffy clock $B092-5 ($B092 first) emulated 6502 cycles run -- so cycles/seconds tells you the speed directly $B09F BOOT.BIN build number. There is no version on the boot screen, so this is how you confirm the card actually took the image you copied. Test programs: risc/test_speed.bas, risc/test_ipc.bas. MEASURED, FOR ANYONE TUNING THIS FURTHER: on this CPU a plain instruction costs ~0.94 clocks, a LOAD ~1.94, and a TAKEN BRANCH ~5.25. There is no branch predictor. Optimise for fewer taken branches before fewer instructions. Needs core v0.56 or newer. BASIC v1.0 - First BOOT.BIN released separately from the core Everything below used to require a 40-minute core rebuild and a reflash. Now it is a file copy. POKE MAP: the VIH is reachable from BASIC. $B000 is the machine's I/O page, laid out like the C64's $D000 so that $B020 is the border exactly as $D020 is on a C64. Mirrored offset-for-offset where the meaning matches: $B000-$B00F sprite 0-7 X,Y ($D000-$D00F) $B010 sprite X bit 8 ($D010) $B011/$B012 raster line (read) ($D011/$D012) $B015 sprite enable 0-7 ($D015) $B01B sprite behind bg ($D01B) $B01E/$B01F collisions (read) ($D01E/$D01F) $B020/$B021 border / background ($D020/$D021) $B027-$B02E sprite 0-7 colour ($D027-$D02E) VIXEN has more hardware than a VIC-II, and the extras live PAST that block so they can never collide with a mirrored register: $B030 select sprite 0-15, then $B031-$B036 X lo / X hi / Y / image slot / colour / flags $B038 sprite enable 8-15 $B040-$B046 tiles: enable, priority, scroll X/Y, map select $B050-$B055 bitmap layer: enable, pointer, scroll $B060-$B064 joystick 1, joystick 2, mouse X, mouse Y, mouse buttons -- all live reads $B070-$B079 copper: stage line/reg/value, $B078 commits an entry, $B079 arms N entries $B400-$B41C SID registers 0-28 ($D400 on a C64) In decimal: PEEK(45152) reads joystick 1 ($B060), and POKE 45088,0 sets the border black ($B020). Appendix B of the Chipset Reference lists the addresses both ways. LOADING A .RVK NO LONGER COMPETES WITH BASIC FOR MEMORY. The loader used to inflate an app into a window in BRAM and then copy it down. That capped apps at 228 KB -- less when compressed, because the packed and unpacked copies both had to fit at once -- and every variable BASIC gained made the largest loadable app smaller. An app now inflates straight from the card image into place. Apps can be ~500 KB and BASIC's size has nothing to do with it. THE PALETTE IS RESTORED ON RESET. The palette is set up when the FPGA configures, not when the CPU resets -- so a game that recoloured the machine left its colours behind and reset gave you BASIC in them. Entries 0-31 (the 16 C64 colours and the 16 greys) are now put back at startup. 32-255 are left alone: they belong to whatever runs next. NO MORE "Ready" OR LEFTOVER CURSOR WHEN A .RVK STARTS. The launch used to happen after BASIC had finished the program and printed its prompt, so every game start flashed a Ready belonging to a program that was about to be replaced. The blinking cursor was left painted on screen too. Needs core v0.56 or newer. BASIC v1.9 - TCP, and the network stops eating the SD card (BOOT.BIN 92) ----------------------------------------------------------------------- THE MACHINE FETCHED A WEB PAGE. example.com, looked up by name, over a real TCP connection: 828 bytes and HTTP/1.1 200 OK on the screen. Nothing in BASIC changed for it -- TCP lives in the network module and is there for apps, with an IRC client and a BBS terminal as the reason it exists. It is a CLIENT and it connects out; nothing can connect to the machine. One segment in flight at a time, two connections at once, and nothing blocks -- which is what lets a program keep drawing while it waits. TFTP NOW GIVES THE CARD BACK. The SD card is shared with the core's own file browser, and whoever holds it locks the other out. Until now the first upload kept it: F12 went blind until you power cycled, so you could send a .rvk to the machine over the network and then not be able to load it. A transfer hands the card back when it finishes. A build number that could not lie. BOOT.BIN's build is a -D flag, and make cannot see a flag: builds 87 to 90 all reported themselves as 86, so PEEK(45215) -- the one thing that tells you which kernel is running -- described a kernel that had been replaced three times. It is a generated file now, and 92 says 92. BASIC v2.0 - READF and WRITEF: files as data, not just programs (BOOT.BIN 97) ---------------------------------------------------------------------------- A PROGRAM CAN NOW LOAD AND SAVE ITS OWN DATA. Not a .PRG -- data: a sprite sheet, a level, a table, a high-score list. (READF arrived in build 96, WRITEF in 97.) READF unit,"name",addr WRITEF unit,"name",addr,len unit -1 report the size, read nothing (READF only) 0 6502 RAM, addr $0000-$FFFF 1 chip RAM, addr $000000-$EFFFFF LOAD is for programs. It reads a .PRG, believes the load address in the first two bytes and fixes up BASIC's pointers. READF believes nothing: it reads the whole file, header and all, exactly where it is told. 10 READF -1,"LEVELS.BIN",0 20 N=PEEK($B0BC)+PEEK($B0BD)*$100+PEEK($B0BE)*$10000 30 IF PEEK($B0BF)<>0 THEN PRINT "NO FILE":END 40 READF 1,"LEVELS.BIN",$100000 IT NEVER STOPS THE PROGRAM, SO YOU MUST CHECK THE STATUS. A missing file, a full disk or an address out of range sets the status byte and returns, and the next line runs as if nothing had happened. A program that does not read $B0BF cannot tell data it loaded from whatever was in that memory before, and will cheerfully draw a sprite sheet that never arrived. CHECK IT AFTER EVERY READF AND WRITEF: 10 READF -1,"LEVELS.BIN",0 20 IF PEEK($B0BF)<>0 THEN PRINT "NO LEVELS":END 30 READF 1,"LEVELS.BIN",$100000 40 IF PEEK($B0BF)<>0 THEN PRINT "LOAD FAILED":END Stopping on failure was the alternative, and it would have cost the thing that makes -1 worth having: a command that aborts cannot be used to ask whether a file is there. Everything it did is where a program can PEEK it: $B0BC-$B0BE bytes read, or the size, for a -1 query $B0BF 0 ok, 1 no file, 2 read error, 3 address out of range, 4 bad unit, 5 no disk support WRITEF IS THE SAME COMMAND BACKWARDS, with one difference: the length is mandatory. READF knows where a file ends; memory does not, so only the program knows how much of it means anything. 10 FOR I=0 TO 9:POKE $4000+I,S(I):NEXT 20 WRITEF 0,"SCORES.BIN",$4000,10 30 IF PEEK($B0BF)<>0 THEN PRINT "CANNOT SAVE" It writes a whole file every time -- no seek, no append, no update in place. That is exactly what a high-score table wants, and deliberately not a database. There is no -1: a size query has nothing to ask about when the bytes are the caller's, so -1 is a unit that does not exist. BOTH WORK FROM MACHINE CODE TOO. The keywords are a convenience on top of a register block, not a privileged path: fill in $B0C2-$B0CC and JSR $BFE8 to read or $BFE6 to write, and an assembler program loads its own assets with no BASIC involved. The values persist between calls, so a second transfer only writes what changed. Appendix B of the Chipset Reference has the register list and a worked example. SPRITE DATA CAN COME OFF A DISK NOW. Slot N lives at chip address N*4096, so READF 1,"SHIP.SPR",12*4096 fills slot 12 in one command at disk speed, instead of a READ/POKE loop through $B083 at 6502 speed. THE LAST MEGABYTE IS REFUSED. $F00000 and up is where the kernel modules live -- FatFs, the network stack -- so a program landing a file there would take the disk out from under itself. A read that would reach it is status 3 and does not start. Everything below is allowed, sprite slots included. Drives A: and B: only, following CD like every other file command, and a name may carry "B:" as usual. The address is a full expression, so A or BASE+N*4096 work as well as a literal. That is why READF evaluates its arguments in the ROM instead of scanning the raw text in C the way DIR and DEL do -- a filename is always spelled out, an address never is. 24 bits is exactly 16,777,216: the size of the SDRAM, every address in it exactly representable in BASIC's float. BASIC v2.1 - The BBS: dial the board (client BBS_B12.RVK) --------------------------------------------------------- THE MACHINE HAS A BULLETIN BOARD. BBS_B12.RVK in /VIXEN-32/network/ dials vixen-32.mooo.com: the modem handshake, CONNECT 1200, and the board's logon art painting itself in at 1200 baud -- the real thing, not a screenshot of it. Pick a username at the prompt; on the board today are chat and WHO IS ON, with message bases and .rvk downloads to come. Eight lines. A ninth caller gets ALL LINES ARE BUSY. The board is the server -- every screen is composed there -- so it will keep growing without this client changing. Anything that speaks telnet can call the same board, and sees standard ANSI. The speed is the sysop's: the board announces it, the terminal obeys, and there is nothing to press to make it go faster. That is the point. BASIC v2.2 - The character set belongs to BASIC now (BOOT.BIN 100) ------------------------------------------------------------------ REDEFINE A CHARACTER THE WAY A C64 DOES. Pick it, poke its bytes, show it: 10 POKE $B0C0,65 : REM define "A" 20 FOR I=0 TO 7 : READ B : POKE $B0CF,B : NEXT 30 POKE $B0CE,1 : REM show the uploaded font 40 DATA 60,66,165,129,165,153,66,60 $B0C0 character 0-255; writing it restarts the glyph $B0C1 bit0 = code bit 8 (256-511), bit1 = 8bpp, bit2 = 8x16 $B0CF one glyph byte, the offset advances by itself $B0CE bit0 = show the uploaded font, bit1 = display 8x16 Bit 7 is the leftmost pixel, exactly as a C64 character, so charset data written for a C64 maps straight across. A glyph is 8 bytes at 8x8, 16 at 8x16, 64 at 8bpp (one palette entry per pixel). 512 characters either way. A WHOLE CHARACTER SET IS A FILE. READF grew two more units: READF 2,"FONT.CHR",0 all 512 characters, 1bpp, one command READF 2,"SHIP.CHR",64*8 just character 64 upward READF 3,"COLOR.CHR",0 the 8bpp font The address is a byte offset into the font and must be a multiple of 8 -- eight bytes is one stored row, and a part-row offset would shift every glyph after it. WRITEF cannot go the other way: the font memory has a write port and no read port, so a glyph can never be read back out and units 2 and 3 return status 4. Keep your own copy. SWITCHING TO AN EMPTY FONT BLANKS THE SCREEN, "Ready" included -- the console draws with the ROM font, so POKE $B0CE,1 before uploading anything shows you 512 blank characters. That is what a C64 does when you point the VIC at uninitialised RAM, and it is not a bug; upload first, switch second. $B0CD IS LEFT EMPTY. It was the obvious address for the data byte and it could not be used: the crunch matched keyword text inside hex literals, so the CD in POKE $B0CD WAS the CD keyword and the line died as "Syntax Error in line 10" in a program that looked perfectly correct. Fixed in build 101 below -- but the data byte stays at $B0CF, because an I/O address that moves after it has shipped is worse than one that looks slightly odd. BASIC v2.3 - Hex literals stopped colliding with keywords (BOOT.BIN 101) ------------------------------------------------------------------------ PRINT $DEC0 PRINTED A SYNTAX ERROR. So did $DEF0, and so did POKE $B0CD. EhBASIC crunches keyword text anywhere outside quotes and never knew it was inside a number -- and hex digits are letters, so any literal whose digits spell a keyword was tokenised through the middle: PRINT $DEC0 -> 0, Syntax Error (DEC) PRINT $DEF0 -> 0, Syntax Error (DEF) PRINT $BEEF -> 48879 (no keyword in it) This has been true of stock EhBASIC since 2.22; VIXEN's own CD keyword just added $B0CD to the casualties, which is how it finally came to light -- as an I/O register that could not be POKEd. The crunch now copies a $ literal verbatim, exactly as it always did for a quoted string, and stops looking for keywords until the digits run out. All three lines above are right, keywords after a literal still crunch, and LIST is unchanged. WORTH KNOWING IF YOU HAVE OLD PROGRAMS: a line that used to fail now works. Nothing that worked before behaves differently -- the only lines affected are ones that could not run at all. BASIC v2.4 - The screen is POKEable at last (BOOT.BIN 102) ----------------------------------------------------------- BASIC COULD ONLY EVER PRINT. Now it can put a character in a cell, which is how every type-in game ever written draws. $B0A7 column 0-39 $B0AB bit0 flipX, bit1 flipY, $B0A8 row 0-24 bit2 = character bit 8 (256-511), $B0A9 foreground bit3 = draw on map 1 $B0AA background $B0AC write = put the character and step on; read = the character there 10 POKE $B0A7,0 : POKE $B0A8,0 : POKE $B0A9,7 20 FOR I=0 TO 39 : POKE $B0AC,65+(I AND 15) : NEXT A VIXEN cell is 32 bits -- character, two colours, two flip bits -- so it can never be one POKE like a C64's screen byte. A cursor is the next best thing, and it is faster in practice: colours and flags STICK, so a row is one POKE per cell instead of five. Reading $B0AC does NOT step on, or no program could look at the cell it just wrote. A WHOLE SCREEN FROM A FILE. READF gained unit 4: one byte per cell, drawn with the current colours from the current position. READF 4,"TITLE.MAP",0 fill the screen from the top left WITH THE FONT COMMANDS FROM BUILD 100 THIS IS A BITMAP. 512 characters at 8x16 against a 40x12 screen is 480 cells -- every one of them unique, with 32 glyphs spare. Define the set, poke the codes, and the screen is a 320x192 1bpp image with per-cell colour. That is the whole reason both halves exist. MAP 0 IS THE CONSOLE'S, AND IT WILL FIGHT YOU. The console keeps its own copy of the screen for scrolling, so a cell poked into map 0 stays until the next scroll redraws that row and wipes it. Bit 3 of $B0AB draws into map 1, which nothing else touches, and POKE $B046,1 shows it. BOTH ARE VERIFIED ON HARDWARE: a full-screen fill of map 1 and a flip shows the whole screen, exactly as intended. The emulator does it too. BASIC v2.2 - Credit where it is owed (BOOT.BIN 102) ---------------------------------------------------- POKE 45214,1 prints who the machine is built from: EhBASIC, fake6502, FatFs, tinf, newlib. NOTICES.txt beside BOOT.BIN carries the full text. VIXEN-32's BASIC is DERIVED FROM EhBASIC by Lee Davison. EhBASIC is free for NON-COMMERCIAL use provided any binary image carrying it contains that string -- so it is in the image, and it is on the screen when you ask. That is a condition on the whole machine, worth knowing rather than discovering. BASIC v2.5 - The beeper answers to BASIC (BOOT.BIN 103) -------------------------------------------------------- The machine's third voice -- beside the SID and the PCM engine -- was the one sound source BASIC could not touch. Now: $B0AD tone in Hz, low byte $B0AE tone in Hz, high byte 0 = silence 10 POKE $B0AE,1 : POKE $B0AD,184 : REM 440 Hz, and it IS 440 20 FOR D=0 TO 2000 : NEXT 30 POKE $B0AD,0 : POKE $B0AE,0 IT TAKES HERTZ, NOT A DIVISOR. The hardware wants CLK_AUDIO / (2 * n), and handing a BASIC programmer that sum would have been a poor trade for six lines of C. Poke 440, get 440 -- measured at 440 Hz in the emulator, not merely calculated. Either byte sets the tone from the pair, so a tone under 256 Hz needs the high byte cleared once and an octave change is a single POKE. Nothing else needs switching on: the master audio enable is already set by the time BASIC is running. The divisor is write-only in the hardware and reads back as 0, so the Hz value is kept in the kernel and PEEK returns what was asked for. BASIC v2.6 - Characters 256-511 actually work (BOOT.BIN 104) ------------------------------------------------------------- A BUG THE TUTORIALS FOUND ON THEIR FIRST RUN. $B0AB bit 2 is meant to put a character code above 255 into a cell, and it never did: the ninth bit was being OR-ed into an eight-bit field and thrown away, so every code from 256 up quietly drew the glyph 256 lower. It was invisible until something needed all 512 characters at once -- which is exactly what tuts/basic/BAS3.BAS does. Half its picture was right and half was noise, and the boundary was at character 256. Nothing else changes. If you wrote anything using codes 0-255 it behaved correctly then and behaves identically now. THE BASIC TUTORIALS SHIP FROM HERE. risc/tuts/basic/ holds ten programs -- screen cells, custom fonts, the 480-character bitmap, the hidden map, a sprite, the 256-colour layer, the copper, sound, files, and input -- with three generated .RAW data files they load with READF. They are the first thing to run on a new build: between them they touch nearly every register BASIC can reach. BASIC v2.7 - All 256 colours, and a picture worth showing (BOOT.BIN 105) ------------------------------------------------------------------------- BASIC HAD 32 COLOURS. The hardware has 256, but only the 16 C64 colours and a 16-step grey ramp are set at power-on -- everything above 31 is black, so a "256-colour" picture drawn from BASIC could only ever use 32 of them. $B0B9 red 0-255 $B0BA green 0-255 $B0BB blue 0-255 $B0AF entry 16-255 -- WRITING IT COMMITS the colour above 10 POKE $B0B9,255 : POKE $B0BA,128 : POKE $B0BB,0 20 POKE $B0AF,64 Components in any order, then the entry number. No hidden state and no sequence to get wrong. ENTRIES 0-15 ARE REFUSED, not discouraged. They are what the boot screen, the console and every C64-style program are drawn in, and a program must not be able to repaint them by accident. The greys at 16-31 are allowed: a convenience ramp, not identity. A WHOLE PALETTE IS A FILE. READF unit 5 -- three bytes an entry, starting where the address says: READF 5,"DEMO.PAL",16 240 colours in one command, not 720 POKEs RGB565 IS WHAT THE HARDWARE STORES, so the low bits go: 255,255,255 and 249,253,249 are the same white. The converter truncates BEFORE it quantises for exactly this reason -- quantise first and the 240 colours you chose collapse into fewer once the hardware rounds them. NEW TUTORIAL, BAS11: loads a palette and a picture and puts it on screen, with gen_picture.py to turn any photo into the .RAW and .PAL pair. 238 distinct colours measured on screen, against 32 before. BASIC v2.8 - The blitter, sampled sound, and chip RAM (BOOT.BIN 106) --------------------------------------------------------------------- THREE THINGS BASIC COULD NOT REACH AT ALL. THE BLITTER. Fill, copy, and copy-skipping-a-colour, at sixty million pixels a second against BASIC's three. Set it up, then one POKE starts it: $B0D1-$B0D3 source address $B0D7/$B0D8 width $B0D4-$B0D6 destination $B0D9/$B0DA height $B0DB/$B0DC source stride $B0DF colour / key $B0DD/$B0DE destination stride $B0D0 1 fill, 2 copy, 3 key copy STRIDE, NOT MODULO. The hardware wants bytes-to-skip-per-row, which is stride minus width; the kernel does that subtraction. A stride belongs to the surface (512 for the bitmap layer) and stays put while widths change -- making a BASIC programmer recompute it for every blit would be a poor trade for one line of C. The kernel also waits for the blitter and invalidates the cache afterwards. Neither is something a BASIC program should have to know about. PCM SAMPLE PLAYBACK. Four channels. READF puts the sample in chip RAM, these say where it is: $B0E2 channel 0-3 $B0E5 length in 4096-byte blocks $B0E3/$B0E4 start, $B0E6 rate in HUNDREDS of Hz (80 = 8000) in blocks $B0E7 volume $B0E8 0 stop, 1 play once, 2 loop Signed 8-bit samples: 0 is silence, 128 is nearly full deflection. Blocks rather than bytes for the same reason sprite slots are blocks -- a sample must be word-aligned or it drifts out of tune after the first loop, and the granularity makes that impossible to get wrong. A WINDOW INTO CHIP RAM. $B0E9-$B0EB set a 24-bit address and $B0EC is the byte there -- read or write, and either steps the address on. Until now BASIC could fill chip RAM from a file and save it back but never look at one byte of it: no procedural graphics, and no reading back what the blitter drew. Setting the address invalidates the cache, because the blitter and the sprite DMA write behind the CPU's back. TWO NEW TUTORIALS. BAS12 fills two hundred random rectangles with the blitter; BAS13 plays a sample at four pitches. Both ship in risc/tuts/basic/ with SOUND.RAW. BASIC v2.9 - Every key, not just the last one (BOOT.BIN 107) -------------------------------------------------------------- GET IS NOT A KEYBOARD READ, and BAS13 is where that finally bit. Typing edits the SCREEN -- that is what makes this a C64-style screen editor -- and only Enter feeds a line to BASIC, so "press 1 to 4" meant typing 1 AND Enter. $B0E0/$B0E1 have reported the last key and whether it is still held since build 22, but only the LAST one: press a second key and the first key's state is gone, so left AND up AND fire could not be asked for at all. A C64 can do that -- it scans its keyboard matrix through $DC00/$DC01 -- and this machine could not. $B0ED a key code to ask about (write it) $B0EE 1 if THAT key is down right now (read it) 10 POKE $B0ED,184 : IF PEEK($B0EE) THEN PRINT "1 IS DOWN" Any number of keys, any combination, all reading correctly -- and without the C64's ghosting, because this is a record of what the hardware reported rather than a matrix being scanned. THE CODES ARE C65 MATRIX NUMBERS. "1" is 184 and "3" is 136; there is no order to guess at. Press the key and PEEK $B0E0 to find its number. BAS13 now polls the keyboard this way instead of using GET: hold 1, 2, 3 or 4 and the sample plays at that pitch, with no Enter involved. BASIC v3.0 - The editor can be told to stand aside (BOOT.BIN 109) ------------------------------------------------------------------- $B0EE told a program which keys were down, and the editor went on printing those keys into the middle of the display anyway -- because the echo happens in the console, before BASIC ever sees the key. Polling was correct and the screen was still a mess. POKE $B0EF,1 keys go ONLY to $B0E0/$B0E1/$B0ED/$B0EE POKE $B0EF,0 back to normal typing A C64 program turns its editor off for the same reason. This is that switch: in raw mode the console sees no keys at all -- no echo, no cursor movement, nothing queued for GET. RUN/STOP IS STILL LIVE IN RAW MODE, and breaking a program clears the flag. A program that turns raw mode on and then crashes cannot leave the machine with a keyboard that will not type -- which would have meant a power cycle, and would have been entirely my fault. BAS13 now turns the editor off while it polls, and back on when it stops. BASIC v3.1 - CANVAS and LINE (BOOT.BIN 110) --------------------------------------------- The blitter registers are the hardware as it is: addresses, strides, modulos, and a POKE for every one of them. These are the same silicon with the arithmetic taken off you. CANVAS addr,stride,width,height LINE x0,y0,x1,y1,colour[,thickness] 10 CANVAS $200000,512,384,224 20 LINE 0,0,383,223,1 30 LINE 0,223,383,0,2,5 CANVAS IS SET ONCE and everything drawn afterwards uses it, so a line is only coordinates and a colour. With no CANVAS at all, drawing goes to the bitmap layer -- whatever $B051/$B052 points at, 384x224, stride 512 -- so LINE works the moment the layer is on, and CANVAS becomes the thing you reach for when you want to draw on a hidden page and flip to it. COORDINATES ARE CLIPPED. The blitter has none of its own: a line running off the canvas would keep writing across whatever follows it in chip RAM, and the first symptom would be something unrelated breaking. BASIC is exactly where off-screen coordinates come from. THICKNESS IS PARALLEL LINES offset across the direction of travel, since the hardware draws single pixels. Square ends, like every other BASIC that offers it. A BUG WORTH RECORDING, because it will happen again to anyone adding a keyword: the first version kept a register index in X across the expression evaluator, and the evaluator uses X for its own purposes. Every argument after the first landed wherever X happened to point -- CANVAS's stride and size came back as zero and the lines went nowhere while the command looked perfectly correct. Each argument is stored outright now. BASIC v3.2 - RECT and IMAGE (BOOT.BIN 111) -------------------------------------------- RECT x,y,w,h,colour[,thickness] thickness 0 draws it SOLID IMAGE x,y,w,h,src[,sw,sh] a 64x64 image out of chip RAM 10 RECT 20,20,120,80,2,0 20 RECT 160,20,120,80,7,4 30 READF 1,"IMG64.RAW",64*4096 40 IMAGE 60,40,64,64,64*4096 50 IMAGE 150,30,128,128,64*4096 Both use the canvas CANVAS set, or the bitmap layer if it was never called, and both clip to it. A solid RECT is one blitter fill; a frame is four. AN IMAGE SOURCE IS 64x64, THE SAME SIZE AS A SPRITE SLOT -- slot N is at N*4096, so one file can feed either. Sixty-four rather than the 256 the texture hardware allows, because a second size to remember is a second size to get wrong. IT IS NOT THE SAME FORMAT, THOUGH. A sprite image is 1bpp, eight pixels to a byte, like a C64's. An IMAGE is 8bpp -- one byte per pixel, 4096 bytes. Both are "a 64x64 image" and pointing IMAGE at sprite data draws noise; it caught me while testing this. Colour 0 is transparent either way. SCALING IS FREE. w,h are the size on screen; different from the source and the hardware scales as it draws, same span engine, same cost. That is how a BASIC program gets more moving objects than the sixteen hardware sprites. The texture cache reloads only when the source address changes, so drawing one image a hundred times a frame pays for the upload once. New asset: IMG64.RAW, a shaded ball in the grey ramp, for the tutorials. BASIC v3.3 - The 6502 gets its interrupts (BOOT.BIN 112) ---------------------------------------------------------- EhBASIC shipped with ON IRQ, IRQ ON and RETIRQ, and min_mon has always pointed $FFFE at a patchable handler in page 2 ($020D) -- the machine just never pulled the line. Build 112 pulls it: $B10E enable: bit0 = the 50 Hz tick, bit1 = raster compare $B10F read: which sources fired -- READING ACKS $B110/$B111 the raster line 10 ON IRQ 100 20 IRQ ON : POKE $B10E,1 100 REM runs 50 times a second ... 199 RETIRQ Measured in the emulator: 33 ticks caught during a 0.7-second loop -- the full 50 Hz, none lost -- and the raster source the same at its line. DELIVERY IS BETWEEN SLICES, up to a millisecond late: less jitter than a C64 badline, but single-scanline tricks still belong to the copper, which does them in hardware with no jitter at all. BREAKING A PROGRAM TURNS THE SOURCES OFF. A handler that crashed would otherwise keep firing into the Ready prompt forever. Machine code: patch $020D directly; the default handler there sets EhBASIC's IrqBase flag, which is what the BASIC-level mechanism consumes. BASIC v3.4 - Steady raster interrupts, and BASIC got faster doing it (BOOT.BIN 113) ---------------------------------------------------------------------- BAS16'S BORDER BAND JUMPED. Build 112 handed the 6502 its interrupt at the end of a 2000-cycle emulator slice, and the varying pickup point wobbled the band by up to 15 scanlines. Build 113 samples the line every 64 cycles while a source is enabled: the interrupt lands within ~20 instructions -- under a third of a scanline -- and the band sits still. THE COST IS PAID ONLY BY PROGRAMS THAT USE INTERRUPTS. With no source enabled the interpreter runs its old loop untouched. Two earlier shapes of this fix taxed EVERY program 4-13% and were thrown away; the interpreter's speed is not for sale. AND BASIC IS 4% FASTER THAN BUILD 111. Chasing a 2.8% slowdown exposed that the compiler had quietly stopped inlining the 6502's memory-write path as the kernel grew -- every write was paying a function call. It is pinned inline permanently now (an attribute is a mechanism; the inliner's mood is not), measured: a 20,000-iteration FOR loop went from 324 jiffies on build 111 to 311. The differential test confirms the CPU is bit-identical over 60 million instructions. BASIC v3.5 - Swapping disks no longer shows the old disk (BOOT.BIN 114) ------------------------------------------------------------------------- Swap the image in a drive and DIR printed garbage: names made of noise, impossible sizes, the wrong file count. FatFs was reading the NEW disk's sectors through the OLD disk's cached FAT, and nothing ever told it the disk had changed -- it only looks at a drive when an operation runs, so an eject and remount between two DIRs was invisible. The only way out was ejecting, running DIR into a disk error so FatFs noticed, and mounting again by hand. The kernel now watches both drives every frame and drops the cached filesystem state the moment the mounted bit changes, in either direction. Eject, remount, swap: the next DIR reads the disk that is actually there. VERIFIED ON HARDWARE (build 115, with the edge counter at PEEK(45330)): ejecting with SPACE and then mounting the new image works every time -- two edges seen, fresh DIR. REPLACING an image directly, without the eject, produces NO edge from the core at all, so no kernel can detect it: that path stays stale until the core's QNICE fork learns to blip the mount signal on replace. Until then: PRESS SPACE FIRST. PEEK(45330) counts every mount change the kernel saw -- the debugging aid that settled where this bug lived, left in because it costs one byte. BASIC v3.6 - Drive C: is the SD card (BOOT.BIN 116) ----------------------------------------------------- Every file command now takes C: -- the card itself, alongside A: and B:. DIR C: CD C: LOAD "C:VIXEN-32/GAME.PRG" READF 1,"C:VIXEN-32/DATA.RAW",$200000 READING IS FREE ANYWHERE. WRITING IS JAILED to /VIXEN-32/, the same rule the TFTP server has always enforced: SAVE, WRITEF, DEL, MKDIR, MOVE and COPY outside it answer ?C: IS WRITE-PROTECTED OUTSIDE /VIXEN-32/ (WRITEF reports status 3), and ".." is refused outright. THE CARD IS CLAIMED PER COMMAND AND RELEASED AFTER, so the F12 browser never goes blind. That release unmounts the filesystem -- which forgot the working directory, so CD C:GAMES silently reset to the root on the next command. The FatFs module now remembers its resolved directory and re-applies it on every remount; CD sticks, on every unit. KERNEL-ONLY, deliberately: if C: ships after release, it ships as a BOOT.BIN on the BBS file area, no core update needed. BASIC v3.7 - A file API for machine code, and VIXEN COMMANDER (BOOT.BIN 117, fixed in 118) ----------------------------------------------------------------------- BASIC has had DIR, COPY, MOVE, DEL and MKDIR since build 44, and none of it was reachable from a program. Those commands read their arguments by scanning the BASIC program text and report by printing on the console -- both useless to 6502 machine code with its own screen. Build 117 adds a register block that does the same jobs from registers: $B120 unit 0 = A:, 1 = B:, 3 = C: $B121 unit 2 the destination drive, for COPY $B122/3 path pointer to a NUL-terminated path in 6502 memory $B124/5 path 2 the destination path $B126/7 buffer where an answer is written $B128 buffer length 0 means 256 $B129-$B12C position 32-bit file offset, for READ $B12D COMMAND writing it RUNS the command $B12E status 0 = ok $B12F-$B132 count a size, a byte count, free space $B133 flags mounted / read-only / directory / more to copy Nineteen commands: STAT, DIROPEN/DIRNEXT/DIRCLOSE, MKDIR, DELETE, RENAME, DELTREE, COPYOPEN/COPYSTEP/COPYCLOSE/COPYABORT, FOPEN/FREAD/ FCLOSE, CHDIR, GETCWD, LABEL and SIZE. Appendix B of the Chipset Reference has the table. A COMMAND RUNS INSIDE THE POKE that starts it, so the status and the count are already there when the next 6502 instruction reads them. Nothing to wait for, no interrupt to catch. COPYING IS DONE IN STEPS, not in one call. A copy off the card can run for seconds, and a machine that stops answering for seconds cannot show a progress bar or be interrupted. COPYSTEP moves up to 8 KB and says whether more remains; COPYABORT takes the half-written file with it, because a truncated copy left behind looks like a real file. DELETING A TREE IS ONE COMMAND (DELTREE) and it is done in the kernel, where there is a stack to recurse on. It rescans the directory after every deletion rather than walking it: the FatFs module keeps ONE open directory between all its callers, and deleting out of a directory somebody is reading is how a filesystem gets corrupted. DIRECTORY ENTRIES COME BACK 8.3, ALWAYS. A long name on the disk is reported as its DOS alias -- "LONGFI~1.TXT" -- which opens the same file and fits a 40-column screen. That needed a new call in the FatFs module (dir_next2) and a new jump-table entry, number 30, the first of the four spare disk slots. C: IS STILL JAILED. Every command that writes goes through the same check SAVE does, so /VIXEN-32/ is the only part of the card a program can change, whichever way it came in. **VIXEN COMMANDER** is what it was built for: cc65/vcmd/VCMD.PRG, a Norton Commander with two panels, a drive each, and the function keys where they have been since 1986 -- F3 view (text or hex, 1 and 3 switch), F5 copy, F6 move, F7 make directory, F8 delete with a warning, F10 out. F1 cycles the panel's drive A: -> B: -> C:, TAB swaps sides, RETURN opens a directory. LOAD "VCMD.PRG" then RUN. IT LEAVES THE MACHINE AS IT FOUND IT: it draws on tile map 1, so BASIC's screen is still there when you leave; it never CHDIRs, because the current directory is machine-wide state BASIC shares; and it gives the keyboard back on the way out. TWO BUGS THIS FOUND, both worth knowing about: $B0E0 AND $B0E1 CANNOT BE READ SEPARATELY AND TRUSTED. The kernel writes the key code and the held flag from its own loop while 6502 code runs, so reading one and then the other can pair the PREVIOUS key's code with the NEW key's held flag -- a keypress that never happened. It doubled letters in typed filenames (three of five key changes in one measured run) and, at startup, paired the leftover Return from the RUN command with the first function key pressed, so one press of F7 opened a directory instead. Any program polling those registers must read both twice and discard the pair if it changed; VCMD does. BUILD 118 FIXES THE CARD BEING RELEASED UNDER AN OPEN DIRECTORY. The SD card is claimed per command and released after, so the F12 browser never goes blind -- but that release unmounts the filesystem, and an open directory depends on it just as much as an open file does. Listing C: therefore opened the root, released the card, and read an empty directory out of a filesystem that was no longer there: the drive reported its free space correctly and showed no files at all. An open directory now holds the card until it is closed. Tested headlessly against the emulator: cc65/vcmd/run_tests.sh runs the API on its own (vfstest.prg) and then drives VCMD through eleven cases with a new --key option in vixtest. Every test gets a FRESH COPY of the disk image -- the emulator writes to the image it is given, and tests that shared one produced three different answers to the same question. BASIC v3.8 - Drive C: is switched off (BOOT.BIN 119) ------------------------------------------------------- C: shipped in build 116 and is withdrawn here. A: and B: are the drives this machine has; the card is reachable again by setting ONE switch, VX_DRIVE_C in risc/basic_test.c, back to 1. WHY. THE CARD CAN BE DRIVEN BY ONE SIDE AT A TIME, and A: and B: are disk IMAGES STORED ON THAT CARD, served by the other side. So any operation with C: on one side and A: or B: on the other -- a copy, a move -- needs the card held by both at once, which the hardware cannot do. The transfer fails part way through, which is exactly what a copy from C: to A: did. C: could therefore only ever exchange files with itself, and a drive that cannot reach the drives next to it is worse than no drive at all. WHAT WOULD BRING IT BACK PROPERLY: handing the card over once per block instead of holding it for a whole transfer. Every handover needs a card reset, so it costs speed rather than being free -- a decision, not an oversight, and the reason this is a switch and not a deletion. DIR C: ?NO DRIVE C: -- ONLY A: AND B: CD C: the same, and the current drive does NOT move THE REFUSAL COMES BEFORE THE CURRENT DRIVE CHANGES. "CD C:" that said no but still recorded C: as where you are would leave every command afterwards failing on a drive nobody chose. A REFUSED LETTER BECOMES A UNIT NOTHING ACCEPTS, never a substitute. "C:FILE" quietly turning into "A:FILE" would write to the wrong disk, so LOAD, SAVE, DIR, CD, DEL, MKDIR, MOVE and COPY all say so instead -- and the file API at $B120 answers status 4 (no such unit). NOTHING TOUCHES THE CARD WHILE THE SWITCH IS 0. It was never mounted at startup -- a unit mounts on first use -- and with the letter refused there is no first use. The card release that used to run after every disk command is compiled out too. ONE EXCEPTION, deliberate: reading /VIXEN-32/NETWORK.TXT when the network comes up, which is the kernel reading its own configuration rather than a drive a user can reach, and it gives the card straight back. VIXEN COMMANDER follows: F1 now cycles A: -> B: -> A:. Its own switch is VCMD_DRIVE_C in cc65/vcmd/vcmd.c, and it only means anything when the kernel's VX_DRIVE_C is 1 as well. BASIC v3.9 - Drive C: is back, and SAVE writes .BAS listings (BOOT.BIN 120) -------------------------------------------------------------------------- C: is the SD card again, with ONE RULE: IT IS REFUSED WHILE A: OR B: IS MOUNTED. That is the copy that broke in build 116 -- C: at one end, a disk image on the same card at the other -- and now it cannot start. DIR C: ?UNMOUNT A: AND B: TO USE C: (while A: or B: is in) CD C: the same, and the current drive does NOT move The card is still taken for the length of ONE command and given back, so mounting A: from F12 after using C: is fine: you stay on C:, and the NEXT C: command is the one refused, until A: is unmounted again. READF and WRITEF report status 1, and the file API at $B120 answers status 11. SAVE "C:NAME.BAS" WRITES A PLAIN-TEXT LISTING, not a .PRG -- exactly what LIST shows, CR LF after every line, the same format the F12 menu types back in. It goes in /VIXEN-32/BASIC/, which the first such SAVE creates. SAVE "C:GAME.BAS" -> /VIXEN-32/BASIC/GAME.BAS (a listing) SAVE "C:GAME" -> a .PRG, as before (jail applies) SAVE "A:GAME.BAS" -> a .PRG, as before (A: and B: unchanged) The listing comes back with F12, not LOAD: LOAD reads .PRG only. DIR and CD now print the card as C:. The header of DIR C:PATH said A:, and the current directory came back under the filesystem's own name for the card, SD: -- a drive nobody can type. Not affected by the rule: reading /VIXEN-32/NETWORK.TXT when the network comes up, and the TFTP server. VIXEN COMMANDER build 3 puts C: back in the F1 ring (needs this BOOT.BIN). With A: or B: mounted the C: panel shows NOT MOUNTED and the message line says UNMOUNT A: AND B: TO USE C:. BASIC v4.0 - MKDISK: make a blank disk image (BOOT.BIN 121) ------------------------------------------------------------ MKDISK GAME /VIXEN-32/IMG/GAME.IMG, 1.44 MB MKDISK GAME 720 the same, 720K A new, empty floppy image on the SD card, ready to mount from F12 -- no PC needed. It is the standard DOS layout for that size (what mformat makes), so a PC reads it too, and the disk is labelled with its name. The folder /VIXEN-32/IMG/ is created the first time; .IMG is added when the name has no extension. ?SIZE: 720 OR 1440 any other size ?DISK EXISTS: C:... an image of that name is never overwritten ?DISK IMAGES GO ON C: MKDISK A:NAME and MKDISK B:NAME ?UNMOUNT A: AND B: TO USE C: It writes to the card, so the C: rule applies. A key pressed while it writes stops it, and the half-made image is deleted rather than left as a broken disk. A NEW KEYWORD, so the BASIC ROM changed: MKDISK is token $F5, appended after IMAGE, and every token already in a saved program keeps its number. Build 122: MKDISK 720 or MKDISK 1440 on its own now answers ?NAME MISSING. Build 121 took the size for a name and made a 1.44 MB disk called 720.IMG. A name AND a size (MKDISK 720 720) still makes 720.IMG, at the size given. BASIC v4.1 - The beeper in one byte (BOOT.BIN 124) --------------------------------------------------- POKE $B09C,0 silence POKE $B09C,V V = 1-255: Hz = 8660 * 2^((V - 255) / 32) 1 = 35 Hz 63 = 135 Hz 127 = 541 Hz 191 = 2165 Hz 255 = 8660 Hz The Hz pair at $B0AD/$B0AE needs two POKEs per pitch, and the beeper plays a wrong pitch between them -- a sweep from BASIC crackles. $B09C is the whole tone in ONE write, so a sweep is clean. Every step is the same change of pitch, 32 steps to the octave: +32 doubles it. PEEK returns the value poked. $B0AD/$B0AE work as before. Both drive the same beeper; the last write wins. Build 123 is superseded: its $B09C was a VIC-20 style divider, 8660 / (256 - V), where the low values barely moved and the top ones jumped. Use 124. Build 125: the interrupt status an app's handler gets now says which of the newer sources fired. Key event, Ethernet frame and vertical blank arrive as st.f.key, st.f.eth and st.f.vblank (bits 3-5); before this they reached the handler with every bit clear and an app had to read the pending register at $3A000188 itself. Timer, raster and blitter are unchanged, so existing .rvk apps behave exactly as before. Needs shared/boot_protocol.h from this build to use the new fields. BASIC v4.2 - The kernel hands out memory (BOOT.BIN 126) -------------------------------------------------------- A new kernel module, kmodsys (system services), in module slot 2 at chip 15 MB + 128 KB. Memory first; text output comes next. Three new jump table entries, for programs that keep the kernel: 54 ksys_alloc_mem(type, address, size, align) 55 ksys_alloc_free(ptr) 56 ksys_alloc_set_fast(prog_end, stack_top) type KMEM_CHIP chip RAM, 1 MB to 15 MB (the sprite megabyte and the module megabyte are never handed out) KMEM_FAST the 512K -- only the range the program handed over with ksys_alloc_set_fast (its _end and _stack_top; 16 KB below the stack is kept free) KMEM_TRAPDOOR 256 KB, core v0.87+ KMEM_ZORRO 48 MB, core v0.89+ address 0 = anywhere, anything else = exactly there or NULL. align is any value (0 = 4 bytes). Memory is not cleared. For KMEM_CHIP the address in is the chip address and the pointer out is the CPU's; ksys_alloc_free takes either. Freed space is reused at once, anywhere in the pool. EVERY .rvk STARTS WITH A CLEAN TABLE, AND THE BLOCKS IT BROUGHT INTO CHIP RAM ARE ALREADY MARKED AS TAKEN. A program's first KMEM_CHIP request lands clear of its own data -- no dummy reservation. Freeing such a block (ksys_alloc_free on its address) gives the space back. An .rvk that puts data over the module megabyte gets nothing marked: it has no kernel modules any more. shared/kernel_api.h has the calls and the KMEM_ values, which are the same numbers as ALLOC_MEM_TYPE in _coding/3d/_common/alloc.h. Build 127: NO SET-UP CALL ANY MORE. risc/crt0.S -- the start-up code every program links -- now hands the program's FAST range to the kernel before main() runs, the way a C runtime sets up malloc's heap. A program just calls ksys_alloc_mem(KMEM_FAST, ...) like the other three types. It takes a REBUILD of the program to get the new start-up code; .rvk files built before are unchanged. The start-up code only calls the kernel when the system module is really there, so a program built with it still runs on an older BOOT.BIN (FAST then simply has nothing to hand out). BASIC is built with the same start-up code, which is why this is a new BOOT.BIN. BASIC v4.3 - VMOS from the Ready prompt (BOOT.BIN 128, KERNEL.BIN) ------------------------------------------------------------------- Type VMOS on a line of its own at Ready: VMOS ARE YOU SURE (Y/N)? Y Y starts VMOS, N goes back to Ready; no other key answers. VMOS takes BASIC's memory, so Y ends BASIC and the program in it -- that is what the question is for. Typed as the answer to an INPUT statement, VMOS is just text, as before. VMOS lives in a new file, /VIXEN-32/KERNEL.BIN: this BOOT.BIN with VMOS (vmos_b97) stuck on behind it. The M2M-free core (v0.94 on) boots KERNEL.BIN and reads only the kernel part, so the machine starts as fast as before and VMOS uses no memory until you ask for it. VMOS + Y reads the VMOS part (152 KB) off the card and starts it like an .RVK from F12. BOOT.BIN, for v0.93 and older, has the command too and reads the same KERNEL.BIN, so it works there as well when the card carries one. BOOT.BIN 99,260 bytes cores up to v0.93 KERNEL.BIN 251,196 bytes the M2M-free core, v0.94 on A new VMOS build needs only a new KERNEL.BIN, not a new kernel. Refusals: ?NO /VIXEN-32/KERNEL.BIN, ?NO VMOS IN KERNEL.BIN, and ?UNMOUNT A: AND B: FIRST (the C: rule). Build 129: after N the empty line before Ready is there, as after every other BASIC command. Build 128 printed Ready straight under the answer. KERNEL.BIN 251,196 bytes (kernel 129 + vmos_b97) Build 130: the Y that answers the question no longer turns up in VMOS's editor. 128 and 129 started VMOS while the Y was still waiting in the key buffer, so VMOS typed it. VMOS now starts when the key is let go. KERNEL.BIN 251,708 bytes (kernel 130 + vmos_b97) Build 131: the cursor goes away the moment Y is pressed and the Y stays on the question's line. 130 moved the cursor to the next line and kept it flashing until VMOS took over. KERNEL.BIN 251,708 bytes (kernel 131 + vmos_b97) BASIC v4.4 - MEGA + POUND: network and TFTP server in one press (BOOT.BIN 132) ------------------------------------------------------------------------------- MEGA + POUND network on (if it is off) and the TFTP server on -- SHIFT+POUND and TFTP ON in one go SHIFT + POUND unchanged: network on, press again for off Pressed with the network already on, it just starts the server again. TFTP OFF still stops it. Prints the same lines SHIFT+POUND and TFTP ON print, then Ready. KERNEL.BIN 251,708 bytes (kernel 132 + vmos_b97) BASIC v4.5 - HELP opens a file browser; A: and B: from .IMG files (BOOT.BIN 133) --------------------------------------------------------------------------------- The M2M-free core has no HELP menu any more, so HELP at Ready now opens a file browser of the machine's own, in VMOS's 63-column look: cursor keys, RETURN, walk the card's folders (DEL or LEFT goes up) mouse, double click RETURN on a .RVK NEW and the start lines typed in, RUN starts it -- exactly what the old HELP menu did RETURN on a .PRG loaded like LOAD RETURN on a .BAS typed in, as the old HELP menu did A or B on a .IMG the disk image into drive A: or B: (RETURN = A:) SHIFT+A, SHIFT+B eject ([Eject] with the mouse) RUN/STOP, ESC, HELP back to BASIC Closed without a pick, BASIC is exactly as it was: program, screen and cursor. NAME.BMP next to NAME.RVK (or NAME.IMG, or a folder NAME) is shown beside the list -- an 8-bit BMP, fitted in, in its own colors. The browser opens where it was closed last. Only at Ready: in a running program, or at an INPUT, HELP is the program's key as before. A: AND B: FROM .IMG FILES. Without QNICE nothing served the drives, so the kernel's disk module now serves an image file itself: DIR, LOAD, SAVE, COPY and bootable disks (a bootable disk in A: boots when the browser closes) all work as with F12. C: no longer waits for the drives to be empty -- COPY between C: and A: works. A mounted image cannot be deleted, renamed or written over on C:. Mounts are gone after a reset or power cycle. An image stored on the card in more than 64 pieces is refused (copy it again and it comes back in one). The browser is its own program in KERNEL.BIN, behind VMOS, and KERNEL.BIN now ends in a table of contents (kernel, VMOS, HELP). It is read off the card when HELP is pressed and runs in chip RAM at $F30000, out of BASIC's way. VMOS stays where it always was in the file. Also: palette entries 32-255 start black (as the core powers up), and PEEK($B040) / PEEK($B041) read 1 from boot, as the screen is (tiles on, in front). KERNEL.BIN 274,944 bytes (kernel 133 + vmos_b97 + help_b02) HELP b03 (same kernel 133, new KERNEL.BIN only): a letter or digit jumps to the first entry starting with it; the same key again goes to the next one CTRL+UP / CTRL+DOWN a page up / down CTRL+LEFT / RIGHT the first / the last entry LEFT, RIGHT nothing any more (RETURN opens, DEL goes back) CTRL+A / CTRL+B the disk image into A: / B: (A and B jump now) CTRL+SHIFT+A / B eject KERNEL.BIN 274,944 bytes (kernel 133 + vmos_b97 + help_b03) HELP b04 (same kernel 133, new KERNEL.BIN only): COVER.BMP. on a folder the COVER.BMP inside it shows, without going in (else FOLDER.BMP next to it, as before) inside a folder its COVER.BMP shows for every entry with no picture of its own -- [..] too, so it is there the moment the folder opens a program NAME.BMP next to it still comes first Pictures: 8-bit (or 4-bit) BMP, best 160 x 112 or less (shown 1:1, a smaller one blown up, a bigger one shrunk to fit); up to 219 colors exact. KERNEL.BIN 275,968 bytes (kernel 133 + vmos_b97 + help_b04) HELP b05 (same kernel 133, new KERNEL.BIN only): CTRL+UP / CTRL+DOWN page as in VMOS's editor -- the list moves a page and the selection stays on its row of the screen; only at the top or the end of the list does it go to the first or the last entry. KERNEL.BIN 275,968 bytes (kernel 133 + vmos_b97 + help_b05) BASIC v4.6 -- kernel 134 + HELP b06 (2026-10-27): HDMI zoom and scanlines in the HELP browser, kept in /VIXEN-32/CONFIG.TXT (core v0.95 VIH_HDMI). F1 HDMI zoom on/off (VIXEN's 224 lines fill the HDMI height, 16:9) F3 HDMI scanlines on/off; not while zoom is on the line above the status bar shows both; a click on one switches it Both apply at once and are saved in /VIXEN-32/CONFIG.TXT (text, HDMI_ZOOM=ON / HDMI_SCANLINES=OFF; other lines in it are kept). The kernel reads it at boot and sets the HDMI picture before the boot screen. The 15 kHz analog PAL picture never changes. KERNEL.BIN 279,552 bytes (kernel 134 + vmos_b97 + help_b06) HELP b07 (same kernel 134, new KERNEL.BIN only): for core v0.95 T15 and later, which shows the bitmap layer exactly where it is drawn -- the HELP screen is no longer one pixel to the left there. (Older cores showed it a pixel late and the browser made up for that; on them it is now a pixel to the right.) KERNEL.BIN 284,672 bytes (kernel 134 + vmos_b101 + help_b07) BASIC v4.7 -- kernel 136 + the VIC-20, vic20hw b8 (2026-10-29): GO V20 at Ready starts the VIC-20 on the core's own 6502, VIC and VIAs (core v0.95 T16 and later). GO V20 (or GOV20) on a line of its own, at Ready ARE YOU SURE (Y/N)? Y starts the VIC-20, N goes back to Ready The VIC-20's ROMs are NOT in KERNEL.BIN: put your own in /VIXEN-32/VIC20/ as KERNAL.ROM (8 KBytes), BASIC.ROM (8 KBytes) and CHAR.ROM (4 KBytes). A missing one is said before the question (?/VIXEN-32/VIC20/CHAR.ROM NOT FOUND), and so is one of the wrong size (?BASIC.ROM IS NOT 8 KBYTES). In the VIC-20, HELP opens its game menu (/VIXEN-32/VIC20/GAMES). KERNEL.BIN 307,200 bytes (kernel 136 + vmos_b102 + help_b07 + vic20hw_b8) HELP b08 (same kernel 136, new KERNEL.BIN only): F3 switches HDMI scanlines with zoom on too -- the new core shows both at once (b06/b07 refused it and showed "(not with zoom)"). KERNEL.BIN 307,200 bytes (kernel 136 + vmos_b102 + help_b08 + vic20hw_b8) BASIC v4.8 -- kernel 137 (2026-10-29): loading from the HELP browser shows how far it has got, and the cursor is off while it loads. LOADING... [ 30%] an .RVK or .BAS counts up to [100%] as it comes in -- a game of a few MBytes takes 5-10 seconds The cursor no longer stands frozen on the line above LOADING. A .PRG loads as before (it is in at once). KERNEL.BIN 307,712 bytes (kernel 137 + vmos_b102 + help_b08 + vic20hw_b8) BASIC v4.9 -- kernel 138 (2026-10-30): EhBASIC runs on the core's own 6502 at 25 MHz instead of a 6502 emulated in C -- about seven times as fast (emulator: 10,000 empty FOR/NEXT in 21 jiffies, kernel 137 took 148). Needs core v0.95 (the 8-bit CPU block). Everything else stays as it was: SAVE, LOAD, DIR and the other disk commands, A:, B: and C:, the POKE map, sprites, ON IRQ, RUN/STOP, RUN/STOP+RESTORE, HELP, VMOS and GO V20. PEEK $B092-$B095 the 6502's cycles: now its 25 MHz clock PEEK $B0A0-$B0A3 instructions run: reads 0 (only the emulator could count them) FRE(0) one byte more: EhBASIC's memory runs to $AFFF, was $AFFE RUN/STOP+RESTORE now also gets out of a machine-code program that ran into a JAM opcode (kernel 137 fell into a cold start there). KERNEL.BIN 297,984 bytes (kernel 138 + vmos_b112 + help_b08 + vic20hw_b9) Kernel 139 (BASIC v4.9 still, 2026-10-30): after RUN/STOP+RESTORE has taken a program's sprites off the screen, opening and leaving the HELP browser no longer brings them back. KERNEL.BIN 298,496 bytes (kernel 139 + vmos_b113 + help_b08 + vic20hw_b9) Kernel 140 (BASIC v4.9 still, 2026-10-30): RUN/STOP+RESTORE silences the machine too -- the beeper, the SID and the four PCM sample voices stop, and PEEK reads them back as 0, as after the boot. KERNEL.BIN 298,496 bytes (kernel 140 + vmos_b113 + help_b08 + vic20hw_b9) BASIC v5.0 -- kernel 141 (2026-10-31): 80 columns. ESC then X switches between 40 and 80 columns, as on a MEGA65 -- the core's hi-res text, the same 25 rows and characters half as wide. Needs core v0.95. Into 80 the screen stays on the left half; a line that wrapped onto two rows in 40 becomes one row Back to 40 the screen is cleared The editor the same keys, the same 80-character line: INST stops when the row is full, DEL pulls the row left, RETURN takes the line under the cursor RUN does not switch; RUN/STOP+RESTORE keeps the mode; HELP comes back to 80; VMOS, GO V20 and .RVKs start in 40 as before POKE $B0A4/$B0A7 columns 0-79 in 80 columns The machine still boots in 40 columns, boot screen unchanged. KERNEL.BIN 309,760 bytes (kernel 141 + vmos_b123 + help_b08 + vic20hw_b9) BASIC v5.1 -- kernel 142 + HELP b09 + VCMD b02 (2026-10-31): F5 in the HELP browser opens the VIXEN Commander in 80 columns -- two panels, long file names, mouse and sliders, the old VCMD's keys (F1 drive, F3 view, F5 copy, F6 move, F7 new folder, F8 delete); F10 (SHIFT+F9) or HELP back to the browser, RUN/STOP or ESC back to BASIC. C: writes stay inside /VIXEN-32/. BASIC's screen comes back exactly as it was, in 40 or 80 columns. The commander draws on tile map 1: a program's own picture there is gone after. KERNEL.BIN 343,552 bytes (kernel 142 + vmos_b123 + help_b09 + vic20hw_b9 + vcmd_b02) Kernel 142 + VCMD b03 (BASIC v5.1 still, 2026-10-31): the commander's F5 copy and F6 move take folders with everything in them, to another drive too. KERNEL.BIN 346,624 bytes (kernel 142 + vmos_b123 + help_b09 + vic20hw_b9 + vcmd_b03) Kernel 142 + VCMD b04 (BASIC v5.1 still, 2026-10-31): the commander mends its own screen -- its display registers are written every frame and its boxes redrawn a row a frame, so a box lost on the board comes back. KERNEL.BIN 347,136 bytes (kernel 142 + vmos_b123 + help_b09 + vic20hw_b9 + vcmd_b04) Kernel 142 + vic20hw b12 (BASIC v5.1 still, 2026-11-01): GO V20 gets the VIC-20 build 12 -- a BASIC program's line links are set as LOAD sets them. KERNEL.BIN 347,136 bytes (kernel 142 + vmos_b123 + help_b09 + vic20hw_b12 + vcmd_b04) Kernel 143 (BASIC v5.1 still, 2026-11-01): RND(0) gives random numbers from the start. EhBASIC never seeds its generator and the boot clears the 6502's memory, so RND(0) returned 0 for ever until a program seeded it. Now a key press seeds it from the raster line and the time since power-on at that moment -- only while nothing has seeded it, so RND(n) in a program still gives the same numbers every run. KERNEL.BIN 347,136 bytes (kernel 143 + vmos_b123 + help_b09 + vic20hw_b12 + vcmd_b04) Kernel 143 + VCMD b05 (BASIC v5.1 still, 2026-11-01): the commander renames (F2), marks entries (SPACE, CTRL+A all) and copies, moves and deletes everything marked at once (F5, F6, F8). KERNEL.BIN 351,232 bytes (kernel 143 + vmos_b123 + help_b09 + vic20hw_b12 + vcmd_b05) Kernel 143 + VMOS b127 (BASIC v5.1 still, 2026-11-01): VMOS 0.22 -- bob images 241-1024 of up to 1024 x 1024 in chip RAM, and Bob n, x, y, i, w, h draws a bob scaled to w x h. KERNEL.BIN 353,280 bytes (kernel 143 + vmos_b127 + help_b09 + vic20hw_b12 + vcmd_b05) Kernel 143 + vic20hw b13 (BASIC v5.1 still, 2026-11-01): GO V20 gets the VIC-20 build 13 -- fit to screen off follows a screen that fits. KERNEL.BIN 353,280 bytes (kernel 143 + vmos_b127 + help_b09 + vic20hw_b13 + vcmd_b05) Kernel 143 + vic20hw b15 (BASIC v5.1 still, 2026-11-01): GO V20 gets the VIC-20 build 15 -- b13's screen following taken out, F3 off is the fixed TV view again. KERNEL.BIN 353,280 bytes (kernel 143 + vmos_b127 + help_b09 + vic20hw_b15 + vcmd_b05) Kernel 143 + vic20hw b16 (BASIC v5.1 still, 2026-11-01): GO V20 gets the VIC-20 build 16 -- ALT + the cursor keys move the fixed picture by hand, kept per game. KERNEL.BIN 355,840 bytes (kernel 143 + vmos_b127 + help_b09 + vic20hw_b16 + vcmd_b05) Kernel 143 + vic20hw b17 (BASIC v5.1 still, 2026-11-01): GO V20 gets the VIC-20 build 17 -- the picture moved with ALT + the cursor keys is no longer kept per game. KERNEL.BIN 353,792 bytes (kernel 143 + vmos_b127 + help_b09 + vic20hw_b17 + vcmd_b05) Kernel 143 + VMOS b128 (BASIC v5.1 still, 2026-11-02): VMOS 0.23 -- turned bobs. KERNEL.BIN 355,840 bytes (kernel 143 + vmos_b128 + help_b09 + vic20hw_b17 + vcmd_b05) Kernel 144 (BASIC v5.1 still, 2026-11-02): EhBASIC types the characters printed on the front of the MEGA65's keys with MEGA held, as VMOS does -- MEGA + / \, MEGA + , ~, MEGA + . |, MEGA + = _, MEGA + : {, MEGA + ; }, and MEGA + left arrow the backquote. KERNEL.BIN 355,840 bytes (kernel 144 + vmos_b128 + help_b09 + vic20hw_b17 + vcmd_b05) Kernel 144 + VMOS b130 (BASIC v5.1 still, 2026-11-03): VMOS 0.24 -- the C64: C64 On, C64 Off and C64 Run. Your own C64 ROMs are loaded the way the VIC-20's are, from the program's folder; none are in KERNEL.BIN. KERNEL.BIN 358,912 bytes (kernel 144 + vmos_b130 + help_b09 + vic20hw_b17 + vcmd_b05) Kernel 144 + VMOS b131 (BASIC v5.1 still, 2026-11-03): VMOS 0.24 -- Vic20 Border and C64 Border (left, right, top, bottom): the VIC-20's and the C64's border on their live screens. KERNEL.BIN 359,424 bytes (kernel 144 + vmos_b131 + help_b09 + vic20hw_b17 + vcmd_b05) Kernel 144 + VMOS b132 (BASIC v5.1 still, 2026-11-04): VMOS 0.24 -- the C64's and the VIC-20's picture no longer freezes for one second every 22 seconds. KERNEL.BIN 359,424 bytes (kernel 144 + vmos_b132 + help_b09 + vic20hw_b17 + vcmd_b05) Kernel 145 (BASIC v5.1 still, 2026-11-04): GO 64 at Ready starts the C64, as GO V20 starts the VIC-20 -- the core's own C64 chips, run by c64hw, the new sixth part of KERNEL.BIN. Your own ROMs go in /VIXEN-32/C64/ (KERNAL.ROM, BASIC.ROM, CHAR.ROM); KERNEL.BIN holds none. Games: .PRG files in /VIXEN-32/C64/GAMES, from HELP inside the C64. KERNEL.BIN 371,200 bytes (kernel 145 + vmos_b132 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b5) Kernel 145 + VMOS b133 (BASIC v5.1 still, 2026-11-04): VMOS 0.24 -- the VIC-20 now starts with its picture right after a C64 run (it was black the first time). KERNEL.BIN 371,200 bytes (kernel 145 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b5) Kernel 146 (BASIC v5.1 still, 2026-11-04): GO 20 (or GO20) at Ready starts the VIC-20, the same as GO V20. KERNEL.BIN 371,200 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b5) Kernel 146 + c64hw b6 (BASIC v5.1 still, 2026-11-05): the C64 plays .CRT cartridges too (normal 8K / 16K / Ultimax and EasyFlash), from the HELP menu inside the C64; needs core C64-T6. KERNEL.BIN 373,760 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b6) Kernel 146 + c64hw b7 (BASIC v5.1 still, 2026-11-05): three more .CRT cartridge types -- Final Cartridge III and Ocean (on core C64-T6) and Zaxxon (needs core C64-T7). KERNEL.BIN 374,272 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b7) Kernel 146 + c64hw b8 (BASIC v5.1 still, 2026-11-05): bank-switching .CRT cartridges switch without copying, so Creatures loads fast. Needs core C64-T8 -- on an older core, bank-switching cartridges break. KERNEL.BIN 374,784 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b8) Kernel 146 + c64hw b9 (BASIC v5.1 still, 2026-11-05): F3 in the C64's menu makes the Amiga mouse a joystick, paddles or a 1351 mouse, in port 1 or 2. Paddles and the 1351 need core C64-T9; the rest needs C64-T8. KERNEL.BIN 375,808 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b9) Kernel 146 + c64hw b10 (BASIC v5.1 still, 2026-11-06): the C64's mouse speed -- F5 faster, F7 slower in the C64's menu, 25% to 400% (default 100%), in the paddle and 1351 modes. Needs core C64-T9. KERNEL.BIN 375,808 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b10) Kernel 146 + c64hw b11 (BASIC v5.1 still, 2026-11-06): the C64's mouse speeds are now 12%, 25%, 33%, 50%, 75%, 100% and 150% (default 50%). Needs core C64-T9. KERNEL.BIN 375,808 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b17 + vcmd_b05 + c64hw_b11) Kernel 146 + vic20hw b18 (BASIC v5.1 still, 2026-11-06): the VIC-20's mouse as paddles -- F5 in the VIC-20's menu on / off, F7 / SHIFT+F7 the speed, 12% to 150% (default 50%). The paddles need core C64-T10. KERNEL.BIN 376,832 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b11) Kernel 146 + c64hw b12 (BASIC v5.1 still, 2026-11-06): in the C64's menu, F5 now slows the mouse and F7 speeds it up. KERNEL.BIN 376,832 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b12) Kernel 146 + c64hw b14 (BASIC v5.1 still, 2026-11-06): ten more .CRT cartridge types in the C64 (types 4, 7, 8, 11, 12, 13, 15, 17, 19 and 21). KERNEL.BIN 377,344 bytes (kernel 146 + vmos_b133 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b14) Kernel 147 (BASIC v5.1 still, 2026-11-07): the kernel's file system reads the card 3-4 times faster per sector (the core's paired burst read), so films and big files stream faster -- Magic Carpet's intro first. An older core without it keeps the old read. KERNEL.BIN 377,856 bytes (kernel 147 + vmos_b133 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b14) C64 b16 (BASIC v5.1 still, 2026-11-08): GO 64 now has drive 8 for .D64 files, with no 1541 and no core change. A .D64 in /VIXEN-32/C64/GAMES shows in its HELP menu as DISK: RETURN puts the disk in and types LOAD"*",8,1 and RUN; SHIFT+RETURN only puts it in, or takes it out. The disk is read only. KERNEL.BIN 383,488 bytes (kernel 147 + vmos_b133 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b16) Kernel 148 (BASIC v5.1 still, 2026-11-11): three fixes found on the board. A .BAS or .PRG picked in HELP makes C: and its own folder current, so BAS3's READF finds FONT16.RAW beside it (the kernel's file system also keeps a folder changed without a CD printing it). And GET reads the keys while a program runs, as on a C64: "PRESS A KEY" goes on at any key, and nothing is typed on the screen; at Ready and in INPUT typing is as before. And IMAGE loads its picture again after a LOAD, a HELP pick or a READF: before, the second run of BAS15 drew a streak along the top of every ball. KERNEL.BIN 384,000 bytes (kernel 148 + vmos_b133 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b16) Kernel 149 (BASIC v5.1 still, 2026-11-11): raw keys (POKE $B0EF,1) end at Ready, however the program stopped: BAS13 broken with RUN/STOP no longer leaves a keyboard that types nothing. And RUN/STOP always breaks a GET loop -- GET could take it as a key and the program went on. KERNEL.BIN 384,512 bytes (kernel 149 + vmos_b133 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b16) VMOS b134 (2026-11-12): one editor fix -- typing after an empty selection. KERNEL.BIN 384,512 bytes (kernel 149 + vmos_b134 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b16) C64 b17 (2026-11-12): GMod2 cartridges (.CRT type 60: Sam's Journey, Wormhole) -- 64 banks of 8K plus the cartridge's 2K EEPROM, saved on the card as GAME.EEP beside GAME.CRT a second after the game saves and when HELP opens the menu. No core change. KERNEL.BIN 385,536 bytes (kernel 149 + vmos_b134 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b17) C64 b18 (2026-11-12): a cartridge read the 6502 waits on is answered while the picture is copied, so the 6502 no longer stands for a whole copy. Runs on any core from C64-T8; Wormhole needs core C64-T11 (the CIAs keep counting while the 6502 waits). KERNEL.BIN 385,536 bytes (kernel 149 + vmos_b134 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b18) C64 b19 (2026-11-12): SHIFT+F3 in the C64 game menu swaps the joystick ports (MEGA65 port 1 = C64 port 2 and the other way round); the status bar shows PORTS SWAPPED, and it stays from game to game. Mouse paddles and the 1351 stay in their own C64 port. Any core. KERNEL.BIN 386,048 bytes (kernel 149 + vmos_b134 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b19) C64 b20 (2026-11-13): .TAP tapes in the C64 game menu -- RETURN puts the tape in, presses PLAY and types LOAD/RUN; SHIFT+RETURN only puts the tape in or takes it out. A tape sits in the top 8 MBytes of Zorro RAM while the C64 runs. Tapes need core v0.98 (the menu says so on an older core); everything else runs on any core from C64-T8. KERNEL.BIN 387,584 bytes (kernel 149 + vmos_b134 + help_b09 + vic20hw_b18 + vcmd_b05 + c64hw_b20) HELP b10 + Commander b06 (2026-11-14): both title bars show the core's version beside the kernel's build: "Core V0.98 Kernel 149". A core older than v0.98 shows the kernel alone, as before. KERNEL.BIN 389,120 bytes (kernel 149 + vmos_b134 + help_b10 + vic20hw_b18 + vcmd_b06 + c64hw_b20) VMOS b135 (2026-11-14): .CMS files (CMOS's programs) -- F3 lists and loads them, F1 runs them, and saving keeps the .CMS name. KERNEL.BIN 389,120 bytes (kernel 149 + vmos_b135 + help_b10 + vic20hw_b18 + vcmd_b06 + c64hw_b20) Commander b07 (2026-11-16): the commander guards KERNEL.BIN alone, the one file the machine starts from (never deleted, moved or written over). KERNEL.BIN 388,608 bytes (kernel 149 + vmos_b135 + help_b10 + vic20hw_b18 + vcmd_b07 + c64hw_b20)