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.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

46 行
1.1KB

  1. #ifndef NESE_INES_H_
  2. #define NESE_INES_H_
  3. #include <stdint.h>
  4. #define INES_TRAINER_SIZE (0x0200U)
  5. #define INES_PRG_ROM_SIZE (0x4000U)
  6. #define INES_CHR_ROM_SIZE (0x2000U)
  7. #define INES_MAGIC "NES\x1a"
  8. typedef enum __attribute__((packed)) {
  9. ines_Flag_Vert_Mirror = 0b00000001,
  10. ines_Flag_Battery = 0b00000010,
  11. ines_Flag_Trainer = 0b00000100,
  12. ines_Flag_Alt_Nametable = 0b00001000,
  13. ines_Mapper_Nibble_Lo = 0b11110000,
  14. } ines_6_Flag;
  15. typedef enum __attribute__((packed)) {
  16. ines_Console_Mask = 0b00000011,
  17. ines_Console_NES = 0b00000000,
  18. ines_Console_VS = 0b00000001,
  19. ines_Console_PC10 = 0b00000010,
  20. ines_Console_Ext = 0b00000011,
  21. ines_NES_2_MASK = 0b00001100,
  22. ines_NES_2_ID = 0b00001000,
  23. ines_Mapper_Nibble_Hi = 0b11110000,
  24. } ines_7_Flag;
  25. typedef struct __attribute__((packed)) {
  26. char magic[4];
  27. uint8_t prg_size_lsb;
  28. uint8_t chr_size_lsb;
  29. ines_6_Flag flags_6;
  30. ines_7_Flag flags_7;
  31. uint8_t prg_ram_size;
  32. uint8_t tv_system;
  33. uint8_t flags_10;
  34. uint8_t padding[5];
  35. } ines_Header;
  36. #endif // NESE_INES_H_