src/bbcvdu.c
// Output a character with a logical plotting mode
Output a character with a logical plotting mode
Output a character with a logical plotting mode
static void charout_logic (short ax, short fg, int cx, int cy, int dx)
{
	int pitch, c, x, y ;
	int *p ;
	SDL_Rect rect = {0, 0, dx, chary} ;
	SDL_Texture *tex = SDL_GetRenderTarget (memhdc) ;
	SDL_Texture *src = SDL_CreateTexture (memhdc, SDL_PIXELFORMAT_ABGR8888,
				SDL_TEXTUREACCESS_STREAMING, dx, chary) ;
	SDL_SetRenderTarget (memhdc, NULL) ;
	SDL_SetRenderDrawColor (memhdc, 0, 0, 0, 0xFF) ;
	SDL_RenderFillRect (memhdc, &rect) ;
	charout (ax, 0xFF, 0xFF, 0, 0, dx) ;
	SDL_LockTexture (src, NULL, (void **) &p, &pitch) ;
	SDL_RenderReadPixels (memhdc, &rect, SDL_PIXELFORMAT_ABGR8888, p, pitch) ;
	SDL_SetRenderTarget (memhdc, tex) ;
	BBC_RenderSetClipRect (memhdc, hrect) ;
	glEnableBBC (GL_COLOR_LOGIC_OP) ;
	glLogicOpBBC (0x1500 + (fg & 0xFF)) ;
	setcol (fg >> 8) ;
	for (y = cy; y < (cy + chary); y++)
		for (x = cx; x < (cx + dx); x++)
		{
			c = *p++ ;
			if (c & 0x8000)
				SDL_RenderDrawPoint(memhdc, x, y) ;
		}
	glDisableBBC (GL_COLOR_LOGIC_OP) ;
	SDL_UnlockTexture (src) ;
	SDL_DestroyTexture (src) ;
}
static void charout_logic ( short ax , short fg , int cx , int cy , int dx ) { int pitch , c , x , y ; int * p ; SDL_Rect rect = { 0 , 0 , dx , chary } ; SDL_Texture * tex = SDL_GetRenderTarget ( memhdc ) ; SDL_Texture * src = SDL_CreateTexture ( memhdc , SDL_PIXELFORMAT_ABGR8888 , SDL_TEXTUREACCESS_STREAMING , dx , chary ) ; SDL_SetRenderTarget ( memhdc , NULL ) ; SDL_SetRenderDrawColor ( memhdc , 0 , 0 , 0 , 0xFF ) ; SDL_RenderFillRect ( memhdc , & rect ) ; charout ( ax , 0xFF , 0xFF , 0 , 0 , dx ) ; SDL_LockTexture ( src , NULL , ( void * * ) & p , & pitch ) ; SDL_RenderReadPixels ( memhdc , & rect , SDL_PIXELFORMAT_ABGR8888 , p , pitch ) ; SDL_SetRenderTarget ( memhdc , tex ) ; BBC_RenderSetClipRect ( memhdc , hrect ) ; glEnableBBC ( GL_COLOR_LOGIC_OP ) ; glLogicOpBBC ( 0x1500 + ( fg & 0xFF ) ) ; setcol ( fg >> 8 ) ; for ( y = cy ; y < ( cy + chary ) ; y ++ ) for ( x = cx ; x < ( cx + dx ) ; x ++ ) { c = * p ++ ; if ( c & 0x8000 ) SDL_RenderDrawPoint ( memhdc , x , y ) ; } glDisableBBC ( GL_COLOR_LOGIC_OP ) ; SDL_UnlockTexture ( src ) ; SDL_DestroyTexture ( src ) ; }
Output a character with a logical plotting mode
Output a character with a logical plotting mode