aboutsummaryrefslogtreecommitdiff
path: root/cpu/cpu.go
diff options
context:
space:
mode:
authorcrecher <crecher@crecher.net>2026-10-12 15:44:15 +0200
committercrecher <crecher@crecher.net>2026-10-12 15:44:15 +0200
commit780b1e886f6676efedc732b67328f5fbdbe87dc4 (patch)
treeed9c99db91cbee374e31cea24f6ad34848dc47af /cpu/cpu.go
parent6c49575d1cacd5126b73506cc30430643310396b (diff)
downloadgones-780b1e886f6676efedc732b67328f5fbdbe87dc4.tar.gz
gones-780b1e886f6676efedc732b67328f5fbdbe87dc4.zip
waiter waiter more comments please
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}
}