diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 06:29:11 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 06:29:11 -0700 |
commit | b0a83af0e56a3f1d32059554c06734fff58bebc5 (patch) | |
tree | d8a62ca7502f03cf5be4f78dc1f0b6182a1bcd6c /browse_slack | |
parent | 179db5aeb6c51936242a33a4612d6f6c1dc88b88 (diff) | |
download | mu-b0a83af0e56a3f1d32059554c06734fff58bebc5.tar.gz |
slack: fix abort after load
I forgot about the null bytes that come from loading sectors.
Diffstat (limited to 'browse_slack')
-rw-r--r-- | browse_slack/main.mu | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/browse_slack/main.mu b/browse_slack/main.mu index c3e351d2..29610343 100644 --- a/browse_slack/main.mu +++ b/browse_slack/main.mu @@ -43,7 +43,8 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) var _s/eax: (addr stream byte) <- lookup *s-ah var s/ebx: (addr stream byte) <- copy _s #? load-sectors data-disk, 0/lba, 0x20000/sectors, s - load-sectors data-disk, 0/lba, 0x7000/sectors, s +#? load-sectors data-disk, 0/lba, 0x7000/sectors, s + load-sectors data-disk, 0/lba, 0x10/sectors, s draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "done", 3/fg 0/bg # parse global data structures out of the stream var users-h: (handle array user) @@ -87,6 +88,9 @@ fn parse in: (addr stream byte), users: (addr array user), channels: (addr array var done?/eax: boolean <- stream-empty? in compare done?, 0/false break-if-!= + var c/eax: byte <- peek-byte in + compare c, 0 + break-if-= set-cursor-position 0/screen, 0x20 0x20 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, user-idx, 3/fg 0/bg draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, item-idx, 4/fg 0/bg @@ -114,6 +118,9 @@ fn parse-record in: (addr stream byte), out: (addr stream byte) { compare paren, 0x28/open-paren { break-if-= + set-cursor-position 0/screen, 0x20 0x10 + var c/eax: int <- copy paren + draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen c, 5/fg 0/bg abort "parse-record: (" } var paren-int/eax: int <- copy paren |