cursor.asm 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. ; $Id$
  2. ; MegaZeux
  3. ;
  4. ; Copyright (C) 1996 Greg Janson
  5. ; Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6. ;
  7. ; This program is free software; you can redistribute it and/or
  8. ; modify it under the terms of the GNU General Public License as
  9. ; published by the Free Software Foundation; either version 2 of
  10. ; the License, or (at your option) any later version.
  11. ;
  12. ; This program is distributed in the hope that it will be useful,
  13. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. ; General Public License for more details.
  16. ;
  17. ; You should have received a copy of the GNU General Public License
  18. ; along with this program; if not, write to the Free Software
  19. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ;
  21. ; CURSOR.ASM- Functions to change the cursor's shape and position.
  22. ;
  23. Ideal
  24. include "cursor.inc"
  25. p186
  26. JUMPS
  27. include "model.inc"
  28. Codeseg
  29. cursor_mode db CURSOR_UNDERL
  30. ;
  31. ; Function- cursor_underline
  32. ;
  33. ; Activate traditional underline cursor.
  34. ;
  35. proc cursor_underline far
  36. pusha
  37. mov cx,12+11*256
  38. mov ax,0103h
  39. int 10h
  40. mov [cursor_mode],CURSOR_UNDERL
  41. popa
  42. ret
  43. endp cursor_underline
  44. ;
  45. ; Function- cursor_solid
  46. ;
  47. ; Activate solid cursor for editing.
  48. ;
  49. proc cursor_solid far
  50. pusha
  51. mov cx,13+0*256
  52. mov ax,0103h
  53. int 10h
  54. mov [cursor_mode],CURSOR_BLOCK
  55. popa
  56. ret
  57. endp cursor_solid
  58. ;
  59. ; Function- cursor_off
  60. ;
  61. ; Turns cursor off.
  62. ;
  63. proc cursor_off far
  64. pusha
  65. mov cx,0+31*256
  66. mov ax,0103h
  67. int 10h
  68. mov [cursor_mode],CURSOR_INVIS
  69. popa
  70. ret
  71. endp cursor_off
  72. ;
  73. ; Funciton- move_cursor
  74. ;
  75. ; Position cursor on all four pages.
  76. ;
  77. ; Arguments: x position (word)
  78. ; y position (word)
  79. ;
  80. proc move_cursor far
  81. arg x_pos:word,y_pos:word
  82. pusha
  83. mov ax,0203h ; Service 2 of int 10h (al=3 for video mode)
  84. mov dx,[x_pos] ; column in dl.
  85. mov bx,[y_pos] ; Row in dh.
  86. mov dh,bl
  87. xor bx,bx ; Page 0
  88. push ax bx dx
  89. int 10h ; Call BIOS int
  90. pop dx bx ax
  91. inc bh ; Do for pages 1, 2, and 3
  92. push ax bx dx
  93. int 10h
  94. pop dx bx ax
  95. inc bh
  96. push ax bx dx
  97. int 10h
  98. pop dx bx ax
  99. inc bh
  100. int 10h
  101. popa
  102. ret
  103. endp move_cursor
  104. ends
  105. end