PancakeNESEmu
A homebrewed NES Emulator written in C
|
This structure will be used to represent the state of the Central Processing Unit (CPU) of our emulator. This Virtual CPU emulates a "MOS Technology 6502". More...
#include <cpu.h>
Public Attributes | |
address | program_counter |
An address pointing to the next instruction to be executed. | |
data | stack_pointer |
A register that holds the 8 lower bytes of the address 0x11??. | |
data | cache |
A 8 bit reserved space that I use for some operations. | |
data | accumulator |
A 8 bit register used to perform operations. | |
data | register_x |
A 8 bit register. Commonly used to hold offset and counters. | |
data | register_y |
A 8 bit register. Commonly used to hold offset and counters. | |
data | flags |
NVPBDIZC. | |
unsigned char | cycle_counter |
The cycle counter. The counter is decremented every step. | |
memory | mem |
A direct access to the Emulator Memory. | |
This structure will be used to represent the state of the Central Processing Unit (CPU) of our emulator. This Virtual CPU emulates a "MOS Technology 6502".
Here's some informations about this CPU:
data CPU::accumulator |
A 8 bit register used to perform operations.
Definition at line 31 of file cpu.h.
Referenced by init_cpu(), main(), print_cpu_state(), and printw_cpu_state().
data CPU::cache |
A 8 bit reserved space that I use for some operations.
Definition at line 30 of file cpu.h.
Referenced by init_cpu().
unsigned char CPU::cycle_counter |
The cycle counter. The counter is decremented every step.
Definition at line 37 of file cpu.h.
Referenced by init_cpu(), and step_cpu().
data CPU::flags |
NVPBDIZC.
Definition at line 35 of file cpu.h.
Referenced by init_cpu(), main(), and print_cpu_state().
memory CPU::mem |
A direct access to the Emulator Memory.
Definition at line 39 of file cpu.h.
Referenced by execute_instruction(), free_cpu(), get_next_instruction(), init_cpu(), main(), print_stack_state(), start_cpu(), and step_cpu().
address CPU::program_counter |
An address pointing to the next instruction to be executed.
Definition at line 28 of file cpu.h.
Referenced by execute_instruction(), get_next_instruction(), init_cpu(), print_cpu_state(), printw_cpu_state(), start_cpu(), and step_cpu().
data CPU::register_x |
A 8 bit register. Commonly used to hold offset and counters.
Definition at line 32 of file cpu.h.
Referenced by execute_instruction(), get_next_instruction(), init_cpu(), main(), print_cpu_state(), and printw_cpu_state().
data CPU::register_y |
A 8 bit register. Commonly used to hold offset and counters.
Definition at line 33 of file cpu.h.
Referenced by execute_instruction(), get_next_instruction(), init_cpu(), main(), print_cpu_state(), and printw_cpu_state().
data CPU::stack_pointer |
A register that holds the 8 lower bytes of the address 0x11??.
Definition at line 29 of file cpu.h.
Referenced by init_cpu(), main(), print_cpu_state(), print_stack_state(), and printw_cpu_state().