wp34s ui tweaks Message #1 Posted by Andrew Nikitin on 21 June 2013, 11:01 p.m.
I implemented several minor changes to keyboard/display interface. I tied them to enablers in features.h so default builds act as they did before.
1. DEFAULT_DATEMODE
Specifies "default" date mode, the one that is not shown when selected. I tried to set my favorite y.md format and discovered that I cannot work like that since y.md hovers in top line ALL THE TIME. So I pretty much had to switch back to d.my. You would want to change this feature if your favorite mode is other than d.my
Additionally, when DEFAULT_DATEMODE is undefined, there is no date indication whatsoever. Since datemode is something that you set once and never touch, maybe it is the right setting for some because it saves a few bytes.
2. MODIFY_BEG_SSIZE8
When defined, changes the meaning of BEG annunciator. Now it is lit when stack size is 8 (think of BEG as BIG with typo). I found that I like the flexibility of 2 stack sizes, but most of the time I want to use 4 levels + 4 easy to access registers a,b,c,d. So when some library program (or myself) sneakily changes that, I want some visual indication.
3. MODIFY_K62_E3_SWITCH
When defined, modifies meaning of [h] [./,] in DECM mode. Instead of changing radix symbol it turns on/off thousand separator, similar to INT mode.
Here is the patch (preserves original settings). Would you please incorporate it into build?
Index: display.c
===================================================================
--- display.c (revision 3412)
+++ display.c (working copy)
@@ -14,6 +14,7 @@
* along with 34S. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "features.h"
#include "xeq.h"
#include "storage.h"
#include "display.h"
@@ -485,13 +486,21 @@
}
if (!is_intmode()) {
+#ifdef DEFAULT_DATEMODE
switch (UState.date_mode) {
- //case DATE_DMY: q = "d.my\006\006"; break;
+#if (DEFAULT_DATEMODE!=0)
+ case DATE_DMY: q = "d.my\006\006"; break;
+#endif
+#if (DEFAULT_DATEMODE!=1)
case DATE_YMD: q = "y.md\006\006"; break;
+#endif
+#if (DEFAULT_DATEMODE!=2)
case DATE_MDY: q = "m.dy\006\006"; break;
+#endif
default: q = " \006"; break;
}
p = scopy(p, q);
+#endif
p = scopy(p, (get_trig_mode() == TRIG_GRAD)?"\006\006\007":" \006\006\006");
} else {
switch(int_mode()) {
@@ -1614,7 +1623,11 @@
* typing lower case in alpha mode. Turn the big equals if we're
* browsing constants.
*/
+#ifdef MODIFY_BEG_SSIZE8
+ dot(BEG, UState.stack_depth && ! Running);
+#else
dot(BEG, state_pc() <= 1 && ! Running);
+#endif
dot(INPUT, State2.catalogue || State2.alphas || State2.confirm);
dot(DOWN_ARR, (State2.alphas || State2.multi) && State2.alphashift);
dot(BIG_EQ, get_user_flag(A_FLAG));
Index: features.h
===================================================================
--- features.h (revision 3412)
+++ features.h (working copy)
@@ -157,7 +157,27 @@
// Right-justify seven-segment exponent (007 rather than 7 )
//#define INCLUDE_RIGHT_EXP
+// h ./, in DECM mode switches E3 separator on/off (instead of chnaging radix symbol)
+//#define MODIFY_K62_E3_SWITCH
+// BEG annunciators indicates BIG stack size rather than beginning of program
+//#define MODIFY_BEG_SSIZE8
+
+/*
+ * This setting allows to change default mode to one of the other 2
+ * possibilities. The date mode equal to DEFAULT_DATEMODE will not be
+ * announced, the other 2 will be.
+ * When undefined, there will be no indication of date mode (other than result
+ * of date operations).
+ * Since date mode is something that does not change often, or even at all,
+ * undefining this feature may be worth its bytes in savings. To implement
+ * original behaviour set DEFAULT_DATEMODE to 0.
+ * See enum date_modes for values of
+ * DATE_DMY=0, DATE_YMD=1, DATE_MDY=2
+*/
+#define DEFAULT_DATEMODE 0
+
/*******************************************************************/
/* Below here are the automatic defines depending on other defines */
/*******************************************************************/
Index: keys.c
===================================================================
--- keys.c (revision 3412)
+++ keys.c (working copy)
@@ -14,6 +14,7 @@
* along with 34S. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "features.h"
#include "xeq.h"
#include "keys.h"
#include "display.h"
@@ -783,7 +784,11 @@
// Row 7
OP_NIL | OP_OFF,
_RARG | RARG_PAUSE,
+#ifdef MODIFY_K62_E3_SWITCH
+ OP_NIL | OP_THOUS_OFF,
+#else
OP_NIL | OP_RADCOM,
+#endif
STATE_UNFINISHED, // P/R
OP_SPEC | OP_SIGMAPLUS | NO_INT
};
@@ -797,8 +802,12 @@
case K62:
if (UState.intm)
op = UState.nointseparator ? (OP_NIL | OP_INTSEP_ON) : (OP_NIL | OP_INTSEP_OFF);
- else if (UState.fraccomma)
- op = OP_NIL | OP_RADDOT;
+ else
+#ifdef MODIFY_K62_E3_SWITCH
+ if (UState.nothousands) op = OP_NIL | OP_THOUS_ON;
+#else
+ if (UState.fraccomma) op = OP_NIL | OP_RADDOT;
+#endif
break;
case K63: // Program<->Run mode
Edited: 21 June 2013, 11:05 p.m.
|