#15259 - Cuauhtemoc - Tue Jan 20, 2004 4:34 am
Hello, I wrote(tried) a simple mode 0 program, but it doesn't work. I'm just a newbie, I can't figure why it doesn't work. Could somebody help me ?
#include "tile.c"
#include "map.c"
#include "palette.c"
#define REG_DISPCNT *(unsigned short*)0x4000000
#define Video ((unsigned short*)0x6000000)
#define BG0 0x100
#define BG_PAL ((unsigned short *)0x5000000)
#define BG0CTRL *(unsigned short*) 0x4000008
#define CharBlock(n) (((n)*0x4000)+0x6000000)
#define ScreenBlock(n) (((n)*0x800)+0x6000000)
int main(void)
{
unsigned short c;
unsigned short* Tile =((unsigned short*) CharBlock(1));
unsigned short* Map =((unsigned short*) ScreenBlock(0));
REG_DISPCNT=(0x0|0x100); // (MODE_0 | BG0)
BG0CTRL=(0x80|8<<0|2<<1);// (256clrs|ScrnBlk|ChrBlk)
for(c=0;c<256;c++)BG_PAL[c]=Pal[c];
for(c=0;c<3072;c++)Tile[c]=tiles[c];
for(c=0;c<1024;c++)Map[c]=_map_[c];
while(1){}
return 0;
}
THANK YOU VERY MUCH
#include "tile.c"
#include "map.c"
#include "palette.c"
#define REG_DISPCNT *(unsigned short*)0x4000000
#define Video ((unsigned short*)0x6000000)
#define BG0 0x100
#define BG_PAL ((unsigned short *)0x5000000)
#define BG0CTRL *(unsigned short*) 0x4000008
#define CharBlock(n) (((n)*0x4000)+0x6000000)
#define ScreenBlock(n) (((n)*0x800)+0x6000000)
int main(void)
{
unsigned short c;
unsigned short* Tile =((unsigned short*) CharBlock(1));
unsigned short* Map =((unsigned short*) ScreenBlock(0));
REG_DISPCNT=(0x0|0x100); // (MODE_0 | BG0)
BG0CTRL=(0x80|8<<0|2<<1);// (256clrs|ScrnBlk|ChrBlk)
for(c=0;c<256;c++)BG_PAL[c]=Pal[c];
for(c=0;c<3072;c++)Tile[c]=tiles[c];
for(c=0;c<1024;c++)Map[c]=_map_[c];
while(1){}
return 0;
}
THANK YOU VERY MUCH