2021-10-20 22:39:29 +02:00
|
|
|
#ifndef _CARTRIDGE_H_
|
|
|
|
#define _CARTRIDGE_H_
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
struct Bus;
|
|
|
|
|
|
|
|
struct Cartridge
|
|
|
|
{
|
2021-10-20 23:11:08 +02:00
|
|
|
Byte* prg_rom;
|
|
|
|
Byte* chr_rom;
|
2021-10-20 22:39:29 +02:00
|
|
|
|
|
|
|
struct Bus* bus;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Cartridge* createCartridge(struct Bus* parent, const char* filepath);
|
|
|
|
void destroyCartridge(struct Cartridge* cartridge);
|
|
|
|
|
2021-10-20 23:23:16 +02:00
|
|
|
// readCartridge/writeCartridge to and from the cartridge
|
|
|
|
Byte readCartridge(struct Cartridge* cartridge, Word addr);
|
|
|
|
void writeCartridge(struct Cartridge* cartridge, Word addr, Byte val);
|
|
|
|
|
2021-10-20 22:39:29 +02:00
|
|
|
#endif //_CARTRIDGE_H_
|