interrupt

package
v0.0.0-...-8886972 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IFAddr = 0x0F
	IEAddr = 0xFF
)

offset is FF00

View Source
const (
	VBlankAddr   types.Addr = 0x0040
	LCD_STATAddr types.Addr = 0x0048
	TimerAddr    types.Addr = 0x0050
	SerialAddr   types.Addr = 0x0058
	JoypadAddr   types.Addr = 0x0060
)

@see https://gbdev.io/pandocs/Interrupts.html#ffff---ie---interrupt-enable-rw

View Source
const (
	VBlankFlag   byte = 0x01
	LCD_STATFlag byte = 0x02
	TimerFlag    byte = 0x04
	SerialFlag   byte = 0x08
	JoypadFlag   byte = 0x10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IRQ

type IRQ struct {
	IF  byte
	IE  byte
	IME bool
}

func NewIRQ

func NewIRQ() *IRQ

func (*IRQ) Disable

func (i *IRQ) Disable()

func (*IRQ) Enable

func (i *IRQ) Enable()

func (*IRQ) Enabled

func (i *IRQ) Enabled() bool

func (*IRQ) Has

func (i *IRQ) Has() bool

if any irq is enable

func (*IRQ) Read

func (i *IRQ) Read(addr types.Addr) byte

func (*IRQ) Request

func (i *IRQ) Request(v byte)

func (*IRQ) Write

func (i *IRQ) Write(addr types.Addr, v byte)

Jump to

Keyboard shortcuts

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