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:
Bradford Lamson-Scribner 2020-05-27 14:52:39 -06:00
parent 366b4ce53e
commit 3ff2e7f9ab
3 changed files with 20 additions and 1 deletions

View File

@ -48,7 +48,8 @@ const (
zeroPageYIndexed
)
type mos6502cpu struct {
// Mos6502 TODO: docs
type Mos6502 struct {
pc uint16 // program counter (16 bit)
ac uint8 // accumulator (8 bit)
x uint8 // X register (8 bit)
@ -56,3 +57,8 @@ type mos6502cpu struct {
sr uint8 // status register [NV-BDIZC] (8 bit)
sp uint8 // stack pointer (8 bit)
}
// New TODO: docs
func New() *Mos6502 {
return &Mos6502{}
}

13
pkg/appleone/appleone.go Normal file
View 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()}
}