Commit Graph

8997 Commits

Author SHA1 Message Date
Kartik Agaram 61ec86b719 . 2021-08-30 09:21:52 -07:00
Kartik K. Agaram a479f0d083 .
Open question fixed.
2021-08-30 00:41:11 -07:00
Kartik K. Agaram c970190021 first rendering of non-latin script
Open question: why does column 0 get cropped? The spacing also seems
excessive. Are we taking up 3 grid points?
2021-08-30 00:34:40 -07:00
Kartik K. Agaram 877fbf640a . 2021-08-30 00:06:51 -07:00
Kartik K. Agaram 6e05a8fa27 fix bad terminology: grapheme -> code point
Unix text-mode terminals transparently support utf-8 these days, and so
I treat utf-8 sequences (which I call graphemes in Mu) as fundamental.

I then blindly carried over this state of affairs to bare-metal Mu,
where it makes no sense. If you don't have a terminal handling
font-rendering for you, fonts are most often indexed by code points and
not utf-8 sequences.
2021-08-29 22:20:09 -07:00
Kartik K. Agaram 4b90a26d71 . 2021-08-29 20:54:05 -07:00
Kartik K. Agaram 0633e401f9 . 2021-08-29 20:43:57 -07:00
Kartik K. Agaram b1dcfb03d0 load Font in a non-contiguous area of memory 2021-08-29 20:34:53 -07:00
Kartik K. Agaram 354c72a637 . 2021-08-29 20:33:54 -07:00
Kartik K. Agaram 14cfa3e109 . 2021-08-29 19:13:23 -07:00
Kartik K. Agaram 8306c084ad . 2021-08-29 19:12:47 -07:00
Kartik K. Agaram bd226ccb3a improve translation scripts 2021-08-29 11:25:08 -07:00
Kartik K. Agaram efae02cf11 . 2021-08-29 11:21:09 -07:00
Kartik K. Agaram 899cdcc3f3 inline SubX translation
We can't really translate purely SubX code anyway at the top-level. Stop
exposing those scripts.
2021-08-29 11:21:09 -07:00
Kartik K. Agaram c5f8415e03 retreat to 640KB 2021-08-29 11:21:09 -07:00
Kartik K. Agaram 0e2a9ad93d build still broken
Now we load all the code, but it overwrites the extended BIOS area.
640KB is no longer enough. Need to rethink loading strategy.
2021-08-29 11:21:09 -07:00
Kartik K. Agaram 1b18ec6ee9 import a few more unicode blocks from Unifont
shell/ is currently broken; we've overflowed available contiguous space
for code.

Block names based on https://www.compart.com/en/unicode/block:
  0x0000 - 0x007f Basic Latin 128
  0x0080 - 0x00ff Latin-1 Supplement 128
  0x0100 - 0x017f Latin Extended-A 128
  0x0180 - 0x024f Latin Extended-B 208
  0x0250 - 0x02af IPA Extensions 96
  0x02b0 - 0x02ff Spacing Modifier Letters 80
  0x0300 - 0x036f Combining Diacritical Marks 112
  0x0370 - 0x03ff Greek and Coptic 135
  0x0400 - 0x04ff Cyrillic 256
  0x0500 - 0x052f Cyrillic Supplement 48
  0x0530 - 0x058f Armenian 91
  0x0590 - 0x05ff Hebrew 88
  0x0600 - 0x06ff Arabic 255
  0x0700 - 0x074f Syriac 77
  0x0750 - 0x077f Arabic Supplement 48
  0x0780 - 0x07bf Thaana 50
  0x07c0 - 0x07ff NKo 62
  0x0800 - 0x083f Samaritan 61
  0x0840 - 0x085f Mandaic 29
  0x0860 - 0x086f Syriac Supplement 11
  0x08a0 - 0x08ff Arabic Extended-A 84
  0x0900 - 0x097f Devanagari 128
  0x0980 - 0x09ff Bengali 96
  0x0a00 - 0x0a7f Gurmukhi 80
  0x0a80 - 0x0aff Gujarati 91
  0x0b00 - 0x0b7f Oriya 91
  0x0b80 - 0x0bff Tamil 72
  0x0c00 - 0x0c7f Telugu 98
  0x0c80 - 0x0cff Kannada 89
  0x0d00 - 0x0d7f Malayalam 118
  0x0d80 - 0x0dff Sinhala 91
  0x0e00 - 0x0e7f Thai 87
  0x0e80 - 0x0eff Lao 82
  0x0f00 - 0x0fff Tibetan 211
  0x1000 - 0x109f Myanmar 160
  0x10a0 - 0x10ff Georgian 88

But don't trust the block sizes above. Thanks to gdb[1] for this helper:

define z
  print 2 * (0x$arg1 - 0x$arg0 + 1)
end

e.g:
  (gdb) z 10a0 10ff
  192

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html
2021-08-29 11:20:47 -07:00
Kartik K. Agaram 34c7221b84 render wide glyphs in the font 2021-08-29 01:04:26 -07:00
Kartik K. Agaram 7e70d3ac04 bugfix in commit 8e182e394
Any command in shell that rendered the screen resulted in an infinite
loop. But it took me forever to even realize it was an infinite loop.
2021-08-29 00:51:57 -07:00
Kartik K. Agaram bd34858c4e . 2021-08-29 00:29:57 -07:00
Kartik K. Agaram a46cb565ca . 2021-08-29 00:16:51 -07:00
Kartik K. Agaram 96f91f9b2d . 2021-08-29 00:10:19 -07:00
Kartik K. Agaram f5f91a5843 . 2021-08-29 00:06:30 -07:00
Kartik K. Agaram 8e182e394e width-aware drawing primitives
No support yet for drawing wide graphemes.
2021-08-29 00:01:08 -07:00
Kartik K. Agaram bc859a7ca4 . 2021-08-28 22:57:22 -07:00
Kartik K. Agaram 468927ee1c . 2021-08-28 22:22:04 -07:00
Kartik K. Agaram 3640f1dfe9 support unused screen-cells in fake screens
We'll need this when rendering 16-bit glyphs. They'll occupy two
8x16 display units on screen, but the grapheme is a single unit as far
as fake screens are concerned.
2021-08-28 22:01:26 -07:00
Kartik K. Agaram 2c51a46455 . 2021-08-28 21:59:38 -07:00
Kartik K. Agaram 2e00a9c288 .
Convert some old code to current idioms.
2021-08-28 21:53:37 -07:00
Kartik K. Agaram 79e2569f1a font data structure now supports 16-bit glyphs
We can't yet render the latter 8 bits.
2021-08-28 21:11:45 -07:00
Kartik K. Agaram 2c87cd2f34 reorganize font before adding non-ASCII 2021-08-27 08:41:15 -07:00
Kartik K. Agaram c45371b319 compute-offset: literal index 2021-08-25 22:19:24 -07:00
Kartik K. Agaram 9b62454975 . 2021-08-25 21:46:22 -07:00
Kartik K. Agaram 2d2c46da5c another long-overdue bugfix
If I forgot a 'var', Mu would interpret the ':' in the var declaration
as a named block, and all parsing after would be thrown off.

Perhaps I should use separate characters for defining blocks vs vars.
2021-08-22 23:06:51 -07:00
Kartik K. Agaram 791a71e27e fix a long-standing bug in Mu's translator
While all test pass, this change is disquieting. When I first designed
Mu I deliberately chose to exclude literal strings from most primitive
instructions both for type-checking and to avoid silently passing
through strange constructions. Nobody really needs to add a string to a
number, and am I sure no SubX instruction will cause a memory safety
issue when passed a string literal instead of a number?

But clearly I have no tests encoding this desire. And any string literal
could be replaced by an integer literal containing the exact same value,
so what are we protecting against anyway.

Let me fix the bug for now. If I run into problems I'll come back and do
this right.
2021-08-22 22:10:02 -07:00
Kartik K. Agaram ba4a3c5be7 start throwing error on labels too far for /disp8
While I'm doing this I might as well lay out a story I don't seem to
have told before in this commit log.

I translated Mu programs to Linux before I did so to bare metal like I
do in the top-level these days. The translator programs still run from
the linux/ directory. However they don't always have good error
messages. As long as I was translating to Linux this wasn't a huge deal
because I always translated Mu programs using the bootstrap translator
in linux/bootstrap/ -- which has great error messages. However,
linux/bootstrap/ can't build bare-metal programs because boot.subx uses
real-mode instructions that aren't supported. As a hack I created a
script called misc_checks that at least tries to run everything besides
boot.subx -- even though translation can never succeed. If I run it and
get to errors about unknown variables I know everything besides
boot.subx raised no errors.

Having labels too far in /disp8 args is is the single biggest reason we
need the misc_checks hack. Hopefully it's now obsolete.
2021-08-22 21:40:03 -07:00
Kartik K. Agaram 5c26d765c7 . 2021-08-22 21:24:36 -07:00
Kartik K. Agaram 827dd4a7fe start throwing error on duplicate label
One less error that's only in the bootstrap phase.

On the other hand, for simplicity I got rid of the ability to override
the Entry label. One less special case, but we're also going further
from the ability to run subsets of layers. We haven't really been
exercising it for a long time, though (commit 7842, March 2021 when we
made baremetal the default).
2021-08-22 21:09:28 -07:00
Kartik K. Agaram b41aed4a9a . 2021-08-22 20:24:37 -07:00
Kartik Agaram 52e3ea8a4b . 2021-08-15 23:44:43 -07:00
Kartik K. Agaram 8765064d69 move gap buffer code to top-level
Now that it's been used in a second app without needing any changes.
2021-08-15 21:09:17 -07:00
Kartik K. Agaram 412a68d0c1 minimize repaints when navigating between channels 2021-08-15 04:24:36 -07:00
Kartik K. Agaram 7282b475ae . 2021-08-15 04:22:57 -07:00
Kartik K. Agaram 31ef51d92a correct menu when first entering search mode
Test required.
2021-08-15 04:22:57 -07:00
Kartik K. Agaram 553d2ffc8e .
Make it more obvious that we always do a full repaint if dirty is set.
2021-08-15 04:22:57 -07:00
Kartik K. Agaram 8086b7b603 keep cursor stable when switching to thread view
Test required.
2021-08-15 04:02:42 -07:00
Kartik K. Agaram 6684112972 missing code: selecting a thread in channel view
Test required. And a clean fixture.
2021-08-15 04:02:23 -07:00
Kartik K. Agaram 7d3f2722ff no, we can't just sort lines in the slack archive
Comments contain indices back to the parent. Reordering items completely
messes up the indices.
2021-08-14 19:56:09 -07:00
Kartik K. Agaram ef3881ab5a slack: navigation for thread screens 2021-08-14 18:29:15 -07:00
Kartik K. Agaram bfe3a175be slack: quick 'n' dirty thread screen 2021-08-14 18:02:57 -07:00