X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=cart.h;h=9c60b3477ac5a6cf5d2bf5f4382303fe86553c45;hp=b066771dcde111b03997fafc2be0c6b05660c7e9;hb=892b1f6c68346fa00dc3029ab8bd31178e730509;hpb=c62d28102c77e19c291c78bf6bf7f0a81abd54b9 diff --git a/cart.h b/cart.h index b066771..9c60b34 100644 --- a/cart.h +++ b/cart.h @@ -1,3 +1,32 @@ +#ifndef _CART_H +#define _CART_H + +typedef struct { + /* 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. */ + 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. + */ +} CartInfo; + +void FCEU_SaveGameSave(CartInfo *LocalHWInfo); +void FCEU_LoadGameSave(CartInfo *LocalHWInfo); + extern uint8 *Page[32],*VPage[8],*MMC5SPRVPage[8],*MMC5BGVPage[8]; void ResetCartMapping(void); @@ -5,7 +34,10 @@ 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); + extern uint8 *PRGptr[32]; extern uint8 *CHRptr[32]; @@ -43,7 +75,7 @@ void FASTAPASS(2) setchr8r(int r, unsigned int V); void FASTAPASS(2) setchr1(unsigned int A, unsigned int V); void FASTAPASS(2) setchr2(unsigned int A, unsigned int V); void FASTAPASS(2) setchr4(unsigned int A, unsigned int V); -void FASTAPASS(2) setchr8(unsigned int V); +void FASTAPASS(1) setchr8(unsigned int V); void FASTAPASS(2) setvram4(uint32 A, uint8 *p); void FASTAPASS(1) setvram8(uint8 *p); @@ -68,3 +100,8 @@ void GeniePower(void); void OpenGenie(void); void CloseGenie(void); +void FCEU_KillGenie(void); +void GenieSetPages(int restore); + +#endif // ndef _CART_H +