framebuffer mode now also works from LCD memory
This commit is contained in:
parent
540ffbbcda
commit
86ba586d00
|
@ -105,6 +105,11 @@ void GPU_Reset(GPU *g, u8 l)
|
|||
g->BGSize[0][1] = g->BGSize[1][1] = g->BGSize[2][1] = g->BGSize[3][1] = 256;
|
||||
g->dispOBJ = g->dispBG[0] = g->dispBG[1] = g->dispBG[2] = g->dispBG[3] = TRUE;
|
||||
|
||||
MMU.vram_mode[0] = 4 ;
|
||||
MMU.vram_mode[1] = 5 ;
|
||||
MMU.vram_mode[2] = 6 ;
|
||||
MMU.vram_mode[3] = 7 ;
|
||||
|
||||
g->spriteRender = sprite1D;
|
||||
|
||||
if(g->core == GPU_SUB)
|
||||
|
@ -1210,7 +1215,7 @@ INLINE void extRotBG2(GPU * gpu, u8 num, u8 * DST, u16 H, s32 X, s32 Y, s16 PA,
|
|||
y1 = (mapinfo & 0x800) ? 7 - (auxY&7) : (auxY&7);
|
||||
coul = tile[(mapinfo&0x3FF)*64 + x1 + (y1<<3)];
|
||||
if(coul)
|
||||
renderline_setFinalColor(gpu,0,num,dst, T1ReadWord(pal, (coul + (mapinfo>>12)*0x100) << 1),x,Y);
|
||||
renderline_setFinalColor(gpu,0,num,dst, T1ReadWord(pal, (coul + (mapinfo>>12)*0x100) << 1),i,Y);
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -1223,7 +1228,7 @@ INLINE void extRotBG2(GPU * gpu, u8 num, u8 * DST, u16 H, s32 X, s32 Y, s16 PA,
|
|||
{
|
||||
mapinfo = map[auxX + auxY * lg];
|
||||
if(mapinfo)
|
||||
renderline_setFinalColor(gpu,0,num,dst, T1ReadWord(pal, mapinfo << 1),x,Y);
|
||||
renderline_setFinalColor(gpu,0,num,dst, T1ReadWord(pal, mapinfo << 1),i,Y);
|
||||
})
|
||||
}
|
||||
return;
|
||||
|
@ -1234,7 +1239,7 @@ INLINE void extRotBG2(GPU * gpu, u8 num, u8 * DST, u16 H, s32 X, s32 Y, s16 PA,
|
|||
{
|
||||
mapinfo = T1ReadWord(map, (auxX + auxY * lg) << 1);
|
||||
if ((mapinfo) && (mapinfo & 0x8000))
|
||||
renderline_setFinalColor(gpu,0,num,dst, mapinfo,x,Y);
|
||||
renderline_setFinalColor(gpu,0,num,dst, mapinfo,i,Y);
|
||||
})
|
||||
}
|
||||
return;
|
||||
|
@ -1298,19 +1303,19 @@ void extRotBG(GPU * gpu, u8 num, u8 * DST)
|
|||
#define RENDERS_A(a) \
|
||||
if((a)&&(prioTab[sprX]>=prio)) \
|
||||
{ \
|
||||
renderline_setFinalColor(gpu, sprX << 1,4,dst, c,sprX,l); \
|
||||
renderline_setFinalColor(gpu, sprX << 1,4,dst, c,i,l); \
|
||||
prioTab[sprX] = prio; \
|
||||
}
|
||||
#define RENDERS_B(c) \
|
||||
if((c)&&(prioTab[sprX]>=prio)) \
|
||||
{ \
|
||||
renderline_setFinalColor(gpu, sprX << 1,4,dst, T1ReadWord(pal, (c) << 1),sprX,l); \
|
||||
renderline_setFinalColor(gpu, sprX << 1,4,dst, T1ReadWord(pal, (c) << 1),i,l); \
|
||||
prioTab[sprX] = prio; \
|
||||
}
|
||||
#define RENDERS_C(c,d) \
|
||||
if((c)&&(prioTab[sprX]>=prio)) \
|
||||
{ \
|
||||
renderline_setFinalColor(gpu, (sprX d) << 1,4,dst, T1ReadWord(pal, ((c)+(spriteInfo->PaletteIndex<<4)) << 1),(sprX d),l); \
|
||||
renderline_setFinalColor(gpu, (sprX d) << 1,4,dst, T1ReadWord(pal, ((c)+(spriteInfo->PaletteIndex<<4)) << 1),i,l); \
|
||||
prioTab[sprX d] = prio; \
|
||||
}
|
||||
|
||||
|
|
|
@ -422,6 +422,7 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
|
|||
GPU * gpu = screen->gpu;
|
||||
u8 * dst = GPU_screen + (screen->offset + l) * 512;
|
||||
u8 * mdst = GPU_screen + (MainScreen.offset + l) * 512;
|
||||
u8 * sdst = GPU_screen + (SubScreen.offset + l) * 512;
|
||||
itemsForPriority_t * item;
|
||||
u8 spr[512];
|
||||
u8 sprPrio[256];
|
||||
|
@ -454,29 +455,26 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
|
|||
/* we only draw one of the VRAM blocks */
|
||||
vram_bank = gpu->dispCnt.bits.VRAM_Block ;
|
||||
|
||||
if(!(MMU.vScreen&1)) dest = mdst; else dest = dst;
|
||||
|
||||
switch (MMU.vram_mode[vram_bank])
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
// if(!(gpu->lcd)) dest = mdst; else dest = sdst;
|
||||
dest = dst ;
|
||||
{
|
||||
int ii = l * 256 * 2;
|
||||
for (i=0; i<(256 * 2); i+=2)
|
||||
{
|
||||
u8 * vram = ARM9Mem.ARM9_ABG + MMU.vram_mode[vram_bank] * 0x20000;
|
||||
u8 * vram ;
|
||||
if (MMU.vram_mode[vram_bank] & 4)
|
||||
{
|
||||
vram = ARM9Mem.ARM9_LCD + (MMU.vram_mode[vram_bank] & 3) * 0x20000;
|
||||
} else
|
||||
{
|
||||
vram = ARM9Mem.ARM9_ABG + MMU.vram_mode[vram_bank] * 0x20000;
|
||||
}
|
||||
|
||||
T2WriteWord(dest, i, T1ReadWord(vram, ii));
|
||||
ii+=2;
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
case 3:
|
||||
|
|
|
@ -881,6 +881,9 @@ void FASTCALL MMU_write8(u32 proc, u32 adr, u8 val)
|
|||
MMU.vram_mode[adr-REG_VRAMCNTA] = 3; // BG-VRAM
|
||||
//MMU.vram_offset[0] = ARM9Mem.ARM9_ABG+(0x20000*3); // BG-VRAM
|
||||
break;
|
||||
case 0: /* mapped to lcd */
|
||||
MMU.vram_mode[adr-REG_VRAMCNTA] = 4 | (adr-REG_VRAMCNTA) ;
|
||||
break ;
|
||||
}
|
||||
MMU_VRAMReloadFromLCD(adr-REG_VRAMCNTA,val) ;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue