I successfully applied bounds to check whether the cursor is at the edge of the screen or not. This is borrowed from Brian L. Stuart's implementation on vgabase.c. I'm using 9front's implementation on swcursor.c.
𝚟𝚘𝚒𝚍
𝚜𝚠𝚌𝚞𝚛𝚜𝚘𝚛𝚍𝚛𝚊𝚠(𝙿𝚘𝚒𝚗𝚝 𝚙)
{
...
𝚒𝚏(𝚙.𝚡 < 0)
𝚙.𝚡 = 0;
𝚎𝚕𝚜𝚎 𝚒𝚏(𝚙.𝚡 >= 𝚐𝚜𝚌𝚛𝚎𝚎𝚗->𝚛.𝚖𝚊𝚡.𝚡 - 𝟷)
𝚙.𝚡 = 𝚐𝚜𝚌𝚛𝚎𝚎𝚗->𝚛.𝚖𝚊𝚡.𝚡 - 𝟸;
𝚒𝚏(𝚙.𝚢 < 0)
𝚙.𝚢 = 0;
𝚎𝚕𝚜𝚎 𝚒𝚏(𝚙.𝚢 >= 𝚐𝚜𝚌𝚛𝚎𝚎𝚗->𝚛.𝚖𝚊𝚡.𝚢 - 𝟷)
𝚙.𝚢 = 𝚐𝚜𝚌𝚛𝚎𝚎𝚗->𝚛.𝚖𝚊𝚡.𝚢 - 𝟸;
𝚖𝚘𝚞𝚜𝚎𝚝𝚛𝚊𝚌𝚔(0, 𝚙.𝚡, 𝚙.𝚢, 0);
...
}
However, the cursor movement is botching. Odd enough, this only happens when the window manager or a graphical app is loaded. The cursor isn't vanishing, but the movement is broken.
As you can see from the sent recording, I'm presented a graphical terminal, and the cursor is working fine from there.