Trying to improve x49gp
08-31-2018, 08:15 AM (This post was last modified: 08-31-2018 03:36 PM by 3298.)
Post: #50
 3298 Member Posts: 117 Joined: Oct 2014
RE: Trying to improve x49gp
(08-31-2018 12:10 AM)brickviking Wrote:  I'd like the ability to fire up a hp49g+; do I simply swap out the png, or do I have to tweak the config to use the 49g+ firmware? (Is there any practical binary difference?)
You go into the config and replace the line reading "type=hp50g" by "type=hp49g+". Editing the line reading "name=HP 50g" is optional, but may avoid confusion (if you delete that line entirely, it will be regenerated as "name=HP 50g" or "name=HP 49g+" depending on the value of the "type=" line, so you can also just remove it). x49gp will then use the other .png file for its appearance.
(08-31-2018 12:10 AM)brickviking Wrote:  Additionally, how do I select this at runtime, i.e. x49gp -49|-50?
Not possible. The type is part of the calculator state, so it belongs into the config.
(08-31-2018 12:10 AM)brickviking Wrote:  Related to the first item, how would I "reset" the firmware during running, i.e. it boots up as a 50g, but I want to have a 49g+ without shutting down, erasing ~/.x49gp/* and reloading?
Not possible either. I don't really see the point of it, though.
(08-31-2018 12:10 AM)brickviking Wrote:  and I still have to source a 49g+ firmware, I'm not sure I actually have one.
The 49g+ uses the same firmware as the 50g, so you definitely have one.

(08-31-2018 12:47 AM)Claudio L. Wrote:  Basically, the only thing you'd need to change is the background image, everything else is identical in both machines, as far as the emulator is concerned.
There's no difference in the firmware between 49g+ and 50g, except the text that appears when you use the VERSION command. The differences were mainly in the hardware (USB power, 4 batteries, tougher keys, etc), which is obviously meaningless in the emulator.
In addition to that, I believe the 49g+ had one less communication port (was it IR or serial? Don't remember). That's irrelevant too, because x49gp does not implement any communication to the outside world other than the SD card.

When creating a flash image from the firmware, x49gp also uses one of two different bootloader versions, depending on the calculator type. I assume they were dumped from real calculators of their respective types, and it's appropriate that the 49g+ gets an older version than the 50g (3.15.04 vs 4.01.03.03). I'm pretty sure they are irrelevant during operation, as the bootcode has nothing to say after it successfully starts the firmware.
Oh, the serial numbers (stored at the end of the bootloader) are also different: DE00000001 for the 49g+. DEA0000001 for the 50g.

That's it for the differences between 49g+ and 50g in x49gp: appearance and bootloader, including serial number. There are absolutely no other special cases in the code. If you change the type in the config without deleting the flash, you can even get a calculator with the 'wrong' bootloader and serial number, but it'll work just fine.

-----
Edit:
I thought of two more things I could improve in the context of flash creation.
Code:
When loading a firmware during flash initialization, check for the KINPOUPDATEIMAGE signature, and fail if it's missing
Code:
When selecting a firmware interactively, show errors in a message window and retry The user may not even have a terminal open to catch the error message, so the previous behavior was basically a silent failure to them.
Makes sense, doesn't it?

Attached File(s)