I have not been doing an outstanding job at posting on this blog! (TL:DR Pictures at the bottom)
Work has been resumed on SnapCterm. I seem to be getting into a flow with it which is good. Rolling through some less dramatic changes, iterating over sections and re-writing bits. Moving out bits to functions and general housekeeping that is hardly exciting reading. I gave in to actually processing the ESC codes and implementing what might be a state machine? Point of technicality, basically we start flagging and filtering through IFs as each character passes from RX buffer to screen. That said I haven't fully detached the RX Buffer from the screen, poping data from the buffer still gets posted to ANSI screen driver. Only now there is a process to watch the stream. So we can push other ESC codes to the screen to correct or respond to the remote system (which wasn't implemented in the ANSI driver!). Not quite at a point of calling this section of code done, I may go for a full disconnect, process the ESC code and modify before posting to screen. Now for something a little more visual, colour clash correction! Oh, the problem with a single Bright bit for both foreground and background. So ANSI terminal bright seems to ONLY apply to the foreground colour. So blue on blue with "Bold" enabled gives a light blue text on a blue background. On the spectrum colour pallet that becomes a beautiful bright blue text on a nice bright blue background... Black on black is also very popular, doubly bugged on a spectrum. Not only does the bright apply foreground and background colour, but "bright black" is also the same as black... Took a while to figure out a process to handle this problem. Comes down to fully decoding the ESC code for setting colour and attributes. Keeping track of them in a set of variables. When we have a Bold enabled check the foreground colour against the background. If they match look up the colour code and push in an ESC code to change the colours. On the next ESC code that changes the colours, recall what the setting should be and replay them. Then because I pass characters direct to the ANSI driver, we then need to replay the last code sequence again! As the first processing updated the changed set, which might not have replaced all colours and attribute. This is one reason why I might need to re-think the design. Any way picture time... Spot the original ANSI render using Mate Terminal in Linux. SnapCterm without correction and with correction on the Spectrum.
0 Comments
|
AuthorMe, slightly crazy engineer type. Generalist in nature, hardware or software with nonspecialist skill set. Archives
January 2020
Categories
All
|