gb

package
v0.0.0-...-7a8c7a0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	INPUT_A = iota
	INPUT_B
	INPUT_SELECT
	INPUT_START
	INPUT_RIGHT
	INPUT_LEFT
	INPUT_UP
	INPUT_DOWN
)
View Source
const (
	// F value (flag) :
	ZF = 0x80 // Zero 0x80 -> Set if last operation produced 0
	N  = 0x40 // Operation 0x40 -> Set if last operation addition/subtraction
	H  = 0x20 // Half-carry 0x20 -> Set if last operation result [lower half] overflowed 15
	CY = 0x10 // Carry 0x10 -> Set if last operation produced over flow
)
View Source
const (
	IF         = 0xFF0F
	IE         = 0xFFFF
	INTVBLANK  = 0x40
	INTLCDSTAT = 0x48
	INTTIMER   = 0x50
	INTJOYPAD  = 0x60
)
View Source
const (
	WHITE = iota
	LIGHT_GRAY
	DARK_GRAY
	BLACK
)
View Source
const (
	ScreenWidth  = 160
	ScreenHeight = 144
)
View Source
const (
	DIVIDER = 0xFF04
	TIMA    = 0xFF05
	TMA     = 0xFF06
	TMC     = 0xFF07
)
View Source
const (
	MAXCYCLES = 69905 // 4194304 / 60 ( cpu cycles per sec / frame rate)
)

Variables

View Source
var OpcodeCBCycles = []int{} //0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

/* 256 elements not displayed */
View Source
var OpcodeCycles = []int{} //0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

/* 256 elements not displayed */

Functions

This section is empty.

Types

type CPU

type CPU struct {
	// contains filtered or unexported fields
}

func CPUinit

func CPUinit() *CPU

type Cartridge

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

func CartrigdeInit

func CartrigdeInit(url string) *Cartridge

type Gameboy

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

func (*Gameboy) GetCPUSTAT

func (gb *Gameboy) GetCPUSTAT() [10]uint16

func (*Gameboy) GetGameTitle

func (gb *Gameboy) GetGameTitle() string

func (*Gameboy) GetScreen

func (gb *Gameboy) GetScreen() [ScreenWidth][ScreenHeight][3]int

func (*Gameboy) GetVRAM

func (gb *Gameboy) GetVRAM() [0x2000]byte

func (*Gameboy) Init

func (gb *Gameboy) Init(cartridgeUrl string)

func (*Gameboy) KeyPressed

func (gb *Gameboy) KeyPressed(key int)

func (*Gameboy) KeyReleased

func (gb *Gameboy) KeyReleased(key int)

func (*Gameboy) Update

func (gb *Gameboy) Update()

type PPU

type PPU struct {
	// contains filtered or unexported fields
}

type Registers

type Registers struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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