hello,
I'm trying to program my own routine to get the cursor position.
Some days ago, I saw here a piece of code that does the same thing but in my OS I use two different registers for columns and rows.
What I need is the formula to do this (for example to move the cursor: newposition=column+row*80).
Thanks.
Get Cursor Position formula
Re:Get Cursor Position formula
Your OS is the only thing controlling the cursor, so it's OK to keep track of the cursor position in a couple of variables.
Re:Get Cursor Position formula
if you want to update the position of the cursor to (x,y) what you should do is this.
1) new_offset= (y*80) + x ;
2) update the position of the cursor with the new_offset.
HTH
1) new_offset= (y*80) + x ;
2) update the position of the cursor with the new_offset.
HTH
Only Human