Commit Graph

14 Commits

Author SHA1 Message Date
circuit10
b44a95a9b3 Casio fx-CG series port (#324)
* Initial test - working on Linux

* Try to make it work with liba

* Stop using liba and the filesystem

* IT WORKS

* Key input, full res, fix some of the crashes

* Fix the hang when doing calculations

* Add some more key mappings

* Fix the square root issue

* Icons

* Better key mappings, brightness control, better gamma correction, more effficient framebuffer

* Cleanup stage 1

* Cleanup stage 2

* Make the build system build a g3a

* Make it not exit when you press the menu button

* Add Casio port to README

* Use omega-master instead of omega-dev

* Fix mistake with cherry-picking in the README

* Fix internal storage crash

* Fix compile error on Numworks calculators

* Upsilon branding

* Sharper icon

* Make the CI work

* Add power off and improve menu

* Map Alpha + up/down to the brightness shortcut

* Add missing file

* Fix web CI build

* Revert "Fix web CI build"

This reverts commit f19657d9fc.

* Change "prizm" to "fxcg"

* Add FASTLOAD option for Add-in Push

* Add some charatcers to the catalog on Casio and improve key mappings

* Build with -Os -flto

* Disable LTO for now as it's causing crashes

* Put back the fonts I accidently changed

I'd like to add an option for this though as I prefer the ones from Epsilon
2023-05-10 18:28:18 +02:00
Gabriel Ozouf
591f47d6a9 [continuous_function_cache] Coding style 2020-12-02 16:50:17 +01:00
Gabriel Ozouf
3501146e35 [shared/continuous_function_cache] Detach cache from function
When three functions or more, the third function and later don't use
caching. But it is still possible for them to have been linked to a
cache (for instance if previous functions had been deactivated earlier).
To avoid a function tapping into another function's cache, we reset the
cache.

e.g. Define 3 functions f(x)=1, g(x)=2, h(x)=3, and deactivate f.
     Draw the graph, come back, reactivate f, then draw again.
---> The space between y=2 and y=3 will be filled with the color of h,
as h "remembers" using cache n°2, wich currently contains the values of
function g.
2020-12-02 16:50:17 +01:00
Hugo Saint-Vignes
5339d9e7b4 [apps/shared] Add static assert for cache steps
Change-Id: I77498775b4caf3d97522219d2a7c979601b985e8
2020-11-04 15:58:07 +01:00
Gabriel Ozouf
bd068312d9 [apps/continuous_function_cache] Clear on bad step
Cache did not check that the step was the same before panning, causing
old values to remains cached.
e.g. :
  - Type f(x) = x, and plot it.
  - Go to Axes, and set Xmax = 0.
  - Confirm

Change-Id: Ie8ed10c336cf517a65f19b05bd14866daf8128c2
2020-11-04 15:33:00 +01:00
Hugo Saint-Vignes
8fdec305c4 [apps/graph/test] Fix caching test
Change-Id: I536d1422ca6c9ecded66f7876ae019aaf5742005
2020-11-04 15:30:54 +01:00
Hugo Saint-Vignes
52f83eb682 [apps/shared] Halve k_parametricStepFactor to maximise cache hits
Change-Id: Ibe3c441e4af88277d1e4594801b805336a1f3e0b
2020-11-04 15:11:45 +01:00
Gabriel Ozouf
2bfdc482a6 [apps/continuous_function] Cut clearCache method
Inlined call to ContinuousFunction::clearCache and removed the method,
as its name was confusing.

Change-Id: I54454fb0b06167e01249afaa5b23932451125f2e
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
1de6ac702d [apps/continuous_function_cache] abs -> fabs
Replaced abs calls on float with fabs.

Change-Id: I26eda164416ca8b2d601431a59171fd7b00ed33f
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
b0533e6836 [apps/graph] Changed cache tolerance
This fixes a bug where, when drawing 1/x, a vertical bar would appear on
0, because of false positive cache hits.

Change-Id: I2eafeac5e254c8a556769a41c8edc532db44383a
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
beb228fa78 [apps/graph] Fixed cache step quirks
Change-Id: I5b630301ab2a4b17a5a4d77c7d9a05120449e55e
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
1bee23cf4f [apps/graph] Reworked function caching
Instead of being memoized all at once before display, functions values
are now stored at evaluation time. Fixed some quirks with caching
preparation.

Change-Id: I5d212c271c8c41a6dc9074a15c720f0bccf8ac40
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
42fcf557b8 [apps/graph] Limited number of cached functions
The caches used for function values memoization are now stored in
ContinuousFunctionStore : there are now only a fixed number, instead of
one per function. This effectively enables caching only for the first
few functions on screen, while reducing the memory usage.

Change-Id: I2ade091717f73a14a756fe527c773db8e8627be7
2020-11-04 15:04:24 +01:00
Gabriel Ozouf
552dca9494 [apps/shared] Implemented function memoization
ContinuousFunction now has an attribute of type ContinuousFunctionCache,
implementing methods to store and retrieve 320 float values, in order to
speed up function display in Graph.

Change-Id: I6f7ccdf3ae3c6dd8b08b93d786c8d0be7aa4dee8
2020-11-04 14:45:35 +01:00