The VIXEN-32 computer

MEGA65 Edition

VIXEN‑32
User’s Guide

A friendly introduction to your 32‑bit home computer

Welcome

The VIXEN‑32 is a home computer in the classic mould: switch it on and a few seconds later a blue screen says Ready, waiting for you to type. Underneath that familiar face is a modern heart — a 32‑bit RISC‑V processor at 100 MHz, 512 KB of fast RAM plus 16 MB of chip RAM, sixteen 64×64 hardware sprites, a copper, a blitter, a SID sound chip and a four‑voice sample player, real floppy‑style disk drives, and an Ethernet port.

The language you meet at the prompt is BASIC (EhBASIC 2.22), with a full‑screen editor that works exactly the way the eight‑bit machines taught the world: move the cursor onto any line, change it, press RETURN, and it is so.

This guide is written in the spirit of the computer manuals of 1982 — the ones that assumed nothing and got you flying a hot‑air balloon across the screen by the sprite chapter. That balloon is here too, in Chapter 5, wearing a V for VIXEN.

Chapter 1

Setting up your VIXEN‑32

The hardware

VIXEN‑32 runs on the MEGA65 computer — its FPGA becomes the VIXEN chipset, and its keyboard, SD card slot, joystick ports and Ethernet socket become the VIXEN’s own.

The VIXEN-32 computer
The VIXEN‑32 — MEGA65 hardware underneath.

What you need

Three things: a MEGA65 with the VIXEN‑32 core installed, a display, and an SD card carrying the machine’s software.

The display. The VIXEN outputs both HDMI (720p at 50 Hz) and 15 kHz analog RGB at the same time, so a modern television and a proper CRT are equally at home. The picture is true PAL: 384×224 pixels, 50 frames a second.

The SD card. Everything the machine is lives in one file: /VIXEN-32/BOOT.BIN. At power‑on the core reads it from the card and becomes the machine. Updating your VIXEN is a file copy — no flashing, no tools (Chapter 8 shows how to do it over the network without even removing the card).

Switching on

Turn the power on. The border flashes through a sequence of colours as the machine boots — on a healthy start they pass in under a second — and then:

The VIXEN-32 boot screen: the V32 logo and banner on a blue screen inside a yellow border
The boot screen: the V32 logo at the left, the banner beside it, white on blue inside a yellow border. The white block is the cursor — BASIC, listening.

If instead you get a red border and an error code, the machine could not load BOOT.BIN — nothing is broken, and nothing on the card has been changed. Appendix C lists every code and what to do about it.

Chapter 2

Getting started

The keyboard

Every key types what is printed on it. Letters arrive in uppercase, which is what BASIC keywords require. A few keys are special:

KeyWhat it does
RETURNFeeds the line under the cursor to BASIC.
Cursor keysMove anywhere on the screen; they wrap at the edges.
INS/DELDelete pulls the line left; insert pushes it right.
HOME / CLRCursor to the top corner; shifted, clears the screen.
RUN/STOPStops a running program: BREAK IN LINE n. CONT resumes.
RUN/STOP+RESTOREThe panic button. Clears the screen, restores the boot colours, returns to Ready — even from machine code.
CTRLHeld during LIST, slows the listing.
NO SCROLLPauses a listing; again to continue.
SHIFT+£Switches the network on and off (Chapter 8).

The screen is the editor

The screen is 40 columns by 25 rows, and all of it is editable. Type anywhere. Move the cursor up onto an old line, change a character, press RETURN, and the changed line is entered as if you had typed it fresh. A logical line may be up to 80 characters — two screen rows — and RETURN enters the whole thing. This one idea — edit the screen, not a buffer — is how you will fix and re‑enter program lines all day.

Your first words

PRINT "HELLO, I AM THE VIXEN-32" HELLO, I AM THE VIXEN-32 PRINT 2+2 4 PRINT 512*1024 524288

