Fix the vertical bearing of the `v` glyph so that it does not appear
to be one pixel above the others.
Also add glyphs for
* dot-product (`⋅`, U8901)
* cross-product (`⨯`, 10799)
These can be used to refer to the `CROSS` and `DOT` commands.
Fixes: #1117
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The `DispXY` command on the HP50G takes a font ID that takes 2 values,
1 for small font and 2 for regular font.
In order to implement this in a more easy way, reorder the font IDs so
that they "match", except that 0 gives the even smaller help font and
3 gives the larger editor font.
Fixes: #1146
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Switch to using the built-in data files by default, and extending them
with teh configuration file.
The `ShowBuiltinConstants`, `ShowBuiltinCharacters` and
`ShowBuiltinUnits` are not on by default. The size of the
corresponding `config/*.csv` files are reduced to a really simple
example.
Fixes: #1052
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The `shown` variable should be set even without a `\n`, so that
history records position correctly.
Fixes: #1044
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
When we draw a BMP that has a width that is not a multiple of 8, some
black pixels show up on the right, and the left part is truncated.
The root cause is that the horizontal adjustment uses the width and
not the scanline, so we don't get the correct range of pixels.
Code inspection also showed that there was an error in the size of the
datalen being returned from `grob::pixels`, because it returnes the
size of the object, not the size of the data bitmap.
Fixes: #1043
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add the `Edit` feature to the interactive stack.
When editing an object and replacing it with multiple objects, the
objects are inserted at the interactive stack location.
Add the `Info` button to show information about the stack level.
Separate the `Sort` feature into `MemSort` (sort by memory
representation) and `ValSort` (sort by value).
Add the `EchoNSp` to echo without spaces the way the HP48 does.
Fixes: #1031
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add commands to the `EditMenu` to go both up and down in the history,
and to enter the interactive stack.
Switch to the `EditMenu` automatically when we use the history command.
Fixes: #1028
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The menus are now 3 pixels higher than before.
Adjust the help display area to match.
Fixes: #1026
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Implement an additive congruential random number generator (ACORN),
which is a very simple implementation that can be configured to have
an arbitrary number of random bits.
https://en.wikipedia.org/wiki/ACORN_(random_number_generator)Fixes: #1019
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The tests for the interactive stack involved a change in the code to
show an object, in order to process test commands correctly and to not
overwrite the screen content with the stack.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add link to [pre-built WASM simulator](https://c3d.github.io/db48x)
to make it easy for someone to actually try the simulator.
Fixes: #994
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
When parsing `'xroot(a;-b)'` we were incorrectly returning
'-xroot(a;b)'` because we were treating `-` specially and before
treating parentheses or arguments.
Fixes: #959 (first comment)
Reported-by: mahi2003@users.github.com
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The `xroot` command is a special case on HP50, in that `A B XROOT`
returns `XROOT(B;A)` and not `XROOT(A;B)` like for other commands.
Special-case the parsing and rendering of that command.
(This is super-ugly, all the more so that the HP50G advanced user
manual actually indicates the order depends on algebraic vs. RPN mode)
Fixes: #959
Reported-by: mahi2003@users.github.com
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Automatically apply some common simplification rules, like `-(-X)`
being converted to `X`.
Fixes: #952
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Descenders in softkey menus were not really visible. This meant that a
unit like `kg` would be visually equivalent to `kq`.
This adjusts the size of menus by one pixel to make it visible, and
extends the clipping area by another pixel, which gives two extra
pixels when drawing in white on a black background.
This is not visually perfect, because as a result, menu entries
without a descender, e.g. 'mol' now appear to be a bit shifted up.
Fixes: #939
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Depending on the context, we either want another menu, e.g. `SymbolicMenu`, or
the editor menu when using the `ToolsMenu` with an empty command line.
Fixes: #902
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
When we don't add parentheses around a function's argument, insert a
space to make it look better.
Fixes: #900
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>