home *** CD-ROM | disk | FTP | other *** search
/ Set of Apple II Hard Drive Images / hard.hdv / HARD / PROJECT / SOURCE / DISPNOTE.SRC < prev    next >
Encoding:
Text File  |  1992-07-07  |  6.9 KB  |  233 lines  |  [04] ASCII Text (0x0000)

  1. ;
  2. ; DISPNOTE.SRC
  3. ;
  4. ;
  5.                     ORG $1000
  6. ;
  7. ORIGIN              JMP   ENTER
  8. ;
  9. DISPMODE            DFB   $00  ;    00=UCS, NON ZERO = LCF
  10. ;
  11. DURL                DFB   $00
  12. DURH                DFB   $00
  13. NOTE                DFB   $00  
  14. VEL                 DFB   $00 
  15. ;
  16. ; ENTRY POINT FOR CLEANUP =$1008
  17. ;
  18.                     JMP   CLEANUP
  19. ;
  20. ; MODE 0 = NOTE OFF, 1 = NOTE ON
  21. CURRMODE            DFB   $00
  22. PREVMODE            DFB   $00
  23. ;
  24. DASH                ASC   "-" 
  25. SPACE               ASC   " "
  26. VBAR                ASC   "|"
  27. ;
  28. SHIFT               DFB   $17
  29. ;
  30. PDURL               DFB   $00
  31. PDURH               DFB   $00   
  32. ;
  33. ; REENTRANT ROUTINE
  34. ; DUR/NOTE/VEL ARE POPULATED UPON ENTRY
  35. ;
  36. ENTER               JSR   SETMODE
  37.                     JSR   CMPMODES
  38.                     BCS   PRINTIT      ;ONLY PRINT IF CURRMODE<>PREVMODE
  39. ;
  40. TESTDUR             LDA   DURL         ;OR DUR<>0
  41.                     BNE   PRINTIT
  42.                     LDA   DURH         ;==>(DURL<>0 OR (DURL=0 AND DURH<>0))
  43.                     BEQ   DONTPRNT
  44. PRINTIT             JSR   NEWLINE
  45. DONTPRNT            LDA   CURRMODE
  46.                     STA   PREVMODE     ;SET UP NEXT PREVMODE
  47.                     LDA   DASH         ;STORE DASH FOR NOTE OFFS
  48.                     LDX   VEL
  49.                     CPX   #$00
  50.                     BEQ   STORLINE
  51.                     LDX   NOTE         ;STORE ASCII CHAR FOR NOT ONS
  52.                     LDA   DISPMODE
  53.                     BNE   DISPLCF      ;DEPENDING ON WHETHER UCS OR LCF
  54.                     LDA   UCS,X
  55.                     CLV
  56.                     BVC   STORLINE
  57. DISPLCF             LDA   LCF,X
  58. STORLINE            LDX   NOTE
  59.                     STA   LINE,X
  60.                     RTS
  61. ;
  62. SETMODE             LDA   #$00         ;SET MODE TO 0 FOR NOTE OFF 
  63.                     STA   CURRMODE     ;OR 1 FOR NOTE ON
  64.                     LDA   VEL
  65.                     BEQ   SETMODE1
  66.                     LDA   #$01
  67.                     STA   CURRMODE
  68. SETMODE1            RTS
  69. ;
  70. CMPMODES            LDA   CURRMODE     ;IF CURRMODE = PREVMODE, CLC
  71.                     CMP   PREVMODE     ;ELSE SEC
  72.                     BEQ   SAME
  73.                     SEC
  74.                     RTS
  75. SAME                CLC
  76.                     RTS
  77. ;
  78. ;
  79. ;
  80. NEWLINE             LDA   DURL
  81.                     STA   PDURL
  82.                     LDA   DURH
  83.                     STA   PDURH
  84.                     LDX   SHIFT
  85.                     LDY   #$48
  86. PRNTLOOP            LDA   LINE,X
  87.                     JSR   $FDED
  88.                     INX   
  89.                     DEY   
  90.                     BNE   PRNTLOOP
  91.                     JSR   PRNTADRS
  92. ;
  93.                     LDX   #$7F
  94. LOOPLINE            LDA   LINE,X
  95.                     CMP   DASH
  96.                     BEQ   DASHFND
  97.                     CMP   SPACE
  98.                     BEQ   NEXTX
  99.                     LDA   VBAR         ;IF NOT A DASH, STORE A VBAR
  100.                     STA   LINE,X
  101.                     CLV
  102.                     BVC   NEXTX
  103. ;
  104. DASHFND             LDA   SPACE        ;IF DASH, SPACE IT OUT
  105.                     STA   LINE,X
  106. ;
  107. NEXTX               DEX   
  108.                     BPL   LOOPLINE
  109.                     LDA   #$00
  110.                     STA   PDURL
  111.                     STA   PDURH
  112.                     RTS   
  113. ;
  114. CLEANUP             LDX   #$7F
  115.                     LDA   #$A0
  116. SPACEALL            STA   LINE,X
  117.                     DEX   
  118.                     BNE   SPACEALL
  119.                     BEQ   CR
  120. ;
  121. PRNTADRS            LDA   $07
  122.                     JSR   $FDDA
  123.                     LDA   $06
  124.                     JSR   $FDDA
  125.                     LDA   PDURL
  126.                     BNE   PDUR
  127.                     LDA   PDURH
  128.                     BNE   PDUR
  129. ;
  130. CR                  LDA   #$8D
  131.                     JMP   $FDED
  132. ;
  133. PDUR                LDA   PDURL
  134.                     STA   $51
  135.                     LDA   PDURH
  136.                     STA   $50
  137.                     JSR   HEXDEC
  138.                     JSR   PRNTDEC
  139.                     RTS   
  140. ;
  141. HEXDEC              LDA   #$0A
  142.                     STA   $53
  143.                     LDY   #$04
  144. ;
  145. HEXDEC0             LDX   #$10
  146.                     LDA   #$00
  147.                     STA   $52
  148.                     CLC   
  149. ;
  150. HEXDEC1             ROL   $50
  151.                     ROL   $51
  152.                     ROL   $52
  153.                     DEX   
  154.                     BMI   HEXDEC2
  155.                     LDA   $52
  156.                     SEC   
  157.                     SBC   $53
  158.                     BCC   HEXDEC1
  159.                     STA   $52
  160.                     BCS   HEXDEC1
  161. ;
  162. HEXDEC2             CLC   
  163.                     ROR   $52
  164.                     LDA   $52
  165.                     ORA   #$B0
  166.                     STA   DEC1,Y
  167.                     DEY   
  168.                     BPL   HEXDEC0
  169.                     RTS   
  170. ;
  171. PRNTDEC             LDA   DEC2
  172.                     CMP   #$B0
  173.                     BNE   OVER1000
  174.                     LDA   #$A0
  175. ;
  176. OVER1000            JSR   $FDED
  177.                     LDA   DEC3
  178.                     JSR   $FDED
  179.                     LDA   DEC4
  180.                     JSR   $FDED
  181.                     LDA   DEC5
  182.                     JSR   $FDED
  183.                     RTS   
  184. ;
  185. DEC1                DFB $B0
  186. DEC2                DFB $B0
  187. DEC3                DFB $B0
  188. DEC4                DFB $B0
  189. DEC5                DFB $B0
  190. ;
  191. LINE                DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  192.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  193.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  194.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  195.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  196.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  197.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  198.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  199.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  200.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  201.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  202.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  203.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  204.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  205.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  206.                     DFB $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0
  207. ;
  208. UCS                 ASC "cCdDefFgGaAb"
  209.                     ASC "cCdDefFgGaAb"
  210.                     ASC "cCdDefFgGaAb"
  211.                     ASC "cCdDefFgGaAb"
  212.                     ASC "cCdDefFgGaAb"
  213.                     ASC "cCdDefFgGaAb"
  214.                     ASC "cCdDefFgGaAb"
  215.                     ASC "cCdDefFgGaAb"
  216.                     ASC "cCdDefFgGaAb"
  217.                     ASC "cCdDefFgGaAb"
  218.                     ASC "cCdDefFg"
  219. ;
  220. LCF                 ASC "CdDeEFgGaAbB"
  221.                     ASC "CdDeEFgGaAbB"
  222.                     ASC "CdDeEFgGaAbB"
  223.                     ASC "CdDeEFgGaAbB"
  224.                     ASC "CdDeEFgGaAbB"
  225.                     ASC "CdDeEFgGaAbB"
  226.                     ASC "CdDeEFgGaAbB"
  227.                     ASC "CdDeEFgGaAbB"
  228.                     ASC "CdDeEFgGaAbB"
  229.                     ASC "CdDeEFgGaAbB"
  230.                     ASC "CdDeEFgG"
  231. ;
  232. EOF                 BRK
  233.