summaryrefslogtreecommitdiff
path: root/rom.h
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2024-06-17 14:46:00 +0530
committervin <git@vineetk.net>2024-06-17 14:46:46 +0530
commit77d37dd455f804c79969979eb39d525b3c5ddfe7 (patch)
tree5cc5ba7972615cdc473f6897a80348c255725c6a /rom.h
parent1f6e3b054cd7a35c5eb8d908525a261ea83d44e7 (diff)
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.
Diffstat (limited to 'rom.h')
-rw-r--r--rom.h17
1 files changed, 17 insertions, 0 deletions
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);