diff --git a/src/moteur.c b/src/moteur.c index dce8a77..3bfa2a1 100644 --- a/src/moteur.c +++ b/src/moteur.c @@ -180,6 +180,7 @@ inline void __attribute__((always_inline)) draw_stripe(image_t *tex, int texSamp : "=r" (oneConst) : "r" (oneConst) ); + register int maxConst asm("r13") = viewport_w*viewport_h; for(int texPos = texSampleY; texPos < 64; ++texPos){ if(screenPos >= -texSize){ int vrampos = ffloor(screenPos)*vramSize+x; @@ -189,6 +190,8 @@ inline void __attribute__((always_inline)) draw_stripe(image_t *tex, int texSamp gint_vram[vrampos] = pix; vrampos += vramSize; oldPos += oneConst; + if(vrampos >= maxConst) + return; }while(oldPos < screenPos+texSize); } screenPos += texSize; diff --git a/src/moteur.h b/src/moteur.h index 11b8303..ef01e34 100644 --- a/src/moteur.h +++ b/src/moteur.h @@ -10,7 +10,7 @@ #define screen_w 396 #define screen_h 224 #define viewport_w 396 -#define viewport_h 224 +#define viewport_h 200 #define max_dist fix(32) //en tuiles << 16, actuellement 32 #define TINDEX_S 256