screen

package
v0.0.0-...-42efdcd Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ScreenModeGreen to render as a green phosphor monitor
	ScreenModeGreen = iota
	// ScreenModePlain to render in color with filled areas
	ScreenModePlain
	// ScreenModeNTSC shows spaces between pixels
	ScreenModeNTSC
)
View Source
const (
	VideoBaseMask  uint32 = 0x1f
	VideoText40    uint32 = 0x01
	VideoGR        uint32 = 0x02
	VideoHGR       uint32 = 0x03
	VideoText80    uint32 = 0x08
	VideoDGR       uint32 = 0x09
	VideoDHGR      uint32 = 0x0a
	VideoText40RGB uint32 = 0x10
	VideoMono560   uint32 = 0x11
	VideoRGBMix    uint32 = 0x12
	VideoRGB160    uint32 = 0x13
	VideoSHR       uint32 = 0x14
	VideoVidex     uint32 = 0x15
)

Base Video Modes

View Source
const (
	VideoMixTextMask  uint32 = 0x0f00
	VideoMixText40    uint32 = 0x0100
	VideoMixText80    uint32 = 0x0200
	VideoMixText40RGB uint32 = 0x0300
)

Mix text video mdes modifiers

View Source
const (
	VideoModifiersMask  uint32 = 0xf000
	VideoSecondPage     uint32 = 0x1000
	VideoAltText        uint32 = 0x2000
	VideoRGBCard        uint32 = 0x4000
	VideoFourColors     uint32 = 0x8000
	VideoText80AltOrder uint32 = 0x10000
)

Other video mode modifiers

Variables

This section is empty.

Functions

func AddScenario

func AddScenario(vs VideoSource, dir string) error

AddScenario Generate a new video scenario

func NextScreenMode

func NextScreenMode(screenMode int) int

func RenderTextModeAnsi

func RenderTextModeAnsi(vs VideoSource, is80Columns bool, isSecondPage bool, isAltText bool, supportsLowercase bool, hasAltOrder bool) string

RenderTextModeAnsi returns the text mode contents using ANSI escape codes for reverse and flash

func RenderTextModeString

func RenderTextModeString(vs VideoSource, is80Columns bool, isSecondPage bool, isAltText bool, supportsLowercase bool, hasAltOrder bool) string

RenderTextModeString returns the text mode contents ignoring reverse and flash

func SaveSnapshot

func SaveSnapshot(vs VideoSource, screenMode int, filename string) error

SaveSnapshot saves a snapshot of the screen to a png file

func Snapshot

func Snapshot(vs VideoSource, screenMode int) *image.RGBA

Snapshot the currently visible screen

func SnapshotCharacterGenerator

func SnapshotCharacterGenerator(vs VideoSource, isAltText bool) *image.RGBA

SnapshotCharacterGenerator shows the current character set

func SnapshotMessageGenerator

func SnapshotMessageGenerator(vs VideoSource, message string) *image.RGBA

SnapshotMessageGenerator shows a message on the screen

func SnapshotPaletted

func SnapshotPaletted(vs VideoSource, screenMode int) *image.Paletted

SnapshotPaletted, snapshot of the currently visible screen as a paletted image

func SnapshotParts

func SnapshotParts(vs VideoSource, screenMode int) *image.RGBA

SnapshotParts the currently visible screen

func VideoModeName

func VideoModeName(vs VideoSource) string

VideoModeName returns the name of the current video mode

Types

type TestScenario

type TestScenario struct {
	VideoMode     uint32     `json:"mode"`
	VideoModeName string     `json:"name"`
	ScreenModes   []int      `json:"screens"`
	TextPages     [4][]uint8 `json:"text"`
	VideoPages    [4][]uint8 `json:"video"`
	SVideoPage    []uint8    `json:"svideo"`
}

TestScenario is the computer video state

func (*TestScenario) GetCardImage

func (ts *TestScenario) GetCardImage(light color.Color) *image.RGBA

GetCardImage returns an image provided by a card, like the videx card

func (*TestScenario) GetCharacterPixel

func (ts *TestScenario) GetCharacterPixel(char uint8, rowInChar int, colInChar int, isAltText bool, isFlashedFrame bool) bool

GetCharacterPixel returns the pixel as output by the character generator

func (*TestScenario) GetCurrentVideoMode

func (ts *TestScenario) GetCurrentVideoMode() uint32

GetCurrentVideoMode returns the active video mode

func (*TestScenario) GetSuperVideoMemory

func (ts *TestScenario) GetSuperVideoMemory() []uint8

GetSuperVideoMemory returns a slice to the SHR video memory

func (*TestScenario) GetTextMemory

func (ts *TestScenario) GetTextMemory(secondPage bool, ext bool) []uint8

GetTextMemory returns a slice to the text memory pages

func (*TestScenario) GetVideoMemory

func (ts *TestScenario) GetVideoMemory(secondPage bool, ext bool) []uint8

GetVideoMemory returns a slice to the video memory pages

func (*TestScenario) SupportsLowercase

func (ts *TestScenario) SupportsLowercase() bool

SupportsLowercase returns true if the video source supports lowercase

type VideoSource

type VideoSource interface {
	// GetCurrentVideoMode returns the active video mode
	GetCurrentVideoMode() uint32
	// GetTextMemory returns a slice to the text memory pages
	GetTextMemory(secondPage bool, ext bool) []uint8
	// GetVideoMemory returns a slice to the video memory pages
	GetVideoMemory(secondPage bool, ext bool) []uint8
	// GetCharactePixel returns the pixel as output by the character generator
	GetCharacterPixel(char uint8, rowInChar int, colInChar int, isAltText bool, isFlashedFrame bool) bool
	// GetSuperVideoMemory returns a slice to the SHR video memory
	GetSuperVideoMemory() []uint8
	// GetCardImage returns an image provided by a card, like the videx card
	GetCardImage(light color.Color) *image.RGBA
	// SupportsLowercase returns true if the video source supports lowercase
	SupportsLowercase() bool
}

VideoSource provides the info to build the video output

Jump to

Keyboard shortcuts

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