From 77d37dd455f804c79969979eb39d525b3c5ddfe7 Mon Sep 17 00:00:00 2001 From: vin Date: Mon, 17 Jun 2024 14:46:00 +0530 Subject: implement basic iNES and Mapper 0 ROM loading It seems like the test ROM loads fine but the instructions are not, but that's exactly what the test ROM is for I suppose. --- rom.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 rom.h (limited to 'rom.h') diff --git a/rom.h b/rom.h new file mode 100644 index 0000000..a52bda1 --- /dev/null +++ b/rom.h @@ -0,0 +1,17 @@ +enum screen_mirroring { + M_HORIZONTAL, + M_VERTICAL, + M_FOUR, +}; + +struct Rom { + char *prg_rom; + char *chr_rom; + size_t prg_rom_size; + size_t chr_rom_size; + uint8_t mapper; + enum screen_mirroring mirror; +}; + +void parse_rom(const uint8_t *data, size_t data_len, struct Rom *rom); +void free_rom(struct Rom *rom); -- cgit v1.2.3