Pico Computer 3 - Fuzix release 0.15
The machine can play a game, and everything in this release is
something that had to be true before it could.
BLIT, SPRITE and the flash slots. BLIT copies a rectangle of
screen anywhere, reads and writes the flash slots MMBasic keeps images
in, and works against the off-screen framebuffer as well as the
display. On top of it sits the SPRITE family — load, show, move,
hide, collision detection, transparency — and a two-axis SPRITE SCROLL. A rectangle crosses into the kernel once now rather than once
per row.
The synthesiser moved into the kernel. PLAY SOUND and PLAY TONE were rendered by a separate program keeping a fifth of a second
of audio queued ahead: fine for music, impossible for a game. The four
voices are now rendered in the interrupt that feeds the DAC, where
MMBasic renders them, and a note is heard in under two milliseconds.
PLAY MODFILE and PLAY MODSAMPLE play tracker modules.
A program's own font. DefineFont takes MMBasic's hex block and
gives the program fonts 10 to 16, byte-compatible with MMBasic's, so a
font written for a PicoMite is pasted in and works.
The compiler bug that made all of it fail. picofrog froze the
machine with no crash message, in native code and bytecode alike. The
compiler emitted a stack frame of whatever size the locals added up to
— 261 bytes in one function — and an odd frame leaves the
interpreter's stack pointer odd, so the next 64-bit store through a
by-reference local crossed an alignment boundary and took a fault the
display mode hid. Frames are rounded now. It would have reached any
program with enough locals and a FLOAT passed by reference.
The keyboard. AltGr types the third character on a key, the
console and INKEY$ share one decoder rather than two that had
drifted, and the USB stack survives a keyboard being unplugged,
replugged or reset mid-session.
Smaller things. cc prog.bas translates and compiles in one
command. ELSE IF as two words translates. Stopping a program with
Ctrl-C no longer leaves the terminal raw — which had been logging
people out, because a shell reading a raw terminal sees an instant end
of input and takes it for a hangup. mmedit colours DefineFont,
SPRITE, BLIT and FLASH as the translatable keywords they became.
Forty-six MMBasic example programs live in /root/MMBasic with a
README saying what each one shows.
If you have built a clone
The kernel now raises the core voltage with the clock, which it
never did before, and clone builders should re-flash fuzix.uf2 for
this alone.
The RP2350 leaves reset at 1.10 V and this kernel runs at 375 MHz. The
Pico Computer 3 itself does not depend on the chip's regulator — DVDD
there comes from an external 1.3 V supply — so the call was left out on
purpose and its absence was invisible on real hardware. A clone built
on a stock module such as a Pimoroni PGA2350 has only the internal
regulator, so it was being asked to run 375 MHz on 1.10 V, and did not.
The ladder is MMBasic's, from PicoMite.c: 1.15 V to 200 MHz, 1.30 V
to 320 MHz, and above that 1.40 V where MMBasic uses 1.60. Voltage is
raised before the clock and given 10 ms to settle.
This kernel has been flashed and booted on a Pico Computer 3, where the
ladder is a no-op because DVDD is external — so what that confirms is
that nothing regressed on the original board, not that a clone now
works. No clone has been tested. If 1.40 V turns out not to be
enough on yours, please say so: it is one constant, and 1.60 V is what
MMBasic would have used.
The same change is in the MicroPython firmware for this board
(UKTailwind/micropython, branch pico-computer-3), which starts at
252 MHz and reaches 378 through screen().
Coverage
104 statements, 91 functions, 5 scalar and 6 array MATH
sub-functions.
Gates
make check 0, cgate 0, fcctests 48/48, qemu 49/49, ctest
165, cpptest clean, ioctlcheck 59 codes, relcheck agrees on
0.15.
Verified on the board, from this card
MM.VER reports 0.15 from a program translated, compiled and run by
the card's own mmbc/cc/bcrun. PLAY, SPRITE, BLIT and flash-slot
programs all compile on the machine itself; a tone plays with no
renderer process in ps, and PLAY MODFILE/PLAY MODSAMPLE drive a
game soundtrack with effects mixed over it. Ctrl-C on a program
holding the terminal returns to the shell prompt.
The assets
fuzix.uf2— the kernel. Hold BOOT, click RESET, release BOOT, and
copy it to the drive that appears.pc3-sd-cc.img.gz— the SD card, with the compiler and the
examples. Writes to any card of 1 GB or more.FUZIX-PC3-MANUAL.pdf— Unix and MMBasic on the Pico Computer.PC3-C-MANUAL.pdf— the C interface to the port's own facilities.