PVSnesLib  4.6.0
Documentation to code in C or ASM for the Nintendo SNES
Loading...
Searching...
No Matches
systems/testregion/src/testregion.c
/*---------------------------------------------------------------------------------
Simple check region code between console and cartridge
Cartridge is currently in region 03 , which is a PAL region
-- alekmaul
---------------------------------------------------------------------------------*/
#include <snes.h>
unsigned short pad0;
//---------------------------------------------------------------------------------
int main(void)
{
// Initialize text console with our font
// Draw a wonderful text :P
consoleDrawText(10, 6, "CHECK REGIONS");
consoleDrawText(3, 10, "BETWEEN SNES AND CARTRIDGE");
// Init background
bgSetGfxPtr(0, 0x3000);
bgSetMapPtr(0, 0x6800, SC_32x32);
// Now Put in 16 color mode and disable Bgs except current
setMode(BG_MODE1, 0);
// Display screen
// Check the regions (1 if ok)
if (consoleRegionIsOK() == 1)
{
consoleDrawText(6, 14, "OK, THE SAME REGION!");
}
else
{
consoleDrawText(4, 14, "BAD, NOT THE SAME REGION!");
}
while (1)
{
}
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.
u16 consoleRegionIsOK(void)
Check compatibility between console (NTSC/PAL) and cartridge (country)
void WaitForVBlank(void)
Waits for a VBlank interrupt.
the master include file for snes applications.
void consoleInitDefaultText(u8 palnum)
Initialize the Text System with the font shipped in PVSNesLib.
void consoleDrawText(u16 x, u16 y, char *fmt,...)
Output formatted string on a screen (tiles mode)
void setScreenOn(void)
Put screen On.
void setMode(u8 mode, u8 size)
Set the SNES hardware to operate in new display mode.