/* * getpixel (bgi256) — цвет пикселя (x,y), mode 0x81. Полностью inline * (bounds + W3-скобка + чтение пикселя), без вызовов _bgi_read/raw. * Возвращает 0 вне экрана. */ #include "../_bgi.h" static uint8_t _gp_y; static uint16_t _gp_addr; static uint8_t _gp_color; color_t getpixel(int x, int y) { #ifndef GFX_NOCHECK if ((unsigned)x >= GFX_WIDTH || (unsigned)y >= GFX_HEIGHT) return 0; #endif _bgi_begin(); register uint8_t _gp_color = _bgi_read_raw(x, y); _bgi_end(); return _gp_color; }