support for sprite enable bit in DISPCNT (bug report #1629605)

This commit is contained in:
mightymax 2007-01-07 09:13:25 +00:00
parent 81883e1194
commit 7e15fa37e5
2 changed files with 8 additions and 2 deletions

View File

@ -174,6 +174,8 @@ void GPU_setVideoProp(GPU * gpu, u32 p)
{ {
gpu->sprBMPBlock = 7; gpu->sprBMPBlock = 7;
} }
gpu->sprEnable = (p & 0x00001000) ;
GPU_setBGProp(gpu, 3, T1ReadWord(ARM9Mem.ARM9_REG, (gpu->core * 0x800 + 7) << 1)); GPU_setBGProp(gpu, 3, T1ReadWord(ARM9Mem.ARM9_REG, (gpu->core * 0x800 + 7) << 1));
GPU_setBGProp(gpu, 2, T1ReadWord(ARM9Mem.ARM9_REG, (gpu->core * 0x800 + 6) << 1)); GPU_setBGProp(gpu, 2, T1ReadWord(ARM9Mem.ARM9_REG, (gpu->core * 0x800 + 6) << 1));
@ -392,7 +394,7 @@ void GPU_setBGProp(GPU * gpu, u16 num, u16 p)
else else
{ {
gpu->BG_bmp_ram[num] = ((u8 *)ARM9Mem.ARM9_ABG) + ((p>>8)&0x1F) * 0x4000; gpu->BG_bmp_ram[num] = ((u8 *)ARM9Mem.ARM9_ABG) + ((p>>8)&0x1F) * 0x4000;
gpu->BG_tile_ram[num] = ((u8 *)ARM9Mem.ARM9_ABG) + ((p>>2)&0xF) * 0x4000 + ((gpu->prop >> 24) & 0x7) * 0x10000; gpu->BG_tile_ram[num] = ((u8 *)ARM9Mem.ARM9_ABG) + ((p>>2)&0xF) * 0x4000 + ((gpu->prop >> 24) & 0x7) * 0x10000 ;
gpu->BG_map_ram[num] = ARM9Mem.ARM9_ABG + ((p>>8)&0x1F) * 0x800 + ((gpu->prop >> 27) & 0x7) * 0x10000; gpu->BG_map_ram[num] = ARM9Mem.ARM9_ABG + ((p>>8)&0x1F) * 0x800 + ((gpu->prop >> 27) & 0x7) * 0x10000;
} }
@ -755,6 +757,7 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * DST, u16 X, u16 Y, u16 LG)
/* color: extended palette */ /* color: extended palette */
pal = ARM9Mem.ExtPal[gpu->core][gpu->BGExtPalSlot[num]]; pal = ARM9Mem.ExtPal[gpu->core][gpu->BGExtPalSlot[num]];
if(!pal) return; if(!pal) return;
yoff = ((Y&7)<<3); yoff = ((Y&7)<<3);
for(x = 0; x < LG;) for(x = 0; x < LG;)
@ -1023,6 +1026,7 @@ void extRotBG(GPU * gpu, u8 num, u8 * DST)
void sprite1D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab) void sprite1D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab)
{ {
if (!gpu->sprEnable) return ;
OAM * aux = gpu->oam + (nbShow-1);// + 127; OAM * aux = gpu->oam + (nbShow-1);// + 127;
u8 block = gpu->sprBlock; u8 block = gpu->sprBlock;
@ -1231,6 +1235,7 @@ void sprite1D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab)
void sprite2D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab) void sprite2D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab)
{ {
if (!gpu->sprEnable) return ;
u16 i; u16 i;
OAM * aux = gpu->oam + (nbShow-1);// + 127; OAM * aux = gpu->oam + (nbShow-1);// + 127;

View File

@ -81,7 +81,7 @@ struct _GPU
s16 BGPD[4]; s16 BGPD[4];
u8 lcd; u8 lcd;
u8 core; u8 core;
u8 dispMode; u8 dispMode;
u8 vramBlock; u8 vramBlock;
@ -96,6 +96,7 @@ struct _GPU
u8 sprBlock; u8 sprBlock;
u8 sprBMPBlock; u8 sprBMPBlock;
u8 sprBMPMode; u8 sprBMPMode;
u32 sprEnable ;
u16 BLDCNT ; u16 BLDCNT ;
u16 BLDALPHA ; u16 BLDALPHA ;