Documentation ¶
Index ¶
- type CursorPos
- type DebugScreen
- func (s *DebugScreen) CleanUp()
- func (s *DebugScreen) DrawCodeLines(renderer *sdl.Renderer, PC uint16) error
- func (s *DebugScreen) DrawScreen()
- func (s *DebugScreen) DrawStack(renderer *sdl.Renderer, em EmulatorInterface) error
- func (s *DebugScreen) Hide()
- func (s *DebugScreen) Show(em EmulatorInterface, status *utils.ComputerStatus)
- type EmulatorInterface
- type Screen
- func (s *Screen) CleanUp()
- func (s *Screen) DisableDebug()
- func (s *Screen) DrawScreen()
- func (s *Screen) EnableDebug(em EmulatorInterface)
- func (s *Screen) GetFontHeight() int32
- func (s *Screen) GetFontWidth() int32
- func (s Screen) GetPosition() (x, y int32)
- func (s Screen) GetSize() (w, h int32)
- func (s *Screen) GetWindowPosition() (x, y int32)
- func (s Screen) IsBusy() bool
- func (s *Screen) IsEmulatorOnOffClicked(x int32, y int32) bool
- func (s *Screen) ProcessRune(r rune)
- func (s *Screen) Reset()
- func (s *Screen) Show() error
- func (s *Screen) UpdateScreen()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CursorPos ¶
type CursorPos struct { X int Y int Display bool Scroll bool Sequence []rune // contains filtered or unexported fields }
CursorPos represents the position of the cursor on the screen It also manages the extents of the screen, so that the cursor Cannot go outside the screen.
The Scroll flag is there to indicate to the calling object that it should scroll up. This object will not handle the scrolling, and the flag can be cleared by either moving the cursor or by calling the ClearScroll method.
func NewCursorPos ¶
NewCursorPos creates a new cursor pos
func (*CursorPos) Backspace ¶
func (cpos *CursorPos) Backspace()
Backspace moves the cursor back one space. If it reaches the beginning of the line, it will do nothing.
func (*CursorPos) ClearScroll ¶
func (cpos *CursorPos) ClearScroll()
ClearScroll clears the scroll flag
func (*CursorPos) NewLine ¶
func (cpos *CursorPos) NewLine()
NewLine moves the cursor to the beginning of the next line. If it exceeds the number of rows on the screen, it will set the Scroll flag.
func (*CursorPos) NextLine ¶
func (cpos *CursorPos) NextLine()
NextLine moves the cursor to the next line, but at the same col. If it exceeds the number of rows on the screen, will set the Scroll flag.
func (*CursorPos) NextLocation ¶
func (cpos *CursorPos) NextLocation()
NextLocation moves the cursor right by one It will move to the next line if you're at the end of a line
func (*CursorPos) NextSequence ¶
NextSequence returns the next rune in the cursor sequence
type DebugScreen ¶
type DebugScreen struct { Active bool // contains filtered or unexported fields }
DebugScreen is the output for the debug info
func NewDebugScreen ¶
func NewDebugScreen(parent *Screen) *DebugScreen
NewDebugScreen creates a new debug window
func (*DebugScreen) CleanUp ¶
func (s *DebugScreen) CleanUp()
CleanUp cleans all resources created by the debug window
func (*DebugScreen) DrawCodeLines ¶
func (s *DebugScreen) DrawCodeLines(renderer *sdl.Renderer, PC uint16) error
DrawCodeLines draws the debug code lines to the screen
func (*DebugScreen) DrawScreen ¶
func (s *DebugScreen) DrawScreen()
DrawScreen draws the entire screen
func (*DebugScreen) DrawStack ¶
func (s *DebugScreen) DrawStack(renderer *sdl.Renderer, em EmulatorInterface) error
DrawStack draws the stack info to the specified renderer
func (*DebugScreen) Show ¶
func (s *DebugScreen) Show(em EmulatorInterface, status *utils.ComputerStatus)
Show shows the debug window
type EmulatorInterface ¶
EmulatorInterface provides a de-coupled interface to the emulator to avoid circular package dependencies
type Screen ¶
type Screen struct { Busy bool // contains filtered or unexported fields }
Screen represents the main object to display text output
func NewScreen ¶
func NewScreen(cols int, rows int, status *utils.ComputerStatus) *Screen
NewScreen creates a new screen object
func (*Screen) CleanUp ¶
func (s *Screen) CleanUp()
CleanUp cleans up all the resources creates by the screen object
func (*Screen) DisableDebug ¶
func (s *Screen) DisableDebug()
DisableDebug turns off debugging/single step
func (*Screen) EnableDebug ¶
func (s *Screen) EnableDebug(em EmulatorInterface)
EnableDebug turns on debugging/single step
func (*Screen) GetFontHeight ¶
GetFontHeight return the height of a row
func (*Screen) GetFontWidth ¶
GetFontWidth returns the width of an individual character
func (Screen) GetPosition ¶
GetPosition returns the position of the screen returns -1, -1 if window not created
func (*Screen) GetWindowPosition ¶
GetWindowPosition returns the current window position
func (*Screen) IsEmulatorOnOffClicked ¶
IsEmulatorOnOffClicked returns if x,y is within the rectangle of the graphic on/off switch
func (*Screen) ProcessRune ¶
ProcessRune processes an ASCII character
func (*Screen) UpdateScreen ¶
func (s *Screen) UpdateScreen()
UpdateScreen allows an external process to force an update of the screen