mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 23:37:46 -04:00
overdraw eliminated in AS mode
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@519 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
e352c3af64
commit
97a7f774d3
3 changed files with 19 additions and 25 deletions
25
Pico/Draw.c
25
Pico/Draw.c
|
@ -628,7 +628,7 @@ last_cut_tile:
|
||||||
// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size
|
// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size
|
||||||
// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8
|
// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8
|
||||||
|
|
||||||
static void DrawSprite(int *sprite, int sh, int as)
|
static void DrawSprite(int *sprite, int sh)
|
||||||
{
|
{
|
||||||
int width=0,height=0;
|
int width=0,height=0;
|
||||||
int row=0,code=0;
|
int row=0,code=0;
|
||||||
|
@ -657,7 +657,7 @@ static void DrawSprite(int *sprite, int sh, int as)
|
||||||
delta<<=4; // Delta of address
|
delta<<=4; // Delta of address
|
||||||
|
|
||||||
pal=(code>>9)&0x30;
|
pal=(code>>9)&0x30;
|
||||||
pal|=((sh|as)<<6);
|
pal|=sh<<6;
|
||||||
|
|
||||||
if (sh && (code&0x6000) == 0x6000) {
|
if (sh && (code&0x6000) == 0x6000) {
|
||||||
if(code&0x0800) fTileFunc=TileFlipSH_noop;
|
if(code&0x0800) fTileFunc=TileFlipSH_noop;
|
||||||
|
@ -1085,7 +1085,7 @@ static void DrawAllSprites(int prio, int sh)
|
||||||
{
|
{
|
||||||
int rs = rendstatus, scan = DrawScanline;
|
int rs = rendstatus, scan = DrawScanline;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
int cnt, as;
|
int cnt;
|
||||||
|
|
||||||
if (rs & (PDRAW_SPRITES_MOVED|PDRAW_DIRTY_SPRITES)) {
|
if (rs & (PDRAW_SPRITES_MOVED|PDRAW_DIRTY_SPRITES)) {
|
||||||
//elprintf(EL_STATUS, "PrepareSprites(%i)", (rs>>4)&1);
|
//elprintf(EL_STATUS, "PrepareSprites(%i)", (rs>>4)&1);
|
||||||
|
@ -1097,15 +1097,14 @@ static void DrawAllSprites(int prio, int sh)
|
||||||
if (cnt == 0) return;
|
if (cnt == 0) return;
|
||||||
|
|
||||||
p = &HighLnSpr[scan][2];
|
p = &HighLnSpr[scan][2];
|
||||||
as = (rs & PDRAW_ACC_SPRITES) ? 1 : 0;
|
|
||||||
|
|
||||||
// Go through sprites backwards:
|
// Go through sprites backwards:
|
||||||
for (cnt--; cnt >= 0; cnt--)
|
for (cnt--; cnt >= 0; cnt--)
|
||||||
{
|
{
|
||||||
int offs;
|
int offs;
|
||||||
if ((p[cnt] >> 7) != prio && !as) continue;
|
if ((p[cnt] >> 7) != prio) continue;
|
||||||
offs = (p[cnt]&0x7f) * 2;
|
offs = (p[cnt]&0x7f) * 2;
|
||||||
DrawSprite(HighPreSpr + offs, sh, as);
|
DrawSprite(HighPreSpr + offs, sh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1331,7 +1330,7 @@ static int DrawDisplay(int sh, int as)
|
||||||
DrawWindow( (win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 0, sh|as);
|
DrawWindow( (win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 0, sh|as);
|
||||||
} else
|
} else
|
||||||
DrawLayer(0|((sh|as)<<1), HighCacheA, 0, maxcells);
|
DrawLayer(0|((sh|as)<<1), HighCacheA, 0, maxcells);
|
||||||
if ((rendstatus & PDRAW_HAVE_LO_SPR) || as)
|
if (rendstatus & PDRAW_HAVE_LO_SPR)
|
||||||
DrawAllSpritesLoPri(0, sh);
|
DrawAllSpritesLoPri(0, sh);
|
||||||
|
|
||||||
if (HighCacheB[0]) DrawTilesFromCache(HighCacheB, sh, maxw);
|
if (HighCacheB[0]) DrawTilesFromCache(HighCacheB, sh, maxw);
|
||||||
|
@ -1366,12 +1365,7 @@ PICO_INTERNAL void PicoFrameStart(void)
|
||||||
if (PicoOpt & POPT_ACC_SPRITES)
|
if (PicoOpt & POPT_ACC_SPRITES)
|
||||||
rendstatus |= PDRAW_ACC_SPRITES;
|
rendstatus |= PDRAW_ACC_SPRITES;
|
||||||
|
|
||||||
if ((Pico.video.reg[12]&6) == 6) {
|
if (sh)
|
||||||
rendstatus |= PDRAW_INTERLACE; // interlace mode
|
|
||||||
DrawAllSpritesLoPri =
|
|
||||||
DrawAllSpritesHiPri = DrawAllSpritesInterlace;
|
|
||||||
}
|
|
||||||
else if (sh)
|
|
||||||
{
|
{
|
||||||
DrawAllSpritesLoPri = DrawAllSprites;
|
DrawAllSpritesLoPri = DrawAllSprites;
|
||||||
DrawAllSpritesHiPri = DrawSpritesSHi;
|
DrawAllSpritesHiPri = DrawSpritesSHi;
|
||||||
|
@ -1383,6 +1377,11 @@ PICO_INTERNAL void PicoFrameStart(void)
|
||||||
}
|
}
|
||||||
if (rendstatus & PDRAW_ACC_SPRITES)
|
if (rendstatus & PDRAW_ACC_SPRITES)
|
||||||
DrawAllSpritesHiPri = DrawSpritesHiAS;
|
DrawAllSpritesHiPri = DrawSpritesHiAS;
|
||||||
|
if ((Pico.video.reg[12]&6) == 6) {
|
||||||
|
rendstatus |= PDRAW_INTERLACE; // interlace mode
|
||||||
|
DrawAllSpritesLoPri =
|
||||||
|
DrawAllSpritesHiPri = DrawAllSpritesInterlace;
|
||||||
|
}
|
||||||
|
|
||||||
if (Pico.m.dirtyPal) Pico.m.dirtyPal = 2; // reset dirty if needed
|
if (Pico.m.dirtyPal) Pico.m.dirtyPal = 2; // reset dirty if needed
|
||||||
|
|
||||||
|
|
16
Pico/Draw.s
16
Pico/Draw.s
|
@ -1163,17 +1163,12 @@ das_no_prep:
|
||||||
|
|
||||||
@ time to do some real work
|
@ time to do some real work
|
||||||
stmfd sp!, {r4-r11,lr}
|
stmfd sp!, {r4-r11,lr}
|
||||||
ldr r4, =rendstatus
|
|
||||||
mov r12,#0xff
|
mov r12,#0xff
|
||||||
ldr r4, [r4]
|
|
||||||
strb r12,[r2,#1] @ set end marker
|
strb r12,[r2,#1] @ set end marker
|
||||||
add r10,r2, #2
|
add r10,r2, #2
|
||||||
add r10,r10,r3 @ r10=HighLnSpr end
|
add r10,r10,r3 @ r10=HighLnSpr end
|
||||||
|
|
||||||
mov r8, r1, lsl #4
|
str r1, [sp, #-4] @ no calls after this point
|
||||||
tst r4, #PDRAW_ACC_SPRITES
|
|
||||||
orrne r8, r8, #1
|
|
||||||
str r8, [sp, #-4] @ no calls after this point
|
|
||||||
|
|
||||||
.if OVERRIDE_HIGHCOL
|
.if OVERRIDE_HIGHCOL
|
||||||
ldr r11,=HighCol
|
ldr r11,=HighCol
|
||||||
|
@ -1196,7 +1191,7 @@ DrawSprite: @ was: unsigned int *sprite, int sh, int acc_sprites
|
||||||
mov r2, r0, lsr #7
|
mov r2, r0, lsr #7
|
||||||
cmp r0, #0xff
|
cmp r0, #0xff
|
||||||
ldmeqfd sp!, {r4-r11,pc} @ end of list
|
ldmeqfd sp!, {r4-r11,pc} @ end of list
|
||||||
cmp r2, r8, lsr #5
|
cmp r2, r8, lsr #1
|
||||||
bne DrawSprite @ wrong priority
|
bne DrawSprite @ wrong priority
|
||||||
and r0, r0, #0x7f
|
and r0, r0, #0x7f
|
||||||
add r0, r1, r0, lsl #3
|
add r0, r1, r0, lsl #3
|
||||||
|
@ -1220,7 +1215,7 @@ DrawSprite: @ was: unsigned int *sprite, int sh, int acc_sprites
|
||||||
mov r2, r9, asr #16 @ r2=sx
|
mov r2, r9, asr #16 @ r2=sx
|
||||||
mov r9, r9, lsl #16
|
mov r9, r9, lsl #16
|
||||||
mov r9, r9, lsr #16
|
mov r9, r9, lsr #16
|
||||||
orr r9, r9, r8, lsl #27 @ r9=code|sh[31]|as[27]
|
orr r9, r9, r8, lsl #31 @ r9=code|sh[31]
|
||||||
|
|
||||||
tst r9, #0x1000
|
tst r9, #0x1000
|
||||||
movne r4, r5, lsl #3
|
movne r4, r5, lsl #3
|
||||||
|
@ -1242,11 +1237,10 @@ DrawSprite: @ was: unsigned int *sprite, int sh, int acc_sprites
|
||||||
mov r5, r5, lsl #4 @ delta<<=4; // Delta of address
|
mov r5, r5, lsl #4 @ delta<<=4; // Delta of address
|
||||||
and r4, r9, #0x6000
|
and r4, r9, #0x6000
|
||||||
orr r9, r9, r4, lsl #16
|
orr r9, r9, r4, lsl #16
|
||||||
orr r9, r9, #0x10000000 @ r9=scc1 a??? ... <code> (s=shadow/hilight, cc=pal, a=acc_spr)
|
orrs r9, r9, #0x10000000 @ r9=scc1 ???? ... <code> (s=shadow/hilight, cc=pal)
|
||||||
|
|
||||||
orrs r3, r9, r9, lsl #4
|
|
||||||
mov r3, r4, lsr #9 @ r3=pal=((code>>9)&0x30);
|
mov r3, r4, lsr #9 @ r3=pal=((code>>9)&0x30);
|
||||||
orrmi r3, r3, #0x40 @ for shadow|as
|
orrmi r3, r3, #0x40 @ for sh/hi
|
||||||
|
|
||||||
add r6, r6, #1 @ inc now
|
add r6, r6, #1 @ inc now
|
||||||
adds r0, r2, #0 @ mov sx to r0 and set ZV flags
|
adds r0, r2, #0 @ mov sx to r0 and set ZV flags
|
||||||
|
|
|
@ -375,7 +375,8 @@ char *debugString(void)
|
||||||
else sprites_lo++;
|
else sprites_lo++;
|
||||||
|
|
||||||
dstrp = dstr;
|
dstrp = dstr;
|
||||||
sprintf(dstrp, "mode set 1: %02x spr lo: %2i, spr hi: %2i\n", (r=reg[0]), sprites_lo, sprites_hi);
|
sprintf(dstrp, "mode set 1: %02x spr lo[%c]: %2i, spr hi[%c]: %2i\n", (r=reg[0]),
|
||||||
|
rendstatus&PDRAW_HAVE_LO_SPR?'y':'n', sprites_lo, rendstatus&PDRAW_HAVE_HI_SPR?'y':'n', sprites_hi);
|
||||||
dstrp+=strlen(dstrp);
|
dstrp+=strlen(dstrp);
|
||||||
sprintf(dstrp, "display_disable: %i, M3: %i, palette: %i, ?, hints: %i\n", bit(r,0), bit(r,1), bit(r,2), bit(r,4));
|
sprintf(dstrp, "display_disable: %i, M3: %i, palette: %i, ?, hints: %i\n", bit(r,0), bit(r,1), bit(r,2), bit(r,4));
|
||||||
dstrp+=strlen(dstrp);
|
dstrp+=strlen(dstrp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue