Pyromaniac

Examples

Example files

Application screenshots

The application runs on a variety of systems - macOS, Windows, and Linux. It's petty similar on them all.

On macOS

[Image]
(Full size image)
MacOS 10.14 is the primary development environment for RISC OS Pyromaniac. The screenshot just shows the application runs, together with the terminal which launched the application.

On Windows (via Wine, on macOS)

[Image]
(Full size image)
Although Windows development environments are available for VMs, largely testing is done though CrossOver (a Wine derived product). Although there will always be some edge cases where the VM with real Windows is necessary, it is simpler to run tests under the Wine environment.
This has the interesting result that RISC OS interfaces are implemented in Python, which runs on a Python compiled for Windows, but which uses interfaces implemented for macOS.

On Linux (via VNC to a local docker image, on macOS)

[Image]
(Full size image)
Running on Linux in desktop in this image is achieved by connecting to a VNC session which is exporting the Linux desktop from a Docker container. The docker container is running the RISC OS Pyromaniac application, but the docker console works just like native.
This is as convoluted as the Windows example, because this is running on macOS. macOS implements Docker by running a Virtual Machine to run the Linux OS underneath. So actually we have RISC OS implemented in Python, executing in a container on Linux, which has been virtualised on a macOS machine to make it look like a native command line tool.

Development media

During the course of development, I produced a number of examples of the tool in use. Some of these are provided here. They are at varying stages of the development of Pyromaniac, although the version number and release date appear on some which may help to identify when they are from.

Building the RISC OS Kernel on macOS

[Asciinema!]
(Asciinema)
An example of the cross-compiling tools running within my CI environment.
This shows the build running for the RISC OS Kernel, on macOS. The process of building is split up into stages:
  • determine what is being built from CI
  • setup up the environment variables for this build
  • download and extract the tools needed for the build (from Artifactory)
  • run the riscos-amu build
  • archive the results
  • upload the archive to Artifactory (when requested)

Running BASIC on macOS

[Asciinema!]
(Asciinema)
BASIC running a few commands very early on.
This demonstrates that SWI calls work, and that the system knows about a few memory regions.

Running BASIC with modules

[Asciinema!]
(Asciinema)
BASIC a month later, with modules present, system banner, and the beginnings of networking.
We now have some more modules working, as well as the Shared C Library. Network works to the point that we can send packets. Quite a few *-commands work now. Console output is converted from Latin-1 to UTF-8 before output.

ANSIText coloured output

[Asciinema!]
(Asciinema)
ANSIText, converting RISC OS VDU sequences to ANSI terminal sequences.
The RISC OS colour selection operations are translated by the 'ansitext' implementation into terminal control codes.

Freeway works

[Asciinema!]
(Asciinema)
Freeway is now running and is able to communicate with its counterpart on another virtualised system.
Here, the system is running on a machine called 'Laputa'. By the time the *FWShow command is issued, Freeway has broadcast its information to other machines on the network and received responses. The command shows that the system has received the registration from the remote machine 'WinRPCEmu' (a RISC OS system running under RPCEmu on Windows). Although it's not visible here, the RPCEmu system happily sees the registration from 'Laputa' as well.
There's a gap in the recording which wasn't intentional - I didn't really need to pause for the module to work.

Snake in a console window

[Asciinema!]
(Asciinema)
ANSIText works well enough to be able to play Snake from INPUT magazine.
Cursor movement is now translatted properly into the terminal control codes by the ANSIText VDU implementation. The program was only slightly modified to run on RISC OS - the original program was designed for a BBC.

OS_GBPB through sed

[Asciinema!]
(Asciinema)
OS_GBPB works, and C programs run.
Being able to run 'sed' means that the multi-byte file operations are working well enough that the C library can read buffered files properly. It's not an amazing demonstration, but it shows that the C library is now working well enough to be useful.

TWIN called from BASIC

[Asciinema!]
(Asciinema)
TWIN runs from within BASIC.
'TWIN' is a BASIC command which invokes the TWIN module to edit the BASIC program. Pyromaniac has its own implementation of TWIN which is incredibly simple - it just invokes a host command on the file, and then waits for it to return.
You'll find the source to the TWIN module in the example code on this page.

CLI aliases

[Asciinema!]
(Asciinema)
Aliases work at the command line.
Aliases are expanded from the system variables, and have to support the same abbreviation rules that the regulr commands do. These are shown to work here - and the fact that aliases containing multiple commands are executed, too.

Tracing execution

