parisse wrote:
FYI, I also experienced the "trapped in Upsilon" issue. I have modified the home app, so that a normal DEL keypress leaves Upsilon. I have not experienced the issue since, I don't know if it's the long MENU keypress that is responsible or something else.
Other changes I made: support for Casio directories when exchanging files from Upsilon to Casio. I also changed the Python heap address to the unused memory area at 0x8c200000, size 0x300000, that's 48 times more memory for your Python scripts.
Addin https://www-fourier.univ-grenoble-alpes.fr/~parisse/casio/upsilon.g3a
The changes in source code:
apps/home/controller.cpp:
https://www-fourier.univ-grenoble-alpes.fr/~parisse/casio/controller.cpp
ion/src/simulator/fxcg/main.cpp
https://www-fourier.univ-grenoble-alpes.fr/~parisse/casio/main.cpp
apps/code/app.cpp: add a declaration at begin

Code:

#ifdef _FXCG
extern "C" int calculator;
#endif

(calculator is a variable that is set to 1 by main if the calc is a FXCG50 or the French equivalent mode Graph 90)
and modify

Code:

void App::initPythonWithUser(const void * pythonUser) {
  if (!m_pythonUser) {
#ifdef _FXCG
    if (calculator==1)
      MicroPython::init( (void *) 0x8c200000, (void *)(0x8c200000+ 0x300000));
    else
#endif
      MicroPython::init(m_pythonHeap, m_pythonHeap + k_pythonHeapSize);
  }
  m_pythonUser = pythonUser;
}


It's possible that, for whatever reason, the main menu registers the user pressing the menu key after opening it and thus re-opens the application. Would there be a way to 'unpress' the MENU key before running SaveAndOpenMainMenu()?
Perhaps the best would be to remove the long press code for MENU and capture a normal MENU keypress in apps/home/controller.cpp (like I currently do with DEL). That way, from any app you would have to press MENU twice to leave Upsilon (except from Upsilon home of course), that's not very different from a long keypress, and I believe it would be more intuitive.

I changed the import code in python/port.cpp, I've added a world switch, it's not clear for me if it's required, but it might for large files.

Code:

#ifdef _FXCG
void do_mp_lexer_new_from_file(const char * filename,mp_lexer_t ** res) {
  mp_reader_t reader;
  mp_reader_new_file(&reader, filename);
  *res=mp_lexer_new(qstr_from_str(filename), reader);
}
#endif

mp_lexer_t * mp_lexer_new_from_file(const char * filename) {
  if (sScriptProvider != nullptr) {
    const char * script = sScriptProvider->contentOfScript(filename, true);
    if (script != nullptr) {
      return mp_lexer_new_from_str_len(qstr_from_str(filename), script, strlen(script), 0 /* size_t free_len*/);
    }
  }
#ifdef _FXCG
  mp_lexer_t * res=0;
  gint_world_switch(GINT_CALL(do_mp_lexer_new_from_file,filename,&res));
  return res;
#endif
  mp_raise_OSError(MP_ENOENT);
}
dr-carlos wrote:
It's possible that, for whatever reason, the main menu registers the user pressing the menu key after opening it and thus re-opens the application. Would there be a way to 'unpress' the MENU key before running SaveAndOpenMainMenu()?

Just an idea:
Do we really need to use [Menu] to exit the application? I would propose to use [Shift] + [Exit] (= Quit). This would solve all the glitches.
MPoupe wrote:
dr-carlos wrote:
It's possible that, for whatever reason, the main menu registers the user pressing the menu key after opening it and thus re-opens the application. Would there be a way to 'unpress' the MENU key before running SaveAndOpenMainMenu()?

Just an idea:
Do we really need to use [Menu] to exit the application? I would propose to use [Shift] + [Exit] (= Quit). This would solve all the glitches.

Nah, it's more that MENU is the intuitive way of doing it.
Given that it already requires a long press (which is not that intuitive), I'd be fine with using Quit.

Having said that, if a single MENU press from the home screen works, that's probably the best choice. It's obvious and easy.
dr-carlos wrote:
MPoupe wrote:
dr-carlos wrote:
It's possible that, for whatever reason, the main menu registers the user pressing the menu key after opening it and thus re-opens the application. Would there be a way to 'unpress' the MENU key before running SaveAndOpenMainMenu()?

Just an idea:
Do we really need to use [Menu] to exit the application? I would propose to use [Shift] + [Exit] (= Quit). This would solve all the glitches.

