Text Mode Cursor: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Rod (talk | contribs)
m →‎Without the BIOS: Add code to get the cursor position.
Rod (talk | contribs)
Line 163: Line 163:
===Get Cursor Data===
===Get Cursor Data===


With this code, you get: <tt>pos = y * VGA_WIDTH + x</tt>. To obtain the coordinates, just calculate: <tt>y = pos/VGA_WIDTH; x = pos%VGA_WIDTH</tt>.
With this code, you get: <tt>pos = y * VGA_WIDTH + x</tt>. To obtain the coordinates, just calculate: <tt>y = pos / VGA_WIDTH; x = pos % VGA_WIDTH</tt>.


'''Source in C'''
'''Source in C'''