Code: Select all
vramSetBankI(VRAM_I_SUB_BG);
Code: Select all
vramSetBankI(VRAM_I_SUB_BG);
Try using this:olwildcory723 wrote:Hi. I've been learning libnds and have been playing with things. In the documentation I've read, this code should work, but it gives me an error when compiling. Here is the code that throws the error:
It gives me the error 'VRAM_I_SUB_BG' undeclared. The tutorials at drunkencoders say that that is an acceptable mapping of the I vram bank. Is this a bug?Code: Select all
vramSetBankI(VRAM_I_SUB_BG);
Code: Select all
vramSetBankI(VRAM_I_SUB_BG_0x06208000);
Code: Select all
105 //-------------------------------------------------------
106 // set up a 2D layer construced of bitmap sprites
107 // this holds the image when rendering to the top screen
108 //-------------------------------------------------------
109 void initSubSprites(void){
110 //-------------------------------------------------------
111
112 oamInit(&oamSub, SpriteMapping_Bmp_2D_256, false);
113
114 int x = 0;
115 int y = 0;
116
117 //set up a 4x3 grid of 64x64 sprites to cover the screen
118 for(y = 0; y < 3; y++)
119 for(x = 0; x < 4; x++)
120 {
121 u16 *offset = &SPRITE_GFX_SUB[(x * 64) + (y * 64 * 256)];
122
123 oamSet(&oamSub, x + y * 4, x * 64, y * 64, 0, 15, SpriteSize_64x64,
124 SpriteColorFormat_Bmp, offset, -1, false,false,false,false,false);
125 }
126
127 swiWaitForVBlank();
128
129 oamUpdate(&oamSub);
130 }
Users browsing this forum: No registered users and 6 guests