-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreen.c
1815 lines (1286 loc) · 32.9 KB
/
screen.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* screen.c - Generic screen manipulation
* Copyright (c) 1995-1997 Stefan Jokisch
*
* This file is part of Frotz.
*
* Frotz is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Frotz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "frotz.h"
extern void A00268 (int, zword);
extern int A00269 (zword);
static struct {
enum story A00075;
int pic;
int pic1;
int pic2;
} mapper[] = {
{ ZORK_ZERO, 5, 497, 498 },
{ ZORK_ZERO, 6, 501, 502 },
{ ZORK_ZERO, 7, 499, 500 },
{ ZORK_ZERO, 8, 503, 504 },
{ ARTHUR, 54, 170, 171 },
{ SHOGUN, 50, 61, 62 },
{ UNKNOWN, 0, 0, 0 }
};
/* These are usually out of date. Always update before using. */
static int font_height = 1;
static int font_width = 1;
static bool input_redraw = FALSE;
static bool more_prompts = TRUE;
static bool discarding = FALSE;
static bool cursor = TRUE;
static int input_window = 0;
static Zwindow wp[8], *cwp = wp;
Zwindow * curwinrec() { return cwp;}
/*
* winarg0
*
* Return the window number in zargs[0]. In V6 only, -3 refers to the
* current window.
*
*/
static zword winarg0 (void)
{
if (A00035 == V6 && A00247( zargs[0] ) == -3)
return cwin;
if (zargs[0] >= ((A00035 == V6) ? 8 : 2))
A00188 (ERR_ILL_WIN);
return zargs[0];
}/* winarg0 */
/*
* winarg2
*
* Return the (optional) window number in zargs[2]. -3 refers to the
* current window. This optional window number was only used by some
* V6 opcodes: set_cursor, set_margins, set_colour.
*
*/
static zword winarg2 (void)
{
if (zargc < 3 || A00247( zargs[2] ) == -3)
return cwin;
if (zargs[2] >= 8)
A00188 (ERR_ILL_WIN);
return zargs[2];
}/* winarg2 */
/*
* update_cursor
*
* Move the hardware cursor to make it match the window properties.
*
*/
static void update_cursor (void)
{
A00233 (
cwp->y_pos + cwp->y_cursor - 1,
cwp->x_pos + cwp->x_cursor - 1);
}/* update_cursor */
/*
* reset_cursor
*
* Reset the cursor of a given window to its initial position.
*
*/
static void reset_cursor (zword win)
{
int lines = 0;
if (A00035 <= V4 && win == 0)
lines = wp[0].y_size / hi (wp[0].font_size) - 1;
wp[win].y_cursor = hi (wp[0].font_size) * lines + 1;
wp[win].x_cursor = wp[win].left + 1;
if (win == cwin)
update_cursor ();
}/* reset_cursor */
/*
* A00031
*
* Turn more prompts on/off.
*
*/
void A00031 (bool flag)
{
if (flag && !more_prompts)
cwp->line_count = 0;
more_prompts = flag;
}/* A00031 */
/*
* units_left
*
* Return the #screen units from the cursor to the end of the line.
*
*/
static int units_left (void)
{
return cwp->x_size - cwp->right - cwp->x_cursor + 1;
}/* units_left */
/*
* A00267
*
* Return maximum width of a line in the given window. This is used in
* connection with the extended output stream #3 call in V6.
*
*/
zword A00267 (zword win)
{
if (A00035 == V6) {
if (win >= 8)
A00188 (ERR_ILL_WIN);
return wp[win].x_size - wp[win].left - wp[win].right;
} else return 0xffff;
}/* A00267 */
/*
* countdown
*
* Decrement the newline counter. Call the newline interrupt when the
* counter hits zero. This is a helper function for A00208.
*
*/
static void countdown (void)
{
if (cwp->nl_countdown != 0)
if (--cwp->nl_countdown == 0)
A00269 (cwp->nl_routine);
}/* countdown */
/*
* A00208
*
* Print a newline to the screen.
*
*/
void A00208 (void)
{
if (discarding) return;
/* Handle newline interrupts at the start (for most cases) */
if (A00049 != INTERP_MSDOS || A00075 != ZORK_ZERO || A00037 != 393)
countdown ();
/* Check whether the last input line gets destroyed */
if (input_window == cwin)
input_redraw = TRUE;
/* If the cursor has not reached the bottom line, then move it to
the next line; otherwise scroll the window or reset the cursor
to the top left. */
cwp->x_cursor = cwp->left + 1;
A00217(0, &font_height, &font_width);
if (cwp->y_cursor + 2 * font_height - 1 > cwp->y_size)
if (A00091) {
zword y = cwp->y_pos;
zword x = cwp->x_pos;
A00231 (y,
x,
y + cwp->y_size - 1,
x + cwp->x_size - 1,
font_height);
} else cwp->y_cursor = 1;
else cwp->y_cursor += font_height;
update_cursor ();
/* See if we need to print a more prompt (unless the game has set
the line counter to -999 in order to suppress more prompts). */
if (A00091 && A00247( cwp->line_count ) != -999) {
zword above = (cwp->y_cursor - 1) / font_height;
zword below = (cwp->y_size - cwp->y_cursor + 1) / font_height;
cwp->line_count++;
if (A00247( cwp->line_count ) >= A00247( above ) + below - 1) {
if (more_prompts)
A00220 ();
cwp->line_count = A00003.context_lines;
}
}
/* Handle newline interrupts at the end for Zork Zero under DOS */
if (A00049 == INTERP_MSDOS && A00075 == ZORK_ZERO && A00037 == 393)
countdown ();
}/* A00208 */
/*
* A00286
*
* Display a single character on the screen.
*
*/
void A00286 (zchar c)
{
int width;
if (discarding) return;
if (c == ZC_INDENT && cwp->x_cursor != cwp->left + 1)
c = ' ';
if (units_left () < (width = A00210 (c))) {
if (!A00089)
{ cwp->x_cursor = cwp->x_size - cwp->right; return; }
A00208 ();
}
A00211 (c); cwp->x_cursor += width;
}/* A00286 */
/*
* A00287
*
* Display a string of characters on the screen. If the word doesn't fit
* then use wrapping or clipping depending on the current setting of the
* A00089 flag.
*
*/
void A00287 (const zchar *s)
{
int width;
if (discarding) return;
if (*s == ZC_INDENT && cwp->x_cursor != cwp->left + 1)
A00286 (*s++);
if (units_left () < (width = A00240 (s))) {
if (!A00089) {
zchar c;
while ((c = *s++) != 0)
if (c == ZC_NEW_FONT || c == ZC_NEW_STYLE) {
int arg = (int) *s++;
if (c == ZC_NEW_FONT)
A00234 (arg);
if (c == ZC_NEW_STYLE)
A00235 (arg);
} else A00286 (c);
return;
}
if (*s == ' ' || *s == ZC_INDENT || *s == ZC_GAP)
width = A00240 (++s);
#ifdef AMIGA
if (cwin == 0) Justifiable ();
#endif
A00208 ();
}
A00212 (s); cwp->x_cursor += width;
}/* A00287 */
/*
* A00288
*
* Display an input line on the screen. This is required during playback.
*
*/
void A00288 (const zchar *buf, zchar key)
{
int width;
if (units_left () < (width = A00240 (buf)))
A00208 ();
A00212 (buf); cwp->x_cursor += width;
if (key == ZC_RETURN)
A00208 ();
}/* A00288 */
/*
* A00289
*
* Remove an input line that has already been printed from the screen
* as if it was deleted by the player. This could be necessary during
* playback.
*
*/
void A00289 (const zchar *buf)
{
if (buf[0] != 0) {
int width = A00240 (buf);
zword y;
zword x;
cwp->x_cursor -= width;
y = cwp->y_pos + cwp->y_cursor - 1;
x = cwp->x_pos + cwp->x_cursor - 1;
A00217(0, &font_height, &font_width);
A00214 (y, x, y + font_height - 1, x + width - 1, -1);
A00233 (y, x);
}
}/* A00289 */
/*
* A00295
*
* Read an input line from the keyboard and return the terminating key.
*
*/
zchar A00295 (int max, zchar *buf, zword timeout, bool continued)
{
zchar key;
int i;
/* Make sure there is some space for input */
if (cwin == 0 && units_left () + A00240 (buf) < 10 * font_width)
A00208 ();
/* Make sure the input line is visible */
if (continued && input_redraw)
A00288 (buf, -1);
input_window = cwin;
input_redraw = FALSE;
/* Get input line from IO interface */
cwp->x_cursor -= A00240 (buf);
key = A00228 (max, buf, timeout, units_left (), continued);
cwp->x_cursor += A00240 (buf);
if (key != ZC_TIME_OUT)
for (i = 0; i < 8; i++)
wp[i].line_count = 0;
/* Add a newline if the input was terminated normally */
if (key == ZC_RETURN)
A00208 ();
return key;
}/* A00295 */
/*
* A00294
*
* Read a single keystroke and return it.
*
*/
zchar A00294 (zword timeout)
{
zchar key;
int i;
key = A00227 (timeout, cursor);
if (key != ZC_TIME_OUT)
for (i = 0; i < 8; i++)
wp[i].line_count = 0;
return key;
}/* A00294 */
/*
* update_attributes
*
* Set the three enable_*** variables to make them match the attributes
* of the current window.
*
*/
static void update_attributes (void)
{
zword attr = cwp->attribute;
A00089 = attr & 1;
A00091 = attr & 2;
A00090 = attr & 4;
A00092 = attr & 8;
/* Some story files forget to select wrapping for printing hints */
if (A00075 == ZORK_ZERO && A00037 == 366)
if (cwin == 0)
A00089 = TRUE;
if (A00075 == SHOGUN && A00037 <= 295)
if (cwin == 0)
A00089 = TRUE;
}/* update_attributes */
/*
* A00024
*
* Set the right text style. This can be necessary when the fixed font
* flag is changed, or when a new window is selected, or when the game
* uses the set_text_style opcode.
*
*/
void A00024 (void)
{
zword style;
if (A00035 != V6) {
style = wp[0].style;
if (cwin != 0 || A00044 & FIXED_FONT_FLAG)
style |= FIXED_WIDTH_STYLE;
} else style = cwp->style;
if (!A00081 && A00079 && A00092) {
A00196 (ZC_NEW_STYLE);
A00196 (style);
} else A00235 (style);
}/* A00024 */
/*
* set_window
*
* Set the current window. In V6 every window has its own set of window
* properties such as colours, text style, cursor position and size.
*
*/
static void set_window (zword win)
{
A00194 ();
cwin = win; cwp = wp + win;
update_attributes ();
if (A00035 == V6) {
A00232 (lo (cwp->colour), hi (cwp->colour));
if (A00217 (cwp->font, &font_height, &font_width))
A00234 (cwp->font);
A00235 (cwp->style);
} else A00024 ();
if (A00035 != V6 && win != 0) {
wp[win].y_cursor = 1;
wp[win].x_cursor = 1;
}
update_cursor ();
}/* set_window */
/*
* A00030
*
* Erase a window to background colour.
*
*/
void A00030 (zword win)
{
zword y = wp[win].y_pos;
zword x = wp[win].x_pos;
if (A00035 == V6 && win != cwin && A00049 != INTERP_AMIGA)
A00232 (lo (wp[win].colour), hi (wp[win].colour));
A00214 (y,
x,
y + wp[win].y_size - 1,
x + wp[win].x_size - 1,
win);
if (A00035 == V6 && win != cwin && A00049 != INTERP_AMIGA)
A00232 (lo (cwp->colour), hi (cwp->colour));
reset_cursor (win);
wp[win].line_count = 0;
}/* A00030 */
/*
* A00025
*
* Divide the screen into upper (1) and lower (0) windows. In V3 the upper
* window appears below the status line.
*
*/
void A00025 (zword height)
{
zword stat_height = 0;
A00194 ();
/* Calculate height of status line and upper window */
if (A00035 != V6)
height *= hi (wp[1].font_size);
if (A00035 <= V3)
stat_height = hi (wp[7].font_size);
/* Cursor of upper window mustn't be swallowed by the lower window */
wp[1].y_cursor += wp[1].y_pos - 1 - stat_height;
wp[1].y_pos = 1 + stat_height;
wp[1].y_size = height;
if (A00247( wp[1].y_cursor ) > A00247( wp[1].y_size) )
reset_cursor (1);
/* Cursor of lower window mustn't be swallowed by the upper window */
wp[0].y_cursor += wp[0].y_pos - 1 - stat_height - height;
wp[0].y_pos = 1 + stat_height + height;
wp[0].y_size = A00054 - stat_height - height;
if (A00247( wp[0].y_cursor ) < 1)
reset_cursor (0);
/* Erase the upper window in V3 only */
if (A00035 == V3 && height != 0)
A00030 (1);
}/* A00025 */
/*
* erase_screen
*
* Erase the entire screen to background colour.
*
*/
static void erase_screen (zword win)
{
int i;
A00214 (1, 1, A00054, A00053, -2);
if (A00247( win ) == -1) {
A00025 (0);
set_window (0);
reset_cursor (0);
}
for (i = 0; i < 8; i++)
wp[i].line_count = 0;
}/* erase_screen */
/*
* A00245
*
* Try to adapt the window properties to a new screen size.
*
*/
void A00245 (void)
{
/* V6 games are asked to redraw. Other versions have no means for that
so we do what we can. */
if (A00035 == V6)
A00044 |= REFRESH_FLAG;
else {
int scroll, h;
wp[0].x_size = A00053;
if (wp[0].x_cursor > A00053)
wp[0].x_cursor = A00053;
wp[1].x_size = A00053;
if (wp[1].x_cursor > A00053)
wp[1].x_cursor = A00053;
wp[7].x_size = A00053;
if (wp[7].x_cursor > A00053)
wp[7].x_cursor = A00053;
h = A00054 - wp[1].y_size - wp[7].y_size;
if (h > 0) {
wp[0].y_size = h;
scroll = wp[0].y_cursor - wp[0].y_size;
} else {
/* Just make a one line window at the bottom of the screen. */
/*XXX We should probably adjust the other windows. But how? */
wp[0].y_size = 1;
scroll = wp[0].y_pos + wp[0].y_cursor - A00054 - 1;
wp[0].y_pos = A00054;
}
if (scroll > 0) {
wp[0].y_cursor = wp[0].y_size;
A00246(0, wp[0].y_pos + scroll, wp[0].y_pos,
wp[0].x_pos, wp[0].y_size, wp[0].x_size);
}
}
}/* A00245 */
/*
* A00023
*
* Prepare the screen for a new game.
*
*/
void A00023 (void)
{
/* Use default settings */
A00232 (A00060, A00059);
if (A00217 (TEXT_FONT, &font_height, &font_width))
A00234 (TEXT_FONT);
A00235 (0);
cursor = TRUE;
/* Initialise window properties */
mwin = 1;
for (cwp = wp; cwp < wp + 8; cwp++) {
cwp->y_pos = 1;
cwp->x_pos = 1;
cwp->y_size = 0;
cwp->x_size = 0;
cwp->y_cursor = 1;
cwp->x_cursor = 1;
cwp->left = 0;
cwp->right = 0;
cwp->nl_routine = 0;
cwp->nl_countdown = 0;
cwp->style = 0;
cwp->colour = (A00059 << 8) | A00060;
cwp->font = TEXT_FONT;
cwp->font_size = (font_height << 8) | font_width;
cwp->attribute = 8;
}
/* Prepare lower/upper windows and status line */
wp[0].attribute = 15;
wp[0].left = A00003.left_margin;
wp[0].right = A00003.right_margin;
wp[0].x_size = A00053;
wp[1].x_size = A00053;
if (A00035 <= V3)
wp[7].x_size = A00053;
A00230 (RESTART_WPROP_SET);
/* Clear the screen, unsplit it and select window 0 */
erase_screen ((zword) (-1));
}/* A00023 */
/*
* A00272
*
* Return false if the last mouse click occured outside the current
* mouse window; otherwise write the mouse arrow coordinates to the
* memory of the header extension table and return true.
*
*/
bool A00272 (void)
{
if (mwin >= 0) {
if (A00086 < wp[mwin].y_pos || A00086 >= wp[mwin].y_pos + wp[mwin].y_size)
return FALSE;
if (A00085 < wp[mwin].x_pos || A00085 >= wp[mwin].x_pos + wp[mwin].x_size)
return FALSE;
A00070 = A00086 - wp[mwin].y_pos + 1;
A00069 = A00085 - wp[mwin].x_pos + 1;
} else {
if (A00086 < 1 || A00086 > A00054)
return FALSE;
if (A00085 < 1 || A00085 > A00053)
return FALSE;
A00070 = A00086;
A00069 = A00085;
}
if (A00035 != V6) {
A00070 = (A00070 - 1) / A00055 + 1;
A00069 = (A00069 - 1) / A00056 + 1;
}
A00268 (HX_MOUSE_Y, A00070);
A00268 (HX_MOUSE_X, A00069);
return TRUE;
}/* A00272 */
/*
* A00290
*
* Start printing a so-called debugging A00084. The contents of the
* A00084 are passed to the A00084 stream, a Frotz specific output
* stream with maximum priority.
*
*/
void A00290 (void)
{
if (cwin == 0) { /* A00084s in window 0 only */
A00235 (0);
if (cwp->x_cursor != cwp->left + 1)
A00208 ();
A00286 (ZC_INDENT);
} else discarding = TRUE; /* discard A00084s in other windows */
}/* A00290 */
/*
* A00291
*
* Stop printing a "debugging" A00084.
*
*/
void A00291 (void)
{
if (cwin == 0) { /* A00084s in window 0 only */
A00208 ();
A00024 ();
} else discarding = FALSE; /* A00084 has been discarded */
}/* A00291 */
/*
* A00096, turn text buffering on/off.
*
* zargs[0] = new text buffering flag (0 or 1)
*
*/
void A00096 (void)
{
/* Infocom's V6 games rarely use the buffer_mode opcode. If they do
then only to print text immediately, without any delay. This was
used to give the player some sign of life while the game was
spending much time on parsing a complicated input line. (To turn
off word wrapping, V6 games use the window_style opcode instead.)
Today we can afford to ignore buffer_mode in V6. */
if (A00035 != V6) {
A00194 ();
wp[0].attribute &= ~8;
if (zargs[0] != 0)
wp[0].attribute |= 8;
update_attributes ();
}
}/* A00096 */
/*
* A00105, draw a picture.
*
* zargs[0] = number of picture to draw
* zargs[1] = y-coordinate of top left corner
* zargs[2] = x-coordinate of top left corner
*
*/
void A00105 (void)
{
zword pic = zargs[0];
zword y = zargs[1];
zword x = zargs[2];
int i;
A00194 ();
if (y == 0) /* use cursor line if y-coordinate is 0 */
y = cwp->y_cursor;
if (x == 0) /* use cursor column if x-coordinate is 0 */
x = cwp->x_cursor;
y += cwp->y_pos - 1;
x += cwp->x_pos - 1;
/* The following is necessary to make Amiga and Macintosh story
files work with MCGA graphics files. Some screen-filling
pictures of the original Amiga release like the borders of
Zork Zero were split into several MCGA pictures (left, right
and top borders). We pretend this has not happened. */
for (i = 0; mapper[i].A00075 != UNKNOWN; i++)
if (A00075 == mapper[i].A00075 && pic == mapper[i].pic) {
int height1, width1;
int height2, width2;
int delta = 0;
A00222 (pic, &height1, &width1);
A00222 (mapper[i].pic2, &height2, &width2);
if (A00075 == ARTHUR && pic == 54)
delta = A00053 / 160;
A00213 (mapper[i].pic1, y + height1, x + delta);
A00213 (mapper[i].pic2, y + height1, x + width1 - width2 - delta);
}
A00213 (pic, y, x);
if (A00075 == SHOGUN)
if (pic == 3) {
int height, width;
A00222 (59, &height, &width);
A00213 (59, y, A00053 - width + 1);
}
}/* A00105 */
/*
* A00107, erase the line starting at the cursor position.
*
* zargs[0] = 1 + #units to erase (1 clears to the end of the line)
*
*/
void A00107 (void)
{
zword pixels = zargs[0];
zword y, x;
A00194 ();
/* Clipping at the right margin of the current window */
if (--pixels == 0 || pixels > units_left ())
pixels = units_left ();
/* Erase from cursor position */
y = cwp->y_pos + cwp->y_cursor - 1;
x = cwp->x_pos + cwp->x_cursor - 1;