notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
amalgamation
[picodrive.git]
/
Pico
/
Draw.c
diff --git
a/Pico/Draw.c
b/Pico/Draw.c
index
2eed289
..
051b16d
100644
(file)
--- a/
Pico/Draw.c
+++ b/
Pico/Draw.c
@@
-34,7
+34,7
@@
static int SpriteBlocks;
struct TileStrip
\r
{
\r
int nametab; // Position in VRAM of name table (for this tile line)
\r
struct TileStrip
\r
{
\r
int nametab; // Position in VRAM of name table (for this tile line)
\r
- int line; // Line number in pixels 0x000-0x3ff within the virtual tilemap
\r
+ int line; // Line number in pixels 0x000-0x3ff within the virtual tilemap
\r
int hscroll; // Horizontal scroll value in pixels for the line
\r
int xmask; // X-Mask (0x1f - 0x7f) for horizontal wraparound in the tilemap
\r
int *hc; // cache for high tile codes and their positions
\r
int hscroll; // Horizontal scroll value in pixels for the line
\r
int xmask; // X-Mask (0x1f - 0x7f) for horizontal wraparound in the tilemap
\r
int *hc; // cache for high tile codes and their positions
\r
@@
-317,12
+317,8
@@
static void DrawStrip(struct TileStrip *ts, int sh)
// terminate the cache list
\r
*ts->hc = 0;
\r
}
\r
// terminate the cache list
\r
*ts->hc = 0;
\r
}
\r
-#endif
\r
\r
// this is messy
\r
\r
// this is messy
\r
-#ifndef _ASM_DRAW_C
\r
-static
\r
-#endif
\r
void DrawStripVSRam(struct TileStrip *ts, int plane)
\r
{
\r
int tilex=0,dx=0,ty=0,code=0,addr=0,cell=0,nametabadd=0;
\r
void DrawStripVSRam(struct TileStrip *ts, int plane)
\r
{
\r
int tilex=0,dx=0,ty=0,code=0,addr=0,cell=0,nametabadd=0;
\r
@@
-386,6
+382,7
@@
void DrawStripVSRam(struct TileStrip *ts, int plane)
// terminate the cache list
\r
*ts->hc = 0;
\r
}
\r
// terminate the cache list
\r
*ts->hc = 0;
\r
}
\r
+#endif
\r
\r
#ifndef _ASM_DRAW_C
\r
static
\r
\r
#ifndef _ASM_DRAW_C
\r
static
\r
@@
-921,13
+918,13
@@
static void PrepareSprites(int full)
height = (hv&3)+1;
\r
\r
if(sy > 240 || sy + (height<<3) <= 0) skip|=1<<22;
\r
height = (hv&3)+1;
\r
\r
if(sy > 240 || sy + (height<<3) <= 0) skip|=1<<22;
\r
-
\r
+
\r
width = (hv>>2)+1;
\r
code2 = sprite[1];
\r
sx = (code2>>16)&0x1ff;
\r
sx -= 0x78; // Get X coordinate + 8
\r
sx_min = 8-(width<<3);
\r
width = (hv>>2)+1;
\r
code2 = sprite[1];
\r
sx = (code2>>16)&0x1ff;
\r
sx -= 0x78; // Get X coordinate + 8
\r
sx_min = 8-(width<<3);
\r
-
\r
+
\r
if((sx <= sx_min && sx >= -0x76) || sx >= 328) skip|=1<<23;
\r
else if (sx > sx_min && !skip) {
\r
int sbl = (2<<height)-1;
\r
if((sx <= sx_min && sx >= -0x76) || sx >= 328) skip|=1<<23;
\r
else if (sx > sx_min && !skip) {
\r
int sbl = (2<<height)-1;
\r
@@
-935,10
+932,10
@@
static void PrepareSprites(int full)
if(shi < 0) shi=0; // negative sy
\r
sblocks |= sbl<<shi;
\r
}
\r
if(shi < 0) shi=0; // negative sy
\r
sblocks |= sbl<<shi;
\r
}
\r
-
\r
+
\r
*pd++ = (width<<28)|(height<<24)|skip|(hv<<16)|((unsigned short)sy);
\r
*pd++ = (sx<<16)|((unsigned short)code2);
\r
*pd++ = (width<<28)|(height<<24)|skip|(hv<<16)|((unsigned short)sy);
\r
*pd++ = (sx<<16)|((unsigned short)code2);
\r
-
\r
+
\r
// Find next sprite
\r
link=(code>>16)&0x7f;
\r
if(!link) break; // End of sprites
\r
// Find next sprite
\r
link=(code>>16)&0x7f;
\r
if(!link) break; // End of sprites
\r
@@
-1205,7
+1202,7
@@
static int DrawDisplay(int sh)
if (win&0x80) { if (Scanline>=edge) hvwind=1; }
\r
else { if (Scanline< edge) hvwind=1; }
\r
\r
if (win&0x80) { if (Scanline>=edge) hvwind=1; }
\r
else { if (Scanline< edge) hvwind=1; }
\r
\r
- if(!hvwind) { // we might have a vertical window here
\r
+ if(!hvwind) { // we might have a vertical window here
\r
win=pvid->reg[0x11];
\r
edge=win&0x1f;
\r
if(win&0x80) {
\r
win=pvid->reg[0x11];
\r
edge=win&0x1f;
\r
if(win&0x80) {
\r
@@
-1245,7
+1242,7
@@
static int DrawDisplay(int sh)
\r
static int Skip=0;
\r
\r
\r
static int Skip=0;
\r
\r
-
void PicoFrameStart(
)
\r
+
PICO_INTERNAL void PicoFrameStart(void
)
\r
{
\r
// prepare to do this frame
\r
rendstatus = (PicoOpt&0x80)>>5; // accurate sprites
\r
{
\r
// prepare to do this frame
\r
rendstatus = (PicoOpt&0x80)>>5; // accurate sprites
\r
@@
-1259,7
+1256,7
@@
void PicoFrameStart()
Skip=0;
\r
}
\r
\r
Skip=0;
\r
}
\r
\r
-int PicoLine(int scan)
\r
+
PICO_INTERNAL
int PicoLine(int scan)
\r
{
\r
int sh;
\r
if (Skip>0) { Skip--; return 0; } // Skip rendering lines
\r
{
\r
int sh;
\r
if (Skip>0) { Skip--; return 0; } // Skip rendering lines
\r