Post Reply 
Bit's WP 34S and 31S patches and custom binaries (version: r3802 20150805-1)
11-15-2014, 08:49 PM (This post was last modified: 08-06-2015 02:27 AM by Bit.)
Post: #1
Bit's WP 34S and 31S patches and custom binaries (version: r3802 20150805-1)
I've been usually asked to provide compiled binaries along with my patches for the WP 34S and 31S. I'll publish here the custom builds and those patches that haven't yet made it into the mainline code so they can all be found in one place. Some features in these builds are already present in mainline as compile time options but are disabled, other features are new.

Feedback would be very welcome. I will check this thread every once in a while and update the patches and builds, but not necessarily very often unless I get prodded. Please just send me a private message instead of posting here if you'd only like to ask for updated builds.

It's easy to produce multiple binaries with various patches or compile time options so if you think some other combination of settings would really make sense, let me know. I'm happy to port patches to the 31S and fix bugs but I don't use it regularly, so the users of the 31S are expected to test everything thoroughly.

Changes in the current version compared to mainline:
  • Y register displayed by default
    While it's easy to understand and get used to the basic idea of a stack, it may not be easy for a complete beginner who's new to RPN to master all its nuances, for example to develop such a good intuitive grasp on when to expect a stack lift, and when not to, that they're never taken by surprise. Having a constant reminder on the screen makes it much easier. Therefore I consider the Y register display a more beginner-friendly default. It makes sense to require advanced users to change it if they prefer rather than the other way around.
  • Y register display in integer modes (34S only)
    The Y register can be displayed not only in floating point modes but also in integer modes. The least significant digits are cut off if necessary and the number of removed digits is indicated after a colon, like very large exponents in double precision mode. A new status screen, accessible by [h] [STATUS], shows the word size and the signed integer representation. A more detailed description can be found here.
    [Image: attachment.php?aid=1533]
  • Quick access to bitwise operations (34S only)
    Bitwise operations are directly accessible from the keyboard, no need to dive into catalogs. It's a huge time saver. Please see the illustrated explanation.
  • Four-digit exponents (34S only)
    Four-digit exponents are displayed, and can be entered directly, in double precision mode. During number entry the last three digits of the mantissa are removed if necessary to make space for the four-digit exponent. The mantissa is not rounded in this case and a right hook indicates that some entered digits are not shown, as you can see in the upper two screens in the attached image. When a result with a four-digit exponent is displayed, only the first ten correctly rounded digits of the mantissa are shown as you can see in the lower screens. (I added these features to mainline but they're disabled there.)
    [Image: attachment.php?aid=1534]
  • Smart exponent limits
    The range of valid exponents for the currently entered mantissa is dynamically calculated. You may enter any exponent as long as the number can be stored without loss of precision or overflow. For example, 0e999 or 0.1e385 are allowed in single precision mode but 10e384 isn't. Entering denormal (also called subnormal) numbers is allowed as long as all entered digits can be stored. The digits of the exponent aren't shifted, you receive a warning instead if you try to enter an invalid exponent. (I added these features to mainline but they're currently disabled pending a decision about the default configuration. See this post for the available compile time configuration options.)
  • Significant figures modes
    Two new display modes, SIG and SIG0 (accessible via the [h] FIX catalog in the 34S or the [f] DISP catalog in the 31S), allow the user to specify the number of significant digits displayed. Please see the detailed explanation. (This feature is present but disabled in mainline.)
  • More user-friendly fraction entry
    In the original builds if you enter two numbers as a..b with two consecutive decimal marks, you get the weird mixed fraction a 0/b, which is really the integer a. While this is very simple to implement because it's consistent with how ordinary mixed fractions are handled, it serves no useful purpose. In my builds a..b is treated the same as .a.b and produces the fraction a/b, which makes it more convenient to enter fractions for those who don't find it natural to always start fractions with a decimal mark. (This feature is present but disabled in mainline.)
  • Easy switching between proper and improper fractions (31S only)
    The [f] [a b/c] key switches between proper and improper fractions (or perhaps more accurately: toggles mixed fractions) when already in fraction mode. The IMPFRC and PROFRC commands have been removed from the MODE catalog since they're no longer needed.
  • EEX and decimal fractions exit fraction mode
    Entering a number with an exponent or entering a decimal fraction (e.g. 1.23) will automatically exit fraction mode. (I added these features to mainline but they're disabled there.)
  • Reverse angular conversions (34S only)
    The conversion arrow can be reversed by pressing it again, and the reversed arrow converts from the selected angular mode to the current angular mode. This is much faster than entering the conversion catalog, and the last remembered catalog position doesn't change.
  • Easy angular conversions (31S only)
    The ->DEG function always converts radians to degrees and the ->RAD function always converts degrees to radians, regardless of the current angular mode, so you can do conversions in either direction without having to switch modes. The modified behavior is more sensible than ->DEG doing nothing in degrees mode and ->RAD doing nothing in radians mode because the 31S doesn't support gradians and so only two conversions are possible. It's also what calculators typically do and what most users expect.
  • Rectangular/Polar conversions save the Y register (34S only)
    Rectangular/Polar conversions cannot always be reverted using only the last value of X (register L) because the angular result is reduced modulo 360°. Saving the Y register as if the conversion was a complex operation (and it could certainly be considered as such) solves the problem. There was only one example program in the library that depended on the I register not being modified during such conversions, and I've included a patch to fix that.
    I didn't add this feature to the 31S because on the one hand it doesn't support complex operations so updating the I register would be unusual there, and on the other hand its undo operation can be used to recover the original values.
  • ALL 4 display
    The default display mode after a reset is ALL 4, so up to three zeros can appear after the decimal mark before the display switches to scientific notation. This is more similar to what other calculators typically do and what most people would probably expect than the original default of ALL 0 that makes e.g. 1/3 appear as 3.33333333333e-1. If you prefer the old behavior, just set ALL 0 manually.
  • Easy toggling of the thousands separator (34S only)
    The [h] [./,] key toggles the thousands separator instead of changing the decimal mark. Commas and periods aren't easily distinguishable on the screen of the HP 20b/30b so you could find yourself turning the thousands separator on and off under different lighting conditions or depending on the numbers you work with. A shortcut for that operation is much more useful than one for changing the decimal mark, because most people will select their preferred decimal mark when they start using the calculator and will never change it again. (This feature is present but disabled in mainline.)
  • Eight-level stack by default
    Newcomers to RPN could easily run out of four stack levels if they perform calculations in the wrong order. It also helps with complex numbers etc. and probably many advanced users prefer it but the primary goal is to make the defaults as beginner-friendly as possible.
  • Stack size displayed
    One dot in the upper line indicates a four-level (single) stack and two dots indicate an eight-level (double) stack. These indicators disappear automatically if something else needs the space. (I added this feature to mainline but it's disabled there.)
  • Order of catalog entries fixed (optional)
    In the official build arrow characters are sorted together with alphanumeric ones. This results in, for example, 'mmHg->Pa' preceding 'm->feet' in the conversion menu, which I find very unnatural because the arrow looks like punctuation between words and shorter words should come before longer ones in the dictionary order. This is fixed in my builds and applies to all catalogs.
    For those who are used to the original ordering, I also provide alternative builds with all other changes included except this one.
  • Unit conversions
    - I've renamed 'cft' to 'cu.ft' because the 'cft' notation is very rarely used.
    - I've added sq. ft because it's commonly used and we already have ft and cu. ft among the unit conversions, so it fills a gap.
    - I've added miles per gallon conversions because they're commonly used and aren't very simple to calculate without a dedicated function.
    - The original names of the U.S. survey foot based units ('feetUS' and 'acreUS') were misleading because they're never actually used in everyday situations in the United States. I've renamed them and since probably nobody used them (except by mistake), they're disabled. (If someone does need those units, please let me know.)
    Earlier discussion about these changes can be found here.
  • PREVP
    The PREVP command (find the previous prime number), analogous to NEXTP, has been added to the X.FCN catalog in the 34S and the MORE catalog in the 31S. (I added the code to mainline in r3702 but it's disabled there.)
  • FACTOR, FIB, LOGx, SLVQ, Wp and Wm (31S only)
    The FACTOR (find smallest prime factor), FIB (extended Fibonacci number), LOGx, SLVQ (solve quadratic equation) and Wp and Wm (principal and negative branches of the Lambert W function) commands have been added to the MORE catalog. (These are already available in the 34S, except FACTOR, which is a compile time option that's disabled by default.) SLVQ works exactly as on the 34S and returns complex roots (indicated by a lower case 'i' in the upper line) even though the 31S doesn't support complex calculations otherwise.
  • Warnings in the upper line
    Warnings about invalid digits or exponents are displayed in the upper line only and don't hide the number you're currently typing. The messages are just as informative as before (the lower line only contains the word 'error' in the official build) but they're less visually disruptive. (I added this feature to mainline but it's disabled there.)
  • No-crystal builds (34S only)
    34S binaries ('noxtal') that don't support the crystal oscillator are included. This saves about 1000 bytes compared to the default build. (I added this feature to mainline but such binaries aren't published currently.)
  • No-stopwatch builds (34S only)
    I've included variants of the 'xtal' and 'ir' builds that lack the stopwatch function. This saves about 2000 bytes in the firmware, which is a significant reduction. Many devices offer similar functionality nowadays so it may be a worthwhile trade-off for some. The 'ir_full' binaries are only available without the stopwatch as they'd be too big otherwise.
  • No BEG annunciator (31S only)
    Since the 31S isn't programmable, there's no point in having the little BEG sign lit up on the display.
  • Universal dispatch
    Experimental feature that slightly reduces the size of the firmware, it's present in mainline but is currently disabled there (see point 2 here).
Previously applied changes that have since been incorporated into mainline:
  • Pretty full number display
    When viewing the full X register digits are grouped to improve legibility and the sign is displayed for negative numbers.
    [Image: attachment.php?aid=1218]
The attached file contains all binaries and patches, it's a 7-Zip archive inside a plain old Zip file. The newer 7-Zip format compresses the binaries really well (free decompressors are available for all major operating systems, for example at 7-zip.org), and the outer Zip container is used because this forum doesn't accept 7-Zip attachments.

Changelog:
20141115-1: YDON by default, thousands sep. toggling (34S), a..b fractions, stack size shown, reordered catalogs (optional), cu.ft renamed, sq.ft, mpg, no survey units, universal dispatch, r3688.
20141115-2: LOGx (31S).
20141116-1: Easy switching between im/proper fractions (31S), FIB (31S), r3690.
20141117-1: Pretty full numbers, no BEG annunciator (31S), improved patch for switching between im/proper fractions (31S).
20141127-1: Eight-level stack by default, PREVP, SLVQ (31S), noxtal (34S), pretty full numbers moved to mainline, r3705, build environment fixed.
20150102-1: Y reg. in int. modes (34S), large exponents (34S), smart exp. limits, FACTOR (31S), Wp & Wm (31S), warnings in the upper line, no-stopwatch builds (34S), r3719.
20150121-1: EEX and dec. fractions exit fraction mode, ALL 4, r3738.
20150125-1: Quick bitwise operations (34S), r3743.
20150131-1: Reverse angular conv. (34S), easy angular conv. (31S), R<->P saves Y (34S), VERS indicates modified build, r3745.
20150207-1: Significant figures modes, r3747.
20150805-1: r3802.


Attached File(s) Thumbnail(s)
   

.zip  Bits_WP_3xS_builds_r3747_20150207-1.zip (Size: 339.42 KB / Downloads: 60)
.zip  Bits_WP_3xS_builds_r3802_20150805-1.zip (Size: 339.91 KB / Downloads: 53)
Find all posts by this user
Quote this message in a reply
11-15-2014, 09:45 PM
Post: #2
RE: Bit's WP 34S and 31S patches and custom binaries
(11-15-2014 08:49 PM)Bit Wrote:  ...

The attached file contains all binaries and patches, it's a 7-Zip archive inside a plain old Zip file. The newer 7-Zip format compresses the binaries really well (free decompressors are available for all major operating systems, for example at 7-zip.org), and the outer Zip container is used because this forum doesn't accept 7-Zip attachments.

Thanks for this! I've downloaded and applied the patch files; I look forward to being able to carry out miles per gallon conversions much more easily than before. One minor problem: my wp34s code files live in the folder "trunk\" whereas your patch files expect them to be in the folder "wp34s_r3682\". It's easy to fix this, of course.

Out of curiosity, how many people out there compile their own firmware? More than ten? Less?

I've had so much fun with this code over the past couple of years. Thanks to everyone once again. Long live open source!

Nigel (UK)
Find all posts by this user
Quote this message in a reply
11-15-2014, 10:22 PM (This post was last modified: 11-15-2014 10:24 PM by Bit.)
Post: #3
RE: Bit's WP 34S and 31S patches and custom binaries
(11-15-2014 09:45 PM)Nigel (UK) Wrote:  Thanks for this! I've downloaded and applied the patch files; I look forward to being able to carry out miles per gallon conversions much more easily than before. One minor problem: my wp34s code files live in the folder "trunk" whereas your patch files expect them to be in the folder "wp34s_r3682". It's easy to fix this, of course.

I'm glad you find it useful.

I intentionally create patches this way so they can be easily applied to both the 34S and the 31S. Just go to the 'trunk' or the 'branches/wp31s' directory and instruct the patch utility to strip the outermost directory from the patch. On the command line it's the '-p1' option.
Find all posts by this user
Quote this message in a reply
11-21-2014, 06:34 AM
Post: #4
RE: Bit's WP 34S and 31S patches
(11-15-2014 08:49 PM)Bit Wrote:  Feedback would be very welcome.
[*]Unit conversions
- I've added miles per gallon conversions because they're commonly used and aren't very simple to calculate without a dedicated function.
Are those Imperial gallons, US gallons, or both?
As a metric person (litres per 100km) it has always amused me, that you could "improve" a car's mileage by taking it to a different country.
Find all posts by this user
Quote this message in a reply
11-21-2014, 11:21 AM
Post: #5
RE: Bit's WP 34S and 31S patches and custom binaries
(11-21-2014 06:34 AM)sa-penguin Wrote:  
(11-15-2014 08:49 PM)Bit Wrote:  Feedback would be very welcome.
[*]Unit conversions
- I've added miles per gallon conversions because they're commonly used and aren't very simple to calculate without a dedicated function.
Are those Imperial gallons, US gallons, or both?
As a metric person (litres per 100km) it has always amused me, that you could "improve" a car's mileage by taking it to a different country.

Both are included. Bit is always very thorough!

Nigel (UK)
Find all posts by this user
Quote this message in a reply
11-27-2014, 09:07 AM (This post was last modified: 11-27-2014 09:37 AM by BarryMead.)
Post: #6
RE: Bit's WP 34S and 31S patches and custom binaries (latest version: r3690 20141117-1)
(11-15-2014 08:49 PM)Bit Wrote:  The attached file contains all binaries and patches, it's a 7-Zip archive inside a plain old Zip file. The newer 7-Zip format compresses the binaries really well (free decompressors are available for all major operating systems, for example at 7-zip.org), and the outer Zip container is used because this forum doesn't accept 7-Zip attachments.

I flashed my WP-34s with this image, and while I really like what I see, I did have one question.
When you bring up the status display with "h status" the right hand area of the display has some
symbols that I have never seen before and don't understand. They appear to be:
0 - |
-

Sorry I couldn't paste a screen image, because I don't have an emulator of this same version of the calculator (Version 3691).
Only the flash images not the emulator.exe files were included in the Bits_WP_3xS_builds_r3690_20141117-1.7z double zipped
file.

I am only able to approximate what I see on the very right hand section of the status display with crude
minus sign and vertical bar characters, but there is a small zero (if no labels A..D) are defined, and
a few non-number parts of the 7-segment display are illuminated.

I don't doubt that once I understand them I will be grateful for their meaning, but at the moment I don't
have a clue.

What do these symbols indicate or mean?
Find all posts by this user
Quote this message in a reply
11-27-2014, 04:12 PM
Post: #7
RE: Bit's WP 34S and 31S patches and custom binaries (latest version: r3690 20141117-1)
Just checked (the latest) build 3697 on the emulator. I see the normal status display as documented. Did you compare with the manual?

d:-?
Find all posts by this user
Quote this message in a reply
11-27-2014, 04:38 PM (This post was last modified: 11-27-2014 04:48 PM by Bit.)
Post: #8
RE: Bit's WP 34S and 31S patches and custom binaries (latest version: r3690 20141117-1)
(11-27-2014 09:07 AM)BarryMead Wrote:  I don't doubt that once I understand them I will be grateful for their meaning, but at the moment I don't have a clue.
Thank you for your kind words but unfortunately those symbols aren't some useful extra feature, it's simply a bug. I don't know what's the culprit but I'll look into it and fix it when I have the time and post an update. Thanks for reporting it!

Walter, it seems it only shows up in my builds and only on real hardware.
Find all posts by this user
Quote this message in a reply
11-27-2014, 06:28 PM (This post was last modified: 11-27-2014 06:39 PM by Bit.)
Post: #9
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3705 20141127-1)
(11-27-2014 04:38 PM)Bit Wrote:  
(11-27-2014 09:07 AM)BarryMead Wrote:  I don't doubt that once I understand them I will be grateful for their meaning, but at the moment I don't have a clue.
Thank you for your kind words but unfortunately those symbols aren't some useful extra feature, it's simply a bug. I don't know what's the culprit but I'll look into it and fix it when I have the time and post an update. Thanks for reporting it!

Walter, it seems it only shows up in my builds and only on real hardware.

The problem was that I used the wrong compiler. I've published an updated package in the first post, in which I believe this has been fixed.

I've also added a few new features (see the changelog at the end of the first post), and used the latest code from SVN that includes some new bugfixes (commit browser, forum thread).

Thank you again for pointing out the issue. Please report any behavior that seems broken or inconsistent or simply weird or just not user-friendly enough. Such feedback is extremely helpful.
Find all posts by this user
Quote this message in a reply
11-27-2014, 10:42 PM
Post: #10
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3705 20141127-1)
(11-27-2014 06:28 PM)Bit Wrote:  The problem was that I used the wrong compiler.
We've had some trouble with any GCC version coming from CodeSourcery or having a version number > 4.6.x. That's why I stick with Yargarto 4.6.0 for my builds. There must be some code generation bugs related to either the space optimizations we are using or the specific ARM architecture implemented by the Atmel chip. I just didn't have enough time and knowledge to investigate the exact reasons for the various failures.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
11-28-2014, 04:16 AM
Post: #11
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3705 20141127-1)
(11-27-2014 10:42 PM)Marcus von Cube Wrote:  That's why I stick with Yargarto 4.6.0 for my builds.
That's exactly what I'm using now. It works well with Wine on Linux.
Find all posts by this user
Quote this message in a reply
11-28-2014, 09:07 AM
Post: #12
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3705 20141127-1)
(11-28-2014 04:16 AM)Bit Wrote:  
(11-27-2014 10:42 PM)Marcus von Cube Wrote:  That's why I stick with Yargarto 4.6.0 for my builds.
That's exactly what I'm using now. It works well with Wine on Linux.

