Documentation ¶
Index ¶
- Constants
- Variables
- func ADDSPimm(cpu *CPU, sys *Sys) int
- func CCF(cpu *CPU, sys *Sys) int
- func CPL(cpu *CPU, sys *Sys) int
- func DAA(cpu *CPU, sys *Sys) int
- func DI(cpu *CPU, sys *Sys) int
- func DRAGONS(cpu *CPU, sys *Sys) int
- func EI(cpu *CPU, sys *Sys) int
- func HALT(cpu *CPU, sys *Sys) int
- func JPHLind(cpu *CPU, sys *Sys) int
- func LDHLSPimm(cpu *CPU, sys *Sys) int
- func LDSPHL(cpu *CPU, sys *Sys) int
- func LDSPImmInd(cpu *CPU, sys *Sys) int
- func NOP(cpu *CPU, sys *Sys) int
- func PANIC(cpu *CPU, sys *Sys) int
- func POPAF(cpu *CPU, sys *Sys) int
- func RLA(cpu *CPU, sys *Sys) int
- func RLCA(cpu *CPU, sys *Sys) int
- func RRA(cpu *CPU, sys *Sys) int
- func RRCA(cpu *CPU, sys *Sys) int
- func SCF(cpu *CPU, sys *Sys) int
- func STOP(cpu *CPU, sys *Sys) int
- type ALUOp
- type BusDev
- type BusHole
- type ButtonState
- type ByteRegister
- type CBROp
- type CPU
- type CPUCond
- type Interrupt
- type Joypad
- type LCDStatusRegister
- type MemRegister
- type NullSerialSwapper
- type OAMblock
- type OAMblocksByReversePriority
- type OpFunc
- func ADDS(sr ShortRegister) OpFunc
- func ALU(op ALUOp, br ByteRegister) OpFunc
- func BIT(n uint, br ByteRegister) OpFunc
- func CALL(con CPUCond) OpFunc
- func CBR(op CBROp, br ByteRegister) OpFunc
- func INCDECB(br ByteRegister, mod int) OpFunc
- func INCDECS(sr ShortRegister, mod int) OpFunc
- func JP(con CPUCond) OpFunc
- func JR(con CPUCond) OpFunc
- func LDARegInd(br ShortRegister, mod int) OpFunc
- func LDB(destReg ByteRegister, srcReg ByteRegister) OpFunc
- func LDBImm(br ByteRegister) OpFunc
- func LDBInd(destReg ByteRegister, srcAddrReg ShortRegister, mod int) OpFunc
- func LDH(atoaddr bool) OpFunc
- func LDHC(atoaddr bool) OpFunc
- func LDHLBindir(br ByteRegister) OpFunc
- func LDSImm(sr ShortRegister) OpFunc
- func LDSimmAddr(atoaddr bool) OpFunc
- func POP(sr ShortRegister) OpFunc
- func PUSH(sr ShortRegister) OpFunc
- func RET(con CPUCond, enableInterrupts bool) OpFunc
- func RST(addr uint16, fromInterrupt bool) OpFunc
- func SETRES(set bool, n uint, br ByteRegister) OpFunc
- func SWAP(br ByteRegister) OpFunc
- type Pixel
- type RAM
- type ROM
- type ReadOnlyRegister
- type Serial
- type SerialSwapper
- type ShortRegister
- type SwapFunc
- type Sys
- func (s *Sys) FreqStep(desiredFreq uint) bool
- func (s *Sys) HandleInterrupt() *Interrupt
- func (s *Sys) IER() uint8
- func (s *Sys) RaiseInterrupt(inter Interrupt)
- func (s *Sys) Rb(addr uint16) uint8
- func (s *Sys) RbLog(addr uint16, l bool) uint8
- func (s *Sys) ReadBytes(addr uint16, len uint16) []byte
- func (s *Sys) Rs(addr uint16) uint16
- func (s *Sys) RsLog(addr uint16, l bool) uint16
- func (s *Sys) Run()
- func (s *Sys) SetPostBootloaderState()
- func (s *Sys) SetSerialSwapper(serialSwapper SerialSwapper)
- func (s *Sys) SetVideoSwapper(videoSwapper VideoSwapper)
- func (s *Sys) Step()
- func (s *Sys) UpdateButtons(state ButtonState)
- func (s *Sys) Wb(addr uint16, val uint8)
- func (s *Sys) WbLog(addr uint16, val uint8, l bool)
- func (s *Sys) WriteBytes(bytes []byte, addr uint16)
- func (s *Sys) Ws(addr uint16, val uint16)
- func (s *Sys) WsLog(addr uint16, val uint16, l bool)
- type SystemRAM
- type Timer
- type UpdateButtonser
- type Video
- type VideoSwapper
- type WriteOnlyRegister
Constants ¶
View Source
const ( RLC = iota RRC RL RR SLA SRA SRL )
View Source
const ( VBlankInterrupt = iota LCDStatInterrupt TimerInterrupt SerialInterrupt JoypadInterrupt )
View Source
const LCDSizeX uint = 160
View Source
const LCDSizeY uint = 144
View Source
const OAMblockSize uint = 4
Variables ¶
View Source
var ByteRegisterNameMap map[ByteRegister]string = map[ByteRegister]string{ B: "B", C: "C", D: "D", E: "E", H: "H", L: "L", A: "A", HLind: "(HL)", Imm: "d8", }
Functions ¶
func LDSPImmInd ¶
Load SP via an imediate value that points to another value
Types ¶
type ButtonState ¶
type CPU ¶
type CPU struct {
// contains filtered or unexported fields
}
func (*CPU) SetPostBootloaderState ¶
type Joypad ¶
func (*Joypad) UpdateButtons ¶
func (j *Joypad) UpdateButtons(sys *Sys, state ButtonState)
type LCDStatusRegister ¶
type LCDStatusRegister struct {
// contains filtered or unexported fields
}
func (*LCDStatusRegister) Asserts ¶
func (l *LCDStatusRegister) Asserts(addr uint16) bool
func (*LCDStatusRegister) R ¶
func (l *LCDStatusRegister) R(_ uint16) uint8
func (*LCDStatusRegister) W ¶
func (l *LCDStatusRegister) W(addr uint16, v uint8)
type MemRegister ¶
type MemRegister struct {
RAM
}
func NewMemRegister ¶
func NewMemRegister(addr uint16) *MemRegister
type NullSerialSwapper ¶
type NullSerialSwapper struct { }
Just acts like nothing is on the other side of the connection
func (*NullSerialSwapper) SerialSwap ¶
func (n *NullSerialSwapper) SerialSwap(_ uint8) uint8
type OAMblocksByReversePriority ¶
type OAMblocksByReversePriority []OAMblock
func (OAMblocksByReversePriority) Len ¶
func (a OAMblocksByReversePriority) Len() int
func (OAMblocksByReversePriority) Less ¶
func (a OAMblocksByReversePriority) Less(i, j int) bool
func (OAMblocksByReversePriority) Swap ¶
func (a OAMblocksByReversePriority) Swap(i, j int)
type OpFunc ¶
func ALU ¶
func ALU(op ALUOp, br ByteRegister) OpFunc
func BIT ¶
func BIT(n uint, br ByteRegister) OpFunc
func LDBInd ¶
func LDBInd(destReg ByteRegister, srcAddrReg ShortRegister, mod int) OpFunc
func LDHLBindir ¶
func LDHLBindir(br ByteRegister) OpFunc
func LDSimmAddr ¶
func POP ¶
func POP(sr ShortRegister) OpFunc
func PUSH ¶
func PUSH(sr ShortRegister) OpFunc
func SWAP ¶
func SWAP(br ByteRegister) OpFunc
type ROM ¶
type ROM struct {
// contains filtered or unexported fields
}
func LoadROMFromFile ¶
func (*ROM) GlobalChecksum ¶
func (*ROM) HeaderChecksum ¶
type ReadOnlyRegister ¶
type ReadOnlyRegister struct {
// contains filtered or unexported fields
}
func (*ReadOnlyRegister) Asserts ¶
func (r *ReadOnlyRegister) Asserts(addr uint16) bool
func (*ReadOnlyRegister) R ¶
func (r *ReadOnlyRegister) R(_ uint16) uint8
func (*ReadOnlyRegister) W ¶
func (r *ReadOnlyRegister) W(_ uint16, _ uint8)
type SerialSwapper ¶
type Sys ¶
func (*Sys) FreqStep ¶
* This only really works for values that divide evenly with the main clock, * but luckily those are all the values we need!
func (*Sys) HandleInterrupt ¶
func (*Sys) RaiseInterrupt ¶
func (*Sys) SetPostBootloaderState ¶
func (s *Sys) SetPostBootloaderState()
func (*Sys) SetSerialSwapper ¶
func (s *Sys) SetSerialSwapper(serialSwapper SerialSwapper)
func (*Sys) SetVideoSwapper ¶
func (s *Sys) SetVideoSwapper(videoSwapper VideoSwapper)
func (*Sys) UpdateButtons ¶
func (s *Sys) UpdateButtons(state ButtonState)
func (*Sys) WriteBytes ¶
type SystemRAM ¶
type SystemRAM struct {
// contains filtered or unexported fields
}
* System RAM needs to assert specially in order to properly do the mirrioring * nonsense.
func NewSystemRAM ¶
func NewSystemRAM() *SystemRAM
type UpdateButtonser ¶
type UpdateButtonser interface {
UpdateButtons(state ButtonState)
}
type VideoSwapper ¶
type WriteOnlyRegister ¶
type WriteOnlyRegister struct {
// contains filtered or unexported fields
}
func (*WriteOnlyRegister) Asserts ¶
func (w *WriteOnlyRegister) Asserts(addr uint16) bool
func (*WriteOnlyRegister) R ¶
func (w *WriteOnlyRegister) R(_ uint16) uint8
func (*WriteOnlyRegister) W ¶
func (w *WriteOnlyRegister) W(_ uint16, val uint8)
Click to show internal directories.
Click to hide internal directories.