3 public ff_empty,ff_get,ff_full,ff_put
13 ;--------------------------------------------------------------------
22 ;--------------------------------------------------------------------
27 ld (ix+o.in_idx),0 ;reset pointers (empty fifo)
46 call hwl2phy ;get phys. address of fifo
48 ld a,(ix+o.id) ;fifo id
55 ; TODO: move to better place
58 push bc ;c: bank-addr, b: ignored
61 push bc ;c: function, b:subf
72 ;--------------------------------------------------------------
73 ; Check if characters in fifo
74 ; Fifo is empty, if output index and input index are the same
83 ;--------------------------------------------------------------
103 ;--------------------------------------------------------------
104 ; Check if room in fifo
105 ; buffer is full, if output index is one behind input index
117 ;--------------------------------------------------------------
118 ; put character in c in buffer
120 ; returns output char in a
124 pop hl ; get buffer start address
127 ld c,(ix+o.in_idx) ; add input index
130 ld (hl),a ; one place is allways free
133 ld a,c ; bump input index
138 jr z,bp.wait ; while new input idx == ouput idx