notaz.gp2x.de
/
picodrive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d0eab7d
)
draw.c, DrawLayer(): impl. proper linescroll, fixes issue #56
author
dinkc64
<terra79pin@yahoo.com>
Fri, 13 Mar 2020 23:26:09 +0000
(19:26 -0400)
committer
dinkc64
<terra79pin@yahoo.com>
Fri, 13 Mar 2020 23:26:09 +0000
(19:26 -0400)
pico/draw.c
patch
|
blob
|
blame
|
history
diff --git
a/pico/draw.c
b/pico/draw.c
index
680de3d
..
e5287b4
100644
(file)
--- a/
pico/draw.c
+++ b/
pico/draw.c
@@
-411,6
+411,7
@@
static void DrawLayer(int plane_sh, int *hcache, int cellskip, int maxcells,
{
\r
struct PicoVideo *pvid=&Pico.video;
\r
const char shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid)
\r
{
\r
struct PicoVideo *pvid=&Pico.video;
\r
const char shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid)
\r
+ const unsigned char h_masks[4] = { 0x00, 0x07, 0xf8, 0xff };
\r
struct TileStrip ts;
\r
int width, height, ymask;
\r
int vscroll, htab;
\r
struct TileStrip ts;
\r
int width, height, ymask;
\r
int vscroll, htab;
\r
@@
-437,8
+438,7
@@
static void DrawLayer(int plane_sh, int *hcache, int cellskip, int maxcells,
else ts.nametab=(pvid->reg[2]&0x38)<< 9; // A
\r
\r
htab=pvid->reg[13]<<9; // Horizontal scroll table address
\r
else ts.nametab=(pvid->reg[2]&0x38)<< 9; // A
\r
\r
htab=pvid->reg[13]<<9; // Horizontal scroll table address
\r
- if ( pvid->reg[11]&2) htab+=est->DrawScanline<<1; // Offset by line
\r
- if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile
\r
+ htab+=(est->DrawScanline&h_masks[pvid->reg[11]&3])<<1; // Point to line (masked)
\r
htab+=plane_sh&1; // A or B
\r
\r
// Get horizontal scroll value, will be masked later
\r
htab+=plane_sh&1; // A or B
\r
\r
// Get horizontal scroll value, will be masked later
\r