Documentation
¶
Index ¶
- Constants
- Variables
- func UnimplementedInstruction(cpu *CPU)
- type CPU
- func (cpu *CPU) ADC_A_s(s byte, cycles byte) byte
- func (cpu *CPU) ADD_HL_SP() (cycles byte)
- func (cpu *CPU) ADD_HL_rr(r1 *byte, r2 *byte) (cycles byte)
- func (cpu *CPU) ADD_SP_e() (cycles byte)
- func (cpu *CPU) ADD_s(s byte, cycles byte) byte
- func (cpu *CPU) AND_s(s byte, cycles byte) byte
- func (cpu *CPU) BIT_b_HL(bit byte) (cycles byte)
- func (cpu *CPU) BIT_b_r(bit byte, r *byte) (cycles byte)
- func (cpu *CPU) CALL() (cycles byte)
- func (cpu *CPU) CALL_cc(conditionCode int) (cycles byte)
- func (cpu *CPU) CCF() (cycles byte)
- func (cpu *CPU) CPL() (cycles byte)
- func (cpu *CPU) CP_s(s byte, cycles byte) byte
- func (cpu *CPU) DAA() (cycles byte)
- func (cpu *CPU) DEC_HL() (cycles byte)
- func (cpu *CPU) DEC_SP() (cycles byte)
- func (cpu *CPU) DEC_r(r *byte) (cycles byte)
- func (cpu *CPU) DEC_rr(r1 *byte, r2 *byte) (cycles byte)
- func (cpu *CPU) DI() (cycles byte)
- func (cpu *CPU) EI() (cycles byte)
- func (cpu *CPU) GetByteOffset(offset uint16) byte
- func (cpu *CPU) GetOpcode() byte
- func (cpu *CPU) HALT() (cycles byte)
- func (cpu *CPU) INC_HL() (cycles byte)
- func (cpu *CPU) INC_SP() (cycles byte)
- func (cpu *CPU) INC_r(r *byte) (cycles byte)
- func (cpu *CPU) INC_rr(r1 *byte, r2 *byte) (cycles byte)
- func (cpu *CPU) IsFlagSet(flag byte) bool
- func (cpu *CPU) JP_HL() (cycles byte)
- func (cpu *CPU) JP_cc_nn(conditionCode int) (cycles byte)
- func (cpu *CPU) JP_nn() (cycles byte)
- func (cpu *CPU) JR_cc_e(conditionCode int) (cycles byte)
- func (cpu *CPU) JR_e() (cycles byte)
- func (cpu *CPU) LDH_A_n() (cycles byte)
- func (cpu *CPU) LDH_n_A() (cycles byte)
- func (cpu *CPU) LD_A_BC() (cycles byte)
- func (cpu *CPU) LD_A_C() (cycles byte)
- func (cpu *CPU) LD_A_DE() (cycles byte)
- func (cpu *CPU) LD_A_HLD() (cycles byte)
- func (cpu *CPU) LD_A_HLI() (cycles byte)
- func (cpu *CPU) LD_A_nn() (cycles byte)
- func (cpu *CPU) LD_BC_A() (cycles byte)
- func (cpu *CPU) LD_C_A() (cycles byte)
- func (cpu *CPU) LD_DE_A() (cycles byte)
- func (cpu *CPU) LD_HLD_A() (cycles byte)
- func (cpu *CPU) LD_HLI_A() (cycles byte)
- func (cpu *CPU) LD_HL_SP_e() (cycles byte)
- func (cpu *CPU) LD_HL_n() (cycles byte)
- func (cpu *CPU) LD_HL_r(register *byte) (cycles byte)
- func (cpu *CPU) LD_SP_HL() (cycles byte)
- func (cpu *CPU) LD_SP_nn() (cycles byte)
- func (cpu *CPU) LD_nn_A() (cycles byte)
- func (cpu *CPU) LD_nn_SP() (cycles byte)
- func (cpu *CPU) LD_r_HL(register *byte) (cycles byte)
- func (cpu *CPU) LD_r_n(register *byte) (cycles byte)
- func (cpu *CPU) LD_r_r(register_1 *byte, register_2 *byte) (cycles byte)
- func (cpu *CPU) LD_rr_nn(r1 *byte, r2 *byte) (cycles byte)
- func (cpu *CPU) NOP() (cycles byte)
- func (cpu *CPU) OR_s(s byte, cycles byte) byte
- func (cpu *CPU) POP_AF() (cycles byte)
- func (cpu *CPU) POP_qq(r1 *byte, r2 *byte) (cycles byte)
- func (cpu *CPU) PUSH_qq(r1 *byte, r2 *byte) (cycles byte)
- func (cpu *CPU) RES_b_HL(bit byte) (cycles byte)
- func (cpu *CPU) RES_b_r(bit byte, r *byte) (cycles byte)
- func (cpu *CPU) RET() (cycles byte)
- func (cpu *CPU) RETI() (cycles byte)
- func (cpu *CPU) RET_cc(conditionCode int) (cycles byte)
- func (cpu *CPU) RLA() (cycles byte)
- func (cpu *CPU) RLCA() (cycles byte)
- func (cpu *CPU) RLC_HL() (cycles byte)
- func (cpu *CPU) RLC_r(r *byte) (cycles byte)
- func (cpu *CPU) RL_HL() (cycles byte)
- func (cpu *CPU) RL_r(r *byte) (cycles byte)
- func (cpu *CPU) RRA() (cycles byte)
- func (cpu *CPU) RRCA() (cycles byte)
- func (cpu *CPU) RRC_HL() (cycles byte)
- func (cpu *CPU) RRC_r(r *byte) (cycles byte)
- func (cpu *CPU) RR_HL() (cycles byte)
- func (cpu *CPU) RR_r(r *byte) (cycles byte)
- func (cpu *CPU) RST(t byte) (cycles byte)
- func (cpu *CPU) ReadByte(addr uint16) byte
- func (cpu *CPU) Reset()
- func (cpu *CPU) ResetFlag(flag byte)
- func (cpu *CPU) SBC_s(s byte, cycles byte) byte
- func (cpu *CPU) SCF() (cycles byte)
- func (cpu *CPU) SET_b_HL(bit byte) (cycles byte)
- func (cpu *CPU) SET_b_r(bit byte, r *byte) (cycles byte)
- func (cpu *CPU) SLA_HL() (cycles byte)
- func (cpu *CPU) SLA_r(r *byte) (cycles byte)
- func (cpu *CPU) SRA_HL() (cycles byte)
- func (cpu *CPU) SRA_r(r *byte) (cycles byte)
- func (cpu *CPU) SRL_HL() (cycles byte)
- func (cpu *CPU) SRL_r(r *byte) (cycles byte)
- func (cpu *CPU) SUB_s(s byte, cycles byte) byte
- func (cpu *CPU) SWAP_HL() (cycles byte)
- func (cpu *CPU) SWAP_r(r *byte) (cycles byte)
- func (cpu *CPU) SetFlag(flag byte)
- func (cpu *CPU) Step() (cycles int)
- func (cpu *CPU) WriteByte(addr uint16, value byte)
- func (cpu *CPU) XOR_s(s byte, cycles byte) byte
- type Instruction
- type Registers
- type Timer
Constants ¶
View Source
const ( IF = 0xFF0F IE = 0xFFFF VBLANK_INTERRUPT = 0 LCDC_INTERRUPT = 1 TIMER_OVERFLOW_INTERRUPT = 2 SERIAL_IO_INTERRUPT = 3 JOYPAD_INTERRUPT = 4 VBLANK_INTERRUPT_ADDR = 0x40 LCDC_INTERRUPT_ADDR = 0x48 TIMER_OVERFLOW_INTERRUPT_ADDR = 0x50 SERIAL_IO_INTERRUPT_ADDR = 0x58 JOYPAD_INTERRUPT_ADDR = 0x60 )
Interrupts
View Source
const ( CC_NZ = 00 CC_Z = 01 CC_NC = 10 CC_C = 11 )
Condition Codes
View Source
const ( Z = 7 // Zero Flag N = 6 // Subtraction Flag H = 5 // Half-Carry Flag CY = 4 // Carry Flag )
flags
View Source
const ( DIV = 0xFF04 TIMA = 0xFF05 TMA = 0xFF06 TAC = 0xFF07 TIMER_STOP = 2 )
Timer and Divider Registers
Variables ¶
View Source
var CBInstructions map[byte]*Instruction = map[byte]*Instruction{}/* 256 elements not displayed */
View Source
var Instructions map[byte]*Instruction = map[byte]*Instruction{}/* 244 elements not displayed */
Functions ¶
func UnimplementedInstruction ¶
func UnimplementedInstruction(cpu *CPU)
Types ¶
type CPU ¶
type CPU struct { Registers Registers SP uint16 PC uint16 CurrentInstruction *Instruction IF byte // Interrupt Flag IE byte // Interrupt Enabled IME bool // Interrupt Master Enable Halt bool // contains filtered or unexported fields }
func (*CPU) GetByteOffset ¶
type Instruction ¶
Click to show internal directories.
Click to hide internal directories.