+ if (SP_PARM == 0) {
+ code = ERR;
+ } else if (yold == ynew && xold == xnew) {
+ code = OK;
+ } else {
+
+ /*
+ * Most work here is rounding for terminal boundaries getting the
+ * column position implied by wraparound or the lack thereof and
+ * rolling up the screen to get ynew on the screen.
+ */
+ if (xnew >= screen_columns(SP_PARM)) {
+ ynew += xnew / screen_columns(SP_PARM);
+ xnew %= screen_columns(SP_PARM);
+ }
+
+ /*
+ * Force restore even if msgr is on when we're in an alternate
+ * character set -- these have a strong tendency to screw up the CR &
+ * LF used for local character motions!
+ */
+ oldattr = SCREEN_ATTRS(SP_PARM);
+ if ((AttrOf(oldattr) & A_ALTCHARSET)
+ || (AttrOf(oldattr) && !move_standout_mode)) {
+ TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move",
+ (unsigned long) AttrOf(oldattr),
+ _traceattr(AttrOf(oldattr))));
+ (void) VIDATTR(A_NORMAL, 0);
+ }