cpu

package
v0.0.0-...-22a0535 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE
	NMI
	RESET
	IRQ
	BRK
)

Interrupt type

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU struct {
	Registers
	Interrupt int
	MemoryMap [0xffff + 1]byte
	PPU       *ppu.PPU
}

func NewCPU

func NewCPU() *CPU

func (*CPU) Pop

func (c *CPU) Pop() uint8

func (*CPU) PopAddress

func (c *CPU) PopAddress() uint16

func (*CPU) PopStatusRegister

func (c *CPU) PopStatusRegister()

func (*CPU) Push

func (c *CPU) Push(v uint8)

func (*CPU) PushAddress

func (c *CPU) PushAddress(val uint16)

func (*CPU) PushStatusRegister

func (c *CPU) PushStatusRegister()

func (*CPU) Reset

func (c *CPU) Reset()

func (*CPU) Run

func (c *CPU) Run() int

func (*CPU) SetPPU

func (c *CPU) SetPPU(ppu *ppu.PPU)

func (*CPU) SetPRGROM

func (c *CPU) SetPRGROM(progROM []byte)

func (*CPU) SetZN

func (c *CPU) SetZN(val uint8)

type Registers

type Registers struct {
	A  byte           // アキュムレーター
	X  byte           // インデックスレジスタ
	Y  byte           // インデックスレジスタ
	S  byte           // スタックポインタレジスタ スタックポインタは0x01|S
	P  statusRegister // ステータスレジスタ 上位8bitは0x01で固定 7:N 6:V 5:R=1 4:B 3:D 2:I 1:Z 0:C
	PC uint16         // プログラムカウンタ
}

レジスタ内容に関しては http://hp.vector.co.jp/authors/VA042397/nes/6502.html を参照

func NewRegisters

func NewRegisters() *Registers

Jump to

Keyboard shortcuts

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