Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ansi parser #55

Merged
merged 7 commits into from
Jul 16, 2023
Merged

Add ansi parser #55

merged 7 commits into from
Jul 16, 2023

Conversation

thejpster
Copy link
Member

phew.

Like the Monotron, we cheat with the cursor. Instead of making the BIOS support a hardware cursor, we fake it in software.

  1. To enable the cursor, cache the glyph currently at the cursor position and replace it with a _
  2. To disable the cursor, put the cached value back
  3. Ensure you temporarily disable the cursor anytime you write to the screen, or really do anything with the screen
  4. Realise you need to recursively enable and disable the cursor, because writing to the screen now goes through the ANSI state machine and that may then emit a second, recursive, write to the screen. Oof.

@thejpster thejpster force-pushed the add-ansi-parser branch 2 times, most recently from 92652b9 to 009e655 Compare July 15, 2023 21:37
Had to rename our println to osprint to avoid clash with libstd's println.
We ran out of flash space, but only on the GHA build not my local build...
@thejpster
Copy link
Member Author

Still todo, test cases for:

  • 'F' => Cursor previous line
  • 'G' => Cursor horizontal absolute
  • 'H' | 'f' => Cursor Position (or Horizontal Vertical Position)
  • 'J' => Erase in Display (needs implementing too)
  • 'K' => Erase in line (needs implementing too)

Also I should add a "cat" program so we can show off our new ANSI output with test files on disk.

@thejpster thejpster merged commit c19314c into develop Jul 16, 2023
4 checks passed
@thejpster thejpster deleted the add-ansi-parser branch July 16, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant