Post Reply 
Yet another HP simulator (using C + X11)
12-02-2021, 10:18 AM
Post: #21
RE: Yet another HP simulator (using C + X11)
(12-02-2021 01:07 AM)cdmackay Wrote:  But the real problem was that many mouse-clicks on the keys are missed. More than half.

Not sure why that is - I frequently use a remote desktop with my headless Raspberry Pi and haven't seen that problem. Are you using X over SSH? (I just enable XDMCP on my LAN and use Xephyr to connect. If someone can sniff those packets I've got bigger problems to worry about than un-encrypted network traffic!).

You can't (yet) easily change the font size but you can make the window bigger by modifying the following lines in x11-calc.h. I added this feature so I could resize the windows to fit the display when using one of the Pi touch screens. If you want to mess with the font _names_ they are defined in x11-calc-font.h.

Code:

#define SCALE_WIDTH     1
#define SCALE_HEIGHT    1

Nice to know to compiles with unstable!

I'm not sure how things work on a MacOS but if you have the X headers installed you should be able to compile it natively..

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
12-03-2021, 01:00 AM
Post: #22
RE: Yet another HP simulator (using C + X11)
thanks! Yes, X over ssh; my server doesn't allow any other sort of login.

I'll give those compiles a try, thanks again.

Cambridge, UK
41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot
Casio, Rockwell 18R
Find all posts by this user
Quote this message in a reply
12-25-2021, 12:00 PM (This post was last modified: 12-26-2021 04:21 PM by Mike T..)
Post: #23
RE: Yet another HP simulator (using C + X11)
Quite a lot more work needed (as the classic machines have slightly different opcodes) but I was wondering what the HP45 fans make of this:

[Image: x11-calc-45.png]

Note: CLX button is pressed in this screen shot.

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
12-25-2021, 12:41 PM
Post: #24
RE: Yet another HP simulator (using C + X11)
Looks good!
Seems to answer the question: What would an HP-45 look like if it were a Woodstock?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
12-25-2021, 01:07 PM
Post: #25
RE: Yet another HP simulator (using C + X11)
(12-25-2021 12:41 PM)rprosperi Wrote:  Looks good!
Seems to answer the question: What would an HP-45 look like if it were a Woodstock?

Actually I hope it looks more like an HP45 as I spent yesterday evening redesigning the buttons to try and match the original...

Perhaps I should make the background darker.

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
12-26-2021, 03:43 AM
Post: #26
RE: Yet another HP simulator (using C + X11)
(12-25-2021 01:07 PM)Mike T. Wrote:  
(12-25-2021 12:41 PM)rprosperi Wrote:  Looks good!
Seems to answer the question: What would an HP-45 look like if it were a Woodstock?

Actually I hope it looks more like an HP45 as I spent yesterday evening redesigning the buttons to try and match the original...

Perhaps I should make the background darker.

For a real 45-like appearance, I suggest these tweaks:

-Smaller buttons with more space between them

-The 4 math operator keys should be half-width (nearly square)

-In several places "-" should be arrow keys, "->"

-y^x, e^x and 10^x powers should be higher

-Label for [shift] [Rv] should have a bar above the x

With such changes, it will be much closed to real 45 in appearance.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
12-26-2021, 12:52 PM
Post: #27
RE: Yet another HP simulator (using C + X11)
(12-02-2021 10:18 AM)Mike T. Wrote:  
(12-02-2021 01:07 AM)cdmackay Wrote:  But the real problem was that many mouse-clicks on the keys are missed. More than half.

Not sure why that is - I frequently use a remote desktop with my headless Raspberry Pi and haven't seen that problem. Are you using X over SSH? (I just enable XDMCP on my LAN and use Xephyr to connect. If someone can sniff those packets I've got bigger problems to worry about than un-encrypted network traffic!).