PRINT shows things; with quotes it shows text, without them it does the arithmetic first. The operators are + - * / and ^ for powers, with parentheses working as they did in school. The machine is also a fine calculator.

Variables remember values: A=10, then PRINT A*3 gives 30. A name ending in $ holds text: N$="FOX". To clear the screen, print the clear‑screen character: PRINT CHR$(147).

Colour, first taste

The border and background each have a colour register you can POKE (Chapter 4 explains POKE properly — for now, trust it):

POKE 45088,2 : REM RED BORDER POKE 45089,0 : REM BLACK BACKGROUND

Sixteen colours, numbered 0–15 — the full chart is Appendix B. Change them, break things, then remember RUN/STOP+RESTORE puts everything back.

Chapter 3

Beginning BASIC programming

A program is lines with numbers. Numbered lines are stored, not executed; RUN executes them in order, LIST shows them, NEW throws them away. Number in tens, so there is room to insert lines later.

Loops and decisions

10 FOR I=1 TO 5 20 PRINT "VIXEN ";I 30 NEXT I RUN VIXEN 1 VIXEN 2 VIXEN 3 VIXEN 4 VIXEN 5

FOR…NEXT repeats; STEP changes the stride (FOR I=10 TO 0 STEP -1 counts down). GOTO jumps to a line. IF…THEN decides. GOSUB…RETURN calls a subroutine and comes back. INPUT asks the person at the keyboard. Those six ideas are most of BASIC; everything else is vocabulary.

A whole game, twenty lines shy

10 REM GUESS THE NUMBER 20 N=INT(RND(1)*100)+1 30 T=0 40 INPUT "YOUR GUESS";G 50 T=T+1 60 IF G<N THEN PRINT "TOO LOW" : GOTO 40 70 IF G>N THEN PRINT "TOO HIGH" : GOTO 40 80 PRINT "GOT IT IN";T;"TRIES"

RND(1) gives a random fraction between 0 and 1; line 20 turns it into a whole number from 1 to 100. Type it in, RUN it, then change it — make the range bigger, count down the guesses, insult the player. Changing a working program is how programming is learned.

When a program is worth keeping, SAVE "GUESS" writes it to disk and LOAD "GUESS" brings it back — Chapter 7 has the whole story.

Chapter 4

Advanced BASIC

PEEK and POKE: the machine’s control panel

POKE address,value writes a byte straight into the machine; PEEK(address) reads one. Most of the VIXEN’s hardware — colours, sprites, sound, joysticks, the copper — is a row of such addresses starting at 45056 ($B000), laid out exactly like a Commodore 64’s $D000 block: the border is at $B020 as it was at $D020, so a C64 routine ports by changing one digit. Appendix A is the full map.

READ and DATA

10 FOR I=1 TO 4 20 READ A : PRINT A*A 30 NEXT I 40 DATA 1,2,3,4

DATA lines hold numbers (or strings) inside the program; READ consumes them in order and RESTORE rewinds. This is how sprite shapes travel inside a listing, as Chapter 5 is about to show. DIM A(10) makes arrays when single variables run out.

Reading the joystick

PEEK(45152) is joystick port 1, PEEK(45153) port 2. Each direction is a bit, and the bits are not in a tidy order — test them with AND:

Bit value124832
Meansdownupfirerightleft
10 J=PEEK(45152) 20 IF J AND 4 THEN PRINT "FIRE!" 30 IF J AND 32 THEN PRINT "LEFT" 40 IF J AND 8 THEN PRINT "RIGHT" 50 GOTO 10

A mouse in the port reads through PEEK(45154)/PEEK(45155) (X and Y) and PEEK(45156) (buttons). The counters run freely and wrap at 256, so keep the previous reading and subtract to get the movement since last time.

Waiting for a key

GET A$ takes one keypress without stopping the program (empty string if none is waiting) — the difference between a form and a game.

Chapter 5

Sprite graphics

