First python project : HP41 emulator + hints of workflow
|
05-16-2021, 01:14 PM
(This post was last modified: 05-19-2021 07:01 AM by Oulan.)
Post: #1
|
|||
|
|||
First python project : HP41 emulator + hints of workflow
While beeing disapointed due to large cpu throttle in HPPL, when python came on the Prime I could not resist ...
So I ported my HP41 emulator on the Prime in Python ... see at LINK Some nice results : - python is at least 10 times faster than HPPL for casual stuff - no cpu throttling - very deep and well done integration of python with prime firmware - hpprime module very well done (some small bugs ...) - python is robust on the prime, very few calc reset/reboot - if you play too long with the emu, when you leave it the prime shut off due to auto off function not taking python execution into account Only tested on a G2 model ... for G1 you can change some timing in nut.py (near line 790 : adjust 0.30 in hpprime.eval('WAIT(.030)')) HP PRIME development workflow in micro-python:
You can do it in the 'HP Connectivy Kit/Content/app.hpappdir/' directory You can also use in the devKit contextual menu 'add a file' in the v/calc. (be sure to 'Sync' before and after). I make minor changes in v/calc without troubles, editor seems robust. I just does not succeed in using 'signets/marks'. 'goto' lines sometimes does not refresh the display, moving the cursor with arrows sometimes correct this (perhaps 1000 lines is too much ?). I sometime edit large parts in the virtual calc directly: PC keyboard and mouse are nice at this job. Only gripes is the lack of 'SHIFT-arrows' to select text. Actually sometimes the dev kit takes some seconds to react ... just wait. When in trouble (shadow apps, strange apps...): As seen somewhere in this forum I do the following:
|
|||
05-16-2021, 01:17 PM
Post: #2
|
|||
|
|||
RE: First python project
I tested it and all I can say is: awesome job, Olivier ! This is a good case to show that Python on the Prime is not a toy, but a pretty stable and performant implementation ! And the topic is nice too - emulating the 41 on the Prime should interest HP fans !
|
|||
05-16-2021, 05:23 PM
(This post was last modified: 05-16-2021 05:28 PM by ggauny@live.fr.)
Post: #3
|
|||
|
|||
RE: First python project
Hi,
I have tested too (on G2) it's SUPER, cudos ! To morrow I'll test on my 2 G1. Many thanks Olivier. Gérard. |
|||
05-17-2021, 12:00 AM
Post: #4
|
|||
|
|||
RE: First python project
Amazing work. Can you give any tips on your workflow when developing this software since accessing python files of the python app via the connectivity kit is one way - I can read them on my PC but cannot write them back into the prime. How did you get around this?
Perhaps you could write a tutorial or provide some tips on using Python on the Prime, since my early steps have not been promising. Simple standard python syntax corrupts the prime python app, backups can't be restored reliably, infinite reboot problems accessing prime from the connectivity kit, and as mentioned cannot edit python on the pc and put them back onto the prime. Yet you have somehow pushed through all these issues and created this amazing software and you sing the praises of Python the Prime! |
|||
05-17-2021, 09:00 PM
Post: #5
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
Olivier that's a great app.
Beyond that, it's a great example for using Python on the Prime. 1. creating own apps, makes you independent of the Python app, thus preserving the own development now is easily possible. It was before, but we didn't know how, THANKS a lot. Your code gives valuable examples for applying Python on the Prime. Quite a lot to chew on, THANKS. Günter |
|||
05-18-2021, 04:30 PM
Post: #6
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
Fantastic App!
Would you consider swap the function of these 2 keys? () : x<>y , : RDN In Prime RPN mode the " ," key functions as x<>y (its symbolised as the crossarrows symbol on right of key). |
|||
05-18-2021, 05:57 PM
(This post was last modified: 05-18-2021 06:04 PM by Oulan.)
Post: #7
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-18-2021 04:30 PM)Stevetuc Wrote: Fantastic App! To swap the keys, just swap the lines 33 and 34 in the key.py file P.S. v2 is progressing, with .MOD support and a config.py file to allow full control of configuration (system, loading of modules in page or in ports, ram, ...) But it seems that python code Code: a=[] |
|||
05-18-2021, 11:06 PM
Post: #8
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-16-2021 01:14 PM)Oulan Wrote: HP PRIME development workflow in micro-python: > An important directory on the PC is 'HP Connectivy Kit/Content/app.hpappdir/' in your 'Documents' The 'C:\Users\Andy\Documents\HP Connectivity Kit\Content' directory has no .hpappdir directories in it, and nothing called 'app.hpappdir', only the directories 'Exam Modes' and 'Results'. If you mean 'app.hpappdir' to refer to any app being developed, then ok, so I copy a random .hpappdir from 'C:\Users\Andy\Documents\HP Connectivity Kit\Calculators\MYVIRTCALC1' into 'Content' - what meaning or effect does that actually have? - I see no effect in the virtual calculator or in the conn kit, which suggests 'Content' is an arbitrary location and any other directory on the PC could be used as a temporary work area, right? Copying a .hpappdir e.g. Py41b_copy.hpappdir into 'C:\Users\Andy\Documents\HP Connectivity Kit\Calculators\MYVIRTCALC1' whilst the virtual calculator is running then hitting 'Refresh' from the r. click menu of the calculator listed in the conn. kit does not update the virtual calculator - in fact 'Refresh' actually DELETES the new .hpappdir directory I just copied in. > First do a 'Sync' from the contextual menu of the v/calc. I cannot find a 'Sync' menu item in the virtual calc, all I see when I r.click is the regular 'Calculator/Skins/Edit/Help' menu structure. Inside the 'Calculator' menu there is only the menu item to 'Reset' not 'Sync'? |
|||
05-19-2021, 01:14 AM
Post: #9
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
I was to force the the app to the calc/emu by right clicking the app and do send to class and that worked
|
|||
05-22-2021, 09:47 PM
Post: #10
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
This app is phenomenal.
|
|||
05-23-2021, 08:04 AM
Post: #11
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-19-2021 01:14 AM)Dougggg Wrote: I was to force the the app to the calc/emu by right clicking the app and do send to class and that worked That worked - thanks! To be clear, in order to edit a Python file on your PC:
(05-22-2021 09:47 PM)Eddie W. Shore Wrote: This app is phenomenal. I agree - this HP41C emulator running on the HP Prime written in Python - is truly astonishing. Pressing and holding a key even shows 'NULL' after a second, etc. just like the real HP41C. I had to press all the keys and write down what each one does - we might need an overlay ;-) Some useful keys are: - To enter in LBL press Units - To enter in RTN press SHIFT EEX I was even able to assign programs to keys in USER mode and XEQ them, with the traditional little bird flying on the screen as they are executed! |
|||
05-23-2021, 11:47 AM
(This post was last modified: 05-23-2021 11:48 AM by Oulan.)
Post: #12
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
Hi, new release (V.1) see.
Ie. when 'GETKEY' is used in a program, depending of the displayed message or program, the meaning is either a digit entry or an alpha entry ... (ie Y/N ... or 0..9). The keymapping is different but I can not guess which one to use Same problem arise in system rom ... it can be sometime guessed but with all the different roms existing ... Anyway, happy testing Btw this is a TRUE hardware emulator, so the goose is included (try synthetic programing if you want to be sure) |
|||
05-23-2021, 04:21 PM
Post: #13
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
Fantastic program! Is there a way to save the speed mode (Fast or Slow) when exiting?
Home doesn't do it for me. Tom L Cui bono? |
|||
05-23-2021, 08:58 PM
Post: #14
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-23-2021 04:21 PM)toml_12953 Wrote: Fantastic program! Is there a way to save the speed mode (Fast or Slow) when exiting? The file p41.py has the entry (line 125) cpu=nut.nut(speed=1). Changing speed=1 to speed=0 starts the 41 in fast-mode. But this is also semi permanent. You have to tell the calculator to use the changed file of course Günter |
|||
05-24-2021, 08:28 AM
(This post was last modified: 05-24-2021 09:14 AM by Stevetuc.)
Post: #15
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
41b is working fine for me on g1. However 41c does not. After pressing clear I get to the main screen. But now pressing any key takes me to Python numeric view showing :
Import phi ... ... Import config I can press clear again to get back to main screen as above, with same issue. I have firmware 2.1.14588 (2021 05 05) CK build 2.1.14575 (2021 4 28) Any ideas what's wrong? |
|||
05-24-2021, 10:03 AM
Post: #16
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-24-2021 08:28 AM)Stevetuc Wrote: 41b is working fine for me on g1. However 41c does not. After pressing clear I get to the main screen. But now pressing any key takes me to Python numeric view showing : Hi, No ideas, I don't have a G1. BUT there are some bugs in micropython. Some code can work in the virtual calc and make the G2 crash ... I found one on a G2 with string.format function ... ok in virtual, crash in real. You have to look at the 41b and 41c code to see what kind of new function/syntax is used in 41c Then try to avoid that by rewriting code differently, and try ... Sorry, that is all I can do |
|||
05-24-2021, 10:48 AM
Post: #17
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-24-2021 10:03 AM)Oulan Wrote:Thanks. I think that might be quite a challenge for me!(05-24-2021 08:28 AM)Stevetuc Wrote: 41b is working fine for me on g1. However 41c does not. After pressing clear I get to the main screen. But now pressing any key takes me to Python numeric view showing : Is anyone running 41c on g1 without issues? if so what version firmware and CK are you using? Thanks Steve |
|||
05-25-2021, 07:00 AM
Post: #18
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-24-2021 10:48 AM)Stevetuc Wrote:(05-24-2021 10:03 AM)Oulan Wrote: Hi,Thanks. I think that might be quite a challenge for me! Just to be sure, what are your settings in Plot/setting for python ? On my G2 I have Heap:1024 and Stack:40000 (and Memory is 233MB). py41c is fine with those settings. 'Files will auto load when changed' is ticked and 'ask before resetting python' is not. Olivier |
|||
05-25-2021, 07:21 AM
(This post was last modified: 05-25-2021 07:23 AM by Stevetuc.)
Post: #19
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
(05-25-2021 07:00 AM)Oulan Wrote:(05-24-2021 10:48 AM)Stevetuc Wrote: Thanks. I think that might be quite a challenge for me! Hi Olivier I have the same settings for Heap and Stack, and same ticked options, but of course the free memory is dramatically less at 11.26MB. I guess this is the issue? I could try reducing the number of modules loaded. |
|||
05-25-2021, 09:42 AM
(This post was last modified: 05-25-2021 09:46 AM by toml_12953.)
Post: #20
|
|||
|
|||
RE: First python project : HP41 emulator + hints of workflow
What are the red hex numbers (circled in blue)?
Tom L Cui bono? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)