Do you have a windows/wine exe file for the emulator that matches the latest 3705 release?
It wasn't included in the zip file.
Find all posts by this user
Quote this message in a reply
11-29-2014, 04:46 AM
Post: #13
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3705 20141127-1)
(11-28-2014 09:07 AM)BarryMead Wrote:  Do you have a windows/wine exe file for the emulator that matches the latest 3705 release?
It wasn't included in the zip file.
I managed to create a Windows build environment in a virtual machine and compiled 34S and 31S binaries. You'll find them in the first post, just copy the .exe files into the install directories of the official emulators.

Marcus, is there a document somewhere explaining the dependencies and procedures for the Windows build? I installed VS 2010 Express but that by itself didn't seem to do the trick, the build scripts tried to use utilities like 'svnversion' and 'touch' that aren't available on Windows by default.
Find all posts by this user
Quote this message in a reply
11-29-2014, 05:16 AM
Post: #14
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3705 20141127-1)
(11-29-2014 04:46 AM)Bit Wrote:  I managed to create a Windows build environment in a virtual machine and compiled 34S and 31S binaries. You'll find them in the first post, just copy the .exe files into the install directories of the official emulators.
Thanks Bit works like a charm.
Find all posts by this user
Quote this message in a reply
11-29-2014, 03:12 PM
Post: #15
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3705 20141127-1)
(11-29-2014 04:46 AM)Bit Wrote:  Marcus, is there a document somewhere explaining the dependencies and procedures for the Windows build? I installed VS 2010 Express but that by itself didn't seem to do the trick, the build scripts tried to use utilities like 'svnversion' and 'touch' that aren't available on Windows by default.

