home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol142 / pacman.asm < prev    next >
Encoding:
Assembly Source File  |  1984-04-29  |  3.4 KB  |  136 lines

  1. ; *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*
  2. ; *+ Version 1 -  SCREEN.CNT (Screen Control File) for PACMAN.COM/.DAT +*
  3. ; *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*
  4. ;
  5. ;       Warning -> PACMAN.COM is for Z80 CPUs ONLY <- Warning
  6. ;
  7. ;   October 2, 1982 - Kelly Smith, CP/M-Net SYSOP, (805) 527-9321  
  8. ;
  9. ; Hah, Fooled you didn't I(?).  Bet you thought this was going to be 
  10. ; assembly language source for PACMAN...  Sorry, but this is a file 
  11. ; to  be  used  as the SCREEN CONTROL file for the  PACMAN.COM  and 
  12. ; PACMAN.DAT  files.   The  original files from FOG (First  Osborne 
  13. ; User's  Group) included a bunch of object code '.CNT' files  that 
  14. ; you  were  supposed to rename to SCREEN.CNT for  your  particular 
  15. ; terminal/computer  type...  I thought we might get more "mileage" 
  16. ; out  of the program if I set-up one source program that could  be 
  17. ; modified  to  suit  ANYONEs  needs.    Choose  your  'true/false' 
  18. ; terminal  parameter  switch...set to TRUE (and ONLY  ONE  may  be 
  19. ; TRUE), rename to 'SCREEN.CNT', assemble, load, and run PACMAN.COM
  20. ; (and note, that all files must be on the same 'logged-in' disk).
  21. ; This PACMAN program has a larger maze than the PACMAN95.COM  that 
  22. ; has appeared on many RCPM systems...it's also a little bit easier 
  23. ; (i. e.,  slower) to play.  I have verified it's operation on both 
  24. ; the  Osborne I (be sure and run SETUP to turn the AUTO SCROLL  to 
  25. ; OFF)  and the KAYPRO II computers,  and it really works nice with 
  26. ; the cursor arrow keys (a particular challenge with the 52  column 
  27. ; wide screen display of the Osborne I computer).
  28. ; Please  feel  free to add YOUR favorite flavor of terminal  CLEAR 
  29. ; SCREEN  and CURSOR POSITION command to this program...and  'bump' 
  30. ; the version number,  add your name and date,  so we can all  keep 
  31. ; track of the changes.   Send any updates to either my RCPM (CP/M-
  32. ; Net,  (805) 527-9321) or Trevor Marshall's (Technical RCPM, (805) 
  33. ; 492-5472)...Thanks
  34. ;
  35. ;
  36. ;
  37. true        equ    -1    ; define true
  38. false        equ    not true; define false
  39. ;
  40. adm3        equ    true    ; Televideo 950/ADM-3/Osborne I/Kaypro II
  41. vt52        equ    false    ; DEC VT52
  42. hazel        equ    false    ; Hazeltine
  43. ;
  44. bdos        equ    5    ; CP/M-80 BDOS entry address
  45. tpa        equ    0100h    ; standard origin for CP/M-80
  46. ;
  47. ;
  48. ;
  49.     org    tpa
  50. ;
  51. ; clear screen subroutine
  52. ;
  53.     if    adm3
  54.     mvi    e,'Z'-40h    ; clear screen
  55.     endif
  56.  
  57.     if    vt52
  58.     mvi    e,'['-40h
  59.     mvi    c,6
  60.     call    bdos
  61.     mvi    e,'H'
  62.     mvi    c,6
  63.     call    bdos
  64.     mvi    e,'['-40h
  65.     mvi    c,6
  66.     call    bdos
  67.     mvi    e,'J'
  68.     endif
  69.  
  70.     if    hazel
  71.     mvi    e,'~'
  72.     mvi    c,6
  73.     call    bdos
  74.     mvi    e,'\'-40h
  75.     endif
  76.  
  77.     mvi    c,6
  78.     call    bdos
  79.     ret            ; return from clear screen routine
  80. ;
  81. ;
  82. ;
  83.     org    tpa+40h        ; leave plenty of room for clear screen
  84. ;
  85. ; cursor addressing subroutine
  86. ;
  87.     push    h        ; save column and line co-ordinate pointers
  88.     push    d
  89.  
  90.     if    adm3
  91.     mvi    e,'['-40h    ; send first leadin character
  92.     mvi    c,6
  93.     call    bdos
  94.     mvi    e,'='        ; send second leadin character
  95.     endif
  96.  
  97.     if    vt52
  98.     mvi    e,'['-40h
  99.     mvi    c,6
  100.     call    bdos
  101.     mvi    e,'Y'
  102.     endif
  103.  
  104.     if    hazel
  105.     mvi    e,'~'
  106.     mvi    c,6
  107.     call    bdos
  108.     mvi    e,'Q'-40h
  109.     endif
  110.  
  111.     mvi    c,6
  112.     call    bdos
  113.     pop    h        ; get line pointer
  114.     mov    a,m        ; get line number
  115.     adi    32        ; add offset
  116.     mov    e,a        ; send line number
  117.     mvi    c,6
  118.     call    bdos
  119.     pop    h        ; get column point
  120.     mov    a,m        ; get column number
  121.     adi    32        ; add offset
  122.     mov    e,a        ; send column number
  123.     mvi    c,6
  124.     call    bdos
  125.     ret            ; return from cursor position routine
  126. ;
  127. ;
  128. ;
  129.     org    tpa+080h    ; leave plenty of room for cursor routine
  130. ;
  131. ;
  132. ;
  133.     end
  134.