diff --git a/system/buffer.s65 b/system/buffer.s65 index d34f8cc..599dc30 100644 --- a/system/buffer.s65 +++ b/system/buffer.s65 @@ -58,7 +58,6 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2 cpx RB_WRITE beq @rb_read_rts ; if buffer empty lda RB_START,x - Inc_buf_ptr RB_READ inx ; increment RB_READ pointer, not using macro bec. of unknown Pz cpx #RB_LENGTH beq @read_wrap @@ -89,16 +88,17 @@ RB_LENGTH = RBUF_MEM_END - RBUF_MEM_START - 2 stx RB_WRITE @check_buf_full: ; increment read if buffer is full cpx RB_READ - beq read_inc + beq @read_inc rts @write_wrap: ; ptr == RB_LENGTH -> ptr = 0 stz RB_WRITE + ldx #0 bra @check_buf_full @read_inc: ldx RB_READ inx cpx #RB_LENGTH - beq read_wrap + beq @read_wrap stx RB_READ rts @read_wrap: ; ptr == RB_LENGTH -> ptr = 0