A sprite is a picture the hardware moves over the screen for free — no redrawing, no flicker, no arithmetic. The VIXEN‑32 has sixteen of them, each up to 64×64 pixels, each in a single colour (1 bit per pixel) or full 256‑colour (8 bits per pixel). All sixteen can share a scanline; there is no per‑line limit to outwit.

Designing a sprite

A one‑colour sprite is a grid of on/off pixels, eight pixels to a byte, the leftmost pixel in the highest bit — the same order the Commodore 64 used, so classic sprite DATA pokes straight in. Here is ours: the hot‑air balloon, 24×21, with a V punched out of the canopy where the old machines wore a C:

The balloon, 24×21 pixels — three bytes per row. Each row of the grid becomes three numbers in a DATA line.

Getting the picture into the machine

A C64 poked sprite shapes into its own RAM. The VIXEN keeps sprite images in chip RAM, in numbered 4096‑byte slots, reached through a little three‑register window:

POKEHexMeaning
45184,n$B080Select slot n (resets the write position)
45185 / 45186$B081/2Write position within the slot, low / high
45187,v$B083Write one byte; the position steps forward by itself

A 1‑bit‑per‑pixel image is 8 bytes per row, 64 rows — 512 bytes. Our balloon is 24 pixels wide, so each row is its three data bytes and five blank ones, and after 21 rows the rest of the slot is padded with zeros.

Aiming a sprite

Select a sprite channel, then set what it shows and how:

POKEHexMeaning
45104,n$B030Select sprite 0–15
45105 / 45106$B031/2X position, low byte / high bit
45107,y$B033Y position
45108,s$B034Image slot number
45109,c$B035Colour (1‑bpp sprites)
45110,f$B036Flags: 2=8bpp, 4=opaque, 8=flip‑H, 16=flip‑V, 32=on top
45077,m$B015Enable sprites 0–7 (one bit each, like $D015)
45112,m$B038Enable sprites 8–15

Coordinates count from the top‑left of the border, C64‑style: the visible 320×200 window runs from X=32 to 351 and Y=12 to 211. X can exceed 255, which is why it has a high bit — the listing below shows the classic idiom for splitting it.

The familiar C64 register layout is also mirrored for the first eight sprites — POKE 45056+2*n for X, 45057+2*n for Y, 45095+n for colour — so old fingers find everything where it was.

Up, up and away

Everything above, in one program. Type it in exactly, then RUN:

10 REM UP, UP AND AWAY -- THE VIXEN BALLOON 20 PRINT CHR$(147) 30 POKE 45088,0 : POKE 45089,6 40 PRINT "UP, UP AND AWAY!" 100 REM LOAD THE IMAGE INTO SLOT 1 110 POKE 45184,1 120 FOR R=0 TO 20 130 FOR B=0 TO 2 : READ Q : POKE 45187,Q : NEXT B 140 FOR B=3 TO 7 : POKE 45187,0 : NEXT B 150 NEXT R 160 FOR N=1 TO 344 : POKE 45187,0 : NEXT N 200 REM SPRITE 0: SLOT 1, CYAN, ON TOP 210 POKE 45104,0 : POKE 45108,1 : POKE 45109,3 : POKE 45110,32 220 POKE 45077,1 300 REM FLY, RISING TO THE RIGHT 310 FOR X=32 TO 288 320 Y=150-X/2 330 POKE 45105,X AND 255 : POKE 45106,-(X>255) : POKE 45107,Y 340 NEXT X 350 GOTO 310 1000 DATA 0,127,0,1,255,192,3,255,224,3,221,224 1010 DATA 7,221,240,7,235,240,7,235,240,3,247,224 1020 DATA 3,255,224,3,255,224,2,255,160,1,127,64 1030 DATA 1,62,64,0,156,128,0,156,128,0,73,0,0,73,0 1040 DATA 0,62,0,0,62,0,0,62,0,0,28,0

What each part does:

