src/libxpeccy/video.c
// tsconf normal screen (separated 'cuz of palette)
tsconf normal screen (separated 'cuz of palette)
tsconf normal screen ( separated ' cuz of palette )
void vidDrawTSLNormal(Video* vid) {
	xscr = vid->x - vid->tsconf.xPos;
	yscr = vid->y - vid->tsconf.yPos;
	if ((yscr < 0) || (yscr > 191) || (vid->nogfx)) {
		col = vid->brdcol;
	} else {
		xadr = vid->tsconf.vidPage ^ (vid->curscr & 2);	
		if ((xscr & 7) == 4) {
			adr = ((yscr & 0xc0) << 5) | ((yscr & 7) << 8) | ((yscr & 0x38) << 2) | (((xscr + 4) & 0xf8) >> 3);
			nxtbyte = vid->mem->ram[xadr].data[adr];
		}
		if ((xscr < 0) || (xscr > 255)) {
			col = vid->brdcol;
		} else {
			if ((xscr & 7) == 0) {
				scrbyte = nxtbyte;
				adr = 0x1800 | ((yscr & 0xc0) << 2) | ((yscr & 0x38) << 2) | (((xscr + 4) & 0xf8) >> 3);
				vid->atrbyte = vid->mem->ram[xadr].data[adr];
				if ((vid->atrbyte & 0x80) && vid->flash) scrbyte ^= 0xff;
				ink = inkTab[vid->atrbyte & 0x7f];
				pap = papTab[vid->atrbyte & 0x7f];
			}
			col = vid->tsconf.scrPal | ((scrbyte & 0x80) ? ink : pap);
			scrbyte <<= 1;
		}
	}
	vidPutDot(vid,col);
}
void vidDrawTSLNormal ( Video * vid ) { xscr = vid -> x - vid -> tsconf . xPos ; yscr = vid -> y - vid -> tsconf . yPos ; if ( ( yscr < 0 ) || ( yscr > 191 ) || ( vid -> nogfx ) ) { col = vid -> brdcol ; } else { xadr = vid -> tsconf . vidPage ^ ( vid -> curscr & 2 ) ; if ( ( xscr & 7 ) == 4 ) { adr = ( ( yscr & 0xc0 ) << 5 ) | ( ( yscr & 7 ) << 8 ) | ( ( yscr & 0x38 ) << 2 ) | ( ( ( xscr + 4 ) & 0xf8 ) >> 3 ) ; nxtbyte = vid -> mem -> ram [ xadr ] . data [ adr ] ; } if ( ( xscr < 0 ) || ( xscr > 255 ) ) { col = vid -> brdcol ; } else { if ( ( xscr & 7 ) == 0 ) { scrbyte = nxtbyte ; adr = 0x1800 | ( ( yscr & 0xc0 ) << 2 ) | ( ( yscr & 0x38 ) << 2 ) | ( ( ( xscr + 4 ) & 0xf8 ) >> 3 ) ; vid -> atrbyte = vid -> mem -> ram [ xadr ] . data [ adr ] ; if ( ( vid -> atrbyte & 0x80 ) && vid -> flash ) scrbyte ^= 0xff ; ink = inkTab [ vid -> atrbyte & 0x7f ] ; pap = papTab [ vid -> atrbyte & 0x7f ] ; } col = vid -> tsconf . scrPal | ( ( scrbyte & 0x80 ) ? ink : pap ) ; scrbyte <<= 1 ; } } vidPutDot ( vid , col ) ; }
tsconf normal screen (separated 'cuz of palette)
tsconf normal screen ( separated ' cuz of palette )
// TODO : ORLY? Current video page //	*(vid->scrptr++) =  col; //	if (vidFlag & VF_DOUBLE) *(vid->scrptr++) = col;