Documentation ¶
Overview ¶
Package video contains video components and devices
Index ¶
- Constants
- Variables
- type MC6845
- func (mc *MC6845) CurrentCol() byte
- func (mc *MC6845) CurrentLine() byte
- func (mc *MC6845) CurrentRow() byte
- func (mc *MC6845) Emulate(tstates int)
- func (mc *MC6845) InHSync() bool
- func (mc *MC6845) InVSync() bool
- func (mc *MC6845) Init()
- func (mc *MC6845) OnClock()
- func (mc *MC6845) Read(port byte) byte
- func (mc *MC6845) ReadRegister(register byte) byte
- func (mc *MC6845) Register(index byte) byte
- func (mc *MC6845) Reset()
- func (mc *MC6845) SelectRegister(selected byte)
- func (mc *MC6845) Selected() byte
- func (mc *MC6845) SetDefaults(defaults [MC6845Nreg]byte)
- func (mc *MC6845) Write(port byte, data byte)
- func (mc *MC6845) WriteRegister(register, data byte)
- type Rect
- type Renderer
- type Screen
- func (screen *Screen) Clear(index int)
- func (screen *Screen) Data() []uint32
- func (screen *Screen) DirtyRects() []*Rect
- func (screen *Screen) Display() Rect
- func (screen *Screen) GetColour(index int) uint32
- func (screen *Screen) GetPixel(x, y int) uint32
- func (screen *Screen) Height() int
- func (screen *Screen) IsDirty() bool
- func (screen *Screen) Palette() []uint32
- func (screen *Screen) Rects() []Rect
- func (screen *Screen) ScaleX() float32
- func (screen *Screen) ScaleY() float32
- func (screen *Screen) SetDirty(dirty bool)
- func (screen *Screen) SetDisplay(X, Y, W, H int)
- func (screen *Screen) SetPixel(x, y int, colour uint32)
- func (screen *Screen) SetPixelIndex(x, y int, index int)
- func (screen *Screen) SetScaleX(scale float32)
- func (screen *Screen) SetScaleY(scale float32)
- func (screen *Screen) Width() int
- type Video
Constants ¶
View Source
const ( MC6845HorizontalTotal = iota MC6845HorizontalDisplayed MC6845HorizontalSyncPosition MC6845SyncWidths MC6845VerticalTotal MC6845VerticalTotalAdjust MC6845VerticalDisplayed MC6845VerticalSyncPosition MC6845InterlaceAndSkew MC6845MaxScanlineAddress MC6845CursorStart MC6845CursorEnd MC6845StartAddressHigh MC6845StartAddressLow MC6845CursorHigh MC6845CursorLow MC6845LightPenHigh MC6845LightPenLow )
MC6845 register constants
View Source
const (
MC6845Nreg = 0x12 // 18 registers
)
MC6845 constants
Variables ¶
View Source
var ( MC6845Defaults = [MC6845Nreg]byte{ 0x3f, 0x28, 0x2e, 0x8e, 0x26, 0x00, 0x19, 0x1e, 0x00, 0x07, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00} MC6845Masks = [MC6845Nreg]byte{ 0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x7f, 0x7f, 0x03, 0x1f, 0x1f, 0x1f, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff} )
MC6845 register data
Functions ¶
This section is empty.
Types ¶
type MC6845 ¶
type MC6845 struct { // registers HorizontalTotal byte HorizontalDisplayed byte HorizontalSyncPosition byte SyncWidths byte VerticalTotal byte VerticalTotalAdjust byte VerticalDisplayed byte VerticalSyncPosition byte InterlaceAndSkew byte MaxScanlineAddress byte CursorStart byte CursorEnd byte StartAddressHigh byte StartAddressLow byte CursorHigh byte CursorLow byte LightPenHigh byte LightPenLow byte // callbacks OnHSync device.Callback OnVSync device.Callback // contains filtered or unexported fields }
MC6845 Crtc Device
func (*MC6845) ReadRegister ¶
ReadRegister returns register value
func (*MC6845) SelectRegister ¶
SelectRegister selects current register
func (*MC6845) SetDefaults ¶
func (mc *MC6845) SetDefaults(defaults [MC6845Nreg]byte)
SetDefaults sets default register values
func (*MC6845) WriteRegister ¶
WriteRegister writes value to register
type Rect ¶
type Rect struct {
X, Y, W, H int
}
Rect is a screen region
type Renderer ¶ added in v0.20.0
type Renderer interface { // Render renders screen Render(screen *Screen) }
Renderer is the video screen renderer
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
Screen represents a video screen with a pixel buffer of width x height size. Each pixel represents an int32 color, no specific format (RGBA, BGRA,...) Coordinates starts at upper left corner.
func (*Screen) DirtyRects ¶
DirtyRects returns the regions to refresh
func (*Screen) SetDisplay ¶ added in v0.20.0
SetDisplay sets screen display
func (*Screen) SetPixelIndex ¶
SetPixelIndex sets colour index at pixel coordinates
Click to show internal directories.
Click to hide internal directories.