You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getact 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. .PAGE 'GETACT'
  2. ;*********************************
  3. ;* GETACT: GET ACTIVE BUFFER # *
  4. ;* VARS: BUF0,BUF1,LINDX *
  5. ;* REGS: OUT: .A= ACT BUFFER # *
  6. ;* .X= LINDX *
  7. ;* FLAGS: .N=1: NO ACT-BUF *
  8. ;*********************************
  9. ;
  10. GETACT
  11. LDX LINDX
  12. LDA BUF0,X
  13. BPL GA1
  14. LDA BUF1,X
  15. GA1
  16. AND #$BF ; STRIP DIRTY BIT
  17. RTS
  18. ;
  19. ;*********************************
  20. ;* GAFLG: GET ACTIVE BUFFER #; *
  21. ;* SET LBUSED & FLAGS. *
  22. ;* REGS: OUT: .A= ACT BUFFER # *
  23. ;* .X= LINDX *
  24. ;* FLAGS: .N=1: NO ACT-BUF *
  25. ;* .V=1: DIRTY BUF *
  26. ;*********************************
  27. ;
  28. GAFLGS
  29. LDX LINDX
  30. GA2 STX LBUSED ;SAVE BUF #
  31. LDA BUF0,X
  32. BPL GA3
  33. ;
  34. TXA
  35. CLC
  36. ADC #MXCHNS+1
  37. STA LBUSED
  38. LDA BUF1,X
  39. GA3
  40. STA T1
  41. AND #$1F
  42. BIT T1
  43. RTS
  44. ;
  45. ;******************************
  46. ;******************************
  47. ;
  48. ; GET CHANNELS INACTIVE
  49. ; BUFFER NUMBER.
  50. ;
  51. ; INPUT PARAMETERS:
  52. ; LINDX - CHANNEL #
  53. ;
  54. ; OUTPUT PARAMETERS:
  55. ; A <== INACTIVE BUFFER #
  56. ; OR
  57. ; A <== $FF IF NO
  58. ; INACTIVE BUFFER.
  59. ;
  60. ;******************************
  61. ;
  62. GETINA LDX LINDX
  63. LDA BUF0,X
  64. BMI GI10
  65. LDA BUF1,X
  66. GI10 CMP #$FF
  67. RTS
  68. ;
  69. ;*****************************
  70. ;********** P U T I N A ****
  71. ;*****************************
  72. ;
  73. ; PUT INACTIVE BUFFER
  74. ;
  75. ; INPUT PARAMTERS:
  76. ; A = BUFFER #
  77. ;
  78. ; OUTPUT PARAMTERS:
  79. ; NONE
  80. ;
  81. ;*****************************
  82. ;
  83. PUTINA LDX LINDX
  84. ORA #$80
  85. LDY BUF0,X
  86. BPL PI1
  87. STA BUF0,X
  88. RTS
  89. PI1 STA BUF1,X
  90. RTS
  91. ;
  92. .END