2022-06-16 03:58:04 +02:00
|
|
|
#ifndef CART_H
|
|
|
|
#define CART_H
|
|
|
|
|
2008-04-03 05:58:35 +02:00
|
|
|
typedef struct {
|
2012-12-14 18:43:51 +01:00
|
|
|
// Set by mapper/board code:
|
|
|
|
void (*Power)(void);
|
|
|
|
void (*Reset)(void);
|
|
|
|
void (*Close)(void);
|
|
|
|
uint8 *SaveGame[4]; // Pointers to memory to save/load.
|
|
|
|
uint32 SaveGameLen[4]; // How much memory to save/load.
|
|
|
|
|
|
|
|
// Set by iNES/UNIF loading code.
|
|
|
|
int mirror; // As set in the header or chunk.
|
|
|
|
// iNES/UNIF specific. Intended
|
|
|
|
// to help support games like "Karnov"
|
|
|
|
// that are not really MMC3 but are
|
|
|
|
// set to mapper 4.
|
|
|
|
int battery; // Presence of an actual battery.
|
2016-09-18 05:43:24 +02:00
|
|
|
int ines2;
|
|
|
|
int submapper; // Submappers as defined by NES 2.0
|
|
|
|
int wram_size;
|
|
|
|
int battery_wram_size;
|
|
|
|
int vram_size;
|
|
|
|
int battery_vram_size;
|
2012-12-14 18:43:51 +01:00
|
|
|
uint8 MD5[16];
|
|
|
|
uint32 CRC32; // Should be set by the iNES/UNIF loading
|
|
|
|
// code, used by mapper/board code, maybe
|
|
|
|
// other code in the future.
|
2008-04-03 05:58:35 +02:00
|
|
|
} CartInfo;
|
|
|
|
|
2018-08-13 17:04:20 +02:00
|
|
|
extern CartInfo *currCartInfo;
|
|
|
|
|
2008-04-03 05:58:35 +02:00
|
|
|
void FCEU_SaveGameSave(CartInfo *LocalHWInfo);
|
|
|
|
void FCEU_LoadGameSave(CartInfo *LocalHWInfo);
|
2009-07-17 19:27:04 +02:00
|
|
|
void FCEU_ClearGameSave(CartInfo *LocalHWInfo);
|
2008-04-03 05:58:35 +02:00
|
|
|
|
2012-12-14 18:43:51 +01:00
|
|
|
extern uint8 *Page[32], *VPage[8], *MMC5SPRVPage[8], *MMC5BGVPage[8];
|
2008-04-03 05:58:35 +02:00
|
|
|
|
|
|
|
void ResetCartMapping(void);
|
|
|
|
void SetupCartPRGMapping(int chip, uint8 *p, uint32 size, int ram);
|
|
|
|
void SetupCartCHRMapping(int chip, uint8 *p, uint32 size, int ram);
|
|
|
|
void SetupCartMirroring(int m, int hard, uint8 *extra);
|
|
|
|
|
|
|
|
DECLFR(CartBROB);
|
|
|
|
DECLFR(CartBR);
|
|
|
|
DECLFW(CartBW);
|
|
|
|
|
2016-09-18 05:43:24 +02:00
|
|
|
extern uint8 PRGram[32];
|
|
|
|
extern uint8 CHRram[32];
|
|
|
|
|
2008-04-03 05:58:35 +02:00
|
|
|
extern uint8 *PRGptr[32];
|
|
|
|
extern uint8 *CHRptr[32];
|
|
|
|
|
|
|
|
extern uint32 PRGsize[32];
|
|
|
|
extern uint32 CHRsize[32];
|
|
|
|
|
|
|
|
extern uint32 PRGmask2[32];
|
|
|
|
extern uint32 PRGmask4[32];
|
|
|
|
extern uint32 PRGmask8[32];
|
|
|
|
extern uint32 PRGmask16[32];
|
|
|
|
extern uint32 PRGmask32[32];
|
|
|
|
|
|
|
|
extern uint32 CHRmask1[32];
|
|
|
|
extern uint32 CHRmask2[32];
|
|
|
|
extern uint32 CHRmask4[32];
|
|
|
|
extern uint32 CHRmask8[32];
|
|
|
|
|
2009-07-17 19:27:04 +02:00
|
|
|
void setprg2(uint32 A, uint32 V);
|
|
|
|
void setprg4(uint32 A, uint32 V);
|
|
|
|
void setprg8(uint32 A, uint32 V);
|
|
|
|
void setprg16(uint32 A, uint32 V);
|
|
|
|
void setprg32(uint32 A, uint32 V);
|
|
|
|
|
2022-06-16 03:58:04 +02:00
|
|
|
void setprg2r(int r, unsigned int A, unsigned int V);
|
|
|
|
void setprg4r(int r, unsigned int A, unsigned int V);
|
|
|
|
void setprg8r(int r, unsigned int A, unsigned int V);
|
|
|
|
void setprg16r(int r, unsigned int A, unsigned int V);
|
|
|
|
void setprg32r(int r, unsigned int A, unsigned int V);
|
2018-07-28 22:45:29 +02:00
|
|
|
|
2022-06-16 03:58:04 +02:00
|
|
|
void setchr1r(int r, unsigned int A, unsigned int V);
|
|
|
|
void setchr2r(int r, unsigned int A, unsigned int V);
|
|
|
|
void setchr4r(int r, unsigned int A, unsigned int V);
|
|
|
|
void setchr8r(int r, unsigned int V);
|
2018-07-28 22:45:29 +02:00
|
|
|
|
2022-06-16 03:58:04 +02:00
|
|
|
void setchr1(unsigned int A, unsigned int V);
|
|
|
|
void setchr2(unsigned int A, unsigned int V);
|
|
|
|
void setchr4(unsigned int A, unsigned int V);
|
|
|
|
void setchr8(unsigned int V);
|
2009-07-17 19:27:04 +02:00
|
|
|
|
|
|
|
void setmirror(int t);
|
2008-04-03 05:58:35 +02:00
|
|
|
void setmirrorw(int a, int b, int c, int d);
|
2009-07-17 19:27:04 +02:00
|
|
|
void setntamem(uint8 *p, int ram, uint32 b);
|
2008-04-03 05:58:35 +02:00
|
|
|
|
|
|
|
#define MI_H 0
|
|
|
|
#define MI_V 1
|
|
|
|
#define MI_0 2
|
|
|
|
#define MI_1 3
|
|
|
|
|
|
|
|
extern int geniestage;
|
|
|
|
|
2012-12-14 18:43:51 +01:00
|
|
|
void FCEU_GeniePower(void);
|
2008-04-03 05:58:35 +02:00
|
|
|
|
2016-09-18 05:43:24 +02:00
|
|
|
bool FCEU_OpenGenie(void);
|
2012-12-14 18:43:51 +01:00
|
|
|
void FCEU_CloseGenie(void);
|
2008-04-03 05:58:35 +02:00
|
|
|
void FCEU_KillGenie(void);
|
2022-06-16 03:58:04 +02:00
|
|
|
|
|
|
|
#endif
|