tIPC_Client *b = *(tIPC_Client**)_b;
ASSERT(a);
- ASSERT(b);
+ if(!b) return -1;
if(a->IPCType < b->IPCType) return -1;
if(a->IPCType > b->IPCType) return 1;
while(div > 0)
{
div /= 2;
+ _SysDebug("Cmp with %i [%i] (%p)", pos, div, gIPC_Clients[pos]);
cmp = _CompareClientPtrs(&TargetClient, &gIPC_Clients[pos]);
// _SysDebug("Checking against %i gives %i", pos, cmp);
if(cmp == 0) break;
#include <stdint.h>
static struct {
- uint16_t W, H, OfsX, OfsY;
+ uint16_t W, H;
uint32_t Data[];
} cCursorBitmap = {
- 8, 16, 0, 0,
+ 8, 16,
{
0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
}
giScreenWidth = dims.PW;
giScreenHeight = dims.PH;
+ if( giScreenWidth < 640 || giScreenHeight < 480 ) {
+ Video_int_SetBufFmt(PTYBUFFMT_TEXT);
+ _SysDebug("Resoltion too small, 640x480 reqd but %ix%i avail",
+ giScreenWidth, giScreenHeight);
+ exit(-1);
+ }
_SysDebug("AxWin3 running at %ix%i", dims.PW, dims.PH);
giVideo_LastDirtyLine = giScreenHeight;
gpScreenBuffer = malloc( giScreenWidth*giScreenHeight*4 );
// Set cursor position and bitmap
- // TODO: This will require using the 2DCMD buffer format
- //_SysIOCtl(giTerminalFD, TERM_IOCTL_SETCURSORBITMAP, &cCursorBitmap);
+ {
+ Video_int_SetBufFmt(PTYBUFFMT_2DCMD);
+ 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);
+ _SysWrite(giTerminalFD, &hdr, sizeof(hdr));
+ _SysDebug("size = %i (%04x:%02x * 4)", size, hdr.len_hi, hdr.len_low);
+ _SysWrite(giTerminalFD, &cCursorBitmap, size-sizeof(hdr));
+ }
Video_SetCursorPos( giScreenWidth/2, giScreenHeight/2 );
}
void Video_SetCursorPos(short X, short Y)
{
struct ptycmd_setcursorpos cmd;
- cmd.cmd = PTY2D_CMD_SETCURSORPOS;
+ 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;