aboutsummaryrefslogtreecommitdiff
path: root/cpu/cpu.go
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/cpu.go')
-rw-r--r--cpu/cpu.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/cpu/cpu.go b/cpu/cpu.go
index fb673b7..113adf0 100644
--- a/cpu/cpu.go
+++ b/cpu/cpu.go
@@ -13,6 +13,16 @@ type CPU struct {
SP uint8 // stack pointer
PC uint16 // program counter
Status uint8 // status flags
+ // status flags are NV1B DIZC
+ // |||| ||||
+ // |||| |||+- Carry
+ // |||| ||+-- Zero
+ // |||| |+--- Interrupt Disable
+ // |||| +---- Decimal
+ // |||+------ (no cpu effect, check https://www.nesdev.org/wiki/Status_flags#The_B_flag for a good explanation)
+ // ||+------- (no cpu effect, always pushed as 1)
+ // |+-------- Overflow
+ // +--------- Negative
Bus Bus
Cycles uint64
@@ -21,7 +31,7 @@ type CPU struct {
extraCycles int
}
-func NewCPU(bus Bus) *CPU {
+func NewCPU(bus Bus) *CPU { // creates new cpu with bus
return &CPU{Bus: bus}
}