Skip to content

Add ansi parser - #55

Merged
thejpster merged 7 commits into
developfrom
add-ansi-parser
Jul 16, 2023
Merged

thejpster merged 7 commits into
developfrom
add-ansi-parser

Conversation

@thejpster

Copy link
Copy Markdown
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
Copy Markdown
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
@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