[Asciinema!]
(Asciinema)
Using the tracing functions to trace the execution of a utility.
This demonstrates that the instruction tracing works - it's also showing how some of the instructions used to appear - LDM instead of LDMIA, LSR instead of MOV ..., LSR. These are Capstone's disassembly features.

Lots of modules

[Asciinema!]
(Asciinema)
One of the early attempts to just throw as many modules as possible at the system.
There are 217 modules present, although the first few are from Pyromaniac itself and many reported errors on initialisation.

Early example of JFPatch

[Asciinema!]
(Asciinema)
An early example of JFPatch running inside a docker container.
With Pyromaniac and JFPatch in a docker container, it's possible to put together a simple command line which is able to run Pyromaniac inside the container, with the current directory mounted, and then invoke JFPatch on the file that was supplied. Effectively allowing JFPatch to be run from macOS command line.

Network connections

[Asciinema!]
(Asciinema)
Network interface enumeration, and network connections using IPv4 and IPv6 work.
Demonstrates the mapping of the host interfaces to those that can be used by RISC OS. The stack provides IPv4 and IPv6 access to the system. The ifconfig tool was modified slightly to add support for reading the information about the IPv6 addresses - and to use SIOCGIFCONF better. The test command has some hard-coded IPv4 and IPv6 addresses in it which it will communicate with - at present there is not Resolver support for IPv6 addresses.

RAMFS and low-vector watches

[Asciinema!]
(Asciinema)
RAMFS initialisation, and showing that it worked, but it did access the low vector area, triggering the watchpoints.
This example demonstrates loading FileSwitch, FileCore and RAMFS modules and then resizing the RAM disc to have some memory set aside. In doing so, it triggers a bug in FileSwitch, caused by the register for the special field being dereferenced even though is was invalid. This bug was fixed using this information.

Faking Git

[Asciinema!]
(Asciinema)
Experiments with running the host git tool through the Host command can make it look like you're running the command directly.
The command line shows exactly what commands are being used ('*PyromaniacHostCommand ...') but it looks like you're running git on RISC OS. Kinda. The git command is using the terminal control sequences, which the PyromaniacHostCommand implementation turns into the relevant VDU control codes on RISC OS to change colours. The VDU implementation is ANSIText, which then converts those VDU control codes back to the correct terminal control sequences. Thus, the colour that was output by the host git command changes the RISC OS state, and is then output in the right way for the terminal to have colour. The later PyromaniacGit module provides similar operation but is even more integrated to hide the host system.

ErrorCancel module

[Asciinema!]
(Asciinema)
Rick Murray's ErrorCancel module waits for an error box to turn and then clears it by pressing Escape.
It works with the Pyromaniac implementation of the error box. The Pyromaniac error box actually has a few implementations - one that does nothing, one that outputs the message to the screen like you see here, and one that uses the Python EasyGUI package to give you a desktop error box.

CObey crash

[Asciinema!]
(Asciinema)
Julie Stamp's COBey module running under Pyromaniac.
I tested it with Pyromaniac and Fortify and found that it freed the stack underneath it - triggering a Pyromaniac exception report. It's actually not that exciting, but it's useful to see that an exception in real code (not just tests) can be traced through Pyromaniac.

Drawfile rendering

[Image]
(Video)
15 year old Drawfile being drawn.
My brother and I draw a replica of the 'More Than Meets The Eye' album cover, back when we were at school. The Pyromanic Draw renderer copes just fine with it. The video shows the image being built up. There is some significant banding as this is rendered in a 256 colour mode. Although Cairo is actually using 24bit, Pyromaniac is only using the 256 colours from the standard palette.,

BootMenu

[Image]
(Video)
BootMenu working with FontManager.
RISC OS Boot menu running on Pyromaniac using a very heavily hacked together Pyromaniac FontManager. After this work, the FontManager was significantly reworked, but this was one of the first applications demonstrated to work with the FontManager.

Wimp experiment

[Image]
(Full size image)
Very hacky and experimental opening of windows through the Wimp.
An experimental Pyromaniac Window Manager is able to load template files, and open windows. The icons aren't right - the only flags for icons that are supported are the border and the alignment.
Demonstrates that the windows can be created, although you can't do anything with them and it is only CreateWindow/OpenWindow that work right now. Alphabet is honoured in the text strings, though.

MacOS application

[Image]
(Video)
The macOS application demonstrates the graphics UI and input.
Pyromaniac running as a macOS application, running an old maze game from INPUT magazine.
Demonstrates the VDU23 characters, and uses INKEY$() to input characters with a delay. Also shows a vertical off-by one error in the rendering in places.

Font_Paint, showing UTF-8