Nah, it's more that MENU is the intuitive way of doing it.
Given that it already requires a long press (which is not that intuitive), I'd be fine with using Quit.

Having said that, if a single MENU press from the home screen works, that's probably the best choice. It's obvious and easy.


I could probably add a settings entry for it so people can choose what they prefer

I think the default should be pressing menu again on the home screen though because thatís obvious and intuitive
I believe we should try:
1/ file ion/src/simulator/fxcg/keyboard.cpp : in State scan() modify

Code:

...
      // Wait until EXE and MENU are released
      do {
        sleep_ms(10);
        clearevents();
      } while (keydown(KEY_EXE) || keydown(KEY_MENU));
...

2/ file apps/home/controller.cpp: in bool Controller::handleEvent(Ion::Events::Event event) add:

Code:

  if (event == Ion::Events::Backspace || event==Ion::Events::Home){
    Ion::Simulator::FXCGMenuHandler::openMenu();
  }
I've been trying to build the project but I keep having errors pop up as it's trying to use C++ standard library headers when building with sh-elf.

i.e., I'm getting this output:
Quote:

CXX apps/apps_container_launch_default.o
CXX apps/alternate_empty_nested_menu_controller.o
CXX apps/apps_container.o
CXX apps/apps_container_prompt_none.o
CXX apps/apps_container_storage.o
CXX apps/apps_window.o
CXX apps/atomic/app.o
CXX apps/atomic/atom_info.o
In file included from poincare/include/poincare/context.h:6,
from poincare/include/poincare/layout.h:4,
from escher/include/escher/highlight_cell.h:6,
from escher/include/escher/nested_menu_controller.h:5,
from apps/alternate_empty_nested_menu_controller.h:4,
from apps/alternate_empty_nested_menu_controller.cpp:1:
libaxx/include/bridge/cmath:4:15: fatal error: cmath: No such file or directory
4 | #include_next <cmath>
| ^~~~~~~
compilation terminated.


I replaced cmath with math.h, but now I'm getting the same error except it's trying to find new instead of cmath.
Any suggestions what I'm missing?
dr-carlos wrote:
I've been trying to build the project but I keep having errors pop up as it's trying to use C++ standard library headers when building with sh-elf.

i.e., I'm getting this output:
Quote:

CXX apps/apps_container_launch_default.o
CXX apps/alternate_empty_nested_menu_controller.o
CXX apps/apps_container.o
CXX apps/apps_container_prompt_none.o
CXX apps/apps_container_storage.o
CXX apps/apps_window.o
CXX apps/atomic/app.o
CXX apps/atomic/atom_info.o
In file included from poincare/include/poincare/context.h:6,
from poincare/include/poincare/layout.h:4,
from escher/include/escher/highlight_cell.h:6,
from escher/include/escher/nested_menu_controller.h:5,
from apps/alternate_empty_nested_menu_controller.h:4,
from apps/alternate_empty_nested_menu_controller.cpp:1:
libaxx/include/bridge/cmath:4:15: fatal error: cmath: No such file or directory
4 | #include_next <cmath>
| ^~~~~~~
compilation terminated.


I replaced cmath with math.h, but now I'm getting the same error except it's trying to find new instead of cmath.
Any suggestions what I'm missing?


Are you using a custom-built compiler or the one that fxsdk/gint installs? You need fxsdk/gint to build it
Heath wrote:

Are you using a custom-built compiler or the one that fxsdk/gint installs? You need fxsdk/gint to build it

I have fxsdk, and gint and sh-elf-gcc installed in the fxsdk sysroot.
Having said that, I did compile sh-elf-gcc myself, so I'll go and compile it with Lephe's patches and see if that fixes it.
dr-carlos wrote:
Heath wrote:

Are you using a custom-built compiler or the one that fxsdk/gint installs? You need fxsdk/gint to build it

I have fxsdk, and gint and sh-elf-gcc installed in the fxsdk sysroot.
Having said that, I did compile sh-elf-gcc myself, so I'll go and compile it with Lephe's patches and see if that fixes it.


I imagine the sysroot thing would be what you need but I donít know much about how that works

Are you on the latest version? I think C++ standard library support is recent-ish
Heath wrote:
dr-carlos wrote:
Heath wrote:

Are you using a custom-built compiler or the one that fxsdk/gint installs? You need fxsdk/gint to build it