I just tried building and running the latest from GitHub in a VM running Ubuntu 14.04, and I found that it was dropping mouse events as well, and also just being unbearably sluggish overall. I noticed that while the app was running, compiz was running at over 100% CPU, and xorg was using another 40% or so. Compiz pegging a core could explain the dropped events.

Note that this version does include the -std=gnu99 option that was mentioned earlier... it also includes -no-pie in src/makefile, which I had to remove because it was not recognized, and causing compilation to fail.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-26-2021, 04:13 PM
Post: #28
RE: Yet another HP simulator (using C + X11)
(12-26-2021 12:52 PM)Thomas Okken Wrote:  I just tried building and running the latest from GitHub in a VM running Ubuntu 14.04, and I found that it was dropping mouse events as well, and also just being unbearably sluggish overall. I noticed that while the app was running, compiz was running at over 100% CPU, and xorg was using another 40% or so. Compiz pegging a core could explain the dropped events.

Note that this version does include the -std=gnu99 option that was mentioned earlier... it also includes -no-pie in src/makefile, which I had to remove because it was not recognized, and causing compilation to fail.

Thomas,

If would he helpful to know what VM host you have and which desktop you were using?

Was the simulator using 100% CPU all the time? If it was then that suggests that it is using a default busy loop rather then an dependent sleep() function.

If you send me a private message with the output of 'dpkg --get-selections' that would be useful (alternatively create an issue on github https://github.com/mike632t/x11-calc/blo...em-reports and attach it there). I'll see if I can set up an Ubuntu 14.04 VM in the meantime.

Having seen a similar issue on the Raspberry Pi there I suspect there may be a problem drawing the X11 primitives when hardware acceleration is enabled. It is worth trying to reproduce the problem but I'm not sure I can do much about it!

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
12-26-2021, 04:32 PM (This post was last modified: 12-26-2021 04:34 PM by Mike T..)
Post: #29
RE: Yet another HP simulator (using C + X11)
(12-26-2021 03:43 AM)rprosperi Wrote:  
(12-25-2021 01:07 PM)Mike T. Wrote:  Actually I hope it looks more like an HP45 as I spent yesterday evening redesigning the buttons to try and match the original...

Perhaps I should make the background darker.

For a real 45-like appearance, I suggest these tweaks:

-Smaller buttons with more space between them

-The 4 math operator keys should be half-width (nearly square)

-In several places "-" should be arrow keys, "->"

-y^x, e^x and 10^x powers should be higher

-Label for [shift] [Rv] should have a bar above the x

With such changes, it will be much closed to real 45 in appearance.

Unfortunately I really can't do a lot about the text without a custom font (I know there is a suitable true fype font somewhere but I can't use it as I can only use an X11 bitmap font).

I've made the math function keys narrower, but left the others unchanged to keep the buttons as big as possible so they are easier to use with a touch screen.

[Image: x11-calc-45.png]

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
12-26-2021, 07:07 PM
Post: #30
RE: Yet another HP simulator (using C + X11)
(12-26-2021 04:13 PM)Mike T. Wrote:  If would he helpful to know what VM host you have and which desktop you were using?

The VM host is VirtualBox 6.1.29 r148218 running under the latest MacOS;
the desktop is GNOME 3 with Xorg (no Wayland).

(12-26-2021 04:13 PM)Mike T. Wrote:  Was the simulator using 100% CPU all the time? If it was then that suggests that it is using a default busy loop rather then an dependent sleep() function.

Pretty much, yes, but note that it's not the simulator itself that's using all that CPU time:

