nesemu/include/rom.h

39 lines
708 B
C

//
// Created by william on 12/2/23.
//
#include <stdbool.h>
#include "types.h"
#include "system.h"
#ifndef NESEMULATOR_ROM_H
#define NESEMULATOR_ROM_H
// The size of the header in a ROM file, in bytes
#define ROM_HEADER_SIZE 16
// The size of the trainer in a ROM file, in bytes
#define ROM_TRAINER_SIZE 512
typedef struct {
byte header[ROM_HEADER_SIZE];
bool nametable_mirrored;
byte *prg_rom;
unsigned int prg_rom_size;
byte *chr_rom;
} Rom;
Rom *rom_get();
/**
* Loads a ROM from a specified file path.
*
* @param path The file path
* @return A boolean indicating a success (true) or an error.
*/
bool rom_load(char *path);
void rom_unload();
#endif //NESEMULATOR_ROM_H