mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
eliminate texrels (wip2)
This commit is contained in:
parent
ea38612fad
commit
99bdfd31b8
13 changed files with 102 additions and 147 deletions
|
@ -85,9 +85,9 @@ static void convert_pal555(int invert_prio)
|
||||||
// this is almost never used (Wiz and menu bg gen only)
|
// this is almost never used (Wiz and menu bg gen only)
|
||||||
void FinalizeLine32xRGB555(int sh, int line, struct PicoEState *est)
|
void FinalizeLine32xRGB555(int sh, int line, struct PicoEState *est)
|
||||||
{
|
{
|
||||||
unsigned short *pd = DrawLineDest;
|
unsigned short *pd = est->DrawLineDest;
|
||||||
unsigned short *pal = Pico32xMem->pal_native;
|
unsigned short *pal = Pico32xMem->pal_native;
|
||||||
unsigned char *pmd = HighCol + 8;
|
unsigned char *pmd = est->HighCol + 8;
|
||||||
unsigned short *dram, *p32x;
|
unsigned short *dram, *p32x;
|
||||||
unsigned char mdbg;
|
unsigned char mdbg;
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ void FinalizeLine32xRGB555(int sh, int line, struct PicoEState *est)
|
||||||
|
|
||||||
#define PICOSCAN_PRE \
|
#define PICOSCAN_PRE \
|
||||||
PicoScan32xBegin(l + (lines_sft_offs & 0xff)); \
|
PicoScan32xBegin(l + (lines_sft_offs & 0xff)); \
|
||||||
dst = DrawLineDest; \
|
dst = Pico.est.DrawLineDest; \
|
||||||
|
|
||||||
#define PICOSCAN_POST \
|
#define PICOSCAN_POST \
|
||||||
PicoScan32xEnd(l + (lines_sft_offs & 0xff)); \
|
PicoScan32xEnd(l + (lines_sft_offs & 0xff)); \
|
||||||
|
@ -228,7 +228,7 @@ void PicoDraw32xLayer(int offs, int lines, int md_bg)
|
||||||
int lines_sft_offs;
|
int lines_sft_offs;
|
||||||
int which_func;
|
int which_func;
|
||||||
|
|
||||||
DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;
|
Pico.est.DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;
|
||||||
dram = Pico32xMem->dram[Pico32x.vdp_regs[0x0a/2] & P32XV_FS];
|
dram = Pico32xMem->dram[Pico32x.vdp_regs[0x0a/2] & P32XV_FS];
|
||||||
|
|
||||||
if (Pico32xDrawMode == PDM32X_BOTH) {
|
if (Pico32xDrawMode == PDM32X_BOTH) {
|
||||||
|
@ -266,7 +266,7 @@ do_it:
|
||||||
if (Pico32x.vdp_regs[2 / 2] & P32XV_SFT)
|
if (Pico32x.vdp_regs[2 / 2] & P32XV_SFT)
|
||||||
lines_sft_offs |= 1 << 8;
|
lines_sft_offs |= 1 << 8;
|
||||||
|
|
||||||
do_loop[which_func](DrawLineDest, dram, lines_sft_offs, md_bg);
|
do_loop[which_func](Pico.est.DrawLineDest, dram, lines_sft_offs, md_bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// mostly unused, games tend to keep 32X layer on
|
// mostly unused, games tend to keep 32X layer on
|
||||||
|
@ -292,7 +292,7 @@ void PicoDraw32xLayerMdOnly(int offs, int lines)
|
||||||
for (l = 0; l < lines; l++) {
|
for (l = 0; l < lines; l++) {
|
||||||
if (have_scan) {
|
if (have_scan) {
|
||||||
PicoScan32xBegin(l + offs);
|
PicoScan32xBegin(l + offs);
|
||||||
dst = DrawLineDest + poffs;
|
dst = Pico.est.DrawLineDest + poffs;
|
||||||
}
|
}
|
||||||
for (p = 0; p < plen; p += 4) {
|
for (p = 0; p < plen; p += 4) {
|
||||||
dst[p + 0] = pal[*pmd++];
|
dst[p + 0] = pal[*pmd++];
|
||||||
|
|
|
@ -20,13 +20,12 @@ char *PDebugMain(void)
|
||||||
{
|
{
|
||||||
struct PicoVideo *pv=&Pico.video;
|
struct PicoVideo *pv=&Pico.video;
|
||||||
unsigned char *reg=pv->reg, r;
|
unsigned char *reg=pv->reg, r;
|
||||||
extern int HighPreSpr[];
|
|
||||||
int i, sprites_lo, sprites_hi;
|
int i, sprites_lo, sprites_hi;
|
||||||
char *dstrp;
|
char *dstrp;
|
||||||
|
|
||||||
sprites_lo = sprites_hi = 0;
|
sprites_lo = sprites_hi = 0;
|
||||||
for (i = 0; HighPreSpr[i] != 0; i+=2)
|
for (i = 0; Pico.est.HighPreSpr[i] != 0; i+=2)
|
||||||
if (HighPreSpr[i+1] & 0x8000)
|
if (Pico.est.HighPreSpr[i+1] & 0x8000)
|
||||||
sprites_hi++;
|
sprites_hi++;
|
||||||
else sprites_lo++;
|
else sprites_lo++;
|
||||||
|
|
||||||
|
|
68
pico/draw.c
68
pico/draw.c
|
@ -35,18 +35,16 @@ int (*PicoScanBegin)(unsigned int num) = NULL;
|
||||||
int (*PicoScanEnd) (unsigned int num) = NULL;
|
int (*PicoScanEnd) (unsigned int num) = NULL;
|
||||||
|
|
||||||
static unsigned char DefHighCol[8+320+8];
|
static unsigned char DefHighCol[8+320+8];
|
||||||
unsigned char *HighCol = DefHighCol;
|
|
||||||
static unsigned char *HighColBase = DefHighCol;
|
static unsigned char *HighColBase = DefHighCol;
|
||||||
static int HighColIncrement;
|
static int HighColIncrement;
|
||||||
|
|
||||||
static unsigned int DefOutBuff[320*2/2];
|
static unsigned int DefOutBuff[320*2/2];
|
||||||
void *DrawLineDest = DefOutBuff; // pointer to dest buffer where to draw this line to
|
|
||||||
void *DrawLineDestBase = DefOutBuff;
|
void *DrawLineDestBase = DefOutBuff;
|
||||||
int DrawLineDestIncrement;
|
int DrawLineDestIncrement;
|
||||||
|
|
||||||
static int HighCacheA[41+1]; // caches for high layers
|
static int HighCacheA[41+1]; // caches for high layers
|
||||||
static int HighCacheB[41+1];
|
static int HighCacheB[41+1];
|
||||||
int HighPreSpr[80*2+1]; // slightly preprocessed sprites
|
static int HighPreSpr[80*2+1]; // slightly preprocessed sprites
|
||||||
|
|
||||||
#define SPRL_HAVE_HI 0x80 // have hi priority sprites
|
#define SPRL_HAVE_HI 0x80 // have hi priority sprites
|
||||||
#define SPRL_HAVE_LO 0x40 // *lo*
|
#define SPRL_HAVE_LO 0x40 // *lo*
|
||||||
|
@ -100,7 +98,7 @@ void blockcpy_or(void *dst, void *src, size_t n, int pat)
|
||||||
#define TileNormMaker(funcname,pix_func) \
|
#define TileNormMaker(funcname,pix_func) \
|
||||||
static int funcname(int sx,int addr,int pal) \
|
static int funcname(int sx,int addr,int pal) \
|
||||||
{ \
|
{ \
|
||||||
unsigned char *pd = HighCol+sx; \
|
unsigned char *pd = Pico.est.HighCol+sx; \
|
||||||
unsigned int pack=0; unsigned int t=0; \
|
unsigned int pack=0; unsigned int t=0; \
|
||||||
\
|
\
|
||||||
pack=*(unsigned int *)(Pico.vram+addr); /* Get 8 pixels */ \
|
pack=*(unsigned int *)(Pico.vram+addr); /* Get 8 pixels */ \
|
||||||
|
@ -124,7 +122,7 @@ static int funcname(int sx,int addr,int pal) \
|
||||||
#define TileFlipMaker(funcname,pix_func) \
|
#define TileFlipMaker(funcname,pix_func) \
|
||||||
static int funcname(int sx,int addr,int pal) \
|
static int funcname(int sx,int addr,int pal) \
|
||||||
{ \
|
{ \
|
||||||
unsigned char *pd = HighCol+sx; \
|
unsigned char *pd = Pico.est.HighCol+sx; \
|
||||||
unsigned int pack=0; unsigned int t=0; \
|
unsigned int pack=0; unsigned int t=0; \
|
||||||
\
|
\
|
||||||
pack=*(unsigned int *)(Pico.vram+addr); /* Get 8 pixels */ \
|
pack=*(unsigned int *)(Pico.vram+addr); /* Get 8 pixels */ \
|
||||||
|
@ -515,7 +513,7 @@ static void DrawWindow(int tstart, int tend, int prio, int sh,
|
||||||
pal=((code>>9)&0x30);
|
pal=((code>>9)&0x30);
|
||||||
|
|
||||||
if (prio) {
|
if (prio) {
|
||||||
int *zb = (int *)(HighCol+8+(tilex<<3));
|
int *zb = (int *)(est->HighCol+8+(tilex<<3));
|
||||||
*zb++ &= 0xbfbfbfbf;
|
*zb++ &= 0xbfbfbfbf;
|
||||||
*zb &= 0xbfbfbfbf;
|
*zb &= 0xbfbfbfbf;
|
||||||
} else {
|
} else {
|
||||||
|
@ -541,7 +539,7 @@ static void DrawTilesFromCacheShPrep(void)
|
||||||
// as some layer has covered whole line with hi priority tiles,
|
// as some layer has covered whole line with hi priority tiles,
|
||||||
// we can process whole line and then act as if sh/hi mode was off,
|
// we can process whole line and then act as if sh/hi mode was off,
|
||||||
// but leave lo pri op sprite markers alone
|
// but leave lo pri op sprite markers alone
|
||||||
int c = 320/4, *zb = (int *)(HighCol+8);
|
int c = 320/4, *zb = (int *)(Pico.est.HighCol+8);
|
||||||
Pico.est.rendstatus |= PDRAW_SHHI_DONE;
|
Pico.est.rendstatus |= PDRAW_SHHI_DONE;
|
||||||
while (c--)
|
while (c--)
|
||||||
{
|
{
|
||||||
|
@ -591,7 +589,7 @@ static void DrawTilesFromCache(int *hc, int sh, int rlim, struct PicoEState *est
|
||||||
addr=(code&0x7ff)<<4;
|
addr=(code&0x7ff)<<4;
|
||||||
addr+=(unsigned int)code>>25; // y offset into tile
|
addr+=(unsigned int)code>>25; // y offset into tile
|
||||||
dx=(code>>16)&0x1ff;
|
dx=(code>>16)&0x1ff;
|
||||||
zb = HighCol+dx;
|
zb = est->HighCol+dx;
|
||||||
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;
|
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;
|
||||||
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;
|
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;
|
||||||
|
|
||||||
|
@ -607,7 +605,7 @@ static void DrawTilesFromCache(int *hc, int sh, int rlim, struct PicoEState *est
|
||||||
last_cut_tile:
|
last_cut_tile:
|
||||||
{
|
{
|
||||||
unsigned int t, pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels
|
unsigned int t, pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels
|
||||||
unsigned char *pd = HighCol+dx;
|
unsigned char *pd = est->HighCol+dx;
|
||||||
if (!pack) return;
|
if (!pack) return;
|
||||||
if (code&0x0800)
|
if (code&0x0800)
|
||||||
{
|
{
|
||||||
|
@ -812,7 +810,7 @@ static void DrawSpritesSHi(unsigned char *sprited, const struct PicoEState *est)
|
||||||
int offs, delta, width, height, row;
|
int offs, delta, width, height, row;
|
||||||
|
|
||||||
offs = (p[cnt] & 0x7f) * 2;
|
offs = (p[cnt] & 0x7f) * 2;
|
||||||
sprite = HighPreSpr + offs;
|
sprite = est->HighPreSpr + offs;
|
||||||
code = sprite[1];
|
code = sprite[1];
|
||||||
pal = (code>>9)&0x30;
|
pal = (code>>9)&0x30;
|
||||||
|
|
||||||
|
@ -936,7 +934,7 @@ static void DrawSpritesHiAS(unsigned char *sprited, int sh)
|
||||||
|
|
||||||
/* nasty 1: remove 'sprite' flags */
|
/* nasty 1: remove 'sprite' flags */
|
||||||
{
|
{
|
||||||
int c = 320/4/4, *zb = (int *)(HighCol+8);
|
int c = 320/4/4, *zb = (int *)(Pico.est.HighCol+8);
|
||||||
while (c--)
|
while (c--)
|
||||||
{
|
{
|
||||||
*zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f;
|
*zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f;
|
||||||
|
@ -1147,7 +1145,7 @@ static void DrawAllSprites(unsigned char *sprited, int prio, int sh,
|
||||||
|
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
|
|
||||||
void BackFill(int reg7, int sh)
|
void BackFill(int reg7, int sh, struct PicoEState *est)
|
||||||
{
|
{
|
||||||
unsigned int back;
|
unsigned int back;
|
||||||
|
|
||||||
|
@ -1157,7 +1155,7 @@ void BackFill(int reg7, int sh)
|
||||||
back|=back<<8;
|
back|=back<<8;
|
||||||
back|=back<<16;
|
back|=back<<16;
|
||||||
|
|
||||||
memset32((int *)(HighCol+8), back, 320/4);
|
memset32((int *)(est->HighCol+8), back, 320/4);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1204,10 +1202,10 @@ void PicoDoHighPal555(int sh, int line, struct PicoEState *est)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FinalizeLine555(int sh, int line)
|
void FinalizeLine555(int sh, int line, struct PicoEState *est)
|
||||||
{
|
{
|
||||||
unsigned short *pd=DrawLineDest;
|
unsigned short *pd=est->DrawLineDest;
|
||||||
unsigned char *ps=HighCol+8;
|
unsigned char *ps=est->HighCol+8;
|
||||||
unsigned short *pal=HighPal;
|
unsigned short *pal=HighPal;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
@ -1242,7 +1240,7 @@ void FinalizeLine555(int sh, int line)
|
||||||
|
|
||||||
static void FinalizeLine8bit(int sh, int line, struct PicoEState *est)
|
static void FinalizeLine8bit(int sh, int line, struct PicoEState *est)
|
||||||
{
|
{
|
||||||
unsigned char *pd = DrawLineDest;
|
unsigned char *pd = est->DrawLineDest;
|
||||||
int len, rs = est->rendstatus;
|
int len, rs = est->rendstatus;
|
||||||
static int dirty_count;
|
static int dirty_count;
|
||||||
|
|
||||||
|
@ -1271,12 +1269,12 @@ static void FinalizeLine8bit(int sh, int line, struct PicoEState *est)
|
||||||
|
|
||||||
if (!sh && (rs & PDRAW_SONIC_MODE)) {
|
if (!sh && (rs & PDRAW_SONIC_MODE)) {
|
||||||
if (dirty_count >= 11) {
|
if (dirty_count >= 11) {
|
||||||
blockcpy_or(pd, HighCol+8, len, 0x80);
|
blockcpy_or(pd, est->HighCol+8, len, 0x80);
|
||||||
} else {
|
} else {
|
||||||
blockcpy_or(pd, HighCol+8, len, 0x40);
|
blockcpy_or(pd, est->HighCol+8, len, 0x40);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
blockcpy(pd, HighCol+8, len);
|
blockcpy(pd, est->HighCol+8, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,8 +1401,8 @@ PICO_INTERNAL void PicoFrameStart(void)
|
||||||
rendstatus_old = Pico.est.rendstatus;
|
rendstatus_old = Pico.est.rendstatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
HighCol = HighColBase + offs * HighColIncrement;
|
Pico.est.HighCol = HighColBase + offs * HighColIncrement;
|
||||||
DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;
|
Pico.est.DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;
|
||||||
Pico.est.DrawScanline = 0;
|
Pico.est.DrawScanline = 0;
|
||||||
skip_next_line = 0;
|
skip_next_line = 0;
|
||||||
|
|
||||||
|
@ -1421,7 +1419,7 @@ static void DrawBlankedLine(int line, int offs, int sh, int bgc)
|
||||||
if (PicoScanBegin != NULL)
|
if (PicoScanBegin != NULL)
|
||||||
PicoScanBegin(line + offs);
|
PicoScanBegin(line + offs);
|
||||||
|
|
||||||
BackFill(bgc, sh);
|
BackFill(bgc, sh, &Pico.est);
|
||||||
|
|
||||||
if (FinalizeLine != NULL)
|
if (FinalizeLine != NULL)
|
||||||
FinalizeLine(sh, line, &Pico.est);
|
FinalizeLine(sh, line, &Pico.est);
|
||||||
|
@ -1429,8 +1427,8 @@ static void DrawBlankedLine(int line, int offs, int sh, int bgc)
|
||||||
if (PicoScanEnd != NULL)
|
if (PicoScanEnd != NULL)
|
||||||
PicoScanEnd(line + offs);
|
PicoScanEnd(line + offs);
|
||||||
|
|
||||||
HighCol += HighColIncrement;
|
Pico.est.HighCol += HighColIncrement;
|
||||||
DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement;
|
Pico.est.DrawLineDest = (char *)Pico.est.DrawLineDest + DrawLineDestIncrement;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PicoLine(int line, int offs, int sh, int bgc)
|
static void PicoLine(int line, int offs, int sh, int bgc)
|
||||||
|
@ -1452,7 +1450,7 @@ static void PicoLine(int line, int offs, int sh, int bgc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw screen:
|
// Draw screen:
|
||||||
BackFill(bgc, sh);
|
BackFill(bgc, sh, &Pico.est);
|
||||||
if (Pico.video.reg[1]&0x40)
|
if (Pico.video.reg[1]&0x40)
|
||||||
DrawDisplay(sh);
|
DrawDisplay(sh);
|
||||||
|
|
||||||
|
@ -1462,8 +1460,8 @@ static void PicoLine(int line, int offs, int sh, int bgc)
|
||||||
if (PicoScanEnd != NULL)
|
if (PicoScanEnd != NULL)
|
||||||
skip_next_line = PicoScanEnd(line + offs);
|
skip_next_line = PicoScanEnd(line + offs);
|
||||||
|
|
||||||
HighCol += HighColIncrement;
|
Pico.est.HighCol += HighColIncrement;
|
||||||
DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement;
|
Pico.est.DrawLineDest = (char *)Pico.est.DrawLineDest + DrawLineDestIncrement;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicoDrawSync(int to, int blank_last_line)
|
void PicoDrawSync(int to, int blank_last_line)
|
||||||
|
@ -1539,7 +1537,7 @@ void PicoDrawSetOutBuf(void *dest, int increment)
|
||||||
{
|
{
|
||||||
DrawLineDestBase = dest;
|
DrawLineDestBase = dest;
|
||||||
DrawLineDestIncrement = increment;
|
DrawLineDestIncrement = increment;
|
||||||
DrawLineDest = DrawLineDestBase + Pico.est.DrawScanline * increment;
|
Pico.est.DrawLineDest = DrawLineDestBase + Pico.est.DrawScanline * increment;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicoDrawSetInternalBuf(void *dest, int increment)
|
void PicoDrawSetInternalBuf(void *dest, int increment)
|
||||||
|
@ -1547,7 +1545,7 @@ void PicoDrawSetInternalBuf(void *dest, int increment)
|
||||||
if (dest != NULL) {
|
if (dest != NULL) {
|
||||||
HighColBase = dest;
|
HighColBase = dest;
|
||||||
HighColIncrement = increment;
|
HighColIncrement = increment;
|
||||||
HighCol = HighColBase + Pico.est.DrawScanline * increment;
|
Pico.est.HighCol = HighColBase + Pico.est.DrawScanline * increment;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
HighColBase = DefHighCol;
|
HighColBase = DefHighCol;
|
||||||
|
@ -1572,4 +1570,12 @@ void PicoDrawSetCallbacks(int (*begin)(unsigned int num), int (*end)(unsigned in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim:ts=4:sw=4:expandtab
|
void PicoDrawInit(void)
|
||||||
|
{
|
||||||
|
Pico.est.DrawLineDest = DefOutBuff;
|
||||||
|
Pico.est.HighCol = HighColBase;
|
||||||
|
Pico.est.HighPreSpr = HighPreSpr;
|
||||||
|
rendstatus_old = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// vim:ts=2:sw=2:expandtab
|
||||||
|
|
|
@ -10,15 +10,7 @@
|
||||||
|
|
||||||
#include "pico_int_o32.h"
|
#include "pico_int_o32.h"
|
||||||
|
|
||||||
.extern PicoOpt
|
|
||||||
.extern HighCol
|
|
||||||
.extern HighSprZ
|
|
||||||
.extern HighPreSpr
|
|
||||||
.extern DrawLineDest
|
|
||||||
.extern DrawStripInterlace
|
.extern DrawStripInterlace
|
||||||
.extern HighCacheS_ptr
|
|
||||||
|
|
||||||
.equiv OVERRIDE_HIGHCOL, 1
|
|
||||||
|
|
||||||
.equ PDRAW_SPRITES_MOVED, (1<<0)
|
.equ PDRAW_SPRITES_MOVED, (1<<0)
|
||||||
.equ PDRAW_WND_DIFF_PRIO, (1<<1)
|
.equ PDRAW_WND_DIFF_PRIO, (1<<1)
|
||||||
|
@ -395,14 +387,9 @@ DrawLayer:
|
||||||
sub r10,r10,r9, lsl #16 @ cells-=cellskip
|
sub r10,r10,r9, lsl #16 @ cells-=cellskip
|
||||||
|
|
||||||
@ cache some stuff to avoid mem access
|
@ cache some stuff to avoid mem access
|
||||||
.if OVERRIDE_HIGHCOL
|
ldr r11,[sp, #9*4] @ est
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r0, #0xf
|
mov r0, #0xf
|
||||||
ldr r11,[r11]
|
ldr r11,[r11, #OFS_HighCol]
|
||||||
.else
|
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r0, #0xf
|
|
||||||
.endif
|
|
||||||
|
|
||||||
mvn r9, #0 @ r9=prevcode=-1
|
mvn r9, #0 @ r9=prevcode=-1
|
||||||
add r1, r11, r7 @ r1=pdest
|
add r1, r11, r7 @ r1=pdest
|
||||||
|
@ -548,14 +535,9 @@ DrawLayer:
|
||||||
add r10,r10,r9, lsl #16 @ cell+=cellskip
|
add r10,r10,r9, lsl #16 @ cell+=cellskip
|
||||||
|
|
||||||
@ cache some stuff to avoid mem access
|
@ cache some stuff to avoid mem access
|
||||||
.if OVERRIDE_HIGHCOL
|
ldr r11,[sp, #9*4] @ est
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r0, #0xf
|
mov r0, #0xf
|
||||||
ldr r11,[r11]
|
ldr r11,[r11, #OFS_HighCol]
|
||||||
.else
|
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r0, #0xf
|
|
||||||
.endif
|
|
||||||
|
|
||||||
mvn r9, #0 @ r9=prevcode=-1
|
mvn r9, #0 @ r9=prevcode=-1
|
||||||
add r1, r11, r7 @ r1=pdest
|
add r1, r11, r7 @ r1=pdest
|
||||||
|
@ -722,23 +704,17 @@ DrawLayer:
|
||||||
|
|
||||||
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
@ void BackFill(int reg7, int sh, struct PicoEState *est)
|
||||||
|
|
||||||
.global BackFill @ int reg7, int sh
|
.global BackFill
|
||||||
|
|
||||||
BackFill:
|
BackFill:
|
||||||
stmfd sp!, {r4-r9,lr}
|
stmfd sp!, {r4-r9,lr}
|
||||||
|
|
||||||
.if OVERRIDE_HIGHCOL
|
|
||||||
ldr lr, =HighCol
|
|
||||||
mov r0, r0, lsl #26
|
mov r0, r0, lsl #26
|
||||||
ldr lr, [lr]
|
ldr lr, [r2, #OFS_HighCol]
|
||||||
mov r0, r0, lsr #26
|
mov r0, r0, lsr #26
|
||||||
add lr, lr, #8
|
add lr, lr, #8
|
||||||
.else
|
|
||||||
ldr lr, =(HighCol+8)
|
|
||||||
mov r0, r0, lsl #26
|
|
||||||
mov r0, r0, lsr #26
|
|
||||||
.endif
|
|
||||||
|
|
||||||
orr r0, r0, r1, lsl #6
|
orr r0, r0, r1, lsl #6
|
||||||
orr r0, r0, r0, lsl #8
|
orr r0, r0, r0, lsl #8
|
||||||
|
@ -764,8 +740,8 @@ BackFill:
|
||||||
stmia lr!, {r0-r7}
|
stmia lr!, {r0-r7}
|
||||||
stmia lr!, {r0-r7}
|
stmia lr!, {r0-r7}
|
||||||
|
|
||||||
ldmfd sp!, {r4-r9,r12}
|
ldmfd sp!, {r4-r9,lr}
|
||||||
bx r12
|
bx lr
|
||||||
|
|
||||||
|
|
||||||
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
@ -778,14 +754,8 @@ DrawTilesFromCache:
|
||||||
stmfd sp!, {r4-r9,r11,lr}
|
stmfd sp!, {r4-r9,r11,lr}
|
||||||
|
|
||||||
@ cache some stuff to avoid mem access
|
@ cache some stuff to avoid mem access
|
||||||
.if OVERRIDE_HIGHCOL
|
ldr r11,[r3, #OFS_HighCol]
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r12,#0xf
|
mov r12,#0xf
|
||||||
ldr r11,[r11]
|
|
||||||
.else
|
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r12,#0xf
|
|
||||||
.endif
|
|
||||||
ldr lr, [r3, #OFS_Pico_vram]
|
ldr lr, [r3, #OFS_Pico_vram]
|
||||||
mov r9, r3 @ est
|
mov r9, r3 @ est
|
||||||
|
|
||||||
|
@ -964,14 +934,8 @@ DrawSpritesSHi:
|
||||||
add r10,r0, #3 @ r10=HighLnSpr end
|
add r10,r0, #3 @ r10=HighLnSpr end
|
||||||
add r10,r10,r3 @ r10=HighLnSpr end
|
add r10,r10,r3 @ r10=HighLnSpr end
|
||||||
|
|
||||||
.if OVERRIDE_HIGHCOL
|
ldr r11,[r1, #OFS_HighCol]
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r12,#0xf
|
mov r12,#0xf
|
||||||
ldr r11,[r11]
|
|
||||||
.else
|
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r12,#0xf
|
|
||||||
.endif
|
|
||||||
ldr lr, [r1, #OFS_Pico_vram]
|
ldr lr, [r1, #OFS_Pico_vram]
|
||||||
|
|
||||||
|
|
||||||
|
@ -979,7 +943,7 @@ DrawSpriteSHi:
|
||||||
@ draw next sprite
|
@ draw next sprite
|
||||||
ldrb r0, [r10,#-1]!
|
ldrb r0, [r10,#-1]!
|
||||||
ldr r7, [sp] @ est
|
ldr r7, [sp] @ est
|
||||||
ldr r1, =HighPreSpr
|
ldr r1, [r7, #OFS_HighPreSpr]
|
||||||
cmp r0, #0xff
|
cmp r0, #0xff
|
||||||
ldmeqfd sp!, {r1,r4-r11,pc} @ end of list
|
ldmeqfd sp!, {r1,r4-r11,pc} @ end of list
|
||||||
and r0, r0, #0x7f
|
and r0, r0, #0x7f
|
||||||
|
@ -1159,14 +1123,8 @@ das_no_prep:
|
||||||
add r10,r0, #3
|
add r10,r0, #3
|
||||||
add r10,r10,r2 @ r10=HighLnSpr end
|
add r10,r10,r2 @ r10=HighLnSpr end
|
||||||
|
|
||||||
.if OVERRIDE_HIGHCOL
|
ldr r11,[r3, #OFS_HighCol]
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r12,#0xf
|
mov r12,#0xf
|
||||||
ldr r11,[r11]
|
|
||||||
.else
|
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r12,#0xf
|
|
||||||
.endif
|
|
||||||
ldr lr, [r3, #OFS_Pico_vram]
|
ldr lr, [r3, #OFS_Pico_vram]
|
||||||
|
|
||||||
@ + 0 : hhhhvvvv ----hhvv yyyyyyyy yyyyyyyy // v, h: horiz. size
|
@ + 0 : hhhhvvvv ----hhvv yyyyyyyy yyyyyyyy // v, h: horiz. size
|
||||||
|
@ -1182,7 +1140,7 @@ DrawSprite:
|
||||||
ldmeqfd sp!, {r1,r3-r11,pc} @ end of list
|
ldmeqfd sp!, {r1,r3-r11,pc} @ end of list
|
||||||
cmp r2, r8, lsr #1
|
cmp r2, r8, lsr #1
|
||||||
bne DrawSprite @ wrong priority
|
bne DrawSprite @ wrong priority
|
||||||
ldr r1, =HighPreSpr
|
ldr r1, [r7, #OFS_HighPreSpr]
|
||||||
and r0, r0, #0x7f
|
and r0, r0, #0x7f
|
||||||
add r0, r1, r0, lsl #3
|
add r0, r1, r0, lsl #3
|
||||||
|
|
||||||
|
@ -1352,17 +1310,10 @@ DrawWindow:
|
||||||
sub r8, r1, r0
|
sub r8, r1, r0
|
||||||
|
|
||||||
@ cache some stuff to avoid mem access
|
@ cache some stuff to avoid mem access
|
||||||
.if OVERRIDE_HIGHCOL
|
ldr r11, [r11, #OFS_HighCol]
|
||||||
ldr r11,=HighCol
|
|
||||||
mov r8, r8, lsl #1 @ cells
|
mov r8, r8, lsl #1 @ cells
|
||||||
ldr r11,[r11]
|
|
||||||
mvn r9, #0 @ r9=prevcode=-1
|
|
||||||
add r11,r11,#8
|
add r11,r11,#8
|
||||||
.else
|
|
||||||
ldr r11,=(HighCol+8)
|
|
||||||
mov r8, r8, lsl #1 @ cells
|
|
||||||
mvn r9, #0 @ r9=prevcode=-1
|
mvn r9, #0 @ r9=prevcode=-1
|
||||||
.endif
|
|
||||||
add r1, r11, r0, lsl #4 @ r1=pdest
|
add r1, r11, r0, lsl #4 @ r1=pdest
|
||||||
mov r0, #0xf
|
mov r0, #0xf
|
||||||
b .dwloop_enter
|
b .dwloop_enter
|
||||||
|
@ -1632,17 +1583,9 @@ FinalizeLineRGB555_pal_done:
|
||||||
tstne r12,#PDRAW_ACC_SPRITES
|
tstne r12,#PDRAW_ACC_SPRITES
|
||||||
movne lr, #0x3f
|
movne lr, #0x3f
|
||||||
|
|
||||||
.if OVERRIDE_HIGHCOL
|
ldr r1, [r10, #OFS_HighCol]
|
||||||
ldr r1, =HighCol
|
ldr r0, [r10, #OFS_DrawLineDest]
|
||||||
ldr r0, =DrawLineDest
|
|
||||||
ldr r1, [r1]
|
|
||||||
ldr r0, [r0]
|
|
||||||
add r1, r1, #8
|
add r1, r1, #8
|
||||||
.else
|
|
||||||
ldr r0, =DrawLineDest
|
|
||||||
ldr r1, =(HighCol+8)
|
|
||||||
ldr r0, [r0]
|
|
||||||
.endif
|
|
||||||
|
|
||||||
ldrb r12, [r8, #12]
|
ldrb r12, [r8, #12]
|
||||||
mov lr, lr, lsl #1
|
mov lr, lr, lsl #1
|
||||||
|
@ -1650,7 +1593,7 @@ FinalizeLineRGB555_pal_done:
|
||||||
tst r12, #1
|
tst r12, #1
|
||||||
movne r2, #320/8 @ len
|
movne r2, #320/8 @ len
|
||||||
bne .fl_no32colRGB555
|
bne .fl_no32colRGB555
|
||||||
ldr r4, =PicoOpt
|
ldr r4, [r10, #OFS_PicoOpt]
|
||||||
mov r2, #256/8
|
mov r2, #256/8
|
||||||
ldr r4, [r4]
|
ldr r4, [r4]
|
||||||
tst r4, #0x4000
|
tst r4, #0x4000
|
||||||
|
|
16
pico/mode4.c
16
pico/mode4.c
|
@ -28,7 +28,7 @@ static int screen_offset;
|
||||||
|
|
||||||
static int TileNormM4(int sx, int addr, int pal)
|
static int TileNormM4(int sx, int addr, int pal)
|
||||||
{
|
{
|
||||||
unsigned char *pd = HighCol + sx;
|
unsigned char *pd = Pico.est.HighCol + sx;
|
||||||
unsigned int pack, t;
|
unsigned int pack, t;
|
||||||
|
|
||||||
pack = *(unsigned int *)(Pico.vram + addr); /* Get 4 bitplanes / 8 pixels */
|
pack = *(unsigned int *)(Pico.vram + addr); /* Get 4 bitplanes / 8 pixels */
|
||||||
|
@ -50,7 +50,7 @@ static int TileNormM4(int sx, int addr, int pal)
|
||||||
|
|
||||||
static int TileFlipM4(int sx,int addr,int pal)
|
static int TileFlipM4(int sx,int addr,int pal)
|
||||||
{
|
{
|
||||||
unsigned char *pd = HighCol + sx;
|
unsigned char *pd = Pico.est.HighCol + sx;
|
||||||
unsigned int pack, t;
|
unsigned int pack, t;
|
||||||
|
|
||||||
pack = *(unsigned int *)(Pico.vram + addr); /* Get 4 bitplanes / 8 pixels */
|
pack = *(unsigned int *)(Pico.vram + addr); /* Get 4 bitplanes / 8 pixels */
|
||||||
|
@ -192,7 +192,7 @@ static void DrawDisplayM4(int scanline)
|
||||||
|
|
||||||
if (pv->reg[0] & 0x20)
|
if (pv->reg[0] & 0x20)
|
||||||
// first column masked
|
// first column masked
|
||||||
((int *)HighCol)[2] = ((int *)HighCol)[3] = 0xe0e0e0e0;
|
((int *)Pico.est.HighCol)[2] = ((int *)Pico.est.HighCol)[3] = 0xe0e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicoFrameStartMode4(void)
|
void PicoFrameStartMode4(void)
|
||||||
|
@ -219,7 +219,7 @@ void PicoFrameStartMode4(void)
|
||||||
rendlines = lines;
|
rendlines = lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawLineDest = (char *)DrawLineDestBase + screen_offset * DrawLineDestIncrement;
|
Pico.est.DrawLineDest = (char *)DrawLineDestBase + screen_offset * DrawLineDestIncrement;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicoLineMode4(int line)
|
void PicoLineMode4(int line)
|
||||||
|
@ -233,7 +233,7 @@ void PicoLineMode4(int line)
|
||||||
skip_next_line = PicoScanBegin(line + screen_offset);
|
skip_next_line = PicoScanBegin(line + screen_offset);
|
||||||
|
|
||||||
// Draw screen:
|
// Draw screen:
|
||||||
BackFill(Pico.video.reg[7] & 0x0f, 0);
|
BackFill(Pico.video.reg[7] & 0x0f, 0, &Pico.est);
|
||||||
if (Pico.video.reg[1] & 0x40)
|
if (Pico.video.reg[1] & 0x40)
|
||||||
DrawDisplayM4(line);
|
DrawDisplayM4(line);
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ void PicoLineMode4(int line)
|
||||||
if (PicoScanEnd != NULL)
|
if (PicoScanEnd != NULL)
|
||||||
skip_next_line = PicoScanEnd(line + screen_offset);
|
skip_next_line = PicoScanEnd(line + screen_offset);
|
||||||
|
|
||||||
DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement;
|
Pico.est.DrawLineDest = (char *)Pico.est.DrawLineDest + DrawLineDestIncrement;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicoDoHighPal555M4(void)
|
void PicoDoHighPal555M4(void)
|
||||||
|
@ -282,12 +282,12 @@ static void FinalizeLineRGB555M4(int line)
|
||||||
|
|
||||||
static void FinalizeLine8bitM4(int line)
|
static void FinalizeLine8bitM4(int line)
|
||||||
{
|
{
|
||||||
unsigned char *pd = DrawLineDest;
|
unsigned char *pd = Pico.est.DrawLineDest;
|
||||||
|
|
||||||
if (!(PicoOpt & POPT_DIS_32C_BORDER))
|
if (!(PicoOpt & POPT_DIS_32C_BORDER))
|
||||||
pd += 32;
|
pd += 32;
|
||||||
|
|
||||||
memcpy32((int *)pd, (int *)(HighCol+8), 256/4);
|
memcpy32((int *)pd, (int *)(Pico.est.HighCol+8), 256/4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicoDrawSetOutputMode4(pdso_t which)
|
void PicoDrawSetOutputMode4(pdso_t which)
|
||||||
|
|
|
@ -38,6 +38,7 @@ void PicoInit(void)
|
||||||
|
|
||||||
Pico.est.Pico_video = &Pico.video;
|
Pico.est.Pico_video = &Pico.video;
|
||||||
Pico.est.Pico_vram = Pico.vram;
|
Pico.est.Pico_vram = Pico.vram;
|
||||||
|
Pico.est.PicoOpt = &PicoOpt;
|
||||||
|
|
||||||
// Init CPUs:
|
// Init CPUs:
|
||||||
SekInit();
|
SekInit();
|
||||||
|
@ -46,6 +47,8 @@ void PicoInit(void)
|
||||||
PicoInitMCD();
|
PicoInitMCD();
|
||||||
PicoSVPInit();
|
PicoSVPInit();
|
||||||
Pico32xInit();
|
Pico32xInit();
|
||||||
|
|
||||||
|
PicoDrawInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// to be called once on emu exit
|
// to be called once on emu exit
|
||||||
|
|
|
@ -171,8 +171,6 @@ typedef enum
|
||||||
void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode);
|
void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode);
|
||||||
void PicoDrawSetOutBuf(void *dest, int increment);
|
void PicoDrawSetOutBuf(void *dest, int increment);
|
||||||
void PicoDrawSetCallbacks(int (*begin)(unsigned int num), int (*end)(unsigned int num));
|
void PicoDrawSetCallbacks(int (*begin)(unsigned int num), int (*end)(unsigned int num));
|
||||||
extern void *DrawLineDest;
|
|
||||||
extern unsigned char *HighCol;
|
|
||||||
// utility
|
// utility
|
||||||
#ifdef _ASM_DRAW_C
|
#ifdef _ASM_DRAW_C
|
||||||
void vidConvCpyRGB565(void *to, void *from, int pixels);
|
void vidConvCpyRGB565(void *to, void *from, int pixels);
|
||||||
|
|
|
@ -333,8 +333,12 @@ struct PicoEState
|
||||||
{
|
{
|
||||||
int DrawScanline;
|
int DrawScanline;
|
||||||
int rendstatus;
|
int rendstatus;
|
||||||
|
void *DrawLineDest; // draw estination
|
||||||
|
unsigned char *HighCol;
|
||||||
|
int *HighPreSpr;
|
||||||
void *Pico_video;
|
void *Pico_video;
|
||||||
void *Pico_vram;
|
void *Pico_vram;
|
||||||
|
int *PicoOpt;
|
||||||
};
|
};
|
||||||
|
|
||||||
// some assembly stuff depend on these, do not touch!
|
// some assembly stuff depend on these, do not touch!
|
||||||
|
@ -584,9 +588,10 @@ extern void (*PicoCartUnloadHook)(void);
|
||||||
int CM_compareRun(int cyc, int is_sub);
|
int CM_compareRun(int cyc, int is_sub);
|
||||||
|
|
||||||
// draw.c
|
// draw.c
|
||||||
|
void PicoDrawInit(void);
|
||||||
PICO_INTERNAL void PicoFrameStart(void);
|
PICO_INTERNAL void PicoFrameStart(void);
|
||||||
void PicoDrawSync(int to, int blank_last_line);
|
void PicoDrawSync(int to, int blank_last_line);
|
||||||
void BackFill(int reg7, int sh);
|
void BackFill(int reg7, int sh, struct PicoEState *est);
|
||||||
void FinalizeLine555(int sh, int line, struct PicoEState *est);
|
void FinalizeLine555(int sh, int line, struct PicoEState *est);
|
||||||
extern int (*PicoScanBegin)(unsigned int num);
|
extern int (*PicoScanBegin)(unsigned int num);
|
||||||
extern int (*PicoScanEnd)(unsigned int num);
|
extern int (*PicoScanEnd)(unsigned int num);
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
/* autogenerated by ./tools/mkoffsets, do not edit */
|
/* autogenerated by ./tools/mkoffsets, do not edit */
|
||||||
#define OFS_DrawScanline 0x00
|
#define OFS_DrawScanline 0x00
|
||||||
#define OFS_rendstatus 0x04
|
#define OFS_rendstatus 0x04
|
||||||
#define OFS_Pico_video 0x08
|
#define OFS_DrawLineDest 0x08
|
||||||
#define OFS_Pico_vram 0x0c
|
#define OFS_HighCol 0x0c
|
||||||
|
#define OFS_HighPreSpr 0x10
|
||||||
|
#define OFS_Pico_video 0x14
|
||||||
|
#define OFS_Pico_vram 0x18
|
||||||
|
#define OFS_PicoOpt 0x1c
|
||||||
|
|
|
@ -94,7 +94,7 @@ void pemu_prep_defconfig(void)
|
||||||
|
|
||||||
static int EmuScanBegin16(unsigned int num)
|
static int EmuScanBegin16(unsigned int num)
|
||||||
{
|
{
|
||||||
DrawLineDest = (unsigned short *) giz_screen + 321 * num;
|
Pico.est.DrawLineDest = (unsigned short *) giz_screen + 321 * num;
|
||||||
|
|
||||||
if ((currentConfig.EmuOpt&0x4000) && (num&1) == 0) // (Pico.m.frame_count&1))
|
if ((currentConfig.EmuOpt&0x4000) && (num&1) == 0) // (Pico.m.frame_count&1))
|
||||||
return 1; // skip next line
|
return 1; // skip next line
|
||||||
|
@ -105,7 +105,7 @@ static int EmuScanBegin16(unsigned int num)
|
||||||
static int EmuScanBegin8(unsigned int num)
|
static int EmuScanBegin8(unsigned int num)
|
||||||
{
|
{
|
||||||
// draw like the fast renderer
|
// draw like the fast renderer
|
||||||
HighCol = gfx_buffer + 328 * num;
|
Pico.est.HighCol = gfx_buffer + 328 * num;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -122,13 +122,6 @@ static void osd_text(int x, int y, const char *text)
|
||||||
emu_text_out16(x, y, text);
|
emu_text_out16(x, y, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void log1(void *p1, void *p2)
|
|
||||||
{
|
|
||||||
lprintf("%p %p %p\n", p1, p2, DrawLineDest);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void cd_leds(void)
|
static void cd_leds(void)
|
||||||
{
|
{
|
||||||
static int old_reg = 0;
|
static int old_reg = 0;
|
||||||
|
|
|
@ -222,7 +222,7 @@ static unsigned char __attribute__((aligned(4))) rot_buff[320*4*2];
|
||||||
|
|
||||||
static int EmuScanBegin16_rot(unsigned int num)
|
static int EmuScanBegin16_rot(unsigned int num)
|
||||||
{
|
{
|
||||||
DrawLineDest = rot_buff + (num & 3) * 320 * 2;
|
Pico.est.DrawLineDest = rot_buff + (num & 3) * 320 * 2;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ static int EmuScanEnd16_rot(unsigned int num)
|
||||||
|
|
||||||
static int EmuScanBegin8_rot(unsigned int num)
|
static int EmuScanBegin8_rot(unsigned int num)
|
||||||
{
|
{
|
||||||
DrawLineDest = rot_buff + (num & 3) * 320;
|
Pico.est.DrawLineDest = rot_buff + (num & 3) * 320;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,14 +262,14 @@ static int EmuScanBegin16_ld(unsigned int num)
|
||||||
if (emu_scan_begin)
|
if (emu_scan_begin)
|
||||||
return emu_scan_begin(ld_counter);
|
return emu_scan_begin(ld_counter);
|
||||||
else
|
else
|
||||||
DrawLineDest = (char *)g_screen_ptr + 320 * ld_counter * gp2x_current_bpp / 8;
|
Pico.est.DrawLineDest = (char *)g_screen_ptr + 320 * ld_counter * gp2x_current_bpp / 8;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int EmuScanEnd16_ld(unsigned int num)
|
static int EmuScanEnd16_ld(unsigned int num)
|
||||||
{
|
{
|
||||||
void *oldline = DrawLineDest;
|
void *oldline = Pico.est.DrawLineDest;
|
||||||
|
|
||||||
if (emu_scan_end)
|
if (emu_scan_end)
|
||||||
emu_scan_end(ld_counter);
|
emu_scan_end(ld_counter);
|
||||||
|
@ -280,7 +280,7 @@ static int EmuScanEnd16_ld(unsigned int num)
|
||||||
ld_left = ld_lines;
|
ld_left = ld_lines;
|
||||||
|
|
||||||
EmuScanBegin16_ld(num);
|
EmuScanBegin16_ld(num);
|
||||||
memcpy32(DrawLineDest, oldline, 320 * gp2x_current_bpp / 8 / 4);
|
memcpy32(Pico.est.DrawLineDest, oldline, 320 * gp2x_current_bpp / 8 / 4);
|
||||||
if (emu_scan_end)
|
if (emu_scan_end)
|
||||||
emu_scan_end(ld_counter);
|
emu_scan_end(ld_counter);
|
||||||
|
|
||||||
|
|
|
@ -242,8 +242,8 @@ static void do_slowmode_lines(int line_to)
|
||||||
|
|
||||||
static void EmuScanPrepare(void)
|
static void EmuScanPrepare(void)
|
||||||
{
|
{
|
||||||
HighCol = (unsigned char *)VRAM_CACHED_STUFF + 8;
|
Pico.est.HighCol = (unsigned char *)VRAM_CACHED_STUFF + 8;
|
||||||
if (!(Pico.video.reg[1]&8)) HighCol += 8*512;
|
if (!(Pico.video.reg[1]&8)) Pico.est.HighCol += 8*512;
|
||||||
|
|
||||||
if (dynamic_palette > 0)
|
if (dynamic_palette > 0)
|
||||||
dynamic_palette--;
|
dynamic_palette--;
|
||||||
|
@ -258,7 +258,7 @@ static void EmuScanPrepare(void)
|
||||||
static int EmuScanSlowBegin(unsigned int num)
|
static int EmuScanSlowBegin(unsigned int num)
|
||||||
{
|
{
|
||||||
if (!dynamic_palette)
|
if (!dynamic_palette)
|
||||||
HighCol = (unsigned char *)VRAM_CACHED_STUFF + num * 512 + 8;
|
Pico.est.HighCol = (unsigned char *)VRAM_CACHED_STUFF + num * 512 + 8;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ static int EmuScanSlowEnd(unsigned int num)
|
||||||
if (dynamic_palette) {
|
if (dynamic_palette) {
|
||||||
int line_len = (Pico.video.reg[12]&1) ? 320 : 256;
|
int line_len = (Pico.video.reg[12]&1) ? 320 : 256;
|
||||||
void *dst = (char *)VRAM_STUFF + 512*240 + 512*2*num;
|
void *dst = (char *)VRAM_STUFF + 512*240 + 512*2*num;
|
||||||
amips_clut_f(dst, HighCol + 8, localPal, line_len);
|
amips_clut_f(dst, Pico.est.HighCol + 8, localPal, line_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -23,8 +23,12 @@ int main(int argc, char *argv[])
|
||||||
fprintf(f, "/* autogenerated by %s, do not edit */\n", argv[0]);
|
fprintf(f, "/* autogenerated by %s, do not edit */\n", argv[0]);
|
||||||
DUMP(f, DrawScanline);
|
DUMP(f, DrawScanline);
|
||||||
DUMP(f, rendstatus);
|
DUMP(f, rendstatus);
|
||||||
|
DUMP(f, DrawLineDest);
|
||||||
|
DUMP(f, HighCol);
|
||||||
|
DUMP(f, HighPreSpr);
|
||||||
DUMP(f, Pico_video);
|
DUMP(f, Pico_video);
|
||||||
DUMP(f, Pico_vram);
|
DUMP(f, Pico_vram);
|
||||||
|
DUMP(f, PicoOpt);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue