NESe (pronounced "Nessie") is a NES emulator based on the e6502 emulator, also written in C with a focus on speed and portability for use on embedded platforms, especially ARM.
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.

31 line
826B

  1. #ifndef NESE_MAPPER_H_
  2. #define NESE_MAPPER_H_
  3. #include <stdbool.h>
  4. #include "ines.h"
  5. struct nes_Memory;
  6. struct nes_Mapper {
  7. int max_chr_banks;
  8. int (*init)(struct nes_Mapper*, const ines_Header*, struct nes_Memory*);
  9. bool (*write_rom)(struct nes_Mapper*, uint16_t addr, uint8_t val);
  10. bool (*write_sram)(struct nes_Mapper*, uint16_t addr, uint8_t val);
  11. bool (*write_apu)(struct nes_Mapper*, uint16_t addr, uint8_t val);
  12. uint8_t (*read_apu)(struct nes_Mapper*, uint16_t addr);
  13. void (*hsync)(struct nes_Mapper*);
  14. void (*vsync)(struct nes_Mapper*);
  15. void (*ppu_bus)(struct nes_Mapper*, uint16_t addr);
  16. void (*ppu_mem_mode)(struct nes_Mapper*, uint8_t mode);
  17. void* data;
  18. };
  19. typedef struct nes_Mapper nes_Mapper;
  20. extern const nes_Mapper* nes_mappers[256];
  21. #endif // NESE_MAPPER_H_