This is a shortcut to save the current state.
Note that you can also get that with RSHIFT-EXIT.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
If two mouse clicks are issued quickly, the second one has the type
QEvent::MouseButtonDblClick. This leads to the event being ignored.
This is now fixed.
Signed-off-by: Kjell Christenson <kjell.christenson@gmail.com>
Reviewed-by: Christophe de Dinechin <christophe@dinechin.org>
The `qApp->primaryScreen()->devicePixelRatio()` method no longer
returns the correct pixel ratio at least on X11 over the network.
Add the `-s` option as a workaround to be able to auto-scale the
window for testing purpose.
It looks like gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4) thinks it's a good
idea to complain about every single zero-initialized C structure.
This is widely acknowledged as a (rather annoying)
[GCC bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119)
Add a constructor to silence the warning where possible.
For DMCP C structures where this is not possible, well, add ugly code.
With gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4), there is a message about
fall-through switch statements. Add comment to silence the warning when the
fall-through is intentional.
There was one case where the fall-through was not intentional.
Missing `break` added.
Fixes: #853
On Fedora 38, GCC incorrectly warns about unused arguments despite the
`__attribute__((unused)))` that should silence the warning.
Observed with gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4).
Fixes: #853
This is just to avoid setting `errno` when we are just trying to
make sure that the directory exists.
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>
Instead of proactively wait, add a wait loop checking for the result.
This allows the tests to run significantly faster.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Make sure that we capture consistent pixmaps, which we can do on the
RPL thread, and only defer the transfer of the pixmap to the main
thread, which is fast.
Additionally, optimize updates by doing a byte-by-byte xor comparison
in order to see which bytes actually changed. This minimizes the cost
on the RPL thread to update the pixmap.
This makes it possible to have a much better screen behaviour for the
`CBench` benchmark, where it updates it regularly on the screen while
not slowing things down too much.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add a callback to explicitly refresh the screen instead of relying on
a volatile counter indicating that the screen is dirty.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
By convention, 0 is Monday for DMCP, but Sunday for Unix.
I managed to not notice until now...
Fixes: #838
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
When hitting the F9 key, take a partial screen snapshot directly
(partial meaning no header).
When hitting the F8 key, take a screen snapshot using the `Screenshot`
command, which is now implemented on the simulator.
Also reduce the size of the window a little so that we can take video
snapshots that are 720 x 400 pixels and capture the keyboard.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The DMCP convention is for the month field to start at 1.
Integrate that in our emulation.
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>
Add the `→Date` command to set the system date,
and the `→Time` command to set the system time.
Fixes: #823
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>
Add image checking from saved image references as a way to check that
the generated pixmaps are consistent from run to run.
Fixes: #732
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Each test is controlled by a specific recorder tweak.
The `-T` option can now take a test name, e.g. `-Tkeyboard` to run
only that test in an automated way.
The `-O` option can select a single test for interactive testing with
the F12 key.
In both cases, the name follows the recorder syntax.
Fixes: #728
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
We use `-1` to mark the termination of the RPL thread and request the
state to be saved on disk.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
A call to `wait_for_key()` would prevent the key sync counters from
being updated, and as a result, the test suite would stop.
Fixes: #731
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>
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>
Did a few additional focused optimizations that bring back another
100ms on the `NQueens` benchmark on the DM42.
This comes at the expense of about 4K of additional generated code,
which is probably as much as is reasonable to dedicate to this.
The numbers for the DM32 are now the best we ever had.
Fixes: #533
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>
Detect a low-batter situation and, when it happens, automatically
switch the calculator with a message on top of the off-image.
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>