I have fxsdk, and gint and sh-elf-gcc installed in the fxsdk sysroot.
Having said that, I did compile sh-elf-gcc myself, so I'll go and compile it with Lephe's patches and see if that fixes it.


I imagine the sysroot thing would be what you need but I donít know much about how that works

Are you on the latest version? I think C++ standard library support is recent-ish

I've built and installed Lephe's sh-elf-gcc but this hasn't fixed the issue.
dr-carlos wrote:
Heath wrote:
dr-carlos wrote:
Heath wrote:

Are you using a custom-built compiler or the one that fxsdk/gint installs? You need fxsdk/gint to build it

I have fxsdk, and gint and sh-elf-gcc installed in the fxsdk sysroot.
Having said that, I did compile sh-elf-gcc myself, so I'll go and compile it with Lephe's patches and see if that fixes it.


I imagine the sysroot thing would be what you need but I donít know much about how that works

Are you on the latest version? I think C++ standard library support is recent-ish

I've built and installed Lephe's sh-elf-gcc but this hasn't fixed the issue.


Are you definitely on the latest version of gint and fxsdk?
Heath wrote:
Tari wrote:
Cool! I guess this is mostly a testament to Numworks' code having a good hardware abstraction layer that means it's easy to tell what you need to implement in order to target a new platform?


Yes, and also the fact that someone ported it to the TI-Nspire before so I could use that as an example

I could not find info about a TI Nspire port. Perhaps you meant the HP Prime custom firmware of J.B. Boric https://github.com/boricj/epsilon/tree/hp_prime?
I made a port for the TI Nspire CX and CX 2 (if ndless compatible):
https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon.tns
All the modifications I made for the Casio and for the TI are here:
https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon_changes.tgz
parisse wrote:
Heath wrote:
Tari wrote:
Cool! I guess this is mostly a testament to Numworks' code having a good hardware abstraction layer that means it's easy to tell what you need to implement in order to target a new platform?


Yes, and also the fact that someone ported it to the TI-Nspire before so I could use that as an example

I could not find info about a TI Nspire port. Perhaps you meant the HP Prime custom firmware of J.B. Boric https://github.com/boricj/epsilon/tree/hp_prime?
I made a port for the TI Nspire CX and CX 2 (if ndless compatible):
https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon.tns
All the modifications I made for the Casio and for the TI are here:
https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon_changes.tgz


This is the existing TI-Nspire port: https://github.com/UpsilonNumworks/Upsilon/pull/131

Did you make another one yourself as well?
Yes. It's a cx and cx2 port (I have not checked on monochrom Nspire). Since I did not know about the nspire port, my code does not derive directly from this port, but it derives from it via your own fxcg50 code. As far as I can tell looking at the source code this port is prototype quality, the key mapping is not optimal, it will probably crash because of unaligned read/write in the scriptstore. I may try it's display code, my own code using gui_gc* calls is not efficient.
B&W is supported if the zehn binary is built without compression.
https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilonbw.tns
I made another update for Casio and Nspire, now supports persistence of history calculation.
Binaries:
FXCG50 https://www-fourier.univ-grenoble-alpes.fr/~parisse/casio/upsilon.g3a
Nspire https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilonbw.tns (works also on CX/CX2, but you might prefer the compressed version to save flash https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon.tns, this last version does not load on monochrom Nspire, there is not enough RAM)
Source changes as before https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon_changes.tgz
parisse wrote:
I made another update for Casio and Nspire, now supports persistence of history calculation.
Binaries:
FXCG50 https://www-fourier.univ-grenoble-alpes.fr/~parisse/casio/upsilon.g3a
Nspire https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilonbw.tns (works also on CX/CX2, but you might prefer the compressed version to save flash https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon.tns, this last version does not load on monochrom Nspire, there is not enough RAM)
Source changes as before https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/upsilon_changes.tgz


Good work, but I've noticed that if the history items take up more than one character height in vertically (e.g. a square root) then that doesn't get saved properly and it gets cut off
Also the home menu button changes don't seem to fix the returning to the menu after sleep thing so some more investigation might be needed there
Heath wrote:
Good work, but I've noticed that if the history items take up more than one character height in vertically (e.g. a square root) then that doesn't get saved properly and it gets cut off

This is fixed. The history item was correctly saved but additional code was required to display items properly (I also made a few changes to the splash screen).

Quote:

Also the home menu button changes don't seem to fix the returning to the menu after sleep thing so some more investigation might be needed there

I did not touch to the sleep code. Did you try to press DEL instead of MENU?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement