#ifndef NESE_INES_H_ #define NESE_INES_H_ #include #define INES_TRAINER_SIZE (0x0200U) #define INES_PRG_ROM_SIZE (0x4000U) #define INES_CHR_ROM_SIZE (0x2000U) #define INES_MAGIC "NES\x1a" typedef enum __attribute__((packed)) { ines_Flag_Vert_Mirror = 0b00000001, ines_Flag_Battery = 0b00000010, ines_Flag_Trainer = 0b00000100, ines_Flag_Alt_Nametable = 0b00001000, ines_Mapper_Nibble_Lo = 0b11110000, } ines_6_Flag; typedef enum __attribute__((packed)) { ines_Console_Mask = 0b00000011, ines_Console_NES = 0b00000000, ines_Console_VS = 0b00000001, ines_Console_PC10 = 0b00000010, ines_Console_Ext = 0b00000011, ines_NES_2_MASK = 0b00001100, ines_NES_2_ID = 0b00001000, ines_Mapper_Nibble_Hi = 0b11110000, } ines_7_Flag; typedef struct __attribute__((packed)) { char magic[4]; uint8_t prg_size_lsb; uint8_t chr_size_lsb; ines_6_Flag flags_6; ines_7_Flag flags_7; uint8_t prg_ram_size; uint8_t tv_system; uint8_t flags_10; uint8_t padding[5]; } ines_Header; #endif // NESE_INES_H_