+void CVideo::SetBufFormat(unsigned int FormatID)
+{
+ if( m_bufferFormat != FormatID )
+ {
+
+ struct ptymode mode = {.OutputMode = FormatID, .InputMode = 0};
+ int rv = _SysIOCtl( m_fd, PTY_IOCTL_SETMODE, &mode );
+ if( rv ) {
+ throw ::AxWin::InitFailure("Can't set PTY to framebuffer mode");
+ }
+
+ m_bufferFormat = FormatID;
+ }
+}
+
+void CVideo::SetCursorBitmap()
+{
+ // Set cursor position and bitmap
+ struct ptycmd_header hdr = {PTY2D_CMD_SETCURSORBMP,0,0};
+ size_t size = sizeof(hdr) + sizeof(cCursorBitmap) + cCursorBitmap.W*cCursorBitmap.H*4;
+ hdr.len_low = size / 4;
+ hdr.len_hi = size / (256*4);
+
+ SetBufFormat(PTYBUFFMT_2DCMD);
+ _SysWrite(m_fd, &hdr, sizeof(hdr));
+ _SysDebug("size = %i (%04x:%02x * 4)", size, hdr.len_hi, hdr.len_low);
+ _SysWrite(m_fd, &cCursorBitmap, size-sizeof(hdr));
+}
+
+void CVideo::SetCursorPos(int X, int Y)
+{
+ struct ptycmd_setcursorpos cmd;
+ cmd.hdr.cmd = PTY2D_CMD_SETCURSORPOS;
+ cmd.hdr.len_low = sizeof(cmd)/4;
+ cmd.hdr.len_hi = 0;
+ cmd.x = X;
+ cmd.y = Y;
+
+ SetBufFormat(PTYBUFFMT_2DCMD);
+ _SysWrite(m_fd, &cmd, sizeof(cmd));
+}