gb

package
v0.0.0-...-6248722 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CY cpuFlags // carry
	H           // halfCarry
	N           // negative
	Z           // zero
)
View Source
const (
	Byte size = 1
	KiB       = 1024 * Byte
	MiB       = 1024 * KiB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button uint8
const (
	A Button = 1 << iota
	B
	Select
	Start
	Right
	Left
	Up
	Down
)

type Cartridge

type Cartridge struct {
	CartridgeInfo
	// contains filtered or unexported fields
}

func NewCartridge

func NewCartridge(r io.Reader) (*Cartridge, error)

func (*Cartridge) Saveable

func (c *Cartridge) Saveable() bool

type CartridgeInfo

type CartridgeInfo struct {
	Title                string
	ManufacturerCode     string
	CGBFlag              uint8
	NewLicenseeCode      string
	SGBFlag              uint8
	CartridgeType        uint8
	ROMSize              size
	RAMSize              size
	DestinationCode      uint8
	OldLicenseeCode      uint8
	MaskROMVersionNumber uint8
	HeaderChecksum       uint8
	GlobalChecksum       []uint8
}

func (CartridgeInfo) String

func (cm CartridgeInfo) String() string

type GameBoy

type GameBoy struct {
	Debug bool
	// contains filtered or unexported fields
}

func (*GameBoy) CartridgeInfo

func (gb *GameBoy) CartridgeInfo() CartridgeInfo

func (*GameBoy) ClockFrame

func (gb *GameBoy) ClockFrame() []uint8

func (*GameBoy) DrawNametables

func (gb *GameBoy) DrawNametables() []uint8

func (*GameBoy) DrawVram

func (gb *GameBoy) DrawVram() []uint8

func (*GameBoy) DumpWram

func (gb *GameBoy) DumpWram() error

func (*GameBoy) ExecuteInst

func (gb *GameBoy) ExecuteInst()

func (*GameBoy) InsertCartridge

func (gb *GameBoy) InsertCartridge(cart *Cartridge, savReader io.Reader, savWriter io.WriteCloser) error

func (*GameBoy) PowerOn

func (gb *GameBoy) PowerOn()

func (*GameBoy) Press

func (gb *GameBoy) Press(btns Button, pressed bool)

func (*GameBoy) Save

func (gb *GameBoy) Save() error

func (*GameBoy) SetVolume

func (gb *GameBoy) SetVolume(vol float64)

func (*GameBoy) ToggleBackground

func (gb *GameBoy) ToggleBackground()

func (*GameBoy) ToggleSprites

func (gb *GameBoy) ToggleSprites()

func (*GameBoy) ToggleWindow

func (gb *GameBoy) ToggleWindow()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL