Commit Graph

14 Commits

Author SHA1 Message Date
Kartik Agaram 6f65b65f7d 7290
I've wrestled for a long time with how to support integer division with
its hard-coded registers. The answer's always been staring me in the face:
just turn it into a function! We already expect function outputs to go
to hard-coded registers.
2020-11-27 21:37:20 -08:00
Kartik Agaram 32505d159e 7269 2020-11-21 21:40:23 -08:00
Kartik Agaram e996502f01 7237
Minor tweaks to get Mu shell running nicely on a Linux console atop Qemu.

We also need to switch a few 256-color codes to 8-color mode. I'm not
sure whether/how to patch the repo for those.
2020-11-14 20:27:43 -08:00
Kartik Agaram d715599246 7226 2020-11-11 23:30:56 -08:00
Kartik Agaram 307745bcc2 7225
Both manual tests described in commit 7222 now work.

To make them work I had to figure out how to copy a file. It
requires a dependency on a new syscall: lseek.
2020-11-11 23:25:55 -08:00
Kartik Agaram 3ae62cfd79 7222
Ok, I found a failing manual test for files as well.

Here are the two steelman tests, one for screens and one for files:

1.
  5 5 fake-screen =s

  s 1 down 1 right

  ctrl-d foo

  expand

final state:

  s       foo                                            foo
               s       1       down    1       right   ⇗
   ┌─────┐                                                ┌─────┐
                ┌─────┐      1  ┌─────┐      1  ┌─────┐    │
                        ┌─────┐  │      ┌─────┐  │         ─
                                         │       │
                                         │       │
                                                 ─
   └─────┘                                                └─────┘
                └─────┘         └─────┘         └─────┘
                        └─────┘         └─────┘

2.

  "x" open =f

  f read f read

  ctrl-d read2

  expand

final state:

  f      read2                                read2
                f      read   f      read   ⇗
    FILE                                       ❝def❞
                  FILE  ❝abc❞   FILE  ❝❞
                               ❝def❞  ❝ghi❞

In both cases there are 3 levels of issues:

- getting a single-line expression to work
- getting a single-line expression to work when operating on a binding
  defined in a previous line
- getting an expanded function call to work

The third is where the rub is right now. And what both examples above share
is that the function performs 2 mutations to the screen/file.

So we need a deep copy after all. And it's not very clear how to copy a
file descriptor including the seek location. Linux's dup() syscall creates
an alias to the file descriptor. And opening /proc seems awfully Linux-specific:

https://stackoverflow.com/questions/54727231/duplicating-file-descriptor-and-seeking-through-both-of-them-independently/54727424#54727424
2020-11-10 19:32:54 -08:00
Kartik Agaram c01289ddde 7218
This bug was incredibly painful to track down: the one-line fix is to replace
'line' with 'first-line' in the call to 'evaluate' in render-line before
recursing.

Things that made it challenging:
- A high degree of coiling with recursive calls and multiple places of
  evaluation.
- An accidental aliasing in bindings (when rendering the main column in
  render-line) that masked the underlying bug and made things seem to work
  most of the time.
- Too many fucking arguments to render-line, a maze of twisty line objects
  all alike.
2020-11-09 21:16:09 -08:00
Kartik Agaram f2a3c381a7 7210
Bug fixed; I had to reinitialize the table of bindings.
Interesting debugging experience.
2020-11-07 19:45:58 -08:00
Kartik Agaram 88e53f5628 7202 - rendering screens above other values 2020-11-06 18:26:25 -08:00
Kartik Agaram aa96c23f0c 7198 - tile: primitive 'print' 2020-11-06 17:46:27 -08:00
Kartik Agaram abba997d1b 7197 - tile: render screen contents and cursor 2020-11-06 16:05:33 -08:00
Kartik Agaram 2855bc69bd 7196 - tile: render empty screen 2020-11-06 14:26:42 -08:00
Kartik Agaram 443140ae3e 7195 - tile: create 'screen' objects 2020-11-06 13:39:46 -08:00
Kartik Agaram 0181e9eeb6 7193 - tile: extract taxonomy of values into a separate file 2020-11-06 13:39:46 -08:00