#108041 - ollhak - Sat Nov 04, 2006 7:13 pm
Alright, I'm stuck again :/ I'm trying to set up the following memory bank layout (I basicly want to have as much texture memory as possible with some (64kb) 2d bg memory and a little memory for the subscreen):
However, it doesn't work very well at all.. with this layout, I get neither textures nor a background. Only a subscreen background. The best layout I have got to work is this:
If i change the texture palette to bank F instead, the texture goes black, and I can't figure out why...
Anyone got any ideas? Here's the code I use for loading the texture if that might be the problem:
Code: |
vramSetBankA(VRAM_A_TEXTURE); // 128 KB vramSetBankB(VRAM_B_TEXTURE); // 128 KB vramSetBankC(VRAM_C_TEXTURE); // 128 KB vramSetBankD(VRAM_D_TEXTURE); // 128 KB vramSetBankE(VRAM_E_MAIN_BG); // 64 KB vramSetBankF(VRAM_F_TEX_PALETTE); // 16 KB vramSetBankG(VRAM_G_LCD); // 16 KB vramSetBankH(VRAM_H_SUB_BG); // 32 KB vramSetBankI(VRAM_I_SUB_SPRITE); // 16 kb |
However, it doesn't work very well at all.. with this layout, I get neither textures nor a background. Only a subscreen background. The best layout I have got to work is this:
Code: |
vramSetBankA(VRAM_A_TEXTURE); // 128 KB
vramSetBankB(VRAM_B_TEXTURE); // 128 KB vramSetBankC(VRAM_C_TEXTURE); // 128 KB vramSetBankD(VRAM_D_MAIN_BG_0x6000000); // 128 KB vramSetBankE(VRAM_E_TEX_PALETTE); // 64 KB //vramSetBankF(VRAM_F_TEX_PALETTE); // 16 KB vramSetBankG(VRAM_G_LCD); // 16 KB vramSetBankH(VRAM_H_SUB_BG); // 32 KB vramSetBankI(VRAM_I_SUB_SPRITE); // 16 kb |
If i change the texture palette to bank F instead, the texture goes black, and I can't figure out why...
Anyone got any ideas? Here's the code I use for loading the texture if that might be the problem:
Code: |
glGenTextures(1, &textureID); glBindTexture(0, textureID); glTexImage2D(0, 0, GL_RGB256, TEXTURE_SIZE_64, TEXTURE_SIZE_64, 0, TEXGEN_TEXCOORD | GL_TEXTURE_COLOR0_TRANSPARENT, data); u16 palette[256]; palette[1] = RGB15(0, 31, 0); pal = gluTexLoadPal( (u16*)palette, 255, GL_RGB256); |