#ifdef _ASM_DRAW_C\r
void DrawWindow(int tstart, int tend, int prio, int sh);\r
void BackFill(int reg7, int sh);\r
-void DrawAllSprites(int prio, int sh);\r
+void DrawAllSprites(unsigned char *sprited, int prio, int sh);\r
void DrawTilesFromCache(int *hc, int sh, int rlim);\r
-void DrawSpritesSHi(unsigned short *sprited);\r
+void DrawSpritesSHi(unsigned char *sprited);\r
void DrawLayer(int plane_sh, int *hcache, int cellskip, int maxcells);\r
void FinalizeLineBGR444(int sh);\r
void FinalizeLineRGB555(int sh);\r
}\r
else\r
{\r
- int old_prio = 0x8000, lo_above_hi = 0;\r
-\r
for (u = 0; u < max_lines; u++)\r
*((int *)&HighLnSpr[u][0]) = 0;\r
\r
if (sh && (code2 & 0x6000) == 0x6000)\r
maybe_op = SPRL_MAY_HAVE_OP;\r
\r
- if (onscr_x && !old_prio && (code2 & 0x8000))\r
- lo_above_hi = SPRL_LO_ABOVE_HI;\r
- old_prio = code2 & 0x8000;\r
-\r
entry = ((pd - HighPreSpr) / 2) | ((code2>>8)&0x80);\r
y = (sy >= DrawScanline) ? sy : DrawScanline;\r
for (; y < sy + (height<<3) && y < max_lines; y++)\r
{\r
- int cnt = HighLnSpr[y][0];\r
+ unsigned char *p = &HighLnSpr[y][0];\r
+ int cnt = p[0];\r
if (cnt >= max_line_sprites) continue; // sprite limit?\r
\r
- if (HighLnSpr[y][2] >= max_line_sprites*2) { // tile limit?\r
- HighLnSpr[y][0] |= 0x80;\r
+ if (p[2] >= max_line_sprites*2) { // tile limit?\r
+ p[0] |= 0x80;\r
continue;\r
}\r
- HighLnSpr[y][2] += width;\r
+ p[2] += width;\r
\r
if (sx == -0x78) {\r
if (cnt > 0)\r
- HighLnSpr[y][0] |= 0x80; // masked, no more sprites for this line\r
+ p[0] |= 0x80; // masked, no more sprites for this line\r
continue;\r
}\r
// must keep the first sprite even if it's offscreen, for masking\r
if (cnt > 0 && !onscr_x) continue; // offscreen x\r
\r
- HighLnSpr[y][3+cnt] = entry;\r
- HighLnSpr[y][0] = cnt + 1;\r
- if (entry & 0x80)\r
- HighLnSpr[y][1] |= SPRL_HAVE_HI;\r
- else HighLnSpr[y][1] |= SPRL_HAVE_LO;\r
- HighLnSpr[y][1] |= maybe_op|lo_above_hi; // there might be op sprites or priority mess on this line\r
+ p[3+cnt] = entry;\r
+ p[0] = cnt + 1;\r
+ p[1] |= (entry & 0x80) ? SPRL_HAVE_HI : SPRL_HAVE_LO;\r
+ p[1] |= maybe_op; // there might be op sprites on this line\r
+ if (cnt > 0 && (code2 & 0x8000) && !(p[3+cnt-1]&0x80))\r
+ p[1] |= SPRL_LO_ABOVE_HI;\r
}\r
}\r
\r
PicoScanEnd(DrawScanline);\r
}\r
\r
-static int DrawDisplay(int sh, int as)\r
+static int DrawDisplay(int sh)\r
{\r
unsigned char *sprited = &HighLnSpr[DrawScanline][0];\r
struct PicoVideo *pvid=&Pico.video;\r
else if (rendstatus & PDRAW_INTERLACE)\r
DrawAllSpritesInterlace(1, sh);\r
// AS on and have both lo/hi sprites and lo before hi sprites?\r
- else if (as && (sprited[1] & 0xd0) == 0xd0)\r
+ else if ((sprited[1] & 0xd0) == 0xd0 && (rendstatus & PDRAW_ACC_SPRITES))\r
DrawSpritesHiAS(sprited, sh);\r
else if (sh && (sprited[1] & SPRL_MAY_HAVE_OP))\r
DrawSpritesSHi(sprited);\r
\r
static void PicoLine(void)\r
{\r
- int sh, as = 0;\r
+ int sh;\r
if (skip_next_line>0) { skip_next_line--; return; } // skip rendering lines\r
\r
sh=(Pico.video.reg[0xC]&8)>>3; // shadow/hilight?\r
- if (rendstatus & PDRAW_ACC_SPRITES) as|=1; // accurate sprites\r
\r
if (PicoScanBegin != NULL)\r
skip_next_line = PicoScanBegin(DrawScanline);\r
\r
// Draw screen:\r
- BackFill(Pico.video.reg[7], sh|as);\r
+ BackFill(Pico.video.reg[7], sh);\r
if (Pico.video.reg[1]&0x40)\r
- DrawDisplay(sh, as);\r
+ DrawDisplay(sh);\r
\r
if (FinalizeLine != NULL)\r
FinalizeLine(sh);\r
HighPal[0x40|i] = (unsigned short)((HighPal[i]>>1)&0x738e);\r
for (i = 0x3f; i >= 0; i--) {\r
int t=HighPal[i]&0xe71c;t+=0x4208;if(t&0x20)t|=0x1c;if(t&0x800)t|=0x700;if(t&0x10000)t|=0xe000;t&=0xe71c;\r
- HighPal[0x80|i]=(unsigned short)t;\r
+ HighPal[0x80|i] = (unsigned short)t;\r
}\r
\r
screen += 16*320+8;\r
ldr r3, =rendstatus\r
orr r1, r2, r1, lsl #1\r
ldr r12,[r3]\r
- tst r12,#(PDRAW_ACC_SPRITES|PDRAW_SPRITES_MOVED)\r
+ tst r12,#(PDRAW_DIRTY_SPRITES|PDRAW_SPRITES_MOVED)\r
beq das_no_prep\r
stmfd sp!, {r0,r1,lr}\r
and r0, r12,#PDRAW_DIRTY_SPRITES\r
- bic r12,r12,#(PDRAW_ACC_SPRITES|PDRAW_SPRITES_MOVED)\r
+ bic r12,r12,#(PDRAW_DIRTY_SPRITES|PDRAW_SPRITES_MOVED)\r
str r12,[r3]\r
bl PrepareSprites\r
ldmfd sp!, {r0,r1,lr}\r
add r12, r12, r0, lsl #2 @ +starttile\r
\r
ldr r6, =rendstatus\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
+ ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
ldr r6, [r6]\r
\r
@ fetch the first code now\r
.dwloop_end:\r
ldr r0, =rendstatus\r
ldr r1, [r0]\r
- and r6, r6, #2\r
+ and r6, r6, #PDRAW_WND_DIFF_PRIO\r
orr r1, r1, r6\r
str r1, [r0]\r
\r
{\r
memset(&defaultConfig, 0, sizeof(defaultConfig));\r
defaultConfig.EmuOpt = 0x1d | 0x00700; // | <- ram_tmng, confirm_save, cd_leds\r
- defaultConfig.s_PicoOpt = 0x0f | 0x20e00; // | <- use_940, cd_pcm, cd_cdda, svp drc\r
+ defaultConfig.s_PicoOpt = 0x0f | POPT_EXT_FM|POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_SVP_DRC|POPT_ACC_SPRITES;\r
defaultConfig.s_PsndRate = 44100;\r
defaultConfig.s_PicoRegion = 0; // auto\r
defaultConfig.s_PicoAutoRgnOrder = 0x184; // US, EU, JP\r
}\r
\r
\r
-void emu_forcedFrame(void)\r
+void emu_forcedFrame(int opts)\r
{\r
int po_old = PicoOpt;\r
int eo_old = currentConfig.EmuOpt;\r
\r
- PicoOpt &= ~0x0010;\r
- PicoOpt |= 0x4080; // soft_scale | acc_sprites\r
+ PicoOpt &= ~0x10;\r
+ PicoOpt |= opts|POPT_ACC_SPRITES; // acc_sprites\r
currentConfig.EmuOpt |= 0x80;\r
\r
//vidResetMode();\r
\r
// if in 8bit mode, generate 16bit image for menu background\r
if ((PicoOpt&0x10) || !(currentConfig.EmuOpt&0x80))\r
- emu_forcedFrame();\r
+ emu_forcedFrame(POPT_EN_SOFTSCALE);\r
}\r
\r
\r