shithub: riscv

Download patch

ref: 97e7b5f71dae2755e7391036e799b13cbee1b92a
parent: 41ef4524abb81254169a47898572547c0db5a666
author: cinap_lenrek <[email protected]>
date: Sat Nov 22 15:35:28 EST 2014

games/md: fix interlace at scale 2

--- a/sys/src/games/md/md.c
+++ b/sys/src/games/md/md.c
@@ -131,10 +131,11 @@
 void
 screenproc(void *)
 {
-	extern u8int pic[320*224*4*3];
+	extern u8int pic[320*224*4*4];
+	extern int intla;
 	Rectangle r;
 	uchar *s;
-	int w;
+	int w, h;
 
 	enum { AMOUSE, ARESIZE, AFLUSH, AEND };
 	Alt a[AEND+1] = {
@@ -159,10 +160,13 @@
 				s = pic;
 				r = picr;
 				w = 320*4*scale;
+				h = scale;
+				if(intla && (h & 1) == 0)
+					h >>= 1;
 				while(r.min.y < picr.max.y){
 					loadimage(tmp, tmp->r, s, w);
 					s += w;
-					r.max.y = r.min.y+scale;
+					r.max.y = r.min.y+h;
 					draw(screen, r, tmp, nil, ZP);
 					r.min.y = r.max.y;
 				}
--- a/sys/src/games/md/vdp.c
+++ b/sys/src/games/md/vdp.c
@@ -4,7 +4,7 @@
 #include "dat.h"
 #include "fns.h"
 
-u8int pic[320*224*4*3];
+u8int pic[320*224*4*4];
 u16int vdpstat = 0x3400;
 int vdpx, vdpy, vdpyy, frame, intla;
 u16int hctr;