~ubuntu-branches/ubuntu/natty/ibm-3270/natty

« back to all changes in this revision

Viewing changes to tcl3270/ctlr.c

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2009-12-14 11:48:53 UTC
  • mfrom: (1.1.4 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091214114853-mywixml32hct9jr1
Tags: 3.3.10ga4-2
* Fix section to match override.
* Use debhelper compat level 7.
* Use 3.0 (quilt) source format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Modifications Copyright 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2002,
3
 
 *  2003, 2004, 2005, 2006 by Paul Mattes.
4
 
 * Original X11 Port Copyright 1990 by Jeff Sparkes.
5
 
 *  Permission to use, copy, modify, and distribute this software and its
6
 
 *  documentation for any purpose and without fee is hereby granted,
7
 
 *  provided that the above copyright notice appear in all copies and that
8
 
 *  both that copyright notice and this permission notice appear in
9
 
 *  supporting documentation.
10
 
 *
11
 
 * Copyright 1989 by Georgia Tech Research Corporation, Atlanta, GA 30332.
12
 
 *  All Rights Reserved.  GTRC hereby grants public use of this software.
13
 
 *  Derivative works based on this software must incorporate this copyright
14
 
 *  notice.
15
 
 *
16
 
 * x3270, c3270, s3270 and tcl3270 are distributed in the hope that they will
17
 
 * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the file LICENSE
19
 
 * for more details.
 
2
 * Copyright (c) 1993-2009, Paul Mattes.
 
3
 * Copyright (c) 1990, Jeff Sparkes.
 
4
 * Copyright (c) 1989, Georgia Tech Research Corporation (GTRC), Atlanta, GA
 
5
 *  30332.
 
6
 * All rights reserved.
 
7
 *
 
8
 * Redistribution and use in source and binary forms, with or without
 
9
 * modification, are permitted provided that the following conditions are met:
 
10
 *     * Redistributions of source code must retain the above copyright
 
11
 *       notice, this list of conditions and the following disclaimer.
 
12
 *     * Redistributions in binary form must reproduce the above copyright
 
13
 *       notice, this list of conditions and the following disclaimer in the
 
14
 *       documentation and/or other materials provided with the distribution.
 
15
 *     * Neither the names of Paul Mattes, Jeff Sparkes, GTRC nor the names of
 
16
 *       their contributors may be used to endorse or promote products derived
 
17
 *       from this software without specific prior written permission.
 
18
 *
 
19
 * THIS SOFTWARE IS PROVIDED BY PAUL MATTES, JEFF SPARKES AND GTRC "AS IS" AND
 
20
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
21
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
22
 * ARE DISCLAIMED. IN NO EVENT SHALL PAUL MATTES, JEFF SPARKES OR GTRC BE
 
23
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
24
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
25
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
26
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
27
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
28
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
29
 * POSSIBILITY OF SUCH DAMAGE.
20
30
 */
21
31
 
22
32
/*
35
45
#include "screen.h"
36
46
#include "resources.h"
37
47
 
 
48
#include "charsetc.h"
38
49
#include "ctlrc.h"
39
50
#include "ftc.h"
40
51
#include "ft_cutc.h"
52
63
#include "tablesc.h"
53
64
#include "telnetc.h"
54
65
#include "trace_dsc.h"
 
66
#include "unicodec.h"
55
67
#include "utilc.h"
56
 
#include "widec.h"
57
68
 
58
69
/* Externals: kybd.c */
59
70
extern unsigned char aid;
61
72
/* Globals */
62
73
int             ROWS, COLS;
63
74
int             maxROWS, maxCOLS;
 
75
int             defROWS, defCOLS;
 
76
int             altROWS, altCOLS;
64
77
int             ov_rows, ov_cols;
 
78
Boolean         ov_auto;
65
79
int             model_num;
66
80
int             cursor_addr, buffer_addr;
67
81
Boolean         screen_alt = False;     /* alternate screen? */
69
83
struct ea      *ea_buf;         /* 3270 device buffer */
70
84
                                /* ea_buf[-1] is the dummy default field
71
85
                                   attribute */
 
86
struct ea      *aea_buf;        /* alternate 3270 extended attribute buffer */
72
87
Boolean         formatted = False;      /* set in screen_disp */
73
88
Boolean         screen_changed = False;
74
89
int             first_changed = -1;
79
94
Boolean         dbcs = False;
80
95
 
81
96
/* Statics */
82
 
static struct ea *aea_buf;      /* alternate 3270 extended attribute buffer */
83
97
static unsigned char *zero_buf; /* empty buffer, for area clears */
84
98
static void set_formatted(void);
85
99
static void ctlr_blanks(void);
128
142
        (((c1) & 0x3F) << 6) | ((c2) & 0x3F))
