Thanks for the help everyone!
Quote:
Code:
——————> bcc IRQ_cleanup <——————
So if I have the count - and subtract the high water mark - Carry set means that the number is smaller than the high water mark - so I can skip turning off the RTS line. So it would seem that I'm constantly turning off the flow and turning it back on in the read routine. I will give BCS a try.
Quote:
BTW, it isn’t necessary or desirable to maintain a queue counter
ok, that makes sense - I can factor that out. I'm just going to write it down though, to get my logic clear. Taking WR_ptr - RD_ptr
Case 1: WR_ptr = $80, RD_ptr = $60 = $20 used in the buffer, CMP #$E0 results in carry being set
Case 2: WR_ptr = $80, RD_ptr = $90 = $F0 used in the buffer, CMP #$E0 results in carry being clear
Case 3: WR_ptr = $10, RD_ptr = $F0 = $20 used in the buffer, CMP #$E0 results in carry being set
Case 4: WR_ptr = $10, RD_ptr = $20 = $F0 used in the buffer, CMP #$E0 results in carry being clear
It is alright to ignore the status of the carry flag before these calculations since it would at most affect the results by 1, but I don't need absolute accuracy?
Quote:
One other thing...subroutines are best avoided in ISRs.
Yes, I can inline that without any difficulty.
Quote:
Lastly, do you have the 6850’s DCD permanently tied low?
Yes.
Quote:
On a site note, are you using an NMOS 6502? Because your code uses TXA PHA instead of just PHX.
Yes, I'm using a NMOS 6502.
Quote:
Besides that, I'm not a fan of the inconsistent capitalization on instructions
Agree - the formatting on this code is poor. I mostly cobbled this together from various sources, and I've tried to differentiate between parts that I've touched through changing the case to lower, but its making it terribly unreadable. I'm hoping to clean it up once I get it working.
Many thanks again,
Tom.