- struct {
- uint16_t x;
- uint16_t y;
- } pos;
- pos.x = giVideo_CursorX = X;
- pos.y = giVideo_CursorY = Y;
- ioctl(giTerminalFD, TERM_IOCTL_GETSETCURSOR, &pos);
+ struct ptycmd_setcursorpos cmd;
+ cmd.hdr.cmd = PTY2D_CMD_SETCURSORPOS;
+ cmd.hdr.len_low = sizeof(cmd)/4;
+ cmd.hdr.len_hi = 0;
+ cmd.x = giVideo_CursorX = X;
+ cmd.y = giVideo_CursorY = Y;
+
+ Video_int_SetBufFmt(PTYBUFFMT_2DCMD);
+ _SysWrite(giTerminalFD, &cmd, sizeof(cmd));
+}
+
+void Video_FillRect(int X, int Y, int W, int H, uint32_t Colour)
+{
+ uint32_t *dest;
+ int i;
+
+ if(X < 0 || Y < 0) return;
+ if(W >= giScreenWidth) return;
+ if(H >= giScreenHeight) return;
+ if(X + W >= giScreenWidth) W = giScreenWidth - W;
+ if(Y + H >= giScreenHeight) W = giScreenHeight - H;
+
+ dest = gpScreenBuffer + Y * giScreenWidth + X;
+ while(H --)
+ {
+ for( i = W; i --; dest ++ ) *dest = Colour;
+ dest += giScreenWidth - W;
+ }