Add a DM48 keymap that restores correct keybindings in the file
selector dialog.
Fixes: #1002
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The tar file we build should not include macos crap such as
```
help/img/._SimpleShear.bmp
tar: Ignoring unknown extended header keyword
'LIBARCHIVE.xattr.com.apple.provenance'
```
Fixes: #1125
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
When distributing a release, only include the relevant help file,
i.e. DB48X.md for DB48X and DB50X.md for DB50x.
Fixes: #1124
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
We exceed the 16-byte limit with the existing format for
`0.7.11-12-42421Z`, which leads to a crash checking the QSPI.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Convert the image files to BMP so that we can display them on the
target calculators.
This will be needed for #1033 (displaying BMP files in help file).
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Fix clean build of simulator with `make sim`:
- Pass `TARGET=opt` instead of `TARGET=` when building tools
to ensure the tool gets properly built irrespective of environment
- Remove reference to obsolete Intel decimal library, which was still
hanging around in my build directories.
Fixes: #999
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Reserve the main thread for display updates and keyboard interaction,
like for the Qt version. This allows the web simulator to work
correctly when you run a program or when you access the firwmare
interface.
The downside is that you need to run that on a web server that is able
to set the following [HTTP headers][coop]:
```
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
```
Unfortunately, it is not entirely clear if this can be made to work
easily with [GitHub pages][ghp].
Fixes: #994
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
[coop]: https://web.dev/articles/coop-coep
[ghp]: https://github.com/orgs/community/discussions/13309
This is an in-tree port of [Franco Trimboli's excellent work][wasm].
The goal is to be able to run the simulator in a browser.
This builds with emscripten, as installed by the `emsdk`.
The `emsdk` is added as a submodule, and initialized on first build.
To build the browser WASM version of the simulator, run `make wasm`.
Fixes: #993
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Suggested-by: Franco Trimboli <sunpazed@gmail.com>
Co-developed-by: Franco Trimboli <sunpazed@gmail.com>
[wasm]: https://github.com/sunpazed/db48x-wasm
Enough algorithms need a separate notion of polynomials.
Devise a space-efficient representation for them.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Make it possible to run the DM42 configuration with color and the DM32
configuration in black-and-white.
Fixes: #907
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Put the object files in different locations, since they use different
configuration parameters that widely impact the generated code.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
For case-sensitive filesystems like on Linux, avoid file errors
when the case does not match.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The project now supports the DM32 just as well as the DM42, so it's better to
not have the DM42 so prominently in the title.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
With the original code, the loop searching for commands to add to the
catalog skips many commands. I suspect this is another case of QSPI
hammering similar to what was observed for fonts. In any case, the
workaround appears to be to slightly deoptimize the code by selecting
a lower optimization level and adding an `else` clause in the inner
`if` statement.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
These are two catalogs that behave much like the constants catalog,
and inherit most of the code.
The equations library is intended to store standard equations.
The library is for standard objects and various useful objects or
programs.
Both can be organized by topics.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The dependency is not quite correct anyway, it's not the end result
that is dependent on the decimal headers, but the intermediate build
steps.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Refactor the code to put all date and time related functions into the
`datetime.h` and `datetime.cc` files.
Also added Julian day number calculations, which enable the
computation of the day of the week in the date format rendering, and
will make it easier to implement future commands such as `DDAYS`.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Dynamic constants menu, similar to units menu, which is populated
either from an internal table, or from `config/constants.csv`
Fixes: #497
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The hardware-accelerated floating-point support in the ARM chip is
about 2000 faster than the variable-precision decimal floating point
implementation. It makes sense to use it.
See numbers recorded in `doc/6-Performance.md` for details.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
A single 10000-digit constant takes about 4K in QSPI space.
Constants are generated in a cache and rebuilt when precision changes.
For now, store pi, which we will need to implement sin/cos/tan
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The `decimal` class represents a variable-size decimal, similar to
what can be found in newRPL.
This commit implements the base class.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
It's interesting to prove that we can build without it, but we can't
do a release without it.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
At some point, we will need to shift to variable-precision decimal.
Being able to disable all `decimal128` code will help evaluate
how much room we have for that.
With decimal128 active, sizes are:
text data bss dec hex filename
2254248 3840 2524 2260612 227e84 build/dm42/release/db48x.elf
wc -c db48x.pgm
710180 db48x.pgm
Without decimal128, sizes are:
text data bss dec hex filename
455864 2872 2412 461148 7095c build/dm42/release/db48x.elf
wc -c db48x.pgm
282236 db48x.pgm
In other words, decimal128 at the moment uses 427944 bytes out of our
716800 budget (i.e. 59.7%) and 1798384 in the total size (79.7%).
Chances that a variable decimal implementation can be made smaller
than that.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The `check-ids` target checks if commands are in the menus
or in the help.
The `src/ignored_menus.csv` and `src/ignored_help.csv` indicate what
does not need to be reported by the tools. It was initialized with the
current state of missing things, and can serve as a reference for what
commands need to either be documented or added to menus.
Fixes: #615
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Just the infrastructure to be able to build the statistics commands.
This originally exceeded the RAM section on DM42, which is surprising
(RAM, not Flash). It turns out that this was the size of the sorted
commands for the catalog, which was fixed.
Fixes: #495
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
When the argument describing the variable is a text, interpret that as
a file path on the disk. By default, data is stored in in a directory
named `data`, which will be created if necessary. For example, you can
use `3 "foo.48s" STO` to store the value `3` in a file named
`data/foo.48s` on disk.
How the file is stored depends on the extension given to the file:
* For `.txt` files, the object is stored as text
* For `.48s` files, the object is stored as DB48X source code
* For `.48b` files, the object is stored in binary format
* For `.csv` files, the object is stored in comma-separated format.
The binary format used for `.48b` includes a 4-byte magic number
identifying a DB48X format, and a 4-byte checksum used to ensure
binary compatibility between the firmware and the disk format.
At least during early days of development (prior to 1.0), it is quite
unlikely that the binary format for one version of the firmware would
be readable or writable by another version. If you need to recover
data from another version, you need to install that version and save
the object again in `.48s` (text) format.
Fixes: #375
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Implement a `debug_printf` that shows something on the screen, and a
`debug_wait` to wait for a given delay or a key.
Fixes: #541
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The `equation` type does not really represent equations (it may)
but arithmetic expressions.
Fixes: #518
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The generated font files contained an ID that could depend on the
configuration settings for the build. That caused the font file on
DM32 to be incorrect, which caused a crash when editing text.
Fixes: #458
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This is a very basic implementation of unit objects.
Unit objects are treated as equations where the outermost object
is an ID_mkunit operator.
Fixes: #16
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Allow images in the source markdown files, but skip them on calculator
Note that we need to skip them at runtime if we want to be able to
have them in the GitHub file correctly.
Fixes: #438
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This is mostly to validate the sanity of that build option
(a compilation bug was actually fixed).
Fixes: #432
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>