Lines 110–160 pour the picture into slot 1: three DATA bytes per row, five blanks to fill the 8‑byte row, then zeros to the end of the 64‑row image. Line 210 points sprite 0 at slot 1, colours it cyan, and sets the on‑top flag. Line 220 switches it on. Lines 310–340 fly it: X AND 255 is the low byte and -(X>255) is a neat BASIC trick — the comparison is −1 when true, and the minus sign turns it into the 1 the high‑bit register wants.

Collisions, and further

PEEK(45086) tells you which sprites touched each other this frame, PEEK(45087) which touched the background — pixel‑perfect, one bit per sprite, just like $D01E/$D01F. When you outgrow one balloon: the machine’s own demonstration, test_hw.bas, flies this same balloon twice — the second copy scaled up 3× in BASIC into a second slot — and is worth reading line by line.

Chapter 6

Creating sound

The VIXEN’s classic voice is a SID — the famous three‑voice synthesizer chip, cycle‑modelled, with its filters and its character intact. Its 29 registers live at POKE 46080+r ($B400, the C64’s $D400 block relocated whole). A value stays set until you change it.

The beeper: one POKE makes sound

Before the SID, meet the machine’s simplest instrument: a single square wave — the same thing a PC speaker is. Two registers take the pitch in hertz, low byte and high byte; either write sets the tone, and 0 Hz is silence:

POKE 45230,1 : POKE 45229,184 : REM 440 HZ, CONCERT A POKE 45229,0 : POKE 45230,0 : REM SILENCE

440 is 1×256 + 184, hence the two POKEs; a pitch under 256 Hz needs only the low byte once the high byte is cleared. There is no envelope — the tone starts and stops instantly — which makes the beeper the right tool for key clicks, alarms, and this:

10 REM SIREN -- RUN/STOP ENDS IT 20 FOR F=300 TO 900 STEP 5 30 POKE 45229,F AND 255 : POKE 45230,INT(F/256) 40 NEXT F 50 FOR F=900 TO 300 STEP -5 60 POKE 45229,F AND 255 : POKE 45230,INT(F/256) 70 NEXT F 80 GOTO 20

(After breaking out, POKE 45229,0 : POKE 45230,0 by hand — or press RUN/STOP+RESTORE, which silences everything.) A PEEK of either register reads back the pitch you asked for.

First SID sound

10 POKE 46104,15 : REM VOLUME UP 20 POKE 46080,137 : POKE 46081,65 : REM VOICE 1 PITCH 30 POKE 46085,0 : POKE 46086,240 : REM ENVELOPE 40 POKE 46084,17 : REM TRIANGLE WAVE, GATE ON 50 FOR T=1 TO 500 : NEXT 60 POKE 46084,16 : REM GATE OFF

The shape of every SID sound is here: set the volume (register 24), a pitch (registers 0 and 1, low and high), an envelope — how the note attacks, decays, sustains, releases (registers 5 and 6) — then open the gate with a waveform (register 4: 17 triangle, 33 sawtooth, 65 pulse, 129 noise; subtract 1 to close the gate and let the note release).

Voices 2 and 3 are the same seven registers at offsets +7 and +14. Try noise (129) with a fast envelope for drums, or two voices a fifth apart — and when the SID feels tame, the machine also carries a four‑voice digital sample player that games and demos use for real recorded sound.

Chapter 7

Disks and files

Drives A: and B:

The VIXEN mounts disk images as drive A: and drive B: (pick them in the platform menu). BASIC speaks fluent disk:

SAVE "TEST" : REM TO DRIVE A: LOAD "TEST" LOAD "B:GAME" : REM FROM DRIVE B: DIR : REM LIST THE DIRECTORY CD DATA : REM ENTER A DIRECTORY, CD \ GOES BACK DEL OLDFILE COPY GAME B: : REM COPY BETWEEN DRIVES MOVE OLD NEW : REM RENAME MKDIR SAVES

