Skip to content

Commit 73666ae

Browse files
mjadczakjamwaffles
authored andcommitted
Terminal mode cursor (#80)
* Implement newline handling for TerminalMode (#78) * Some rebase tweaks * Tweak result types and introduce new error enum for TerminalMode * Add Debug impl to TerminalModeError
1 parent 132dd84 commit 73666ae

File tree

3 files changed

+348
-116
lines changed

3 files changed

+348
-116
lines changed

src/command.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ pub enum Command {
4242
/// 4 bits given.
4343
/// This is only for page addressing mode
4444
UpperColStart(u8),
45+
/// Set the column start address register for Page addressing mode.
46+
/// Combines LowerColStart and UpperColStart
47+
/// This is only for page addressing mode
48+
ColStart(u8),
4549
/// Set addressing mode
4650
AddressMode(AddrMode),
4751
/// Setup column start and end address
@@ -121,7 +125,8 @@ impl Command {
121125
Command::EnableScroll(en) => ([0x2E | (en as u8), 0, 0, 0, 0, 0, 0], 1),
122126
Command::VScrollArea(above, lines) => ([0xA3, above, lines, 0, 0, 0, 0], 3),
123127
Command::LowerColStart(addr) => ([0xF & addr, 0, 0, 0, 0, 0, 0], 1),
124-
Command::UpperColStart(addr) => ([0x1F & addr, 0, 0, 0, 0, 0, 0], 1),
128+
Command::UpperColStart(addr) => ([0x10 | (0xF & addr), 0, 0, 0, 0, 0, 0], 1),
129+
Command::ColStart(addr) => ([0xF & addr, 0x10 | (0xF & (addr >> 4)), 0, 0, 0, 0, 0], 2),
125130
Command::AddressMode(mode) => ([0x20, mode as u8, 0, 0, 0, 0, 0], 2),
126131
Command::ColumnAddress(start, end) => ([0x21, start, end, 0, 0, 0, 0], 3),
127132
Command::PageAddress(start, end) => ([0x22, start as u8, end as u8, 0, 0, 0, 0], 3),

0 commit comments

Comments
 (0)