// this is almost never used (Wiz and menu bg gen only)
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 char *pmd = HighCol + 8;
+ unsigned char *pmd = est->HighCol + 8;
unsigned short *dram, *p32x;
unsigned char mdbg;
#define PICOSCAN_PRE \
PicoScan32xBegin(l + (lines_sft_offs & 0xff)); \
- dst = DrawLineDest; \
+ dst = Pico.est.DrawLineDest; \
#define PICOSCAN_POST \
PicoScan32xEnd(l + (lines_sft_offs & 0xff)); \
int lines_sft_offs;
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];
if (Pico32xDrawMode == PDM32X_BOTH) {
if (Pico32x.vdp_regs[2 / 2] & P32XV_SFT)
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
for (l = 0; l < lines; l++) {
if (have_scan) {
PicoScan32xBegin(l + offs);
- dst = (unsigned short*)DrawLineDest + poffs;
+ dst = (unsigned short*)Pico.est.DrawLineDest + poffs;
}
for (p = 0; p < plen; p += 4) {
dst[p + 0] = pal[*pmd++];
{
struct PicoVideo *pv=&Pico.video;
unsigned char *reg=pv->reg, r;
- extern int HighPreSpr[];
int i, sprites_lo, sprites_hi;
char *dstrp;
sprites_lo = sprites_hi = 0;
- for (i = 0; HighPreSpr[i] != 0; i+=2)
- if (HighPreSpr[i+1] & 0x8000)
+ for (i = 0; Pico.est.HighPreSpr[i] != 0; i+=2)
+ if (Pico.est.HighPreSpr[i+1] & 0x8000)
sprites_hi++;
else sprites_lo++;
int (*PicoScanEnd) (unsigned int num) = NULL;\r
\r
static unsigned char DefHighCol[8+320+8];\r
-unsigned char *HighCol = DefHighCol;\r
static unsigned char *HighColBase = DefHighCol;\r
static int HighColIncrement;\r
\r
static unsigned int DefOutBuff[320*2/2];\r
-void *DrawLineDest = DefOutBuff; // pointer to dest buffer where to draw this line to\r
void *DrawLineDestBase = DefOutBuff;\r
int DrawLineDestIncrement;\r
\r
static int HighCacheA[41+1]; // caches for high layers\r
static int HighCacheB[41+1];\r
-int HighPreSpr[80*2+1]; // slightly preprocessed sprites\r
+static int HighPreSpr[80*2+1]; // slightly preprocessed sprites\r
\r
#define SPRL_HAVE_HI 0x80 // have hi priority sprites\r
#define SPRL_HAVE_LO 0x40 // *lo*\r
#define TileNormMaker(funcname,pix_func) \\r
static int funcname(int sx,int addr,int pal) \\r
{ \\r
- unsigned char *pd = HighCol+sx; \\r
+ unsigned char *pd = Pico.est.HighCol+sx; \\r
unsigned int pack=0; unsigned int t=0; \\r
\\r
pack=*(unsigned int *)(Pico.vram+addr); /* Get 8 pixels */ \\r
#define TileFlipMaker(funcname,pix_func) \\r
static int funcname(int sx,int addr,int pal) \\r
{ \\r
- unsigned char *pd = HighCol+sx; \\r
+ unsigned char *pd = Pico.est.HighCol+sx; \\r
unsigned int pack=0; unsigned int t=0; \\r
\\r
pack=*(unsigned int *)(Pico.vram+addr); /* Get 8 pixels */ \\r
pal=((code>>9)&0x30);\r
\r
if (prio) {\r
- int *zb = (int *)(HighCol+8+(tilex<<3));\r
+ int *zb = (int *)(est->HighCol+8+(tilex<<3));\r
*zb++ &= 0xbfbfbfbf;\r
*zb &= 0xbfbfbfbf;\r
} else {\r
// as some layer has covered whole line with hi priority tiles,\r
// we can process whole line and then act as if sh/hi mode was off,\r
// but leave lo pri op sprite markers alone\r
- int c = 320/4, *zb = (int *)(HighCol+8);\r
+ int c = 320/4, *zb = (int *)(Pico.est.HighCol+8);\r
Pico.est.rendstatus |= PDRAW_SHHI_DONE;\r
while (c--)\r
{\r
addr=(code&0x7ff)<<4;\r
addr+=(unsigned int)code>>25; // y offset into tile\r
dx=(code>>16)&0x1ff;\r
- zb = HighCol+dx;\r
+ zb = est->HighCol+dx;\r
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;\r
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;\r
\r
last_cut_tile:\r
{\r
unsigned int t, pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- unsigned char *pd = HighCol+dx;\r
+ unsigned char *pd = est->HighCol+dx;\r
if (!pack) return;\r
if (code&0x0800)\r
{\r
int offs, delta, width, height, row;\r
\r
offs = (p[cnt] & 0x7f) * 2;\r
- sprite = HighPreSpr + offs;\r
+ sprite = est->HighPreSpr + offs;\r
code = sprite[1];\r
pal = (code>>9)&0x30;\r
\r
\r
/* nasty 1: remove 'sprite' flags */\r
{\r
- int c = 320/4/4, *zb = (int *)(HighCol+8);\r
+ int c = 320/4/4, *zb = (int *)(Pico.est.HighCol+8);\r
while (c--)\r
{\r
*zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f;\r
\r
// --------------------------------------------\r
\r
-void BackFill(int reg7, int sh)\r
+void BackFill(int reg7, int sh, struct PicoEState *est)\r
{\r
unsigned int back;\r
\r
back|=back<<8;\r
back|=back<<16;\r
\r
- memset32((int *)(HighCol+8), back, 320/4);\r
+ memset32((int *)(est->HighCol+8), back, 320/4);\r
}\r
#endif\r
\r
}\r
}\r
\r
-void FinalizeLine555(int sh, int line)\r
+void FinalizeLine555(int sh, int line, struct PicoEState *est)\r
{\r
- unsigned short *pd=DrawLineDest;\r
- unsigned char *ps=HighCol+8;\r
+ unsigned short *pd=est->DrawLineDest;\r
+ unsigned char *ps=est->HighCol+8;\r
unsigned short *pal=HighPal;\r
int len;\r
\r
\r
static void FinalizeLine8bit(int sh, int line, struct PicoEState *est)\r
{\r
- unsigned char *pd = DrawLineDest;\r
+ unsigned char *pd = est->DrawLineDest;\r
int len, rs = est->rendstatus;\r
static int dirty_count;\r
\r
\r
if (!sh && (rs & PDRAW_SONIC_MODE)) {\r
if (dirty_count >= 11) {\r
- blockcpy_or(pd, HighCol+8, len, 0x80);\r
+ blockcpy_or(pd, est->HighCol+8, len, 0x80);\r
} else {\r
- blockcpy_or(pd, HighCol+8, len, 0x40);\r
+ blockcpy_or(pd, est->HighCol+8, len, 0x40);\r
}\r
} else {\r
- blockcpy(pd, HighCol+8, len);\r
+ blockcpy(pd, est->HighCol+8, len);\r
}\r
}\r
\r
rendstatus_old = Pico.est.rendstatus;\r
}\r
\r
- HighCol = HighColBase + offs * HighColIncrement;\r
- DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;\r
+ Pico.est.HighCol = HighColBase + offs * HighColIncrement;\r
+ Pico.est.DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;\r
Pico.est.DrawScanline = 0;\r
skip_next_line = 0;\r
\r
if (PicoScanBegin != NULL)\r
PicoScanBegin(line + offs);\r
\r
- BackFill(bgc, sh);\r
+ BackFill(bgc, sh, &Pico.est);\r
\r
if (FinalizeLine != NULL)\r
FinalizeLine(sh, line, &Pico.est);\r
if (PicoScanEnd != NULL)\r
PicoScanEnd(line + offs);\r
\r
- HighCol += HighColIncrement;\r
- DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement;\r
+ Pico.est.HighCol += HighColIncrement;\r
+ Pico.est.DrawLineDest = (char *)Pico.est.DrawLineDest + DrawLineDestIncrement;\r
}\r
\r
static void PicoLine(int line, int offs, int sh, int bgc)\r
}\r
\r
// Draw screen:\r
- BackFill(bgc, sh);\r
+ BackFill(bgc, sh, &Pico.est);\r
if (Pico.video.reg[1]&0x40)\r
DrawDisplay(sh);\r
\r
if (PicoScanEnd != NULL)\r
skip_next_line = PicoScanEnd(line + offs);\r
\r
- HighCol += HighColIncrement;\r
- DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement;\r
+ Pico.est.HighCol += HighColIncrement;\r
+ Pico.est.DrawLineDest = (char *)Pico.est.DrawLineDest + DrawLineDestIncrement;\r
}\r
\r
void PicoDrawSync(int to, int blank_last_line)\r
{\r
DrawLineDestBase = dest;\r
DrawLineDestIncrement = increment;\r
- DrawLineDest = (unsigned char*)DrawLineDestBase + Pico.est.DrawScanline * increment;\r
+ Pico.est.DrawLineDest = (unsigned char*)DrawLineDestBase + Pico.est.DrawScanline * increment;\r
}\r
\r
void PicoDrawSetInternalBuf(void *dest, int increment)\r
if (dest != NULL) {\r
HighColBase = dest;\r
HighColIncrement = increment;\r
- HighCol = HighColBase + Pico.est.DrawScanline * increment;\r
+ Pico.est.HighCol = HighColBase + Pico.est.DrawScanline * increment;\r
}\r
else {\r
HighColBase = DefHighCol;\r
}\r
}\r
\r
-// vim:ts=4:sw=4:expandtab\r
+void PicoDrawInit(void)\r
+{\r
+ Pico.est.DrawLineDest = DefOutBuff;\r
+ Pico.est.HighCol = HighColBase;\r
+ Pico.est.HighPreSpr = HighPreSpr;\r
+ rendstatus_old = -1;\r
+}\r
+\r
+// vim:ts=2:sw=2:expandtab\r
\r
#include "pico_int_o32.h"\r
\r
-.extern PicoOpt\r
-.extern HighCol\r
-.extern HighSprZ\r
-.extern HighPreSpr\r
-.extern DrawLineDest\r
.extern DrawStripInterlace\r
-.extern HighCacheS_ptr\r
-\r
-.equiv OVERRIDE_HIGHCOL, 1\r
\r
.equ PDRAW_SPRITES_MOVED, (1<<0)\r
.equ PDRAW_WND_DIFF_PRIO, (1<<1)\r
sub r10,r10,r9, lsl #16 @ cells-=cellskip\r
\r
@ cache some stuff to avoid mem access\r
-.if OVERRIDE_HIGHCOL\r
- ldr r11,=HighCol\r
- mov r0, #0xf\r
- ldr r11,[r11]\r
-.else\r
- ldr r11,=HighCol\r
+ ldr r11,[sp, #9*4] @ est\r
mov r0, #0xf\r
-.endif\r
+ ldr r11,[r11, #OFS_HighCol]\r
\r
mvn r9, #0 @ r9=prevcode=-1\r
- add r1, r11, r7 @ r1=pdest\r
+ add r1, r11, r7 @ r1=pdest\r
\r
\r
@ r4 & r7 are scratch in this loop\r
add r10,r10,r9, lsl #16 @ cell+=cellskip\r
\r
@ cache some stuff to avoid mem access\r
-.if OVERRIDE_HIGHCOL\r
- ldr r11,=HighCol\r
- mov r0, #0xf\r
- ldr r11,[r11]\r
-.else\r
- ldr r11,=HighCol\r
+ ldr r11,[sp, #9*4] @ est\r
mov r0, #0xf\r
-.endif\r
+ ldr r11,[r11, #OFS_HighCol]\r
\r
mvn r9, #0 @ r9=prevcode=-1\r
add r1, r11, r7 @ r1=pdest\r
\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
+@ void BackFill(int reg7, int sh, struct PicoEState *est)\r
\r
-.global BackFill @ int reg7, int sh\r
+.global BackFill\r
\r
BackFill:\r
stmfd sp!, {r4-r9,lr}\r
\r
-.if OVERRIDE_HIGHCOL\r
- ldr lr, =HighCol\r
mov r0, r0, lsl #26\r
- ldr lr, [lr]\r
+ ldr lr, [r2, #OFS_HighCol]\r
mov r0, r0, lsr #26\r
add lr, lr, #8\r
-.else\r
- ldr lr, =(HighCol+8)\r
- mov r0, r0, lsl #26\r
- mov r0, r0, lsr #26\r
-.endif\r
\r
orr r0, r0, r1, lsl #6\r
orr r0, r0, r0, lsl #8\r
stmia lr!, {r0-r7}\r
stmia lr!, {r0-r7}\r
\r
- ldmfd sp!, {r4-r9,r12}\r
- bx r12\r
+ ldmfd sp!, {r4-r9,lr}\r
+ bx lr\r
\r
\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
stmfd sp!, {r4-r9,r11,lr}\r
\r
@ cache some stuff to avoid mem access\r
-.if OVERRIDE_HIGHCOL\r
- ldr r11,=HighCol\r
+ ldr r11,[r3, #OFS_HighCol]\r
mov r12,#0xf\r
- ldr r11,[r11]\r
-.else\r
- ldr r11,=HighCol\r
- mov r12,#0xf\r
-.endif\r
ldr lr, [r3, #OFS_Pico_vram]\r
mov r9, r3 @ est\r
\r
add r10,r0, #3 @ r10=HighLnSpr end\r
add r10,r10,r3 @ r10=HighLnSpr end\r
\r
-.if OVERRIDE_HIGHCOL\r
- ldr r11,=HighCol\r
- mov r12,#0xf\r
- ldr r11,[r11]\r
-.else\r
- ldr r11,=HighCol\r
+ ldr r11,[r1, #OFS_HighCol]\r
mov r12,#0xf\r
-.endif\r
ldr lr, [r1, #OFS_Pico_vram]\r
\r
\r
@ draw next sprite\r
ldrb r0, [r10,#-1]!\r
ldr r7, [sp] @ est\r
- ldr r1, =HighPreSpr\r
+ ldr r1, [r7, #OFS_HighPreSpr]\r
cmp r0, #0xff\r
ldmeqfd sp!, {r1,r4-r11,pc} @ end of list\r
and r0, r0, #0x7f\r
add r10,r0, #3\r
add r10,r10,r2 @ r10=HighLnSpr end\r
\r
-.if OVERRIDE_HIGHCOL\r
- ldr r11,=HighCol\r
- mov r12,#0xf\r
- ldr r11,[r11]\r
-.else\r
- ldr r11,=HighCol\r
+ ldr r11,[r3, #OFS_HighCol]\r
mov r12,#0xf\r
-.endif\r
ldr lr, [r3, #OFS_Pico_vram]\r
\r
@ + 0 : hhhhvvvv ----hhvv yyyyyyyy yyyyyyyy // v, h: horiz. size\r
ldmeqfd sp!, {r1,r3-r11,pc} @ end of list\r
cmp r2, r8, lsr #1\r
bne DrawSprite @ wrong priority\r
- ldr r1, =HighPreSpr\r
+ ldr r1, [r7, #OFS_HighPreSpr]\r
and r0, r0, #0x7f\r
add r0, r1, r0, lsl #3\r
\r
sub r8, r1, r0\r
\r
@ cache some stuff to avoid mem access\r
-.if OVERRIDE_HIGHCOL\r
- ldr r11,=HighCol\r
+ ldr r11, [r11, #OFS_HighCol]\r
mov r8, r8, lsl #1 @ cells\r
- ldr r11,[r11]\r
- mvn r9, #0 @ r9=prevcode=-1\r
add r11,r11,#8\r
-.else\r
- ldr r11,=(HighCol+8)\r
- mov r8, r8, lsl #1 @ cells\r
mvn r9, #0 @ r9=prevcode=-1\r
-.endif\r
add r1, r11, r0, lsl #4 @ r1=pdest\r
mov r0, #0xf\r
b .dwloop_enter\r
tstne r12,#PDRAW_ACC_SPRITES\r
movne lr, #0x3f\r
\r
-.if OVERRIDE_HIGHCOL\r
- ldr r1, =HighCol\r
- ldr r0, =DrawLineDest\r
- ldr r1, [r1]\r
- ldr r0, [r0]\r
+ ldr r1, [r10, #OFS_HighCol]\r
+ ldr r0, [r10, #OFS_DrawLineDest]\r
add r1, r1, #8\r
-.else\r
- ldr r0, =DrawLineDest\r
- ldr r1, =(HighCol+8)\r
- ldr r0, [r0]\r
-.endif\r
\r
ldrb r12, [r8, #12]\r
mov lr, lr, lsl #1\r
tst r12, #1\r
movne r2, #320/8 @ len\r
bne .fl_no32colRGB555\r
- ldr r4, =PicoOpt\r
+ ldr r4, [r10, #OFS_PicoOpt]\r
mov r2, #256/8\r
ldr r4, [r4]\r
tst r4, #0x4000\r
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;
pack = *(unsigned int *)(Pico.vram + addr); /* Get 4 bitplanes / 8 pixels */
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;
pack = *(unsigned int *)(Pico.vram + addr); /* Get 4 bitplanes / 8 pixels */
if (pv->reg[0] & 0x20)
// first column masked
- ((int *)HighCol)[2] = ((int *)HighCol)[3] = 0xe0e0e0e0;
+ ((int *)Pico.est.HighCol)[2] = ((int *)Pico.est.HighCol)[3] = 0xe0e0e0e0;
}
void PicoFrameStartMode4(void)
rendlines = lines;
}
- DrawLineDest = (char *)DrawLineDestBase + screen_offset * DrawLineDestIncrement;
+ Pico.est.DrawLineDest = (char *)DrawLineDestBase + screen_offset * DrawLineDestIncrement;
}
void PicoLineMode4(int line)
skip_next_line = PicoScanBegin(line + screen_offset);
// Draw screen:
- BackFill(Pico.video.reg[7] & 0x0f, 0);
+ BackFill(Pico.video.reg[7] & 0x0f, 0, &Pico.est);
if (Pico.video.reg[1] & 0x40)
DrawDisplayM4(line);
if (PicoScanEnd != NULL)
skip_next_line = PicoScanEnd(line + screen_offset);
- DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement;
+ Pico.est.DrawLineDest = (char *)Pico.est.DrawLineDest + DrawLineDestIncrement;
}
void PicoDoHighPal555M4(void)
static void FinalizeLine8bitM4(int line)
{
- unsigned char *pd = DrawLineDest;
+ unsigned char *pd = Pico.est.DrawLineDest;
if (!(PicoOpt & POPT_DIS_32C_BORDER))
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)
\r
Pico.est.Pico_video = &Pico.video;\r
Pico.est.Pico_vram = Pico.vram;\r
+ Pico.est.PicoOpt = &PicoOpt;\r
\r
// Init CPUs:\r
SekInit();\r
PicoInitMCD();\r
PicoSVPInit();\r
Pico32xInit();\r
+\r
+ PicoDrawInit();\r
}\r
\r
// to be called once on emu exit\r
void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode);\r
void PicoDrawSetOutBuf(void *dest, int increment);\r
void PicoDrawSetCallbacks(int (*begin)(unsigned int num), int (*end)(unsigned int num));\r
-extern void *DrawLineDest;\r
-extern unsigned char *HighCol;\r
// utility\r
#ifdef _ASM_DRAW_C\r
void vidConvCpyRGB565(void *to, void *from, int pixels);\r
{\r
int DrawScanline;\r
int rendstatus;\r
+ void *DrawLineDest; // draw estination\r
+ unsigned char *HighCol;\r
+ int *HighPreSpr;\r
void *Pico_video;\r
void *Pico_vram;\r
+ int *PicoOpt;\r
};\r
\r
// some assembly stuff depend on these, do not touch!\r
int CM_compareRun(int cyc, int is_sub);\r
\r
// draw.c\r
+void PicoDrawInit(void);\r
PICO_INTERNAL void PicoFrameStart(void);\r
void PicoDrawSync(int to, int blank_last_line);\r
-void BackFill(int reg7, int sh);\r
+void BackFill(int reg7, int sh, struct PicoEState *est);\r
void FinalizeLine555(int sh, int line, struct PicoEState *est);\r
extern int (*PicoScanBegin)(unsigned int num);\r
extern int (*PicoScanEnd)(unsigned int num);\r
/* autogenerated by ./tools/mkoffsets, do not edit */
#define OFS_DrawScanline 0x00
#define OFS_rendstatus 0x04
-#define OFS_Pico_video 0x08
-#define OFS_Pico_vram 0x0c
+#define OFS_DrawLineDest 0x08
+#define OFS_HighCol 0x0c
+#define OFS_HighPreSpr 0x10
+#define OFS_Pico_video 0x14
+#define OFS_Pico_vram 0x18
+#define OFS_PicoOpt 0x1c
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))
return 1; // skip next line
static int EmuScanBegin8(unsigned int num)
{
// draw like the fast renderer
- HighCol = gfx_buffer + 328 * num;
+ Pico.est.HighCol = gfx_buffer + 328 * num;
return 0;
}
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 int old_reg = 0;
\r
static int EmuScanBegin16_rot(unsigned int num)\r
{\r
- DrawLineDest = rot_buff + (num & 3) * 320 * 2;\r
+ Pico.est.DrawLineDest = rot_buff + (num & 3) * 320 * 2;\r
return 0;\r
}\r
\r
\r
static int EmuScanBegin8_rot(unsigned int num)\r
{\r
- DrawLineDest = rot_buff + (num & 3) * 320;\r
+ Pico.est.DrawLineDest = rot_buff + (num & 3) * 320;\r
return 0;\r
}\r
\r
if (emu_scan_begin)\r
return emu_scan_begin(ld_counter);\r
else\r
- DrawLineDest = (char *)g_screen_ptr + 320 * ld_counter * gp2x_current_bpp / 8;\r
+ Pico.est.DrawLineDest = (char *)g_screen_ptr + 320 * ld_counter * gp2x_current_bpp / 8;\r
\r
return 0;\r
}\r
\r
static int EmuScanEnd16_ld(unsigned int num)\r
{\r
- void *oldline = DrawLineDest;\r
+ void *oldline = Pico.est.DrawLineDest;\r
\r
if (emu_scan_end)\r
emu_scan_end(ld_counter);\r
ld_left = ld_lines;\r
\r
EmuScanBegin16_ld(num);\r
- memcpy32(DrawLineDest, oldline, 320 * gp2x_current_bpp / 8 / 4);\r
+ memcpy32(Pico.est.DrawLineDest, oldline, 320 * gp2x_current_bpp / 8 / 4);\r
if (emu_scan_end)\r
emu_scan_end(ld_counter);\r
\r
static void EmuScanPrepare(void)
{
- HighCol = (unsigned char *)VRAM_CACHED_STUFF + 8;
- if (!(Pico.video.reg[1]&8)) HighCol += 8*512;
+ Pico.est.HighCol = (unsigned char *)VRAM_CACHED_STUFF + 8;
+ if (!(Pico.video.reg[1]&8)) Pico.est.HighCol += 8*512;
if (dynamic_palette > 0)
dynamic_palette--;
static int EmuScanSlowBegin(unsigned int num)
{
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;
}
if (dynamic_palette) {
int line_len = (Pico.video.reg[12]&1) ? 320 : 256;
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;
fprintf(f, "/* autogenerated by %s, do not edit */\n", argv[0]);
DUMP(f, DrawScanline);
DUMP(f, rendstatus);
+ DUMP(f, DrawLineDest);
+ DUMP(f, HighCol);
+ DUMP(f, HighPreSpr);
DUMP(f, Pico_video);
DUMP(f, Pico_vram);
+ DUMP(f, PicoOpt);
fclose(f);
return 0;