Command arguments are separated by spaces, DOS‑style. Long filenames, mixed case and subdirectories all work. Programs are stored in the classic .PRG form — two bytes of load address, then the program — so files move freely between BASIC and the machine’s file menu.

Loading from the menu

The platform menu’s file browser loads three kinds of file: a .BAS types itself into the editor (you RUN it), a .PRG loads as if typed, and a .RVK is a native machine‑code application — a game, a demo, a terminal — that takes over the whole machine and hands it back when it exits.

Files as data: READF and WRITEF

READF 0,"SCORES",49152 : REM FILE -> MEMORY WRITEF 0,"SCORES",49152,100 : REM MEMORY -> FILE

Unit 0 is BASIC’s own memory, unit 1 is the 16 MB chip RAM (sprite sheets, level maps, samples), and unit −1 asks a file’s size without reading it. The result lands where a program can see it: PEEK(45247) is the status (0 means success) and 45244–45246 hold the byte count. Always check the status — a missing file does not stop the program, it just says so there.

Bootable disks

A disk whose first sector carries the V32B signature boots when mounted in A: at the Ready prompt — no key to hold; the disk decides. It stays an ordinary disk otherwise: it lists, copies, and holds files as usual. Only drive A: boots, so any disk can be examined safely from B:.

Chapter 8

The network

The VIXEN‑32 has real Ethernet — and boots with it off. A retro machine should not join a network just because someone switched it on. When you want it:

<SHIFT + £> NET : REM LINK, ADDRESS, COUNTERS PING 192.168.5.1 : REM ROUND TRIP IN MICROSECONDS PING GOOGLE.COM : REM BY NAME, VIA DNS

Out of the box the machine uses DHCP. A plain text file on the SD card, /VIXEN-32/NETWORK.TXT, sets a fixed address, gateway, DNS or MAC when you want one — edit it on any PC. While the machine sits at Ready it answers pings, even while a BASIC program runs.

TFTP: files over the wire

TFTP ON

…and the machine becomes a file server. From a PC on the same network:

C:\> tftp -i 192.168.5.69 put game.rvk C:\> tftp -i 192.168.5.69 get README.TXT

Files named plainly land on the SD card under /VIXEN-32/; prefix A: or B: to write to a mounted disk. About 64 KB/s in either direction — twice an Amiga floppy. This is also how the machine itself is updated: upload a new BOOT.BIN, read it back to compare, power cycle.

Calling the board

The terminal program (TERMINAL_BNN.RVK, in /VIXEN-32/network/) dials the VIXEN‑32 bulletin board — complete with the handshake sound and CONNECT 1200, the logon art painting in at 1200 baud the way it really felt. On the board: multi‑user chat, who‑is‑on, message bases, a file area you can download from straight to the SD card, and updates for the machine itself. Bring the network up first (SHIFT+£); RUN/STOP hangs up.

There is an IRC client beside it for the real chat networks, and Network Pong — press 1 to play the machine, 2 to be matched against whoever else is out there, your mouse as the paddle. First to 9.


Appendix A

POKE & PEEK quick reference

The I/O window starts at 45056 ($B000) and mirrors the C64’s $D000 layout wherever a C64 equivalent exists.

Screen and layers

AddressHexFunction
45088$B020Border colour (as C64 $D020)
45089$B021Background colour (as C64 $D021)
45120 / 45121$B040/1Tile layer on / off; tiles in front
45122–45125$B042–5Tile scroll X / Y
45136$B050Bitmap layer on / off
45137 / 45138$B051/2Bitmap pointer
45139–45141$B053–5Bitmap scroll
45074$B012Raster position (read; BASIC is too slow to chase it)

Sprites

