X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fvideo.cpp;h=50686c61be17f5e1d7b22b31a5ea8206c1b2ddf8;hb=4d0188930e7d0e571db78d1d2e3c4d9b3f0fe8fb;hp=d2eb26a919638b3fc1610d2d492f3497a6405ad4;hpb=0868c6e02b76236ea70a6daa232b3c373f61e131;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/video.cpp b/Usermode/Applications/axwin4_src/Server/video.cpp index d2eb26a9..50686c61 100644 --- a/Usermode/Applications/axwin4_src/Server/video.cpp +++ b/Usermode/Applications/axwin4_src/Server/video.cpp @@ -37,11 +37,15 @@ CVideo::CVideo(const CConfigVideo& config): throw AxWin::InitFailure("Terminal not capable of graphics"); } + _SysDebug("m_width=%i, m_height=%i", m_width, m_height); SetCursorBitmap(); SetCursorPos( m_width/2, m_height/2 ); SetBufFormat(PTYBUFFMT_FB); + uint32_t data[m_width]; + for( unsigned int i = 0; i < m_height; i ++ ) + BlitLine(data, i, 0, m_width); } void CVideo::GetDims(unsigned int& w, unsigned int& h) @@ -52,10 +56,17 @@ void CVideo::GetDims(unsigned int& w, unsigned int& h) void CVideo::BlitLine(const uint32_t* src, unsigned int dst_y, unsigned int dst_x, unsigned int width) { - //_SysWriteAt(m_fd, (dst_y * m_width + dst_x) * 4, width * 4, src); - SetBufFormat(PTYBUFFMT_FB); - _SysSeek(m_fd, (dst_y * m_width + dst_x) * 4, SEEK_SET); - _SysWrite(m_fd, src, width * 4); + //_SysDebug("CVideo::BlitLine (%p, %i, %i, %i)", src, dst_y, dst_x, width); + //_SysDebugHex("CVideo::BlitLine", src, width*4); + size_t cmdlen = (sizeof(struct ptycmd_senddata) + width*4)/4; + //_SysDebug(" - Offset = %i, cmdlen = %i", (dst_y * m_width + dst_x) * 4, cmdlen); + struct ptycmd_senddata cmd = { + {PTY2D_CMD_SEND, uint8_t(cmdlen & 0xFF), uint16_t(cmdlen>>8)}, + (dst_y * m_width + dst_x) + }; + SetBufFormat(PTYBUFFMT_2DCMD); + _SysWrite(m_fd, &cmd, sizeof(cmd)); + _SysWrite(m_fd, src, width*4); } void CVideo::Flush()