nesemu/include/rom.h

29 lines
500 B
C

//
// Created by william on 12/2/23.
//
#ifndef NESEMULATOR_ROM_H
#define NESEMULATOR_ROM_H
// 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
typedef struct {
byte *prg_rom;
byte *chr_rom;
void *header;
} Rom;
int rom_load(char *path);
void rom_uninit();
byte rom_prg_get_byte(address addr);
word rom_prg_get_word(address addr);
#endif //NESEMULATOR_ROM_H