Terse code is easy to read. Gratuitously compact code isn't
The rule of thumb is that if it's short but in no way obfuscated, it's terse. If it's short, and impossible to read because of it, it's gratuitously compact.
The rule of thumb is that if it's short but in no way obfuscated, it's terse. If it's short, and impossible to read because of it, it's gratuitously compact.
/* CPU state */
u8 ram[0x800];
u8 A, X, Y, S;
u16 PC;
Flags P;
bool nmi, irq;
I like it.The reason for the single letters is that those are the actual names of the 6502 registers.
Glad you like it overall. :)
I also love the way you use C++ templates to simplify things!
program counter
flagPort
non maskable interrupt, interrupt request
I'm sure you knew that though, it's common micro processor nomenclature.
Additionally, the zeroth "page" of memory (the lowest 256 bytes) are accessible with a dedicated addressing mode which saves space and time in the program, and can be used as a form of cache.