Post Reply 
Bit's WP 34S and 31S patches and custom binaries (version: r3802 20150805-1)
03-04-2015, 01:57 PM
Post: #23
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3747 20150207-1)
(03-04-2015 01:18 PM)Dieter Wrote:  There is an issue in SIG mode if the DISP function is used. It noticed this on a 31s with version 1.2 3748. Set SIG 5 and press the pi key. You get the expected 3,14159. Set DISP 7 to get 3,1415927 which is fine either. Now try DISP 8 and the display shows 3,0 0. So the display looks like SCI 1, but X is rounded as in SCI 0. Another DISP 8 yields 3,14159265 0, like in SCI 8. So the first "DISP 8" indeed seems to have set the 31s to SCI mode.

Thank you for reporting this issue!

The argument limit for the DISP command wasn't handled correctly: there needs to be a special case for SIG and SIG0 there. Fortunately it's quite easy to fix, see the two patches below. I don't have more time to work on this right now, but I'll commit the fixes to SVN and update my binaries at some later point.

Code:
diff -ur wp34s_r3757/keys.c wp34s_fix_DISP_in_SIG_modes_r3757_20150304/keys.c
--- wp34s_r3757/keys.c    2015-02-07 13:09:17.000000000 -0500
+++ wp34s_fix_DISP_in_SIG_modes_r3757_20150304/keys.c    2015-03-04 08:49:19.086944778 -0500
@@ -1248,10 +1248,15 @@
 }
 
 static int arg_digit(int n) {
+    int lim;
+#ifdef INCLUDE_SIGFIG_MODE
+    int dispmode = get_dispmode_digs(&lim);
+    const unsigned int base = (State2.runmode && CmdBase == RARG_DISP && (dispmode == MODE_SIG || dispmode == MODE_SIG0) ? RARG_SIG : CmdBase);
+#else
     const unsigned int base = CmdBase;
+#endif
     const unsigned int val = State2.digval * 10 + n;
     const int is_reg = argcmds[base].reg || State2.ind;
-    int lim;
     
     if (State2.local) {
         // Handle local registers and flags
diff -ur wp34s_r3757/xeq.c wp34s_fix_DISP_in_SIG_modes_r3757_20150304/xeq.c
--- wp34s_r3757/xeq.c    2015-02-07 13:09:17.000000000 -0500
+++ wp34s_fix_DISP_in_SIG_modes_r3757_20150304/xeq.c    2015-03-04 08:42:44.882954272 -0500
@@ -2195,8 +2195,11 @@
 
     if (op != RARG_DISP)
         dispmode = (op - RARG_STD) + MODE_STD;
-    dispdigs = arg;
-    set_dispmode_digs(dispmode, dispdigs);
+    else if ((dispmode == MODE_SIG || dispmode == MODE_SIG0) && arg >= 8) {
+        err(ERR_RANGE);
+        return;
+    }
+    set_dispmode_digs(dispmode, arg);
 #else
     UState.dispdigs = arg;

Code:
diff -ur wp31s_r3757/keys.c wp31s_fix_DISP_in_SIG_modes_r3757_20150304/keys.c
--- wp31s_r3757/keys.c    2015-02-07 13:09:33.000000000 -0500
+++ wp31s_fix_DISP_in_SIG_modes_r3757_20150304/keys.c    2015-03-04 08:49:26.186944606 -0500
@@ -826,10 +826,15 @@
 }
 
 static int arg_digit(int n) {
+    int lim;
+#ifdef INCLUDE_SIGFIG_MODE
+    int dispmode = get_dispmode_digs(&lim);
+    const unsigned int base = (State2.runmode && CmdBase == RARG_DISP && (dispmode == MODE_SIG || dispmode == MODE_SIG0) ? RARG_SIG : CmdBase);
+#else
     const unsigned int base = CmdBase;
+#endif
     const unsigned int val = State2.digval * 10 + n;
     const int is_reg = argcmds[base].reg || State2.ind;
-    int lim;
 
     if (State2.local) {
         // Handle local registers and flags
diff -ur wp31s_r3757/xeq.c wp31s_fix_DISP_in_SIG_modes_r3757_20150304/xeq.c
--- wp31s_r3757/xeq.c    2015-02-07 13:09:33.000000000 -0500
+++ wp31s_fix_DISP_in_SIG_modes_r3757_20150304/xeq.c    2015-03-04 08:42:59.254953926 -0500
@@ -1692,8 +1692,11 @@
 
     if (op != RARG_DISP)
         dispmode = (op - RARG_STD) + MODE_STD;
-    dispdigs = arg;
-    set_dispmode_digs(dispmode, dispdigs);
+    else if ((dispmode == MODE_SIG || dispmode == MODE_SIG0) && arg >= 8) {
+        err(ERR_RANGE);
+        return;
+    }
+    set_dispmode_digs(dispmode, arg);
 #else
     UState.dispdigs = arg;
     if (op != RARG_DISP)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Bit's WP 34S and 31S patches and custom binaries (version: r3747 20150207-1) - Bit - 03-04-2015 01:57 PM



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