-Rewrote the framebuffer code. Now it supports VRAM blocks A-D
-Added support for Display Mode 0(Display Off) -Added the basic framework for Display Mode 3(Display from Main RAM)
This commit is contained in:
parent
97b68cc3be
commit
36a1ce556b
|
@ -2,6 +2,8 @@
|
||||||
yopyop156@ifrance.com
|
yopyop156@ifrance.com
|
||||||
yopyop156.ifrance.com
|
yopyop156.ifrance.com
|
||||||
|
|
||||||
|
Copyright (C) 2006 Theo Berkau
|
||||||
|
|
||||||
This file is part of DeSmuME
|
This file is part of DeSmuME
|
||||||
|
|
||||||
DeSmuME is free software; you can redistribute it and/or modify
|
DeSmuME is free software; you can redistribute it and/or modify
|
||||||
|
@ -123,11 +125,30 @@ void GPU_DeInit(GPU * gpu)
|
||||||
free(gpu);
|
free(gpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NOTICE: the name of function is unclear, but it's about writing in DISPLAY_CR */
|
/* Sets up LCD control variables for Display Engines A and B for quick reading */
|
||||||
void GPU_setVideoProp(GPU * gpu, u32 p)
|
void GPU_setVideoProp(GPU * gpu, u32 p)
|
||||||
{
|
{
|
||||||
gpu->prop = p;
|
gpu->prop = p;
|
||||||
|
|
||||||
|
gpu->dispMode = p >> 16;
|
||||||
|
if (gpu->lcd == 0)
|
||||||
|
gpu->dispMode &= 0x3;
|
||||||
|
else
|
||||||
|
gpu->dispMode &= 0x1;
|
||||||
|
switch (gpu->dispMode)
|
||||||
|
{
|
||||||
|
case 0: // Display Off
|
||||||
|
return;
|
||||||
|
case 1: // Display BG and OBJ layers
|
||||||
|
break;
|
||||||
|
case 2: // Display framebuffer
|
||||||
|
gpu->vramBlock = (p >> 18) & 0x3;
|
||||||
|
return;
|
||||||
|
case 3: // Display from Main RAM
|
||||||
|
LOG("FIXME: Display Mode 3 not supported(Display from Main RAM)\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
gpu->nbBGActif = 0;
|
gpu->nbBGActif = 0;
|
||||||
if(p & DISPLAY_SPR_1D_LAYOUT)
|
if(p & DISPLAY_SPR_1D_LAYOUT)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
yopyop156@ifrance.com
|
yopyop156@ifrance.com
|
||||||
yopyop156.ifrance.com
|
yopyop156.ifrance.com
|
||||||
|
|
||||||
|
Copyright (C) 2006 Theo Berkau
|
||||||
|
|
||||||
This file is part of DeSmuME
|
This file is part of DeSmuME
|
||||||
|
|
||||||
DeSmuME is free software; you can redistribute it and/or modify
|
DeSmuME is free software; you can redistribute it and/or modify
|
||||||
|
@ -81,6 +83,9 @@ struct _GPU
|
||||||
u8 lcd;
|
u8 lcd;
|
||||||
u8 core;
|
u8 core;
|
||||||
|
|
||||||
|
u8 dispMode;
|
||||||
|
u8 vramBlock;
|
||||||
|
|
||||||
u8 nbBGActif;
|
u8 nbBGActif;
|
||||||
u8 BGIndex[4];
|
u8 BGIndex[4];
|
||||||
u8 ordre[4];
|
u8 ordre[4];
|
||||||
|
@ -137,20 +142,33 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
|
||||||
u8 i8;
|
u8 i8;
|
||||||
u16 i16;
|
u16 i16;
|
||||||
|
|
||||||
/* FIXME I've just quickly added mic's framebuffer patch here.
|
// This could almost be changed to use function pointers
|
||||||
* I'm really not sure it's correct.
|
switch (gpu->dispMode)
|
||||||
*/
|
{
|
||||||
if (gpu->lcd == 0) {
|
case 1: // Display BG and OBJ layers
|
||||||
u32 mainlcdcnt = T1ReadLong(ARM9Mem.ARM9_REG, 0);
|
break;
|
||||||
int ii = l * 256;
|
case 0: // Display Off(Display white)
|
||||||
|
{
|
||||||
if ((mainlcdcnt & 0x10000) == 0) {
|
for (i=0; i<256; i++)
|
||||||
for (i=0; i<256; i++) {
|
{
|
||||||
T2WriteWord(dst, i << 1, T1ReadWord(ARM9Mem.ARM9_LCD, ii << 1));
|
T2WriteWord(dst, i << 1, 0x7FFF);
|
||||||
ii++;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
case 2: // Display framebuffer
|
||||||
|
{
|
||||||
|
int ii = l * 256 * 2;
|
||||||
|
for (i=0; i<(256 * 2); i+=2)
|
||||||
|
{
|
||||||
|
u8 * vram = ARM9Mem.ARM9_LCD + (gpu->vramBlock * 0x20000);
|
||||||
|
|
||||||
|
T2WriteWord(dst, i, T1ReadWord(vram, ii));
|
||||||
|
ii+=2;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case 3: // Display from Main RAM(FIX ME)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 c = T1ReadWord(ARM9Mem.ARM9_VMEM, gpu->lcd * 0x400);
|
u32 c = T1ReadWord(ARM9Mem.ARM9_VMEM, gpu->lcd * 0x400);
|
||||||
|
|
Loading…
Reference in New Issue