home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / utility / mclock / clutil.s < prev    next >
Encoding:
Text File  |  1993-10-22  |  2.5 KB  |  95 lines

  1.  
  2. ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  3. ; Emulate the VT-52 "glass terminal" emulator, without using Line A calls
  4. ; to try to make it faster.
  5. ; This is a stripped down version of the "real" vt52.s, and it is used
  6. ; so that one doesn't have to call Line A from a VBLANK interrupt
  7. ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
  8.  
  9. .include "atari.s"
  10. .include "linea.s"
  11.  
  12. ESC = 27
  13. TRUE = 1
  14. FALSE = 0
  15.  
  16. linewidth = 80  ; Width of one line (in bytes)
  17. linelast = linewidth - 1    ; Width of line - 1
  18. scr_size = 32000    ; Size of screen
  19.  
  20. bios_vec = $B4
  21. ; +++++++++++++++++++++
  22. .macro Conout c
  23.     move.w  \c, -(sp)
  24.     bsr     conout
  25.     addq.l  #2, sp
  26. .endm
  27.  
  28.  
  29.     .bss
  30.  
  31. _curpos::       ds.w 1  ; Curent offset (from Logbase) of cursor
  32. linea:      ds.l 1  ; Line A master variable pointer
  33.     .text
  34.  
  35. ; ****************************************************
  36. _init_vt::
  37. init_vt::
  38.     A_init
  39.     move.l  a0, linea
  40.     move.l  #0, _curpos         ; Init cursor position
  41.     move.w  #FALSE, WMODE(a0)   ; Init wrap mode
  42.  
  43.     rts
  44.  
  45. ; ****************************************************
  46. putc:   ; Puts a character.  Arguments:
  47. ; A0: Line A variable pointer
  48. ; A3: Screen pointer
  49. ; d1.w: offset into screen of where to put character
  50. ; d0.w: character to put
  51. ; Destroys d6, d7, a2, a4
  52.  
  53.     lea     0(a3, d1), a4       ; Address to blit char to
  54.     sub.w   V_FONT_ST(a0), d0   ; character offset in font data
  55.     move.l  V_FONT_AD(a0), a2   ; Address of font form
  56.     ext.l   d0
  57.     add.l   d0, a2              ; Address of character in font
  58.  
  59.     move.w  V_CEL_HT(a0), d7    ; # times to go around loop
  60.     subq.w  #1, d7
  61.     move.w  V_FONT_WD(a0), d6   ; amount to add each time around
  62.     ext.l   d6
  63.  
  64. .l1:                            ; Blit the character
  65.     move.b  (a2), (a4)
  66.     lea     linewidth(a4), a4
  67.     add.l   d6, a2
  68.     dbra    d7, .l1
  69.  
  70.     rts
  71. ; ****************************************
  72. _conout::
  73. conout:: .cargs .c.w    ; Interprets and Outputs a character
  74. ; Register usage:
  75. ; a0: Line A structure
  76. ; a3: Screen base
  77. ; a1, a2: temporary
  78.     move.w  .c(sp), d0
  79. _hoihoi::
  80.     movem.l d1/d6/d7/a0/a1/a2/a3/a4, -(sp)
  81.     move.l  _v_bas_ad, a3
  82.  
  83.     move.l  linea, a0
  84.  
  85.     move.w  _curpos, d1     ; Output the character
  86.     bsr     putc
  87.  
  88.     addq.w  #1, d1          ; Move cursor
  89.     move.w  d1, _curpos
  90.  
  91.     movem.l (sp)+, d1/d6/d7/a0/a1/a2/a3/a4
  92.     rts
  93. ; **************
  94.  
  95.