Documentation ¶
Overview ¶
Package nimgobus is RM Nimbus-inspired Ebiten extension for building building retro apps and games in Go. It mimicks the 16-bit graphics and text 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 cheesey and often 'chromatically challenging' look and feel of classic Nimbus software such as PaintSPA, Ourfacts and Caxton Press.
Nimgobus is a tribute project and is in no way linked to or endorsed by RM plc.
For more background and working examples see https://github.com/adamstimb/nimgobus
Index ¶
- type AreaOptions
- type CircleOptions
- type FileObj
- type FillStyle
- type FloodOptions
- type LineOptions
- type Nimbus
- func (n *Nimbus) AdvanceCursor(forceCarriageReturn bool)
- func (n *Nimbus) Area(opt AreaOptions, coordList []XyCoord)
- func (n *Nimbus) AskBlocksize(b int) (width, height, mode int)
- func (n *Nimbus) AskCurpos() (int, int)
- func (n *Nimbus) AskDrawing(p ...int) (slot, x1, y1, x2, y2 int)
- func (n *Nimbus) AskFillStyle() FillStyle
- func (n *Nimbus) AskMode() int
- func (n *Nimbus) AskSound() bool
- func (n *Nimbus) AskVoice() int
- func (n *Nimbus) AskWriting(p ...int) (slot, col1, row1, col2, row2 int)
- func (n *Nimbus) Bell()
- func (n *Nimbus) Boot()
- func (n *Nimbus) Circle(opt CircleOptions, r, x, y int)
- func (n *Nimbus) Clearblock()
- func (n *Nimbus) Clg()
- func (n *Nimbus) Cls(p ...int)
- func (n *Nimbus) Delblock(b int)
- func (n *Nimbus) Fetch(b int, path string) bool
- func (n *Nimbus) Flood(opt FloodOptions, coord XyCoord)
- func (n *Nimbus) ForceRedraw()
- func (n *Nimbus) Get() int
- func (n *Nimbus) GetPixel(x, y int) (colour int)
- func (n *Nimbus) Init()
- func (n *Nimbus) Input(prepopulateBuffer string) string
- func (n *Nimbus) Keep(b int, format, path string) error
- func (n *Nimbus) Line(opt LineOptions, coordList []XyCoord)
- func (n *Nimbus) Note(pitch1, pitch2, duration, volume, envelope int) bool
- func (n *Nimbus) PlayQueues()
- func (n *Nimbus) PlonkLogo(x, y int)
- func (n *Nimbus) Plot(opt PlotOptions, text string, x, y int)
- func (n *Nimbus) Points(opt PointsOptions, coordList []XyCoord)
- func (n *Nimbus) Print(s string)
- func (n *Nimbus) Put(c int)
- func (n *Nimbus) Queue(v int) int
- func (n *Nimbus) Readblock(b, x1, y1, x2, y2 int)
- func (n *Nimbus) SetBorder(c int)
- func (n *Nimbus) SetColour(paletteSlot, basicColour, flashSpeed, flashColour int)
- func (n *Nimbus) SetCurpos(col, row int)
- func (n *Nimbus) SetCursor(p ...int)
- func (n *Nimbus) SetDrawing(p ...int)
- func (n *Nimbus) SetEnvelope(slot, attackTime, attackLevel, decayTime, decayLevel, sustainTime, ... int)
- func (n *Nimbus) SetFillStyle(style, hatching, colour2 int)
- func (n *Nimbus) SetMode(columns int)
- func (n *Nimbus) SetMouse(mouseOn bool)
- func (n *Nimbus) SetPaper(c int)
- func (n *Nimbus) SetPattern(slot, row, c1, c2, c3, c4 int)
- func (n *Nimbus) SetPen(c int)
- func (n *Nimbus) SetSound(v bool)
- func (n *Nimbus) SetTone(t bool)
- func (n *Nimbus) SetVoice(v int)
- func (n *Nimbus) SetWriting(p ...int)
- func (n *Nimbus) Squash(b, x, y int, over bool)
- func (n *Nimbus) Update(PaddingX, PaddingY int, Scale float64)
- func (n *Nimbus) ValidateBrush(c int) bool
- func (n *Nimbus) ValidateColour(c int) bool
- func (n *Nimbus) ValidateStyle(s int) bool
- func (n *Nimbus) Writeblock(b, x, y int, over bool)
- type PlotOptions
- type PointsOptions
- type Sprite
- type XyCoord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AreaOptions ¶
type CircleOptions ¶
type FillStyle ¶
type FillStyle struct { Style int // 1 for solid/dithered, 2 for hatched, 3 for hollow (edge) Hatching int // Hatching type if Style==2 Colour2 int // 2nd hatching colour if Style==2 }
FillStyle describes the fill settings for AREA, FLOOD, CIRCLE, and SLICE
type FloodOptions ¶
type LineOptions ¶
type Nimbus ¶
type Nimbus struct { PaddingX int PaddingY int Scale float64 Monitor *ebiten.Image // The Monitor image including background MouseX int // Mouse position and button press MouseY int // MouseButton int // MouseOn bool // BreakInterruptDetected bool // Flag is set to true if user makes a <BREAK> FileChannels map[int]*FileObj // File channels and their objects are stored here when they're opened/created // contains filtered or unexported fields }
Nimbus acts as a container for all the components of the Nimbus monitor. You only need to call the Init() method after declaring a new Nimbus.
func (*Nimbus) AdvanceCursor ¶
AdvanceCursor moves the cursor forward and handles line feeds and carriage returns
func (*Nimbus) Area ¶
func (n *Nimbus) Area(opt AreaOptions, coordList []XyCoord)
Area draws a filled polygon of coordinates on the screen
func (*Nimbus) AskBlocksize ¶
AskBlocksize returns the width, height and original screen mode of an image block
func (*Nimbus) AskCurpos ¶
AskCurpos returns the current cursor position within the selected text box
func (*Nimbus) AskDrawing ¶
AskDrawing returns the current drawingbox slot and it's boundaries
func (*Nimbus) AskFillStyle ¶
AskFillStyle gets the current fill style
func (*Nimbus) AskWriting ¶
AskWriting returns the current textbox slot and it's boundaries
func (*Nimbus) Boot ¶
func (n *Nimbus) Boot()
Boot simulates the RM Nimbus "Welcome" boot screen and operating system loading workflow. The original Nimbus would also display system info, such as firmware version, serial number, memory, etc. Nimgobus immitates this using the Go compiler version as the firmware version, and displays the actual physical and virtual memory size. Serial number is a string constant as is the serial number of the Nimbus that provided the ROM dump for the emulation on MAME, from which various bits and pieces were reversed engineering for nimgobus.
func (*Nimbus) Circle ¶
func (n *Nimbus) Circle(opt CircleOptions, r, x, y int)
Circle draws a a filled circle
func (*Nimbus) Cls ¶
Cls clears the selected textbox if no parameters are passed, or clears another textbox if one parameter is passed
func (*Nimbus) Fetch ¶
Fetch receives an image, downsamples the number of colours to 4 or 16 depending on current screen mode, and assigns it to a Nimbus image block
func (*Nimbus) Flood ¶
func (n *Nimbus) Flood(opt FloodOptions, coord XyCoord)
Flood seeds a boundary fill at x, y
func (*Nimbus) ForceRedraw ¶
func (n *Nimbus) ForceRedraw()
ForceRedraw forces the monitor to redraw in the case of, for example, change of border colour
func (*Nimbus) Get ¶
Get returns a single character code input from the keyboard. If no key was pressed then -1 is returned.
func (*Nimbus) GetPixel ¶
getPixel waits until the drawQueue is empty gets the colour of a pixel in the video memory
func (*Nimbus) Init ¶
func (n *Nimbus) Init()
Init initializes a new Nimbus. You must call this method after declaring a new Nimbus variable.
func (*Nimbus) Input ¶
Input receives keyboard input into a string of up to 256 chars and returns the string when ENTER is pressed. The user can edit the string using the delete key and left and right arrow keys. A prompt is printed on the screen at the current cursor position and the user's input is echoed to screen after the prompt. The input buffer can also be pre-populated.
func (*Nimbus) Line ¶
func (n *Nimbus) Line(opt LineOptions, coordList []XyCoord)
Line draws a list of coordinates on the screen connected by lines
func (*Nimbus) PlayQueues ¶
func (n *Nimbus) PlayQueues()
PlayQueue plays all the notes in all the queues
func (*Nimbus) Plot ¶
func (n *Nimbus) Plot(opt PlotOptions, text string, x, y int)
Plot draws a string of characters on the paper at a given location with the colour, size and orientation of your choice.
func (*Nimbus) Points ¶
func (n *Nimbus) Points(opt PointsOptions, coordList []XyCoord)
Points draws points at some given coordinates on the screen
func (*Nimbus) SetColour ¶
SetColour assigns one of the basic colours to a slot in the current palette
func (*Nimbus) SetCursor ¶
SetCursor changes the cursor state. Between 1 and 3 parameters can be passed. The first parameter sets the cursor mode (< 0 for invisible cursor, 0 for flashing cursor, > 0 for visible cursor without flashing), the second parameter sets the ASCII code of the cursor char, the third parameter sets the charset of the cursor char.
func (*Nimbus) SetDrawing ¶
SetDrawing selects a drawingbox if only 1 parameter is passed (index), or defines a drawingbox if 5 parameters are passed (index, col1, row1, col2, row2)
func (*Nimbus) SetEnvelope ¶
func (*Nimbus) SetFillStyle ¶
SetFillStyle sets the fill style for AREA, CIRCLE, SLICE and FLOOD
func (*Nimbus) SetMode ¶
SetMode sets the screen mode. 40 is low-resolution, high-colour mode (320x250) and 80 is high-resolutions, low-colour mode (640x250)
func (*Nimbus) SetPattern ¶
SetPattern defines the user-definable patterns
func (*Nimbus) SetWriting ¶
SetWriting selects a textbox if only 1 parameter is passed (index), or defines a textbox if 5 parameters are passed (index, col1, row1, col2, row2)
func (*Nimbus) ValidateBrush ¶
ValidateBrush validates if a colour/palette slot is valid for the current screen mode
func (*Nimbus) ValidateColour ¶
ValidateColour validates if a colour/palette slot is valid for the current screen mode
func (*Nimbus) ValidateStyle ¶
ValidateStyle validates if a style slot is valid
func (*Nimbus) Writeblock ¶
Writeblock draws an image block on the screen at position x, y