mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
vdp, add handling of external buffers for fast renderer
This commit is contained in:
parent
7e382f5403
commit
207e5ba0ee
3 changed files with 17 additions and 6 deletions
12
pico/draw.c
12
pico/draw.c
|
@ -1855,9 +1855,6 @@ PICO_INTERNAL void PicoFrameStart(void)
|
||||||
Pico.m.dirtyPal = (dirty ? 2 : 0); // mark as dirty but already copied
|
Pico.m.dirtyPal = (dirty ? 2 : 0); // mark as dirty but already copied
|
||||||
blockcpy(Pico.est.SonicPal, PicoMem.cram, 0x40*2);
|
blockcpy(Pico.est.SonicPal, PicoMem.cram, 0x40*2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PicoIn.opt & POPT_ALT_RENDERER)
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DrawBlankedLine(int line, int offs, int sh, int bgc)
|
static void DrawBlankedLine(int line, int offs, int sh, int bgc)
|
||||||
|
@ -1974,10 +1971,12 @@ void PicoDrawUpdateHighPal(void)
|
||||||
void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode)
|
void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode)
|
||||||
{
|
{
|
||||||
PicoDrawSetInternalBuf(NULL, 0);
|
PicoDrawSetInternalBuf(NULL, 0);
|
||||||
|
PicoDraw2SetOutBuf(NULL);
|
||||||
switch (which)
|
switch (which)
|
||||||
{
|
{
|
||||||
case PDF_8BIT:
|
case PDF_8BIT:
|
||||||
FinalizeLine = FinalizeLine8bit;
|
FinalizeLine = FinalizeLine8bit;
|
||||||
|
PicoDrawSetInternalBuf(Pico.est.Draw2FB, 328);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PDF_RGB555:
|
case PDF_RGB555:
|
||||||
|
@ -1989,13 +1988,13 @@ void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FinalizeLine = NULL;
|
FinalizeLine = NULL;
|
||||||
PicoDrawSetOutBufMD(Pico.est.Draw2FB+8, 328);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (PicoIn.AHW & PAHW_32X)
|
if (PicoIn.AHW & PAHW_32X)
|
||||||
PicoDrawSetOutFormat32x(which, use_32x_line_mode);
|
PicoDrawSetOutFormat32x(which, use_32x_line_mode);
|
||||||
PicoDrawSetOutputMode4(which);
|
PicoDrawSetOutputMode4(which);
|
||||||
rendstatus_old = -1;
|
rendstatus_old = -1;
|
||||||
|
Pico.m.dirtyPal = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicoDrawSetOutBufMD(void *dest, int increment)
|
void PicoDrawSetOutBufMD(void *dest, int increment)
|
||||||
|
@ -2004,7 +2003,10 @@ void PicoDrawSetOutBufMD(void *dest, int increment)
|
||||||
// kludge for no-copy mode
|
// kludge for no-copy mode
|
||||||
PicoDrawSetInternalBuf(dest, increment);
|
PicoDrawSetInternalBuf(dest, increment);
|
||||||
}
|
}
|
||||||
if (dest != NULL) {
|
|
||||||
|
if (FinalizeLine == NULL)
|
||||||
|
PicoDraw2SetOutBuf(dest);
|
||||||
|
else if (dest != NULL) {
|
||||||
DrawLineDestBase = dest;
|
DrawLineDestBase = dest;
|
||||||
DrawLineDestIncrement = increment;
|
DrawLineDestIncrement = increment;
|
||||||
Pico.est.DrawLineDest = (char *)DrawLineDestBase + Pico.est.DrawScanline * increment;
|
Pico.est.DrawLineDest = (char *)DrawLineDestBase + Pico.est.DrawScanline * increment;
|
||||||
|
|
10
pico/draw2.c
10
pico/draw2.c
|
@ -692,7 +692,15 @@ PICO_INTERNAL void PicoFrameFull()
|
||||||
pprof_end(draw);
|
pprof_end(draw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PicoDraw2SetOutBuf(void *dest)
|
||||||
|
{
|
||||||
|
if (dest)
|
||||||
|
Pico.est.Draw2FB = dest;
|
||||||
|
else
|
||||||
|
Pico.est.Draw2FB = PicoDraw2FB_;
|
||||||
|
}
|
||||||
|
|
||||||
void PicoDraw2Init(void)
|
void PicoDraw2Init(void)
|
||||||
{
|
{
|
||||||
Pico.est.Draw2FB = PicoDraw2FB_;
|
PicoDraw2SetOutBuf(NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -674,6 +674,7 @@ extern int DrawLineDestIncrement;
|
||||||
extern unsigned int VdpSATCache[128];
|
extern unsigned int VdpSATCache[128];
|
||||||
|
|
||||||
// draw2.c
|
// draw2.c
|
||||||
|
void PicoDraw2SetOutBuf(void *dest);
|
||||||
void PicoDraw2Init(void);
|
void PicoDraw2Init(void);
|
||||||
PICO_INTERNAL void PicoFrameFull();
|
PICO_INTERNAL void PicoFrameFull();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue