Commit Graph

88 Commits

Author SHA1 Message Date
Kartik Agaram
7363c6dfd3 7537 - baremetal: start of cursor support 2021-01-19 22:48:49 -08:00
Kartik Agaram
6ce43fce4f 7536 2021-01-19 22:48:49 -08:00
Kartik Agaram
c5b573cf83 7535 2021-01-17 10:49:23 -08:00
Kartik Agaram
851959ccc6 7534
Don't assume screen dimensions.
2021-01-17 10:43:31 -08:00
Kartik Agaram
9822a2429f 7533
Both issues of commit 7531 fixed.
2021-01-16 20:56:28 -08:00
Kartik Agaram
aa6c50d2bc 7532 2021-01-16 19:07:33 -08:00
Kartik Agaram
966daf1473 7531 - checking fake screens
This uncovers two open issues:
* incrementing the cursor after drawing a single grapheme
* needing to clear background pixels when drawing a grapheme
2021-01-16 16:41:39 -08:00
Kartik Agaram
117a710a9d 7530 - baremetal: print ints to screen 2021-01-16 16:27:58 -08:00
Kartik Agaram
6efc1ebed7 7529 - baremetal: fake screen 2021-01-16 15:32:26 -08:00
Kartik Agaram
3d6c6e5286 7528 - heap allocator 2021-01-16 11:35:13 -08:00
Kartik Agaram
2803748890 7527 2021-01-16 10:40:19 -08:00
Kartik Agaram
a8dd0d4094 7525
Bring back runtime support for bounds-checking arrays. Again, the error
messages kinda suck, because I can't yet print integers. But something
is better than nothing.
2021-01-16 09:06:01 -08:00
Kartik Agaram
0d246473c5 7524 - bring back some abort messages
Our infrastructure for displaying errors is far more rudimentary in
baremetal. Many ways things can go wrong. But making the attempt seems
better than not.

I'm also making some effort to keep it easy to see what has been copied
over from the top-level, by not modifying copied code to use syntax
sugar and so on. It may not be an important enough reason to mix
notations in a single file.
2021-01-15 21:27:52 -08:00
Kartik Agaram
49424b1933 7523
There's a dependency cycle here:

- draw-grapheme (Mu) uses read-grapheme (Mu) to be unicode-aware.
- read-grapheme uses read-byte (SubX). Streams are a fundamental data
  structure in Mu. For the Mu compiler to be able to reason about the
  safety of stream operations, they need to be an opaque type. All
  stream primitives are written in SubX. To manipulate a stream's
  internals we force people to reach for SubX. That way if there's no
  SubX code there's confidence that things are safe.
- read-byte and other stream operations have unit tests, like they
  should. The unit tests need to print data to screen when say a test
  fails. To do this they use various check- functions (SubX) that take a
  string argument.
- Printing a string to screen uses draw-grapheme (Mu).

Perhaps I should maintain variants of drawing primitives that operate
only on ASCII.
2021-01-15 21:22:33 -08:00
Kartik Agaram
8ed27ce431 7522 - bring back a few tests in .subx files
Even though baremetal has tests in SubX, they can only run in Mu
programs since the test harness is currently in a Mu layer. Baremetal
isn't really intended for running SubX programs at the moment. Is this a
step down the slippery slope towards C compilers that I complained about
in http://akkartik.name/akkartik-convivial-20200607.pdf?
2021-01-15 21:11:30 -08:00
Kartik Agaram
6e36ce06dd 7521 - new plan for tests
It's not really manageable to make the fake screen pixel-oriented. Feels
excessive to compare things pixel by pixel when we will mostly be
writing text to screen. It'll also make expected screen assertions
more difficult to manage.

So I'm not sure how to make assertions about pixels for now. Instead
we'll introduce fake screens at draw-grapheme.
2021-01-15 20:30:07 -08:00
Kartik Agaram
232b4a1511 . 2021-01-14 13:37:28 -08:00
Kartik Agaram
21bddb2e4b 7519 - baremetal: run all tests on boot 2021-01-13 21:50:38 -08:00
Kartik Agaram
32bb01ba4a 7518 2021-01-13 21:41:45 -08:00
Kartik Agaram
30e4df8172 7517 2021-01-13 21:19:02 -08:00
Kartik Agaram
686307abe0 7516 2021-01-13 21:15:24 -08:00
Kartik Agaram
fc9286f3b3 7514 2021-01-13 21:00:20 -08:00
Kartik Agaram
f8cb5f97c6 7513 2021-01-13 19:50:30 -08:00
Kartik Agaram
ec0d5bb17e 7510 - baremetal: a game of snake 2021-01-13 16:57:04 -08:00
Kartik Agaram
422ebaf88c 7508
This is the right way to be direction-independent. Don't save the cursor
when drawing a single grapheme. Where the next char goes is just a
property of the direction-oriented primitives.
2021-01-13 00:02:35 -08:00
Kartik Agaram
4413168269 7507 - baremetal: drawing text down then right 2021-01-12 23:52:24 -08:00
Kartik Agaram
fcad74b7b1 7505 2021-01-12 22:01:50 -08:00
Kartik Agaram
c5e617f5cc 7504 2021-01-12 21:51:46 -08:00
Kartik Agaram
e59086e65a 7503 - baremetal: noodling on default VGA palette 2021-01-12 19:50:22 -08:00
Kartik Agaram
0d12f6676b 7502 - baremetal text: better interface 2021-01-12 00:32:06 -08:00
Kartik Agaram
bb0e67a308 7501 - baremetal: draw text within a rectangle 2021-01-12 00:20:22 -08:00
Kartik Agaram
589eba07e2 7500 - baremetal: bounds-check screen space before drawing 2021-01-12 00:00:20 -08:00
Kartik Agaram
ebf912eb7a 7499 2021-01-12 00:00:20 -08:00
Kartik Agaram
b7e736b508 7497 2021-01-11 23:24:35 -08:00
Kartik Agaram
f6075374f5 7496 2021-01-11 23:19:43 -08:00
Kartik Agaram
3de4d557d5 7493 2021-01-09 19:01:13 -08:00
Kartik Agaram
57e4978eac 7492
Port some support for unicode to baremetal.
2021-01-09 18:55:24 -08:00
Kartik Agaram
0518944e37 7491 - baremetal: draw ASCII text to screen 2021-01-09 18:29:04 -08:00
Kartik Agaram
7f8770ae08 7490 - baremetal: draw a grapheme to screen 2021-01-09 18:28:14 -08:00
Kartik Agaram
dbd7082a0e 7489 - include GNU Unifont
https://en.wikipedia.org/wiki/GNU_Unifont#The_.hex_font_format
http://unifoundry.com/unifont/index.html

Since GNU Unifont is covered under the GPL v2, so I believe is this repo.
2021-01-09 18:20:28 -08:00
Kartik Agaram
952ccfc66e 7488 2021-01-09 13:45:41 -08:00
Kartik Agaram
26697e649b 7487 2021-01-09 13:43:39 -08:00
Kartik Agaram
be87d72335 7486 - primitive for reading keys
It also clears keys after reading them, allowing us to read more than 16
keys.
2021-01-09 10:39:12 -08:00
Kartik Agaram
8be561f599 7485 2021-01-09 10:15:33 -08:00
Kartik Agaram
adf7fba7fe 7484 2021-01-09 10:07:41 -08:00
Kartik Agaram
3f7db804c9 7480 - baremetal/ex3.hex now draws multiple pixels
I was wrong in commit 7437 that only one keystroke was working. The problem
was just that I was getting _too_ many events. I wasn't handling key-up
events, and they were entering the buffer, and I was not skipping null
events since the circular buffer is currently considered to be null-terminated.

ex3 isn't done yet; it can only handle 16 events. Apps need to be clearing
the keyboard buffer.
2021-01-07 22:38:07 -08:00
Kartik Agaram
53d99784de 7479 2021-01-07 20:17:32 -08:00
Kartik Agaram
cb13d94740 7477 2020-12-30 19:25:32 -08:00
Kartik Agaram
1e02d840e8 7471 2020-12-29 21:19:41 -08:00
Kartik Agaram
520e3c2542 7470
The ol' 8-byte-register-names issue strikes again. There's no way to access
the lower 8 bits of ESI.

There's still a bug in baremetal/ex2.mu; it's printing transposed somehow.
2020-12-29 21:17:03 -08:00