[Image]
(Full size image)
A BASIC program to plot a string in a given encoding.
Demonstrates that the encoding selection is working, and is able to show a UTF-8 character.

Font_Paint, with macOS fonts

[Image]
(Video)
Listing the RISC OS font (taken from the host).
A Video showing the rendering of all the fonts known to the FontManager, using a small BASIC program.
This was run on macOS, so all the macOS fonts, and extra ones that I have installed, are shown here. Some fonts are not very useful, and just appear as boxes.

Rendering with the classic Draw module

[Image]
(Full size image)
Classic Draw module renders a DrawFile with some glitches.
An old DrawFile, showing the 'Center Parcs' logo, being rendered by the Classic Draw module, with the Pyromaniac graphics implementation configured to be SVG.
When the Draw module renders its shapes, it uses the horizontal line routine. This call only takes a pair of x coordinates and a y coorinate and draws a line between them. When used with the SVG renderer, however, we can see h-line operation.
The large horizontal lines are an artifact of the Pyromaniac rendering - Draw produces very large x-coordinates when a shape goes off the screen. So much so that when Pyromaniac processed it, they became negative, which caused that ugly line wrap.

Running on Windows

[Image]
(Full size image)
Using CrossOver, a Wine derivative for macOS, Pyromaniac runs as a Windows application.
It's not a very exciting demonstration, other than that it functions. It is amusing that this is running RISC OS by emulating the system calls through Python and wxWidgets, which was built for Windows and is communicating with macOS through emulated Windows interfaces.

Font rendering with Pyromaniac

[Image]
(Full size image)
Font_ScanString works well enough to wrap text.
Using my ancient 'bubble' library to render some text into a region. The text is sized using Font_ScanString to wrap it into the space supplied. The bubble is rendered using Draw_Stroke and Draw_Fill.

Font rendering with classic FontManager

[Image]
(Full size image)
Classic FontManager doesn't look quite so nice without anti-aliasing.
The same code, but this time using the Classic FontManager. Because we don't support sprites at present, this was rendered with the FontMax settings set to 0. Interestingly it shows up a problem with the prior image - the font selected here is oblique. It should have been oblique in the prior example; this was an early bug.

JPEG_PlotTransformed

[Image]
(Full size image)
A JPEG, being rendered with a call to JPEG_PlotTransformed.
The transformation matrix is not a simple scaling, and thus produces the skew effect you see. The Classic SpriteExtend does not support transformed JPEGs, but because the Cairo rendering system just plots what it's been given with whatever matrix you supply, rendering an image at an angle isn't a big deal.

Classic Wimp with Pyromaniac fonts

[Image]
(Full size image)
Displaying an error message with the Classic Window Manager.
This is about all that the Classic Window Manager can do. The Pyromaniac FontManager is in use, which is why there are two squares before the text strings. The Window Manager uses the control codes for 'select font' and the font number at the start of the strings, and Pyromaniac's FontManager doesn't handle those control codes yet.

Classic Hourglass

[Image]
(Video)
Using the Classic hourglass module with Pyromaniac.
Demonstrates the pointer shape programming and the hourglass shape.
The hourglass is very large because that's the size of the desktop pointer on my machine. You may notice that the active point isn't set correctly in this video; the setting wasn't working in WxWidgets when I recorded this.

BBC Game Explode

[Image]
(Video)
A game I wrote for the BBC, back when I was 16.
The 'AI' convincingly beats me.
Demonstrates the use of VDU 23 programmed characters again, and keyboard input using INKEY() negative numbers. Italic text achieved by reading the character definitions, shifting bits and reprogramming.

First tune through WaveSynth

[Sound]
(Audio)
The first working tune played through WaveSynth.
The sound system ('SOUND', handled by SoundChannels) usually plays sound through MIDI in Pyromaniac. However, in an experimental branch, the sound system can play sound using the PCM system, by loading the SoundChannels module and whatever voices are required. When this first started working, the example 'Hall Of The Mountain King' program was used to test that it worked as well as the MIDI version.
The sound isn't quite right; there's an annoying clicking in it, which is caused by the sample buffer not having a length which is a multiple of 4. I didn't realise that this was a requirement at the time, but I was very pleased that the first time I tried playing a tune it came out recognisably, and in the right pitch. The repeated note at the end would have been a sustain on the BBC, but doesn't have that effect on RISC OS.
The current version of the experimental branch plays this smoothly without glitches.
This was actually the second time I'd tried to play the tune - the first time was horribly distorted. I'd got the mu-law-to-linear conversion wrong - the values for 16bit sound are -32768 to 32767, but I was mapping to -65536 to 65535, which meant that they clipped and distorted really badly.