Documentation ¶
Index ¶
- Constants
- Variables
- func AsModel(m types.Model) func(gb *GameBoy)
- func Rotate2DFrame(frame [ScreenHeight][ScreenWidth][3]uint8, angleX, angleY, angleZ float64) [ScreenHeight][ScreenWidth][3]uint8
- type GameBoy
- func (g *GameBoy) AttachAudioListener(player func([]uint8))
- func (g *GameBoy) Colourise()
- func (g *GameBoy) Frame() [ppu.ScreenHeight][ppu.ScreenWidth][3]uint8
- func (g *GameBoy) LinkFrame() ([ppu.ScreenHeight][ppu.ScreenWidth][3]uint8, ...)
- func (g *GameBoy) SendCommand(command emulator.CommandPacket) emulator.ResponsePacket
- func (g *GameBoy) SetModel(m types.Model)
- func (g *GameBoy) Start(frames chan<- []byte, events chan<- event.Event, pressed <-chan io.Button, ...)
- func (g *GameBoy) StartLinked(frames1 chan<- []byte, events1 chan<- event.Event, pressed1 <-chan io.Button, ...)
- func (g *GameBoy) State() emulator.State
- func (g *GameBoy) TogglePause()
- type Opt
- type Point
Constants ¶
View Source
const ( ScreenWidth = ppu.ScreenWidth ScreenHeight = ppu.ScreenHeight )
Variables ¶
Functions ¶
func Rotate2DFrame ¶
func Rotate2DFrame(frame [ScreenHeight][ScreenWidth][3]uint8, angleX, angleY, angleZ float64) [ScreenHeight][ScreenWidth][3]uint8
Rotate2DFrame rotates a 2D framebuffer in 3D space with perspective correction.
Types ¶
type GameBoy ¶
type GameBoy struct { sync.RWMutex CPU *cpu.CPU PPU *ppu.PPU APU *apu.APU Timer *timer.Controller Serial *serial.Controller Bus *io.Bus log.Logger Printer *accessories.Printer Scheduler *scheduler.Scheduler // contains filtered or unexported fields }
GameBoy represents a Game Boy. It contains all the components of the Game Boy. It is the main entry point for the emulator.
func NewGameBoy ¶
NewGameBoy returns a new GameBoy.
func (*GameBoy) AttachAudioListener ¶
func (*GameBoy) Frame ¶
func (g *GameBoy) Frame() [ppu.ScreenHeight][ppu.ScreenWidth][3]uint8
Frame will step the emulation until the PPU has finished rendering the current frame. It will then prepare the frame for display, and return it.
func (*GameBoy) LinkFrame ¶
func (g *GameBoy) LinkFrame() ([ppu.ScreenHeight][ppu.ScreenWidth][3]uint8, [ppu.ScreenHeight][ppu.ScreenWidth][3]uint8)
LinkFrame will step the emulation until the PPU has finished rendering the current frame. It will then prepare the frame for display, and return it.
func (*GameBoy) SendCommand ¶
func (g *GameBoy) SendCommand(command emulator.CommandPacket) emulator.ResponsePacket
func (*GameBoy) StartLinked ¶
func (*GameBoy) TogglePause ¶
func (g *GameBoy) TogglePause()
type Opt ¶
type Opt func(gb *GameBoy)
Opt is a function that modifies a GameBoy instance.
func SerialConnection ¶
func SerialDebugger ¶
func WithLogger ¶
func WithPrinter ¶
func WithPrinter(printer *accessories.Printer) Opt
Click to show internal directories.
Click to hide internal directories.