|
|
- #ifndef PSXC_H_
- #define PSXC_H_
-
- #include <stdint.h>
-
- #define REG_GP 28 // Global pointer
- #define REG_SP 29 // Stack pointer
- #define REG_FP 30 // Frame pointer
-
- #define MAIN_RAM_SIZE 0x200000
- #define SCRATCHPAD_BASE 0x1F800000
- #define SCRATCHPAD_END 0x1F8003FF
- #define SCRATCHPAD_SIZE (SCRATCHPAD_END - SCRATCHPAD_BASE + 1)
-
- typedef struct {
- uint32_t regs[32];
- uint32_t pc;
- uint32_t main_ram[MAIN_RAM_SIZE];
- uint32_t sratchpad_ram[SCRATCHPAD_SIZE];
- } cpu_t;
-
- void cpu_write32(cpu_t *cpu, uint32_t addr, uint32_t x);
-
- uint32_t cpu_read32(cpu_t *cpu, uint32_t addr);
-
- #endif
|