You'll need an SVN command line client in your path, something like MinGW to have a Unix like environment, and, last but not least, Perl. The whole process is convoluted at best. I've inherited part of it when I joined the project but I must admit that I've added a good deal to the mess such as the requirement for svnversion. Wink

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
01-03-2015, 02:30 AM
Post: #16
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3719 20150102-1)
I've updated the builds to the latest version and they include all the new features that have been developed recently. The 7-Zip (in Zip) file contains the full collection of flash images as well as two Windows binaries for testing.

Quite a few settings have been changed now. I selected what seemed to me like the most practical options but if someone strongly believes some other combination would be really useful, I'm happy to discuss it.

Enjoy, and please report any issues found.
Find all posts by this user
Quote this message in a reply
01-22-2015, 07:39 PM (This post was last modified: 01-22-2015 07:44 PM by BarryMead.)
Post: #17
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3738 20150121-1)
Bit:

When I download/unzip/un7zip the file Bits_WP_3xS_builds_r3738_20150121-1.zip and flash my calculator the "VERS" function shows version 3739, but when I copy the wp34sgui_Bit.exe file from the Win32GUI subdirectory into the wp34s-3738/trunk/windows/bin/ directory, and run the emulator exe from there, the emulator shows a version number of "0" Zero. Is there any reason for this discrepancy?