129
143
 
130
144
#define ENCODE_BADDR(ptr, addr) { \
131
 
        if ((addr) > 0xfff) { \
 
145
        if ((ROWS * COLS) > 0x1000) { \
132
146
                *(ptr)++ = ((addr) >> 8) & 0x3F; \
133
147
                *(ptr)++ = (addr) & 0xFF; \
134
148
        } else { \
142
156
 * Initialize the emulated 3270 hardware.
143
157
 */
144
158
void
145
 
ctlr_init(unsigned cmask unused)
 
159
ctlr_init(unsigned cmask _is_unused)
146
160
{
147
161
        /* Register callback routines. */
148
162
        register_schange(ST_HALF_CONNECT, ctlr_half_connect);
185
199
{
186
200
        int defmod;
187
201
 
 
202
        if (ovc < 0 || ovr < 0) {
 
203
                ov_auto = True;
 
204
                ovc = 0;
 
205
                ovr = 0;
 
206
        }
 
207
 
188
208
        switch (mn) {
189
209
        case 2:
190
 
                maxCOLS = 80;
191
 
                maxROWS = 24; 
 
210
                maxCOLS = MODEL_2_COLS;
 
211
                maxROWS = MODEL_2_ROWS; 
192
212
                model_num = 2;
193
213
                break;
194
214
        case 3:
195
 
                maxCOLS = 80;
196
 
                maxROWS = 32; 
 
215
                maxCOLS = MODEL_3_COLS;
 
216
                maxROWS = MODEL_3_ROWS; 
197
217
                model_num = 3;
198
218
                break;
199
219
        case 4:
204
224
                        return;
205
225
                }
206
226
#endif /*]*/
207
 
                maxCOLS = 80;
208
 
                maxROWS = 43; 
 
227
                maxCOLS = MODEL_4_COLS;
 
228
                maxROWS = MODEL_4_ROWS; 
209
229
                model_num = 4;
210
230
                break;
211
231
        case 5:
216
236
                        return;
217
237
                }
218
238
#endif /*]*/
219
 
                maxCOLS = 132;
220
 
                maxROWS = 27; 
 
239
                maxCOLS = MODEL_5_COLS;
 
240
                maxROWS = MODEL_5_ROWS; 
221
241
                model_num = 5;
222
242
                break;
223
243
        default:
261
281
            appres.extended ? "-E" : "");
262
282
 
263
283
        /* Make sure that the current rows/cols are still 24x80. */
264
 
        COLS = 80;
265
 
        ROWS = 24;
 
284
        COLS = defCOLS = MODEL_2_COLS;
 
285
        ROWS = defROWS = MODEL_2_ROWS;
266
286
        screen_alt = False;
 
287
 
 
288
        /* Set the defaults for the alternate screen size. */
 
289
        altROWS = maxROWS;
 
290
        altCOLS = maxCOLS;
267
291
}
268
292
 
269
293
 
291
315
 * Called when a host is half connected.
292
316
 */
293
317
static void
294
 
ctlr_half_connect(Boolean ignored unused)
 
318
ctlr_half_connect(Boolean ignored _is_unused)
295
319
{
296
320
        ticking_start(True);
297
321
}
301
325
 * Called when a host connects, disconnects, or changes ANSI/3270 modes.
302
326
 */
303
327
static void
304
 
ctlr_connect(Boolean ignored unused)
 
328
ctlr_connect(Boolean ignored _is_unused)
305
329
{
306
330
        ticking_stop();
307
331
        status_untiming();
308
332
 
309
 
        if (ever_3270)
 
333
        if (ever_3270) {
310
334
                ea_buf[-1].fa = FA_PRINTABLE | FA_MODIFY;
311
 
        else
 
335
                aea_buf[-1].fa = FA_PRINTABLE | FA_MODIFY;
 
336
        } else {
312
337
                ea_buf[-1].fa = FA_PRINTABLE | FA_PROTECT;
 
338
                aea_buf[-1].fa = FA_PRINTABLE | FA_PROTECT;
 
339
        }
313
340
        if (!IN_3270 || (IN_SSCP && (kybdlock & KL_OIA_TWAIT))) {
314
341
                kybdlock_clr(KL_OIA_TWAIT, "ctlr_connect");
315
342
                status_reset();
322
349
        default_ic = 0x00;
323
350
        reply_mode = SF_SRM_FIELD;
324
351
        crm_nattr = 0;
 
352
 
 
353
        /* On disconnect, reset the default and alternate dimensions. */
 
354
        if (!CONNECTED) {
 
355
            defROWS = MODEL_2_ROWS;
 
356
            defCOLS = MODEL_2_COLS;
 
357
            altROWS = maxROWS;
 
358
            altCOLS = maxCOLS;
 
359
            ctlr_erase(False);
 
360
        }
325
361
}
326
362
 
327
363
 
432
468
void
433
469
ctlr_erase(Boolean alt)
434
470
{
 
471
        int newROWS, newCOLS;
 
472
 
435
473
        kybd_inhibit(False);
436
474
 
437
475
        ctlr_clear(True);
439
477
        /* Let a script go. */
440
478
        sms_host_output();
441
479
 
442
 
        if (alt == screen_alt)
 
480
        if (alt) {
 
481
                newROWS = altROWS;
 
482
                newCOLS = altCOLS;
 
483
        } else {
 
484
                newROWS = defROWS;
 
485
                newCOLS = defCOLS;
 
486
        }
 
487
 
 
488
        if (alt == screen_alt && ROWS == newROWS && COLS == newCOLS)
443
489
                return;
444
490
 
445
491
        screen_disp(True);
446
 
 
447
 
        if (alt) {
448
 
                /* Going from 24x80 to maximum. */
449
 
                screen_disp(False);
 
492
        if (visible_control) {
 
493
                /* Blank the entire display. */
 
494
                ctlr_blanks();
450
495
                ROWS = maxROWS;
451
496
                COLS = maxCOLS;
452
 
        } else {
453
 
                /* Going from maximum to 24x80. */
454
 
                if (maxROWS > 24 || maxCOLS > 80) {
455
 
                        if (visible_control) {
456
 
                                ctlr_blanks();
457
 
                                screen_disp(False);
458
 
                        }
459
 
                        ROWS = 24;
460
 
                        COLS = 80;
461
 
                }
 
497
                screen_disp(False);
 
498
        }
 
499
 
 
500
        ROWS = newROWS;
 
501
        COLS = newCOLS;
 
502
        if (visible_control) {
 
503
                /* Fill the active part of the screen with NULLs again. */
 
504
                ctlr_clear(False);
 
505
                screen_disp(False);
462
506
        }
463
507
 
464
508
        screen_alt = alt;
483
527
        switch (buf[0]) {       /* 3270 command */
484
528
        case CMD_EAU:   /* erase all unprotected */
485
529
        case SNA_CMD_EAU:
 
530
                ctlr_erase_all_unprotected();
486
531
                trace_ds("EraseAllUnprotected\n");
487
 
                ctlr_erase_all_unprotected();
488
532
                return PDS_OKAY_NO_OUTPUT;
489
533
                break;
490
534
        case CMD_EWA:   /* erase/write alternate */
491
535
        case SNA_CMD_EWA:
 
536
                ctlr_erase(True);
492
537
                trace_ds("EraseWriteAlternate");
493
 
                ctlr_erase(True);
494
538
                if ((rv = ctlr_write(buf, buflen, True)) < 0)
495
539
                        return rv;
496
540
                return PDS_OKAY_NO_OUTPUT;
497
541
                break;
498
542
        case CMD_EW:    /* erase/write */
499
543
        case SNA_CMD_EW:
 
544
                ctlr_erase(False);
500
545
                trace_ds("EraseWrite");
501
 
                ctlr_erase(False);
502
546
                if ((rv = ctlr_write(buf, buflen, True)) < 0)
503
547
                        return rv;
504
548
                return PDS_OKAY_NO_OUTPUT;
663
707
                if (!IN_SSCP) {
664
708
                        space3270out(3);
665
709
                        *obptr++ = aid_byte;
666
 
                        trace_ds(see_aid(aid_byte));
 
710
                        trace_ds("%s", see_aid(aid_byte));
667
711
                        if (short_read)
668
712
                            goto rm_done;
669
713
                        ENCODE_BADDR(obptr, cursor_addr);
670
 
                        trace_ds(rcba(cursor_addr));
 
714
                        trace_ds("%s", rcba(cursor_addr));
671
715
                } else {
672
716
                        space3270out(1);        /* just in case */
673
717
                }
926
970
 
927
971
#if defined(X3270_TRACE) /*[*/
928
972
/*
929
 
 * Construct a 3270 command to reproduce the current state of the display.
 
973
 * Construct a 3270 command to reproduce the current state of the display, if
 
974
 * formatted.
930
975
 */
931
976
void
932
977
ctlr_snap_buffer(void)
1052
1097
                        *obptr++ = crm_attr[i];
1053
1098
        return True;
1054
1099
}
 
1100
 
 
1101
/*
 
1102
 * Construct a 3270 command to reproduce the current state of the display
 
1103
 * in SSCP-LU mode.
 
1104
 */
 
1105
void
 
1106
ctlr_snap_buffer_sscp_lu(void)
 
1107
{
 
1108
        register int    baddr = 0;
 
1109
 
 
1110
        /* Write out the screen contents once. */
 
1111
        do {
 
1112
                if (ea_buf[baddr].cc == 0xff) {
 
1113
                        space3270out(1);
 
1114
                        *obptr++ = 0xff;
 
1115
                }
 
1116
                space3270out(1);
 
1117
                *obptr++ = ea_buf[baddr].cc;
 
1118
                INC_BA(baddr);
 
1119
        } while (baddr != 0);
 
1120
 
 
1121
        /* Write them out again, until we hit where the cursor is. */
 
1122
        if (cursor_addr != baddr) {
 
1123
                do {
 
1124
                        if (ea_buf[baddr].cc == 0xff) {
 
1125
                                space3270out(1);
 
1126
                                *obptr++ = 0xff;
 
1127
                        }
 
1128
                        space3270out(1);
 
1129
                        *obptr++ = ea_buf[baddr].cc;
 
1130
                        INC_BA(baddr);
 
1131
                } while (baddr != cursor_addr);
 
1132
        }
 
1133
}
1055
1134
#endif /*]*/
1056
1135
 
1057
1136
 
1156
1235
                        ctlr_add_bg(buffer_addr, 0); \
1157
1236
                        ctlr_add_gr(buffer_addr, 0); \
1158
1237
                        ctlr_add_ic(buffer_addr, 0); \
1159
 
                        trace_ds(see_attr(fa)); \
 
1238
                        trace_ds("%s", see_attr(fa)); \
1160
1239
                        formatted = True; \
1161
1240
                }
1162
1241
 
1226
1305
                case ORDER_SF:  /* start field */
1227
1306
                        END_TEXT("StartField");
1228
1307
                        if (previous != SBA)
1229
 
                                trace_ds(rcba(buffer_addr));
 
1308
                                trace_ds("%s", rcba(buffer_addr));
1230
1309
                        previous = ORDER;
1231
1310
                        cp++;           /* skip field attribute */
1232
1311
                        START_FIELD(*cp);
1241
1320
                        buffer_addr = DECODE_BADDR(*(cp-1), *cp);
1242
1321
                        END_TEXT("SetBufferAddress");
1243
1322
                        previous = SBA;
1244
 
                        trace_ds(rcba(buffer_addr));
 
1323
                        trace_ds("%s", rcba(buffer_addr));
1245
1324
                        if (buffer_addr >= COLS * ROWS) {
 
1325
                                trace_ds("COLS %d ROWS %d\n", COLS, ROWS);
1246
1326
                                ABORT_WRITE("invalid SBA address");
1247
1327
                        }
1248
1328
                        current_fa = get_field_attribute(buffer_addr);
1252
1332
                case ORDER_IC:  /* insert cursor */
1253
1333
                        END_TEXT("InsertCursor");
1254
1334
                        if (previous != SBA)
1255
 
                                trace_ds(rcba(buffer_addr));
 
1335
                                trace_ds("%s", rcba(buffer_addr));
1256
1336
                        previous = ORDER;
1257
1337
                        cursor_move(buffer_addr);
1258
1338
                        last_cmd = True;
1310
1390
                        END_TEXT("RepeatToAddress");
1311
1391
                        cp += 2;        /* skip buffer address */
1312
1392
                        baddr = DECODE_BADDR(*(cp-1), *cp);
1313
 
                        trace_ds(rcba(baddr));
 
1393
                        trace_ds("%s", rcba(baddr));
1314
1394
                        cp++;           /* skip char to repeat */
1315
1395
                        add_dbcs = False;
1316
1396
                        ra_ge = False;
1355
1435
                                        trace_ds(" [invalid DBCS RA character X'%02x%02x'; write aborted]",
1356
1436
                                                add_c1, add_c2);
1357
1437
                                        ABORT_WRITEx;
1358
 
                               }
1359
 
                               dbcs_to_mb(add_c1, add_c2, mb);
1360
 
                               trace_ds_nb("'%s'", mb);
 
1438
                                }
 
1439
                                (void) ebcdic_to_multibyte(
 
1440
                                           (add_c1 << 8) | add_c2,
 
1441
                                           mb, sizeof(mb));
 
1442
                                trace_ds_nb("'%s'", mb);
1361
1443
                        } else
