mirror of
https://github.com/ariejan/i6502.git
synced 2025-04-08 21:43:30 +00:00
Add CpuType to differentiate between models/variants
This commit is contained in:
parent
a174259751
commit
d0c10cd4af
9
cpu.go
9
cpu.go
@ -22,8 +22,15 @@ type Cpu struct {
|
||||
SP byte // Stack Pointer
|
||||
|
||||
Bus *AddressBus // The address bus
|
||||
|
||||
CpuType int // Which type of CPU is begin emulated
|
||||
}
|
||||
|
||||
const (
|
||||
Cpu6502 = iota // The original MOS 6502, no bugs
|
||||
Cpu65C02 // The WDC 65C02 version
|
||||
)
|
||||
|
||||
const (
|
||||
ZeropageBase = 0x0000 // 0x0000-00FF Reserved for zeropage instructions
|
||||
StackBase = 0x0100 // 0x0100-01FF Reserved for stack
|
||||
@ -35,7 +42,7 @@ const (
|
||||
|
||||
// Create an new Cpu, using the AddressBus for accessing memory.
|
||||
func NewCpu(bus *AddressBus) (*Cpu, error) {
|
||||
return &Cpu{Bus: bus}, nil
|
||||
return &Cpu{Bus: bus, CpuType: Cpu6502}, nil
|
||||
}
|
||||
|
||||
// Returns a string containing the current state of the CPU.
|
||||
|
Loading…
x
Reference in New Issue
Block a user