screen

package
v0.0.0-...-ad720f0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 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  uint16 = 0x1f
	VideoText40    uint16 = 0x01
	VideoGR        uint16 = 0x02
	VideoHGR       uint16 = 0x03
	VideoText80    uint16 = 0x08
	VideoDGR       uint16 = 0x09
	VideoDHGR      uint16 = 0x0a
	VideoText40RGB uint16 = 0x10
	VideoMono560   uint16 = 0x11
	VideoRGBMix    uint16 = 0x12
	VideoRGB160    uint16 = 0x13
	VideoSHR       uint16 = 0x14
	VideoVidex     uint16 = 0x15
)

Base Video Modes

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

Mix text video mdes modifiers

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

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 RenderTextModeAnsi

func RenderTextModeAnsi(vs VideoSource, is80Columns bool, isSecondPage bool, isAltText bool, isApple2e 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, isApple2e 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     uint16     `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() uint16

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

type VideoSource

type VideoSource interface {
	// GetCurrentVideoMode returns the active video mode
	GetCurrentVideoMode() uint16
	// 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
}

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