X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fvideo.cpp;h=8d5f5dd287d73b80c37fddb249225c00d056227d;hb=145dd00e5c5a36f844be327e16a00b2983245423;hp=14fb76df252c4a801a907f3cf3efa8aa3f5ac909;hpb=47296e890b2b09cbc46db30d7fe2aeeae11a6d4a;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/video.cpp b/Usermode/Applications/axwin4_src/Server/video.cpp index 14fb76df..8d5f5dd2 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,21 @@ 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) { + //_SysDebug("CVideo::BlitLine (%p, %i, %i, %i)", src, dst_y, dst_x, width); + size_t cmdlen = sizeof(struct ptycmd_senddata)/4 + width; + //_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); + + //SetBufFormat(PTYBUFFMT_FB); //_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); + //_SysSeek(m_fd, (dst_y * m_width + dst_x) * 4, SEEK_SET); + //_SysWrite(m_fd, src, width * 4); } void CVideo::Flush() @@ -88,7 +103,7 @@ void CVideo::SetCursorBitmap() SetBufFormat(PTYBUFFMT_2DCMD); _SysWrite(m_fd, &hdr, sizeof(hdr)); - _SysDebug("size = %i (%04x:%02x * 4)", size, hdr.len_hi, hdr.len_low); + _SysDebug("SetCursorBitmap - size = %i (%04x:%02x * 4)", size, hdr.len_hi, hdr.len_low); _SysWrite(m_fd, &cCursorBitmap, size-sizeof(hdr)); }