DM42 skin for the Free42 simulator

Discussion around the Swiss Micros DM42 calculator.
tycho
Posts: 35
Joined: Sun Nov 05, 2017 4:09 pm
Location: Norway

Re: DM42 skin for the Free42 simulator

It's maybe not too bad, but the final apk was about 11 MB, and my own library was less than 1 MB. Here are the libs I linked with (April 2018):
3,636,180 libQt5Core.so
2,639,036 libQt5Gui.so
746,756 libQt5Network.so
2,041,916 libQt5Qml.so
2,284,196 libQt5Quick.so
I havent used Flutter myself, but I think it is easier to make it more barebone, you don't need to drag in a big framework/ toolkit like Qt. That said, Qt Quick/Qml is probably more mature now and will also work well for you.
"The Answer to the Great Question... Of Life, the Universe and Everything... Is... DM42" ― Adam Douglas

Thomas Okken
Posts: 716
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: DM42 skin for the Free42 simulator

Sad and/or amusing facts: adding 10 MB would make Free42 about three times as large as it is now, or about 10 times as large as before the Intel library. Also, the combined sizes of the icons and skins in the current iOS version are larger than Byron Foster's whole 42s app (which is pre-Intel-lib).

And yet, even at 16 MB, a Qt-based Free42 would still be among the smallest 1/3 of apps on my iPhone.

I've been watching computer videos on YouTube lately — some about modern gear, but mostly about old stuff, 8-Bit Guy, Adrian's Digital Basement, that sort of thing — and just the other day, I was marveling at how excited I was back in 1986, when I added an HD20 to my Macintosh. That's a 20 MB hard disk.

Walter
Posts: 1570
Joined: Tue May 02, 2017 11:13 am
Location: Close to FRA, Germany

Re: DM42 skin for the Free42 simulator

Thomas Okken wrote:
Wed Jan 15, 2020 12:52 am
... I was marveling at how excited I was back in 1986, when I added an HD20 to my Macintosh. That's a 20 MB hard disk.
I remember when I bought the first PC for my family, also with a 20MB HDD. At that time I could not imagine that we would ever fill this volume. Those were the times ... then came hungry operating systems and digital fotography.
DM42 SN: 00041 Beta
WP 43S running on this device

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

mezoganet
Posts: 124
Joined: Tue Jan 22, 2019 1:54 pm
Location: Tours, France

Re: DM42 skin for the Free42 simulator

Walter wrote:
Wed Jan 15, 2020 7:13 am
Thomas Okken wrote:
Wed Jan 15, 2020 12:52 am
... I was marveling at how excited I was back in 1986, when I added an HD20 to my Macintosh. That's a 20 MB hard disk.
I remember when I bought the first PC for my family, also with a 20MB HDD. At that time I could not imagine that we would ever fill this volume. Those were the times ... then came hungry operating systems and digital fotography.
More than photos storage, imagine when you dive into machine Learning...