1362
1444
#endif /*]*/
1363
1445
                        {
1414
1496
                        baddr = DECODE_BADDR(*(cp-1), *cp);
1415
1497
                        END_TEXT("EraseUnprotectedAll");
1416
1498
                        if (previous != SBA)
1417
 
                                trace_ds(rcba(baddr));
 
1499
                                trace_ds("%s", rcba(baddr));
1418
1500
                        previous = ORDER;
1419
1501
                        if (baddr >= COLS * ROWS) {
1420
1502
                                ABORT_WRITE("invalid EUA address");
1463
1545
                case ORDER_MF:  /* modify field */
1464
1546
                        END_TEXT("ModifyField");
1465
1547
                        if (previous != SBA)
1466
 
                                trace_ds(rcba(buffer_addr));
 
1548
                                trace_ds("%s", rcba(buffer_addr));
1467
1549
                        previous = ORDER;
1468
1550
                        cp++;
1469
1551
                        na = *cp;
1475
1557
                                                cp++;
1476
1558
                                                ctlr_add_fa(buffer_addr, *cp,
1477
1559
                                                        ea_buf[buffer_addr].cs);
1478
 
                                                trace_ds(see_attr(*cp));
 
1560
                                                trace_ds("%s", see_attr(*cp));
1479
1561
                                        } else if (*cp == XA_FOREGROUND) {
1480
1562
                                                trace_ds("%s",
1481
1563
                                                    see_efa(*cp,
1534
1616
                case ORDER_SFE: /* start field extended */
1535
1617
                        END_TEXT("StartFieldExtended");
1536
1618
                        if (previous != SBA)
1537
 
                                trace_ds(rcba(buffer_addr));
 
1619
                                trace_ds("%s", rcba(buffer_addr));
1538
1620
                        previous = ORDER;
1539
1621
                        cp++;   /* skip order */
1540
1622
                        na = *cp;
1733
1815
                        last_zpt = False;
1734
1816
                        break;
1735
1817
                case FCORDER_NULL:      /* NULL or DBCS control char */
1736
 
                        previous = NULLCH;
1737
1818
                        add_dbcs = False;
1738
1819
                        d = ctlr_lookleft_state(buffer_addr, &why);
1739
1820
                        if (d == DBCS_RIGHT) {
1776
1857
                                END_TEXT("NULL");
1777
1858
                                add_c1 = *cp;
1778
1859
                        }
 
1860
                        previous = NULLCH;
1779
1861
                        ctlr_add(buffer_addr, add_c1, default_cs);
1780
1862
                        ctlr_add_fg(buffer_addr, default_fg);
1781
1863
                        ctlr_add_bg(buffer_addr, default_bg);
1823
1905
                                        trace_ds(" [invalid DBCS character X'%02x%02x'; write aborted]",
1824
1906
                                                add_c1, add_c2);
1825
1907
                                        ABORT_WRITEx;
1826
 
                               }
1827
 
                               add_dbcs = True;
1828
 
                               dbcs_to_mb(add_c1, add_c2, mb);
1829
 
                               trace_ds_nb("%s", mb);
 
1908
                                }
 
1909
                                add_dbcs = True;
 
1910
                                (void) ebcdic_to_multibyte(
 
1911
                                           (add_c1 << 8) | add_c2, mb,
 
1912
                                           sizeof(mb));
 
1913
                                trace_ds_nb("%s", mb);
1830
1914
                        } else {
1831
1915
#endif /*]*/
1832
1916
                                add_c1 = *cp;
1858
1942
        set_formatted();
1859
1943
        END_TEXT0;
1860
1944
        trace_ds("\n");
 
1945
        kybdlock_clr(KL_AWAITING_FIRST, "ctlr_write");
1861
1946
        if (wcc_keyboard_restore) {
1862
1947
                aid = AID_NO;
1863
1948
                do_reset(False);
1903
1988
        int s_row;
1904
1989
        unsigned char c;
1905
1990
        int baddr;
 
1991
        int text = False;
1906
1992
 
1907
1993
        /*
1908
1994
         * The 3174 Functionl Description says that anything but NL, NULL, FM,
1911
1997
         * we display other control codes as spaces.
1912
1998
         */
1913
1999
 
1914
 
        trace_ds("SSCP-LU data\n");
 
2000
        trace_ds("SSCP-LU data\n< ");
1915
2001
        for (i = 0; i < buflen; cp++, i++) {
1916
2002
                switch (*cp) {
1917
2003
                case FCORDER_NL:
1919
2005
                         * Insert NULLs to the end of the line and advance to
1920
2006
                         * the beginning of the next line.
1921
2007
                         */
 
2008
                        if (text) {
 
2009
                            trace_ds("'");
 
2010
                            text = False;
 
2011
                        }
 
2012
                        trace_ds(" NL");
1922
2013
                        s_row = buffer_addr / COLS;
1923
2014
                        while ((buffer_addr / COLS) == s_row) {
1924
2015
                                ctlr_add(buffer_addr, EBC_null, default_cs);
1934
2025
                        /* Some hosts forget they're talking SSCP-LU. */
1935
2026
                        cp++;
1936
2027
                        i++;
1937
 
                        trace_ds(" StartField%s %s [translated to space]\n",
 
2028
                        if (text) {
 
2029
                            trace_ds("'");
 
2030
                            text = False;
 
2031
                        }
 
2032
                        trace_ds(" SF%s %s [translated to space]\n",
1938
2033
                            rcba(buffer_addr), see_attr(*cp));
1939
2034
                        ctlr_add(buffer_addr, EBC_space, default_cs);
1940
2035
                        ctlr_add_fg(buffer_addr, default_fg);
1944
2039
                        INC_BA(buffer_addr);
1945
2040
                        break;
1946
2041
                case ORDER_IC:
1947
 
                        trace_ds(" InsertCursor%s [ignored]\n",
 
2042
                        if (text) {
 
2043
                            trace_ds("'");
 
2044
                            text = False;
 
2045
                        }
 
2046
                        trace_ds(" IC%s [ignored]\n",
1948
2047
                            rcba(buffer_addr));
1949
2048
                        break;
1950
2049
                case ORDER_SBA:
1951
2050
                        baddr = DECODE_BADDR(*(cp+1), *(cp+2));
1952
 
                        trace_ds(" SetBufferAddress%s [ignored]\n", rcba(baddr));
 
2051
                        trace_ds(" SBA%s [ignored]\n", rcba(baddr));
1953
2052
                        cp += 2;
1954
2053
                        i += 2;
1955
2054
                        break;
1962
2061
                                c = EBC_space;
1963
2062
                        else
1964
2063
                                c = *cp;
 
2064
                        if (text) {
 
2065
                            trace_ds("'");
 
2066
                            text = False;
 
2067
                        }
 
2068
                        trace_ds(" GE '%s'", see_ebc(c));
1965
2069
                        ctlr_add(buffer_addr, c, CS_GE);
1966
2070
                        ctlr_add_fg(buffer_addr, default_fg);
1967
2071
                        ctlr_add_bg(buffer_addr, default_bg);
1971
2075
                        break;
1972
2076
 
1973
2077
                default:
 
2078
                        if (!text) {
 
2079
                            trace_ds(" '");
 
2080
                            text = True;
 
2081
                        }
 
2082
                        trace_ds("%s", see_ebc(*cp));
1974
2083
                        ctlr_add(buffer_addr, *cp, default_cs);
1975
2084
                        ctlr_add_fg(buffer_addr, default_fg);
1976
2085
                        ctlr_add_bg(buffer_addr, default_bg);
1980
2089
                        break;
1981
2090
                }
1982
2091
        }
 
2092
        if (text)
 
2093
            trace_ds("'");
 
2094
        trace_ds("\n");
1983
2095
        cursor_move(buffer_addr);
1984
2096
        sscp_start = buffer_addr;
1985
2097
 
2350
2462
{
2351
2463
        int baddr;
2352
2464
 
2353
 
        for (baddr = 0; baddr < ROWS*COLS; baddr++) {
2354
 
                if (!ea_buf[baddr].fa)
2355
 
                        ea_buf[baddr].cc = EBC_space;
 
2465
        for (baddr = 0; baddr < maxROWS*maxCOLS; baddr++) {
 
2466
                ea_buf[baddr].cc = EBC_space;
2356
2467
        }
2357
2468
        ALL_CHANGED;
2358
2469
        cursor_move(0);
2777
2888
}
2778
2889
 
2779
2890
void
2780
 
toggle_showTiming(struct toggle *t unused, enum toggle_type tt unused)
 
2891
toggle_showTiming(struct toggle *t _is_unused, enum toggle_type tt _is_unused)
2781
2892
{
2782
2893
        if (!toggled(SHOW_TIMING))
2783
2894
                status_untiming();
2788
2899
 * No-op toggle.
2789
2900
 */
2790
2901
void
2791
 
toggle_nop(struct toggle *t unused, enum toggle_type tt unused)
 
2902
toggle_nop(struct toggle *t _is_unused, enum toggle_type tt _is_unused)
2792
2903
{
2793
2904
}