mirror of
https://github.com/bradford-hamilton/apple-1.git
synced 2024-06-13 07:29:31 +00:00
pkg/appleone: add a public appleone pkg
Move cpu and opcodes (cpu package) to internal, while adding a public appleone api package to `pkg/`
This commit is contained in:
parent
366b4ce53e
commit
3ff2e7f9ab
|
@ -48,7 +48,8 @@ const (
|
||||||
zeroPageYIndexed
|
zeroPageYIndexed
|
||||||
)
|
)
|
||||||
|
|
||||||
type mos6502cpu struct {
|
// Mos6502 TODO: docs
|
||||||
|
type Mos6502 struct {
|
||||||
pc uint16 // program counter (16 bit)
|
pc uint16 // program counter (16 bit)
|
||||||
ac uint8 // accumulator (8 bit)
|
ac uint8 // accumulator (8 bit)
|
||||||
x uint8 // X register (8 bit)
|
x uint8 // X register (8 bit)
|
||||||
|
@ -56,3 +57,8 @@ type mos6502cpu struct {
|
||||||
sr uint8 // status register [NV-BDIZC] (8 bit)
|
sr uint8 // status register [NV-BDIZC] (8 bit)
|
||||||
sp uint8 // stack pointer (8 bit)
|
sp uint8 // stack pointer (8 bit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New TODO: docs
|
||||||
|
func New() *Mos6502 {
|
||||||
|
return &Mos6502{}
|
||||||
|
}
|
13
pkg/appleone/appleone.go
Normal file
13
pkg/appleone/appleone.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package appleone
|
||||||
|
|
||||||
|
import "github.com/bradford-hamilton/apple-1/internal/cpu"
|
||||||
|
|
||||||
|
// Appleone TODO docs
|
||||||
|
type Appleone struct {
|
||||||
|
cpu *cpu.Mos6502
|
||||||
|
}
|
||||||
|
|
||||||
|
// New TODO: docs
|
||||||
|
func New() *Appleone {
|
||||||
|
return &Appleone{cpu: cpu.New()}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user