1 or 2 Go is nothing ! Far far away from the good old HP’s
HP33E, HP34C, HP41C, HP16C, HP28S, HP42S, HP48S, HP12C, HP35S, DM42, DM41L, DM15L, DM41X (SN#15) and HP3000 @ work during 18 yrs as IT Mgr

Geoff Quickfall
Posts: 326
Joined: Wed May 24, 2017 10:44 pm
Contact:

Re: DM42 skin for the Free42 simulator

In 1984 the lab where I was doing MSc had funds for an IBM PC clone. So we made one and installed two 5MB hard drives. Had the largest hard drive capability around! An Intel 8086 with a monochrome amber Amdek display and a dot matrix printer.

I used the 41CX and HPIL to do the data storage and number crunching and the PC for, i think, the first iteration of dungeons and dragons.

pcscote
Posts: 119
Joined: Tue May 02, 2017 12:12 pm

Re: DM42 skin for the Free42 simulator

Geoff Quickfall wrote:
Fri Jan 17, 2020 4:54 am
I used the 41CX and HPIL to do the data storage and number crunching and the PC for, i think, the first iteration of dungeons and dragons.
That gives the machines their true places, the HP-41CX for real work and the PC for gaming!
[DM1x/DM1xL/DM41/DM41L/DM41X/DM42]

whuyse
Posts: 70
Joined: Thu Dec 21, 2017 1:23 pm

Re: DM42 skin for the Free42 simulator

GETKEY behaves erratically on the first row of keys (not the menu keys).
The real DM42 returns 1-6 for the row S+ to XEQ, and doesn't work for the menu keys (which is a pity, BTW)
The DM42 skin returns 1-6 for the menu keys and 2192 for S+, 2072 for 1/X etc.

Cheers, Werner
42S #3249S01123
DM42 #00345

Thomas Okken
Posts: 716
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: DM42 skin for the Free42 simulator

whuyse wrote:
Mon Jan 20, 2020 11:58 am
GETKEY behaves erratically on the first row of keys (not the menu keys).
[...]
The DM42 skin returns 1-6 for the menu keys and 2192 for S+, 2072 for 1/X etc.
Hmmm, yes, when I implemented the "direct command mapping" feature, I didn't give any thought to how that would affect GETKEY.

"Direct command mapping" allows a key to be mapped directly to a function, instead of a key code. The way such a key press is communicated by the shell to the core is by calling the core_keydown_command() function instead of the usual core_keydown(), and core_keydown_command() looks up the function name in the function table (returning CMD_INV (24) for 1/X, CMD_SIGMAADD (144) for Σ+, and so on — see common/core_tables.h); it then adds 2048 to that function number and passes the result as the key code to core_keydown().

Deep inside the guts of keystroke processing, these magical key codes > 2048 are then recognized and treated in a mostly sensible manner, except in the case of GETKEY, which simply puts that code in the X register and returns.

The good news is that the behavior is not erratic, it is entirely predictable and could even be potentially useful, but I guess it might be more useful to map the function numbers back to key numbers in the normal 1-74 range.

That mapping is pretty straightforward for functions that are on the keyboard, but it's not so obvious what should happen with functions that are not. And maybe even the obvious mapping isn't the right thing to do. One way out would be to modify the macro syntax to allow specifying the desired GETKEY result explicitly, e.g.

Code: Select all

Macro: 101 "Σ+" 1
Macro: 102 "Σ-" 38
with the default behavior, when no GETKEY code is specified, to be the existing behavior, since it might actually be useful once you understand what it does.
Last edited by Thomas Okken on Mon Jan 20, 2020 4:46 pm, edited 1 time in total.

Thomas Okken
Posts: 716
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: DM42 skin for the Free42 simulator

Thomas Okken wrote:
Mon Jan 20, 2020 1:36 pm
with the default behavior, when no GETKEY code is specified, to be the existing behavior, since it might actually be useful once you understand what it does.
On second thought, it would probably be better if the default behavior is to map the function number to the key where it is mapped on the standard keyboard, if it exists, and some obviously out-of-band value like -1, or even an error, if not. If a skin designer specifically wants to return a value > 74, they can still do so, but it would have to be specified explicitly.
Thomas Okken wrote:
Mon Jan 20, 2020 2:21 pm
some obviously out-of-band value like -1, or even an error, if not
On third thought, that case could also be handled by beeping and otherwise doing nothing. It's not written in stone that GETKEY has to return when a key is pressed, and "beep and do nothing" when neither a sensible default mapping nor an explicit one exists accomplishes two things: (1) the user can tell that something is wrong, and (2) programs don't go haywire trying to handle unexpected key codes.

Hmm, on fourth thought, regarding reason (2) above, when would it make sense to return key codes outside of the 1...74 range? Existing programs won't expect it, and users won't expect it, either. So, supporting explicitly defined GETKEY codes for direct command mappings would be useful only when you have a combination of a skin and programs designed to take advantage of it.

I think I'll just keep it simple:

When a direct-command-mapped key is pressed during GETKEY, and
• the command appears on the standard keyboard: the standard key code will be returned. So, any mapping of "Σ+" will return 1, any mapping of "Σ-" will return 38, etc.
• the command does not appear on the standard keyboard: the short, high error beep will sound, and GETKEY will continue waiting.
Straightforward, intuitive, surprise-free... and, as a nice bonus, it can be implemented entirely within the core, so no changes to five different flavors of skin handling code are needed.

Thomas Okken
Posts: 716
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: DM42 skin for the Free42 simulator

I fixed the second-row GETKEY behavior with the DM42 skin, and fixed another, similar bug in GETKEY as well. The fix is in GitHub now; I'll sit on it for a few days, and assuming nothing else comes up, I'll release it this weekend.