#define SLOT1 0
#define SLOT2 1
extern char snesfont, snespal;
char sz[16];
typedef struct
{
s16 posX, posY;
u16 camX, camY;
} SaveState;
SaveState vts, vtl;
void SaveSlot1()
{
vts.camX = 0x1234;
vts.camY = 0x5678;
vts.posX = 0x0009;
vts.posY = 0x000A;
}
void SaveSlot2()
{
vts.camX = 0xA987;
vts.camY = 0x6543;
vts.posX = 0x0002;
vts.posY = 0x0001;
}
void PrintLoadedSlot()
{
sprintf(sz, "%04X camX ", vtl.camX);
sprintf(sz, "%04X camY ", vtl.camY);
sprintf(sz, "%04X posX ", vtl.posX);
sprintf(sz, "%04X posY ", vtl.posY);
}
void LoadSlot1()
{
PrintLoadedSlot();
}
void LoadSlot2()
{
PrintLoadedSlot();
}
int main(void)
{
unsigned short pad0;
while (1)
{
switch (pad0)
{
SaveSlot1();
break;
LoadSlot1();
break;
SaveSlot2();
break;
LoadSlot2();
break;
}
}
return 0;
}
void bgSetGfxPtr(u8 bgNumber, u16 address)
Definition of each background address.
void bgSetDisable(u8 bgNumber)
Disable a BG in the actual SNES mode.
void bgSetMapPtr(u8 bgNumber, u16 address, u8 mapSize)
Change Background Map address.
void consoleSetTextVramAdr(u16 vramfont)
Change text graphics address (4K aligned)
void consoleCopySramWithOffset(u8 *source, u16 size, u16 offset)
Send data to SRAM with offset.
void consoleInitText(u8 palnum, u8 palsize, u8 *tilfont, u8 *palfont)
Initialize the Text System.
void consoleInit(void)
Initialize console.
void consoleDrawText(u16 x, u16 y, char *fmt,...)
Output formatted string on a screen (tiles mode)
void consoleSetTextOffset(u16 offsetfont)
Change text Background map address for display (must be BG address)
void consoleSetTextVramBGAdr(u16 offsetfont)
Change text Background map address for display (must be BG address)
void consoleLoadSramWithOffset(u8 *dest, u16 size, u16 offset)
Load data from SRAM with offset.
void WaitForVBlank(void)
Wait for vblank interrupt
the master include file for snes applications.
void setScreenOn(void)
Put screen On.
void setMode(u8 mode, u8 size)
Set the SNES hardware to operate in new display mode.