AddressHexFunction
45056+2n / 45057+2n$B000+Sprite n X / Y (C64 layout, sprites 0–7)
45072$B010Sprite X high bits (as $D010)
45077 / 45112$B015/$B038Enable sprites 0–7 / 8–15
45095+n$B027+Sprite n colour (as $D027)
45086 / 45087$B01E/FCollisions: sprite–sprite / sprite–background (read)
45104–45110$B030–6Select window: sprite no., X lo, X hi, Y, slot, colour, flags
45184–45187$B080–3Image uploader: slot, offset lo/hi, data byte

Input

AddressHexFunction
45152 / 45153$B060/1Joystick 1 / 2 (1 down, 2 up, 4 fire, 8 right, 32 left)
45154–45156$B062–4Mouse X, Y (wrapping counters), buttons
45280 / 45281$B0E0/1Last key code / still held

Sound, copper, machine

AddressHexFunction
46080+r$B400+SID register r (0–28), C64 $D400 layout
45229 / 45230$B0AD/EBeeper pitch in Hz, low / high byte (0 = silence)
45169–45177$B071–9Copper: scanline, register id, value, commit entry, run n entries
45244–45247$B0FC–FREADF/WRITEF result: byte count (3 bytes) + status
45214$B09EPOKE 1: print the machine’s licence notices
Appendix B

The sixteen colours

No.ColourNo.Colour
0black 8orange
1white 9brown
2red 10light red
3cyan 11dark grey
4purple 12grey
5green 13light green
6blue 14light blue
7yellow 15light grey

These are the boot palette — the classic set, in the classic order. The full palette holds 256 entries chosen from 65,536; native applications repaint it freely.

Appendix C

Boot screens and error codes

A red border with a code means /VIXEN-32/BOOT.BIN could not be loaded. Nothing has been damaged; fix the card and power cycle.

CodeMeaningWhat to do
E01No SD cardInsert or reseat the card.
E02No filesystemFormat the card FAT16/FAT32.
E03BOOT.BIN not foundCopy it to /VIXEN-32/BOOT.BIN.
E04BOOT.BIN size wrongThe copy is truncated — copy it again.
E05Card read failedTry another card.
E06Not a boot imageThe file is not a VIXEN kernel.
E07Boot image too newUpdate the core, or use a matching BOOT.BIN.
E08Boot image damagedCopy it again.
E09Boot image unusableThe image has no startup code — use a released BOOT.BIN.

During a normal boot the border flashes through a fixed colour sequence, one colour per completed step. If the machine ever stops on a colour, that colour names the last step that succeeded — useful to mention when asking for help.

Appendix D

Keyboard summary

KeyEffect
RETURNEnter the line under the cursor
Cursor keysMove anywhere; wrap at the edges
INS/DELInsert / delete within the logical line
HOME / SHIFT+CLRCursor home / clear screen
RUN/STOPBreak a running program (CONT resumes)
RUN/STOP+RESTOREFull reset to Ready, boot colours restored
CTRL / NO SCROLLSlow / pause a listing
SHIFT+£Network on / off
HELPThe platform menu: load files, mount disks

All keys auto‑repeat. Letters are sent uppercase, as BASIC keywords require.

Appendix E

Going further

When BASIC starts feeling small, the machine goes much deeper:

The Chipset Reference (docs/chipset/Vixen-32_Chipset_Reference.md) is the register‑level manual — the copper, the blitter, the sample engine, interrupts, Ethernet — written for programming the machine in C.

Thirteen tutorials in risc/tuts/ take you from “hello world” to a five‑layer parallax scroller, each one a single commented C file that builds a loadable .RVK.

Worked BASIC examples live in risc/ — test_hw.bas, the full balloon demonstration, among them.

POKE 45214,1 prints the machine’s acknowledgements. VIXEN‑32’s BASIC is derived from EhBASIC by Lee Davison, free for non‑commercial use — a condition the machine carries with pride.

VIXEN‑32 User’s Guide — MEGA65 edition. Written in the tradition of the great home‑computer manuals of 1982: assume nothing, promise a balloon, deliver the balloon.