Thanks for the patches and contributions, I really like the improvements.
Find all posts by this user
Quote this message in a reply
01-23-2015, 02:01 AM
Post: #18
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3738 20150121-1)
(01-22-2015 07:39 PM)BarryMead Wrote:  Bit:

When I download/unzip/un7zip the file Bits_WP_3xS_builds_r3738_20150121-1.zip and flash my calculator the "VERS" function shows version 3739, but when I copy the wp34sgui_Bit.exe file from the Win32GUI subdirectory into the wp34s-3738/trunk/windows/bin/ directory, and run the emulator exe from there, the emulator shows a version number of "0" Zero. Is there any reason for this discrepancy?

Thanks for the patches and contributions, I really like the improvements.

The reason for the zero is very unexciting: I was playing with the create_revision.c file and forgot to revert the changes for the Windows build. Fortunately it's a purely cosmetic issue. I'll fix it the next time I update the binaries.

Thank you for the feedback!
Find all posts by this user
Quote this message in a reply
01-25-2015, 10:38 PM
Post: #19
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3743 20150125-1)
I've updated the builds and added a new feature: Quick access to bitwise operations.
Find all posts by this user
Quote this message in a reply
01-31-2015, 02:56 PM
Post: #20
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3745 20150131-1)
I've updated the builds and added some new features to make angular conversions easier, made rectangular/polar conversions save the Y register, and VERS now indicates that it's a modified build.
Find all posts by this user
Quote this message in a reply
Post Reply 




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