Post Reply 
First python project : HP41 emulator + hints of workflow
08-05-2021, 07:29 PM (This post was last modified: 08-06-2021 06:13 PM by Guenter Schink.)
Post: #50
RE: First python project : HP41 emulator + hints of workflow
Edit:
I did of course forget something IMPORTANT.
in py41.py line 24 or so, after "def loop():" and before "k=0"add proper indented a line "global addonState" I've added that to the description below.
/EDIT


The HP41 emulator certainly is pretty cool. It is however not so easy to remember the assignments of the keys. One solution is to have some notes handy, but that's not really cool.

I tinkered around a little bit to have something available right away, by using the unused estate left and right of the printout. The display of this is toggled on/off by <SHIFT><VIEW>. Have a look at the picture.

In order to make it work you have to manually do some editing yourself. Please use an editor (e.g. notepad++) that is is suitable to edit text files.

1. Unzip the attached AddOn.zip and add the file AddOn.py to your P41e.hpappdir
2. open nuts.py to edit as text file, goto line 918 "def infos(self,c)" add as next line (proper indented) "return" it should look like
PHP Code:
def infos(self,c):
    return
    
col=(0xFF0000,0x00FF00,0x0000FF)[c]
    if 
self.theme==1:
      
hpprime.fillrect(0,0,20,50,13,0xffffff,0xffffff)
    else:
      
hpprime.fillrect(0,0,20,50,13,0x181818,0x181818)
    
hpprime.textout(0,0,20,hex(self.stack[0]),col
3. save nuts.py
4. open Py41.py to edit as text file
5. on top, right after "import hpprime" add a line "import AddOn"
5a.At line 24 or so, after "def loop():" and before "k=0"add proper indented a line "global addonState"
6. at bottom, after "config.init(cpu) add a line "addonState=False"
7. look upwards and find line 68 "elif k==4:" followed by "pass"
6 after that line insert a new line "elif k==9 and display.lE&0x0080:" folowed by "addonState=AddOn.addon(addonState)" followed by "cpu.togshift()" observe the indentation as in the lines already there. That now should look like:
PHP Code:
###           
      
elif k==4:    # Esc key
        
pass
      elif k
==and display.lE&0x0080:
        
addonState=AddOn.addon(addonState)
        
cpu.togShift()
      
elif k==10:   # Cas key 

8. save Py41e.hpappdir and send it to your real and virtual Prime.

I hope I haven't forgotten anything. And remember this help is invoked (toggled) by <SHIFT><VIEW>

I must admit that's not as elegant as the fine art of Olivier, but may be of great help using the 41cx emulator on the Prime.

Olivier, if you read this perhaps it motivates you to include something like this in your distribution.

Günter


Attached File(s) Thumbnail(s)
   

.zip  AddOn.zip (Size: 628 bytes / Downloads: 13)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: First python project - Vincent Weber - 05-16-2021, 01:17 PM
RE: First python project - ggauny@live.fr - 05-16-2021, 05:23 PM
RE: First python project - tcab - 05-17-2021, 12:00 AM
RE: First python project : HP41 emulator + hints of workflow - Guenter Schink - 08-05-2021 07:29 PM



User(s) browsing this thread: 2 Guest(s)