Code:
top - 20:01:47 up 10 min,  3 users,  load average: 1.02, 0.61, 0.38
Tasks: 203 total,   2 running, 201 sleeping,   0 stopped,   0 zombie
%Cpu(s): 62.3 us, 14.9 sy,  0.0 ni, 22.6 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st
KiB Mem:   2048144 total,  1580932 used,   467212 free,    19440 buffers
KiB Swap:  2095100 total,     7652 used,  2087448 free.   450480 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                         
 2051 thomas    20   0 1638940 276124  67544 R 116.3 13.5   2:31.84 compiz                                                          
 1019 root      20   0  373216  84776  30160 S  33.2  4.1   0:56.02 Xorg                                                            
 3318 thomas    20   0   22340   2944   2620 S   2.3  0.1   0:01.28 x11-calc-67                                                     
 2281 thomas    20   0 1619444 201468 112084 S   0.7  9.8   0:17.05 Web Content                                                     
 2348 thomas    20   0 1839656 243068  82820 S   0.7 11.9   0:15.93 WebExtensions                                                   
    7 root      20   0       0      0      0 S   0.3  0.0   0:00.68 rcu_sched                                                       
  144 root       0 -20       0      0      0 S   0.3  0.0   0:00.01 kworker/1:1H                                                    
 1734 thomas    20   0  182964   2832   2484 S   0.3  0.1   0:01.25 VBoxClient                                                      
 2558 thomas    20   0  659576  30608  22332 S   0.3  1.5   0:01.39 gnome-terminal                                                  
 3331 thomas    20   0   29168   3128   2576 R   0.3  0.2   0:00.11 top

(12-26-2021 04:13 PM)Mike T. Wrote:  If you send me a private message with the output of 'dpkg --get-selections' that would be useful (alternatively create an issue on github https://github.com/mike632t/x11-calc/blo...em-reports and attach it there).

Will do, you should be getting it shortly.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-27-2021, 12:12 AM
Post: #31
RE: Yet another HP simulator (using C + X11)
(12-26-2021 07:07 PM)Thomas Okken Wrote:  Pretty much, yes, but note that it's not the simulator itself that's using all that CPU time:

Code:
top - 20:01:47 up 10 min,  3 users,  load average: 1.02, 0.61, 0.38
Tasks: 203 total,   2 running, 201 sleeping,   0 stopped,   0 zombie
%Cpu(s): 62.3 us, 14.9 sy,  0.0 ni, 22.6 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st
KiB Mem:   2048144 total,  1580932 used,   467212 free,    19440 buffers
KiB Swap:  2095100 total,     7652 used,  2087448 free.   450480 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                         
 2051 thomas    20   0 1638940 276124  67544 R 116.3 13.5   2:31.84 compiz                                                          
 1019 root      20   0  373216  84776  30160 S  33.2  4.1   0:56.02 Xorg                                                            
 3318 thomas    20   0   22340   2944   2620 S   2.3  0.1   0:01.28 x11-calc-67                                                     
 2281 thomas    20   0 1619444 201468 112084 S   0.7  9.8   0:17.05 Web Content                                                     
 2348 thomas    20   0 1839656 243068  82820 S   0.7 11.9   0:15.93 WebExtensions                                                   
    7 root      20   0       0      0      0 S   0.3  0.0   0:00.68 rcu_sched                                                       
  144 root       0 -20       0      0      0 S   0.3  0.0   0:00.01 kworker/1:1H                                                    
 1734 thomas    20   0  182964   2832   2484 S   0.3  0.1   0:01.25 VBoxClient                                                      
 2558 thomas    20   0  659576  30608  22332 S   0.3  1.5   0:01.39 gnome-terminal                                                  
 3331 thomas    20   0   29168   3128   2576 R   0.3  0.2   0:00.11 top

The good news is that it isn't the busy loop issue (so the compiler is behaving itself), but I have no idea why compiz is taking so much CPU. I'm not a MAC user but I'll see if I can reproduce the problem in QEMU on Debian...

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
03-10-2022, 09:54 PM
Post: #32
RE: Yet another HP simulator (using C + X11)
For anyone that is interested I've just pushed an update to the unstable branch here:

https://github.com/mike632t/x11-calc

With the help and encouragement of others of this forum I've somehow managed to add a simulation of the NUT processor and so I've been able to add the Voyager series to my virtual collection... (Bring your own ROMs)

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
Post Reply 




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