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.src 2.0KB

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