mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
vdp sprite rendering fixes
This commit is contained in:
parent
93f41f8e16
commit
ea431e9ebb
2 changed files with 7 additions and 9 deletions
14
pico/draw.c
14
pico/draw.c
|
@ -333,7 +333,7 @@ static void DrawStripVSRam(struct TileStrip *ts, int plane_sh, int cellskip)
|
||||||
}
|
}
|
||||||
|
|
||||||
code=PicoMem.vram[ts->nametab+nametabadd+(tilex&ts->xmask)];
|
code=PicoMem.vram[ts->nametab+nametabadd+(tilex&ts->xmask)];
|
||||||
if (code==blank) continue;
|
if ((code<<16|ty)==blank) continue;
|
||||||
if (code>>15) { // high priority tile
|
if (code>>15) { // high priority tile
|
||||||
int cval = code | (dx<<16) | (ty<<25);
|
int cval = code | (dx<<16) | (ty<<25);
|
||||||
if(code&0x1000) cval^=7<<26;
|
if(code&0x1000) cval^=7<<26;
|
||||||
|
@ -353,7 +353,7 @@ static void DrawStripVSRam(struct TileStrip *ts, int plane_sh, int cellskip)
|
||||||
pack = *(unsigned int *)(PicoMem.vram + addr+ty);
|
pack = *(unsigned int *)(PicoMem.vram + addr+ty);
|
||||||
|
|
||||||
if (!pack) {
|
if (!pack) {
|
||||||
blank = code;
|
blank = code<<16|ty;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ static void DrawTilesFromCache(int *hc, int sh, int rlim, struct PicoEState *est
|
||||||
{
|
{
|
||||||
int blank=-1; // The tile we know is blank
|
int blank=-1; // The tile we know is blank
|
||||||
while ((code=*hc++)) {
|
while ((code=*hc++)) {
|
||||||
if (!(code & 0x8000) || (unsigned short)code == blank)
|
if ((code<<16|code>>25) == blank)
|
||||||
continue;
|
continue;
|
||||||
// Get tile address/2:
|
// Get tile address/2:
|
||||||
addr = (code & 0x7ff) << 4;
|
addr = (code & 0x7ff) << 4;
|
||||||
|
@ -646,7 +646,7 @@ static void DrawTilesFromCache(int *hc, int sh, int rlim, struct PicoEState *est
|
||||||
|
|
||||||
pack = *(unsigned int *)(PicoMem.vram + addr);
|
pack = *(unsigned int *)(PicoMem.vram + addr);
|
||||||
if (!pack) {
|
if (!pack) {
|
||||||
blank = (unsigned short)code;
|
blank = code<<16|code>>25;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1026,7 +1026,8 @@ static void DrawSpritesHiAS(unsigned char *sprited, int sh)
|
||||||
delta<<=4; // Delta of address
|
delta<<=4; // Delta of address
|
||||||
|
|
||||||
if (entry+1 == cnt) width = p[entry+1]; // last sprite width limited?
|
if (entry+1 == cnt) width = p[entry+1]; // last sprite width limited?
|
||||||
for (; width; width--,sx+=8,tile+=delta)
|
mp = mb+(sx>>3);
|
||||||
|
for (m = *mp << 8; width; width--, sx+=8, *mp++ = m, tile+=delta)
|
||||||
{
|
{
|
||||||
unsigned int pack;
|
unsigned int pack;
|
||||||
|
|
||||||
|
@ -1090,8 +1091,7 @@ static void DrawSpritesForced(unsigned char *sprited)
|
||||||
delta<<=4; // Delta of address
|
delta<<=4; // Delta of address
|
||||||
|
|
||||||
if (entry+1 == cnt) width = p[entry+1]; // last sprite width limited?
|
if (entry+1 == cnt) width = p[entry+1]; // last sprite width limited?
|
||||||
mp = mb+(sx>>3);
|
for (; width; width--,sx+=8,tile+=delta)
|
||||||
for (m = *mp << 8; width; width--, sx+=8, *mp++ = m, tile+=delta)
|
|
||||||
{
|
{
|
||||||
unsigned int pack;
|
unsigned int pack;
|
||||||
|
|
||||||
|
|
|
@ -796,8 +796,6 @@ DrawTilesFromCache:
|
||||||
bic r4, r1, #0xfe00
|
bic r4, r1, #0xfe00
|
||||||
add r1, r11, r4 @ r1=pdest
|
add r1, r11, r4 @ r1=pdest
|
||||||
|
|
||||||
movs r7, r6, lsl #16
|
|
||||||
bpl .dtfc_loop @ !(code & 0x8000)
|
|
||||||
cmp r5, r7, lsr #16
|
cmp r5, r7, lsr #16
|
||||||
beq .dtfc_samecode @ if (code==prevcode)
|
beq .dtfc_samecode @ if (code==prevcode)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue