psx emulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
581 B

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #ifndef PSXC_H_
  2. #define PSXC_H_
  3. #include <stdint.h>
  4. #define REG_GP 28 // Global pointer
  5. #define REG_SP 29 // Stack pointer
  6. #define REG_FP 30 // Frame pointer
  7. #define MAIN_RAM_SIZE 0x200000
  8. #define SCRATCHPAD_BASE 0x1F800000
  9. #define SCRATCHPAD_END 0x1F8003FF
  10. #define SCRATCHPAD_SIZE (SCRATCHPAD_END - SCRATCHPAD_BASE + 1)
  11. typedef struct
  12. {
  13. uint32_t regs[32];
  14. uint32_t pc;
  15. uint32_t main_ram[MAIN_RAM_SIZE];
  16. uint32_t sratchpad_ram[SCRATCHPAD_SIZE];
  17. } cpu_t;
  18. void cpu_write32(cpu_t *cpu, uint32_t addr, uint32_t x);
  19. uint32_t cpu_read32(cpu_t *cpu, uint32_t addr);
  20. #endif