2023-12-03 00:27:07 -05:00
|
|
|
//
|
|
|
|
// Created by william on 12/2/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef NESEMULATOR_ROM_H
|
|
|
|
#define NESEMULATOR_ROM_H
|
|
|
|
|
2023-12-23 16:35:23 -05:00
|
|
|
// The size of the header in a ROM file, in bytes
|
|
|
|
#include "cpu.h"
|
|
|
|
|
|
|
|
#define ROM_HEADER_SIZE 16
|
|
|
|
// The size of the trainer in a ROM file, in bytes
|
|
|
|
#define ROM_TRAINER_SIZE 512
|
|
|
|
|
2023-12-03 00:27:07 -05:00
|
|
|
typedef struct {
|
2023-12-23 16:35:23 -05:00
|
|
|
byte *prg_rom;
|
|
|
|
byte *chr_rom;
|
|
|
|
void *header;
|
2023-12-03 00:27:07 -05:00
|
|
|
} Rom;
|
|
|
|
|
2023-12-23 16:35:23 -05:00
|
|
|
int rom_load(char *path);
|
|
|
|
|
|
|
|
void rom_uninit();
|
|
|
|
|
|
|
|
byte rom_prg_get_byte(address addr);
|
|
|
|
|
|
|
|
word rom_prg_get_word(address addr);
|
2023-12-03 00:27:07 -05:00
|
|
|
|
|
|
|
#endif //NESEMULATOR_ROM_H
|