Documentation
¶
Index ¶
- Constants
- func AddScenario(vs VideoSource, dir string) error
- func NextScreenMode(screenMode int) int
- func RenderTextModeAnsi(vs VideoSource, is80Columns bool, isSecondPage bool, isAltText bool, ...) string
- func RenderTextModeString(vs VideoSource, is80Columns bool, isSecondPage bool, isAltText bool, ...) string
- func SaveSnapshot(vs VideoSource, screenMode int, filename string) error
- func ScreenModeByName(name string) (int, error)
- func Snapshot(vs VideoSource, screenMode int) *image.RGBA
- func SnapshotCharacterGenerator(vs VideoSource, isAltText bool) *image.RGBA
- func SnapshotMessageGenerator(vs VideoSource, message string, is80Columns bool) *image.RGBA
- func SnapshotPaletted(vs VideoSource, screenMode int) *image.Paletted
- func SnapshotParts(vs VideoSource, screenMode int) *image.RGBA
- func VideoModeName(vs VideoSource) string
- type TestScenario
- func (ts *TestScenario) GetCardImage(light color.Color) *image.RGBA
- func (ts *TestScenario) GetCharacterPixel(char uint8, rowInChar int, colInChar int, isAltText bool, isFlashedFrame bool) bool
- func (ts *TestScenario) GetCurrentVideoMode() uint32
- func (ts *TestScenario) GetSuperVideoMemory() []uint8
- func (ts *TestScenario) GetTextMemory(secondPage bool, ext bool) []uint8
- func (ts *TestScenario) GetVideoMemory(secondPage bool, ext bool) []uint8
- func (ts *TestScenario) IsFlashedFrame() bool
- func (ts *TestScenario) SupportsLowercase() bool
- type VideoSource
Constants ¶
const ( // ScreenModeGreen renders as a green phosphor monitor ScreenModeGreen = 0 // ScreenModeColor renders as an NTSC color television ScreenModeColor = screenModeColorBit // ScreenModeGreenScanlines is a green monitor showing the gaps between the // scan lines ScreenModeGreenScanlines = screenModeScanlinesBit // ScreenModeColorScanlines is a color television showing the gaps between // the scan lines ScreenModeColorScanlines = screenModeScanlinesBit | screenModeColorBit )
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
const ( VideoMixTextMask uint32 = 0x0f00 VideoMixText40 uint32 = 0x0100 VideoMixText80 uint32 = 0x0200 VideoMixText40RGB uint32 = 0x0300 )
Mix text video mdes modifiers
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 ¶
NextScreenMode rotates through the four screen modes
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 ScreenModeByName ¶
ScreenModeByName returns the screen mode with the name it has in the configuration
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, is80Columns bool) *image.RGBA
SnapshotMessageGenerator shows a message on the screen, on 40 or 80 columns. The character generator of the machine is used, but not its text memory, so it works whatever the machine is displaying and whether or not it has 80 columns of its own.
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) IsFlashedFrame ¶
func (ts *TestScenario) IsFlashedFrame() bool
IsFlashedFrame returns false, the scenarios are rendered without flashing
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
// IsFlashedFrame returns true when the flashing characters are shown inverse
IsFlashedFrame() bool
}
VideoSource provides the info to build the video output