nimgobus

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

nimgobus

An RM Nimbus-inspired Ebiten extension for building retro apps and games in Go.

Nimgobus is a tribute project and is in no way linked to or endorsed by RM plc.

About

Nimgobus is an extension of the Ebiten game engine. It mimicks the unique 16-bit text, graphics and sound drivers of the RM Nimbus PC186, found in classrooms all over the UK in the 1980s and early 90s. With Nimgobus you can develop Go applications that have the beautiful look and feel of classic Nimbus software such as PaintSPA, Ourfacts and Caxton Press. However, it is not an emulation of the Nimbus itself. This means you get the best of both worlds:

  • Cutting-edge Go computing power, beautifully presented in up to 16 colours
  • Build for Linux, Windows and macOS
  • Mileage may vary on mobile platforms.
  • Unfortunately WebASM cannot be targeted due to its lack of multithreading support.

Usage

Nimgobus generates a screen image that can be embedded in an Ebiten application. First add Nimgobus to your Game struct:

type Game struct {
	count           int
	// ...
	nimgobus.Nimbus // Embed the Nimbus in the Game struct
}

In your NewGame() function, initialize the Nimbus before sending any commands to it:

func NewGame() *Game {
	game := &Game{}
	// ...
	game.Init() // Initialize Nimgobus
	return game
}

In the Update() function add a call to update the Nimbus monitor screen:

func (g *Game) Update() error {
	// ...
	g.Nimbus.Update() // Update the app on all subsequent iterations
	// ...
	return nil
}

The Nimbus screen can be retrieved like this:

img := g.Monitor

And commands sent like this:

g.Subbios.TGraphicsOutput.FGraphicsOutputColdStart() // Start the graphics system
g.Subbios.TGraphicsOutput.FPlotCharacterString(0, 1, 2, 13, 0, "Hello there!", 0, 0) // Say hello
API

Nimgobus is implemented with an API similar to the original Nimbus SUBBIOS which received function calls to the dedicated Nimbus IO drivers as CPU interrupts, with the parameters stored in various registers. For the sake of simplicity Nimgobus uses conventional Go function arguments and return values. Furthermore, the SUBBIOS includes a light implementation of an old-skool stdio C library for sending text data to the screen and receiving keyboard input.

Acknowledgements

Shouts out to the following for their help and advice:

Darren Smith, Tim Nuttal (formely RM, SPA), Tim Pearson (RM co-founder)

Documentation

Overview

nimgobus contains the Nimbus struct from which all the pretend 16-bit magic stems!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Nimbus

type Nimbus struct {
	Subbios subbios.Subbios
	Monitor *ebiten.Image
}

The Subbios commands and Monitor image are accessed here.

func (*Nimbus) Init

func (n *Nimbus) Init()

Initializes nimgobus.

func (*Nimbus) Update

func (n *Nimbus) Update()

Update needs to be called on each ebiten update call.

Directories

Path Synopsis
examples
demos/graphics
Demonstrating RM Nimbus graphics with nimgobus
Demonstrating RM Nimbus graphics with nimgobus
demos/rope
This is an RM Basic demo program called ROPE.BAS rewritten 40 years later in Go.
This is an RM Basic demo program called ROPE.BAS rewritten 40 years later in Go.
internal
subbios
Subbios provides all commands to control the Nimbus.
Subbios provides all commands to control the Nimbus.
subbios/colour
Package colour defines all the default Nimbus colour settings
Package colour defines all the default Nimbus colour settings
subbios/errorcode
Package errorcode defines constants for the subbios error codes.
Package errorcode defines constants for the subbios error codes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL