~ubuntu-branches/ubuntu/wily/xzip/wily

« back to all changes in this revision

Viewing changes to ztypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2001-01-28 18:06:24 UTC
  • Revision ID: james.westby@ubuntu.com-20010128180624-hf85cm3jyb5df4cj
Tags: upstream-1.8.2
ImportĀ upstreamĀ versionĀ 1.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ztypes.h
 
3
 *
 
4
 * Any global stuff required by the C modules.
 
5
 *
 
6
 */
 
7
 
 
8
#if !defined(__ZTYPES_INCLUDED)
 
9
#define __ZTYPES_INCLUDED
 
10
 
 
11
#include <assert.h>
 
12
#include <ctype.h>
 
13
#include <stdio.h>
 
14
#include <stdlib.h>
 
15
#include <string.h>
 
16
#include <time.h>
 
17
 
 
18
#if defined(MSDOS)
 
19
#include <malloc.h>
 
20
#endif /* MSDOS */
 
21
 
 
22
/* Try the endianness auto-detect. */
 
23
 
 
24
#ifdef AUTO_END_MODE
 
25
#ifdef BYTE_ORDER
 
26
 
 
27
#if BYTE_ORDER == BIG_ENDIAN
 
28
#define BIG_END_MODE
 
29
#endif
 
30
 
 
31
#if BYTE_ORDER == LITTLE_ENDIAN
 
32
#define LITTLE_END_MODE
 
33
#endif
 
34
 
 
35
#endif /* BYTE_ORDER */
 
36
#endif /* AUTO_END_MODE */
 
37
 
 
38
/* Define bcopy() if necessary. */
 
39
 
 
40
#ifdef NO_BCOPY
 
41
#define bcopy(s1,s2,l) (memcpy((s2),(s1),(l)))
 
42
#endif /* NO_BCOPY */
 
43
 
 
44
/* Define which random functions we're gonna use. */
 
45
#ifdef LOUSY_RANDOM
 
46
#define RANDOM_FUNC rand
 
47
#define SRANDOM_FUNC srand
 
48
#else
 
49
#define RANDOM_FUNC random
 
50
#define SRANDOM_FUNC srandom
 
51
#endif
 
52
 
 
53
/* Configuration options */
 
54
 
 
55
#define DEFAULT_ROWS 24 /* Default screen height */
 
56
#define DEFAULT_COLS 80 /* Deafult screen width */
 
57
 
 
58
/* Use the Quetzal save file format. This format is portable to other
 
59
   interpreters, and is much smaller than standard save files.
 
60
   However, it is not compatible with standard save files. So if
 
61
   you start using a version of XZip with USE_QUETZAL compiled in,
 
62
   all your old save files will stop working. */
 
63
#define USE_QUETZAL
 
64
 
 
65
/* Perform stricter z-code error checking. If STRICTZ is #defined,
 
66
   the interpreter will check for common opcode errors, such as reading
 
67
   or writing properties of the "nothing" (0) object. When such an
 
68
   error occurs, the opcode will call report_zstrict_error() and
 
69
   then continue in some safe manner. This may mean doing nothing,
 
70
   returning 0, or something like that.
 
71
 See osdepend.c for the definition of report_zstrict_error(). Note that
 
72
   this function may call fatal() to shut down the interpreter.
 
73
 If STRICTZ is not #defined, the STRICTZ patch has no effect at all. 
 
74
   It does not even check to continue safely when an error occurs; 
 
75
   it just behaves the way ZIP has always behaved. This typically
 
76
   means calling get_property_addr(0) or get_object_address(0), 
 
77
   which will return a meaningless value, and continuing on with 
 
78
   that. */
 
79
#define STRICTZ 
 
80
 
 
81
/* Global defines */
 
82
 
 
83
#ifndef TRUE
 
84
#define TRUE 1
 
85
#endif
 
86
 
 
87
#ifndef FALSE
 
88
#define FALSE 0
 
89
#endif
 
90
 
 
91
#ifndef FILENAME_MAX
 
92
#define FILENAME_MAX 255
 
93
#endif
 
94
 
 
95
#ifndef EXIT_SUCCESS
 
96
#define EXIT_SUCCESS 0
 
97
#endif
 
98
 
 
99
#ifndef EXIT_FAILURE
 
100
#define EXIT_FAILURE 1
 
101
#endif
 
102
 
 
103
#ifndef SEEK_SET
 
104
#define SEEK_SET 0
 
105
#endif
 
106
 
 
107
#ifndef SEEK_END
 
108
#define SEEK_END 2
 
109
#endif
 
110
 
 
111
#ifdef unix
 
112
 
 
113
#define strchr(a, b) index (a, b)
 
114
#define memmove(a, b, c) bcopy (b, a, c)
 
115
 
 
116
#define const
 
117
 
 
118
#endif /* unix */
 
119
 
 
120
/* Z types */
 
121
 
 
122
typedef unsigned char zbyte_t;  /* unsigned 1 byte quantity */
 
123
typedef unsigned short zword_t; /* unsigned 2 byte quantity */
 
124
 
 
125
/* Data file header format */
 
126
 
 
127
typedef struct zheader {
 
128
    zbyte_t type;
 
129
    zbyte_t config;
 
130
    zword_t version;
 
131
    zword_t data_size;
 
132
    zword_t start_pc;
 
133
    zword_t words_offset;
 
134
    zword_t objects_offset;
 
135
    zword_t globals_offset;
 
136
    zword_t restart_size;
 
137
    zword_t flags;
 
138
    zbyte_t release_date[6];
 
139
    zword_t synonyms_offset;
 
140
    zword_t file_size;
 
141
    zword_t checksum;
 
142
    zbyte_t interpreter;
 
143
    zbyte_t interpreter_version;
 
144
    zbyte_t screen_rows;
 
145
    zbyte_t screen_columns;
 
146
    zbyte_t screen_left;
 
147
    zbyte_t screen_right;
 
148
    zbyte_t screen_top;
 
149
    zbyte_t screen_bottom;
 
150
    zbyte_t max_char_width;
 
151
    zbyte_t max_char_height;
 
152
    zword_t filler1[3];
 
153
    zword_t function_keys_offset;
 
154
    zword_t filler2[2];
 
155
    zword_t alternate_alphabet_offset;
 
156
    zword_t mouse_position_offset;
 
157
    zword_t filler3[4];
 
158
} zheader_t;
 
159
 
 
160
#define H_TYPE 0
 
161
#define H_CONFIG 1
 
162
 
 
163
#define CONFIG_BYTE_SWAPPED 0x01 /* Game data is byte swapped          - V3/V4 */
 
164
#define CONFIG_COLOUR       0x01 /* Game supports colour               - V5+   */
 
165
#define CONFIG_TIME         0x02 /* Status line displays time          - V3    */
 
166
#define CONFIG_MAX_DATA     0x04 /* Data area should 64K if possible   - V4+   */
 
167
#define CONFIG_TANDY        0x08 /* Tandy licensed game                - V3    */
 
168
#define CONFIG_EMPHASIS     0x08 /* Interpreter supports text emphasis - V4+   */
 
169
#define CONFIG_NOSTATUSLINE 0x10 /* Interpreter cannot support a status line   */
 
170
#define CONFIG_WINDOWS      0x20 /* Interpreter supports split screen mode     */
 
171
#define CONFIG_TIMEDINPUT   0x80 /* Interpreter supports timed input   - V5    */
 
172
 
 
173
#define H_VERSION 2
 
174
#define H_DATA_SIZE 4
 
175
#define H_START_PC 6
 
176
#define H_WORDS_OFFSET 8
 
177
#define H_OBJECTS_OFFSET 10
 
178
#define H_GLOBALS_OFFSET 12
 
179
#define H_RESTART_SIZE 14
 
180
#define H_FLAGS 16
 
181
 
 
182
#define SCRIPTING_FLAG 0x01
 
183
#define FIXED_FONT_FLAG 0x02
 
184
#define REFRESH_FLAG 0x04
 
185
#define GRAPHICS_FLAG 0x08
 
186
#define SOUND_FLAG 0x10          /* V4 */
 
187
#define UNDO_AVAILABLE_FLAG 0x10 /* V5 */
 
188
#define COLOUR_FLAG 0x40
 
189
#define NEW_SOUND_FLAG 0x80
 
190
 
 
191
#define H_RELEASE_DATE 18
 
192
#define H_SYNONYMS_OFFSET 24
 
193
#define H_FILE_SIZE 26
 
194
#define H_CHECKSUM 28
 
195
#define H_INTERPRETER 30
 
196
 
 
197
#define INTERP_GENERIC 0
 
198
#define INTERP_DEC_20 1
 
199
#define INTERP_APPLE_IIE 2
 
200
#define INTERP_MACINTOSH 3
 
201
#define INTERP_AMIGA 4
 
202
#define INTERP_ATARI_ST 5
 
203
#define INTERP_MSDOS 6
 
204
#define INTERP_CBM_128 7
 
205
#define INTERP_CBM_64 8
 
206
#define INTERP_APPLE_IIC 9
 
207
#define INTERP_APPLE_IIGS 10
 
208
#define INTERP_TANDY 11
 
209
 
 
210
#define H_INTERPRETER_VERSION 31
 
211
#define H_SCREEN_ROWS 32
 
212
#define H_SCREEN_COLUMNS 33
 
213
#define H_SCREEN_LEFT 34
 
214
#define H_SCREEN_RIGHT 35
 
215
#define H_SCREEN_TOP 36
 
216
#define H_SCREEN_BOTTOM 37
 
217
#define H_MAX_CHAR_WIDTH 38
 
218
#define H_MAX_CHAR_HEIGHT 39
 
219
#define H_FILLER1 40
 
220
 
 
221
#define H_FUNCTION_KEYS_OFFSET 46
 
222
#define H_FILLER2 48
 
223
 
 
224
#define H_ALTERNATE_ALPHABET_OFFSET 52
 
225
#define H_MOUSE_POSITION_OFFSET 54
 
226
#define H_FILLER3 56
 
227
 
 
228
#define V1 1
 
229
 
 
230
#define V2 2
 
231
 
 
232
/* Version 3 object format */
 
233
 
 
234
#define V3 3
 
235
 
 
236
typedef struct zobjectv3 {
 
237
    zword_t attributes[2];
 
238
    zbyte_t parent;
 
239
    zbyte_t next;
 
240
    zbyte_t child;
 
241
    zword_t property_offset;
 
242
} zobjectv3_t;
 
243
 
 
244
#define O3_ATTRIBUTES 0
 
245
#define O3_PARENT 4
 
246
#define O3_NEXT 5
 
247
#define O3_CHILD 6
 
248
#define O3_PROPERTY_OFFSET 7
 
249
 
 
250
#define O3_SIZE 9
 
251
 
 
252
#define PARENT3(offset) (offset + O3_PARENT)
 
253
#define NEXT3(offset) (offset + O3_NEXT)
 
254
#define CHILD3(offset) (offset + O3_CHILD)
 
255
 
 
256
#define P3_MAX_PROPERTIES 0x20
 
257
 
 
258
/* Version 4 object format */
 
259
 
 
260
#define V4 4
 
261
 
 
262
typedef struct zobjectv4 {
 
263
    zword_t attributes[3];
 
264
    zword_t parent;
 
265
    zword_t next;
 
266
    zword_t child;
 
267
    zword_t property_offset;
 
268
} zobjectv4_t;
 
269
 
 
270
#define O4_ATTRIBUTES 0
 
271
#define O4_PARENT 6
 
272
#define O4_NEXT 8
 
273
#define O4_CHILD 10
 
274
#define O4_PROPERTY_OFFSET 12
 
275
 
 
276
#define O4_SIZE 14
 
277
 
 
278
#define PARENT4(offset) (offset + O4_PARENT)
 
279
#define NEXT4(offset) (offset + O4_NEXT)
 
280
#define CHILD4(offset) (offset + O4_CHILD)
 
281
 
 
282
#define P4_MAX_PROPERTIES 0x40
 
283
 
 
284
#define V5 5
 
285
#define V8 8
 
286
 
 
287
/* Interpreter states */
 
288
 
 
289
#define STOP 0
 
290
#define RUN 1
 
291
 
 
292
/* Call types */
 
293
 
 
294
#define FUNCTION 0x0000
 
295
#define PROCEDURE 0x1000
 
296
#define ASYNC 0x2000
 
297
 
 
298
#define ARGS_MASK 0x00FF
 
299
#define VARS_MASK 0x0F00
 
300
#define TYPE_MASK 0xF000
 
301
#define VAR_SHIFT 8
 
302
 
 
303
/* Local defines */
 
304
 
 
305
#ifdef PAGE_SIZE /* some systems have PAGE_SIZE defined in sys/limits.h */
 
306
#undef PAGE_SIZE
 
307
#endif
 
308
#define PAGE_SIZE 0x200
 
309
#define PAGE_MASK 0x1FF
 
310
#define PAGE_SHIFT 9
 
311
 
 
312
#define STACK_SIZE 1024
 
313
 
 
314
#define ON 1
 
315
#define OFF 0
 
316
#define RESET -1
 
317
 
 
318
#define SCREEN 255
 
319
#define TEXT_WINDOW 0
 
320
#define STATUS_WINDOW 1
 
321
 
 
322
#define NO_CHANGE_ATTRIBUTE (-1)
 
323
#define MIN_ATTRIBUTE 0
 
324
#define NORMAL 0
 
325
#define REVERSE 1
 
326
#define BOLD 2
 
327
#define EMPHASIS 4
 
328
#define FIXED_FONT 8
 
329
#define MAX_ATTRIBUTE 8
 
330
#define NUMFONTS (16) /* convenient --zarf */
 
331
 
 
332
#define TEXT_FONT 1
 
333
#define GRAPHICS_FONT 3
 
334
 
 
335
#define FOREGROUND 0
 
336
#define BACKGROUND 1
 
337
 
 
338
#define GAME_RESTORE 0
 
339
#define GAME_SAVE 1
 
340
#define GAME_SCRIPT 2
 
341
#define GAME_RECORD 3
 
342
#define GAME_PLAYBACK 4
 
343
#define UNDO_SAVE 5
 
344
#define UNDO_RESTORE 6
 
345
#define GAME_SAVEDATA 7
 
346
#define GAME_RESTOREDATA 8
 
347
 
 
348
#define MAX_TEXT_SIZE 8
 
349
 
 
350
/* Data access macros */
 
351
 
 
352
#define get_byte(offset) ((zbyte_t) datap[offset])
 
353
#define get_word(offset) ((zword_t) (((zword_t) datap[offset] << 8) + (zword_t) datap[offset + 1]))
 
354
#define set_byte(offset,value) datap[offset] = (zbyte_t) (value)
 
355
#define set_word(offset,value) datap[offset] = (zbyte_t) ((zword_t) (value) >> 8), datap[offset + 1] = (zbyte_t) ((zword_t) (value) & 0xff)
 
356
 
 
357
/* External data */
 
358
 
 
359
extern zbyte_t h_type;
 
360
extern zbyte_t h_config;
 
361
extern zword_t h_version;
 
362
extern zword_t h_data_size;
 
363
extern zword_t h_start_pc;
 
364
extern zword_t h_words_offset;
 
365
extern zword_t h_objects_offset;
 
366
extern zword_t h_globals_offset;
 
367
extern zword_t h_restart_size;
 
368
extern zword_t h_flags;
 
369
extern zword_t h_synonyms_offset;
 
370
extern zword_t h_file_size;
 
371
extern zword_t h_checksum;
 
372
extern zbyte_t h_interpreter;
 
373
extern zbyte_t h_interpreter_version;
 
374
extern zword_t h_alternate_alphabet_offset;
 
375
 
 
376
extern int story_scaler;
 
377
extern int story_shift;
 
378
extern int property_mask;
 
379
extern int property_size_mask;
 
380
 
 
381
extern zword_t stack[STACK_SIZE];
 
382
extern zword_t sp;
 
383
extern zword_t fp;
 
384
extern zword_t frame_count;
 
385
extern unsigned long pc;
 
386
extern int interpreter_state;
 
387
extern int interpreter_status;
 
388
 
 
389
extern unsigned int data_size;
 
390
extern zbyte_t *datap;
 
391
extern zbyte_t *undo_datap;
 
392
 
 
393
extern int screen_rows;
 
394
extern int screen_cols;
 
395
 
 
396
extern int screen_window;
 
397
 
 
398
extern int formatting;
 
399
extern int outputting;
 
400
extern int redirect_depth;
 
401
extern int scripting;
 
402
extern int scripting_disable;
 
403
extern int recording;
 
404
extern int replaying;
 
405
extern int font;
 
406
 
 
407
extern int status_active;
 
408
extern int status_size;
 
409
 
 
410
extern int lines_written;
 
411
extern int status_pos;
 
412
 
 
413
/*extern char *line;
 
414
 output buffering is now in xtext.c --zarf */
 
415
extern char *status_line;
 
416
 
 
417
extern char lookup_table[3][26];
 
418
 
 
419
extern int strictz_declare_spec;
 
420
 
 
421
#ifdef STRICTZ
 
422
 
 
423
/* Definitions for STRICTZ functions and error codes. */
 
424
 
 
425
#ifdef __STDC__
 
426
void report_strictz_error (int, const char *);
 
427
#else /* __STDC__ */ 
 
428
void report_strictz_error ();
 
429
#endif /* __STDC__ */ 
 
430
 
 
431
/* Reporting modes */
 
432
extern int strictz_report_mode;
 
433
#define STRICTZ_REPORT_NEVER (0)
 
434
#define STRICTZ_REPORT_ONCE (1)
 
435
#define STRICTZ_REPORT_ALWAYS (2)
 
436
#define STRICTZ_REPORT_FATAL (3)
 
437
#define STRICTZ_DEFAULT_REPORT_MODE STRICTZ_REPORT_ONCE
 
438
 
 
439
/* Error codes */
 
440
#define STRZERR_NO_ERROR (0)
 
441
#define STRZERR_JIN (1)
 
442
#define STRZERR_GET_CHILD (2)
 
443
#define STRZERR_GET_PARENT (3)
 
444
#define STRZERR_GET_SIBLING (4)
 
445
#define STRZERR_GET_PROP_ADDR (5)
 
446
#define STRZERR_GET_PROP (6)
 
447
#define STRZERR_PUT_PROP (7)
 
448
#define STRZERR_CLEAR_ATTR (8)
 
449
#define STRZERR_SET_ATTR (9)
 
450
#define STRZERR_TEST_ATTR (10)
 
451
#define STRZERR_MOVE_OBJECT (11)
 
452
#define STRZERR_MOVE_OBJECT_2 (12)
 
453
#define STRZERR_REMOVE_OBJECT (13)
 
454
#define STRZERR_GET_NEXT_PROP (14)
 
455
#define STRICTZ_NUM_ERRORS (15)
 
456
 
 
457
#endif /* STRICTZ */
 
458
 
 
459
/* Global routines */
 
460
 
 
461
/* control.c */
 
462
 
 
463
#ifdef __STDC__
 
464
void check_argument (zword_t);
 
465
int call (int, zword_t *, int);
 
466
void get_fp (void);
 
467
void jump (zword_t);
 
468
void restart (void);
 
469
void restart_interp (int scripton_flag);
 
470
void ret (zword_t);
 
471
void unwind (zword_t, zword_t);
 
472
#else
 
473
void check_argument ();
 
474
int call ();
 
475
void get_fp ();
 
476
void jump ();
 
477
void restart ();
 
478
void restart_interp ();
 
479
void ret ();
 
480
void unwind ();
 
481
#endif
 
482
 
 
483
/* fileio.c */
 
484
 
 
485
#ifdef __STDC__
 
486
void close_record (void);
 
487
void close_script (void);
 
488
void close_story (void);
 
489
unsigned int get_story_size (void);
 
490
void open_playback (int);
 
491
void open_record (void);
 
492
void open_script (void);
 
493
void open_story (const char *);
 
494
int playback_key (void);
 
495
int playback_line (int, char *, int *);
 
496
void read_page (int, void *);
 
497
void record_key (int);
 
498
void record_line (const char *, int);
 
499
int restore (int, zword_t *);
 
500
int save (int, zword_t *);
 
501
void script_char (int);
 
502
void script_string (const char *);
 
503
void script_line (const char *, int);
 
504
void script_new_line (void);
 
505
void undo_restore (void);
 
506
void undo_save (void);
 
507
void verify (void);
 
508
#else
 
509
void close_record ();
 
510
void close_script ();
 
511
void close_story ();
 
512
unsigned int get_story_size ();
 
513
void open_playback ();
 
514
void open_record ();
 
515
void open_script ();
 
516
void open_story ();
 
517
int playback_key ();
 
518
int playback_line ();
 
519
void read_page ();
 
520
void record_key ();
 
521
void record_line ();
 
522
int restore ();
 
523
int save ();
 
524
void script_char ();
 
525
void script_string ();
 
526
void script_line ();
 
527
void script_new_line ();
 
528
void undo_restore ();
 
529
void undo_save ();
 
530
void verify ();
 
531
#endif
 
532
 
 
533
/* getopt.c */
 
534
/* deleted --zarf */
 
535
 
 
536
/* input.c */
 
537
 
 
538
#ifdef __STDC__
 
539
int get_line (char *, zword_t, zword_t);
 
540
void read_character (int, zword_t *);
 
541
void read_line (int, zword_t *);
 
542
void tokenise (int, zword_t *);
 
543
#else
 
544
int get_line ();
 
545
void read_character ();
 
546
void read_line ();
 
547
void tokenise ();
 
548
#endif
 
549
 
 
550
/* interpre.c */
 
551
 
 
552
#ifdef __STDC__
 
553
int interpret (void);
 
554
#else
 
555
int interpret ();
 
556
#endif
 
557
 
 
558
/* math.c */
 
559
 
 
560
#ifdef __STDC__
 
561
void add (zword_t, zword_t);
 
562
void and (zword_t, zword_t);
 
563
void arith_shift (zword_t, zword_t);
 
564
void compare_je (int, zword_t *);
 
565
void compare_jg (zword_t, zword_t);
 
566
void compare_jl (zword_t, zword_t);
 
567
void compare_zero (zword_t);
 
568
void divide (zword_t, zword_t);
 
569
void multiply (zword_t, zword_t);
 
570
void not (zword_t);
 
571
void or (zword_t, zword_t);
 
572
void ziprandom (zword_t);
 
573
void remainder (zword_t, zword_t);
 
574
void shift (zword_t, zword_t);
 
575
void subtract (zword_t, zword_t);
 
576
void test (zword_t, zword_t);
 
577
#else
 
578
void add ();
 
579
void and ();
 
580
void arith_shift ();
 
581
void compare_je ();
 
582
void compare_jg ();
 
583
void compare_jl ();
 
584
void compare_zero ();
 
585
void divide ();
 
586
void multiply ();
 
587
void not ();
 
588
void or ();
 
589
void ziprandom ();
 
590
void remainder ();
 
591
void shift ();
 
592
void subtract ();
 
593
void test ();
 
594
#endif
 
595
 
 
596
/* memory.c */
 
597
 
 
598
#ifdef __STDC__
 
599
void load_cache (void);
 
600
void unload_cache (void);
 
601
zbyte_t read_code_byte (void);
 
602
zbyte_t read_data_byte (unsigned long *);
 
603
zword_t read_code_word (void);
 
604
zword_t read_data_word (unsigned long *);
 
605
#else
 
606
void load_cache ();
 
607
void unload_cache ();
 
608
zbyte_t read_code_byte ();
 
609
zbyte_t read_data_byte ();
 
610
zword_t read_code_word ();
 
611
zword_t read_data_word ();
 
612
#endif
 
613
 
 
614
/* object.c */
 
615
 
 
616
#ifdef __STDC__
 
617
void clear_attr (zword_t, zword_t);
 
618
void compare_parent_object (zword_t, zword_t);
 
619
void insert_object (zword_t, zword_t);
 
620
void load_child_object (zword_t);
 
621
void load_next_object (zword_t);
 
622
void load_parent_object (zword_t);
 
623
void remove_object (zword_t);
 
624
void set_attr (zword_t, zword_t);
 
625
void test_attr (zword_t, zword_t);
 
626
zword_t get_object_address (zword_t);
 
627
#else
 
628
void clear_attr ();
 
629
void compare_parent_object ();
 
630
void insert_object ();
 
631
void load_child_object ();
 
632
void load_next_object ();
 
633
void load_parent_object ();
 
634
void remove_object ();
 
635
void set_attr ();
 
636
void test_attr ();
 
637
zword_t get_object_address ();
 
638
#endif
 
639
 
 
640
/* operand.c */
 
641
 
 
642
#ifdef __STDC__
 
643
void conditional_jump (int);
 
644
void store_operand (zword_t);
 
645
void store_variable (int, zword_t);
 
646
zword_t load_operand (int);
 
647
zword_t load_variable (int);
 
648
#else
 
649
void conditional_jump ();
 
650
void store_operand ();
 
651
void store_variable ();
 
652
zword_t load_operand ();
 
653
zword_t load_variable ();
 
654
#endif
 
655
 
 
656
/* osdepend.c */
 
657
 
 
658
#ifdef __STDC__
 
659
int codes_to_text (int, char *);
 
660
void fatal (const char *);
 
661
void file_cleanup (const char *, int);
 
662
int fit_line (const char *, int, int);
 
663
int get_file_name (char *, char *, int);
 
664
int print_status (int, char *[]);
 
665
void process_arguments (int, char *[]);
 
666
void set_colours (int, int);
 
667
int set_font (int);
 
668
void sound (int, zword_t *);
 
669
#else
 
670
int codes_to_text ();
 
671
void fatal ();
 
672
void file_cleanup ();
 
673
int fit_line ();
 
674
int get_file_name ();
 
675
int print_status ();
 
676
void process_arguments ();
 
677
void set_colours ();
 
678
int set_font ();
 
679
void sound ();
 
680
#endif
 
681
 
 
682
/* property.c */
 
683
 
 
684
#ifdef __STDC__
 
685
void load_byte (zword_t, zword_t);
 
686
void load_next_property (zword_t, zword_t);
 
687
void load_property (zword_t, zword_t);
 
688
void load_property_address (zword_t, zword_t);
 
689
void load_property_length (zword_t);
 
690
void load_word (zword_t, zword_t);
 
691
void move_data (zword_t, zword_t, zword_t);
 
692
void scan_data (int, zword_t *);
 
693
void store_byte (zword_t, zword_t, zword_t);
 
694
void store_property (zword_t, zword_t, zword_t);
 
695
void store_word (zword_t, zword_t, zword_t);
 
696
#else
 
697
void load_byte ();
 
698
void load_next_property ();
 
699
void load_property ();
 
700
void load_property_address ();
 
701
void load_property_length ();
 
702
void load_word ();
 
703
void move_data ();
 
704
void scan_data ();
 
705
void store_byte ();
 
706
void store_property ();
 
707
void store_word ();
 
708
#endif
 
709
 
 
710
/* quetzal.c */
 
711
 
 
712
#ifdef __STDC__
 
713
int save_quetzal (FILE *, FILE *, long);
 
714
int restore_quetzal (FILE *, FILE *, long);
 
715
#else
 
716
int save_quetzal ();
 
717
int restore_quetzal ();
 
718
#endif
 
719
 
 
720
/* screen.c */
 
721
 
 
722
#ifdef __STDC__
 
723
void blank_status_line (void);
 
724
void display_status_line (void);
 
725
void erase_line (zword_t);
 
726
void erase_window (zword_t);
 
727
void output_char (int);
 
728
void output_new_line (void);
 
729
void output_string (const char *);
 
730
void output_line (const char *);
 
731
void print_window (int, zword_t *);
 
732
void select_window (zword_t);
 
733
void set_cursor_position (zword_t, zword_t);
 
734
void set_colour_attribute (zword_t, zword_t);
 
735
void set_font_attribute (zword_t);
 
736
void set_status_size (zword_t);
 
737
#else
 
738
void blank_status_line ();
 
739
void display_status_line ();
 
740
void erase_line ();
 
741
void erase_window ();
 
742
void output_char ();
 
743
void output_new_line ();
 
744
void output_string ();
 
745
void output_line ();
 
746
void print_window ();
 
747
void select_window ();
 
748
void set_cursor_position ();
 
749
void set_colour_attribute ();
 
750
void set_font_attribute ();
 
751
void set_status_size ();
 
752
#endif
 
753
 
 
754
/* screenio.c */
 
755
 
 
756
#ifdef __STDC__
 
757
int input_character (int);
 
758
void clear_line (void);
 
759
void clear_screen (void);
 
760
void clear_status_window (void);
 
761
void clear_text_window (void);
 
762
void create_status_window (int);
 
763
void delete_status_window (void);
 
764
void display_char (int);
 
765
int fit_line (const char *, int, int);
 
766
void get_cursor_position (int *, int *);
 
767
void initialize_screen (void);
 
768
int input_line (int, char *, int, int *, int);
 
769
void move_cursor (int, int);
 
770
int print_status (int, char *[]);
 
771
void reset_screen (void);
 
772
void restart_screen (void);
 
773
void restore_cursor_position (void);
 
774
void save_cursor_position (void);
 
775
void scroll_line (void);
 
776
void select_status_window (void);
 
777
void select_text_window (void);
 
778
void set_attribute (int);
 
779
#else
 
780
int input_character ();
 
781
void clear_line ();
 
782
void clear_screen ();
 
783
void clear_status_window ();
 
784
void clear_text_window ();
 
785
void create_status_window ();
 
786
void delete_status_window ();
 
787
void display_char ();
 
788
int fit_line ();
 
789
void get_cursor_position ();
 
790
void initialize_screen ();
 
791
int input_line ();
 
792
void move_cursor ();
 
793
int print_status ();
 
794
void reset_screen ();
 
795
void restart_screen ();
 
796
void restore_cursor_position ();
 
797
void save_cursor_position ();
 
798
void scroll_line ();
 
799
void select_status_window ();
 
800
void select_text_window ();
 
801
void set_attribute ();
 
802
#endif
 
803
 
 
804
/* text.c */
 
805
 
 
806
#ifdef __STDC__
 
807
void decode_text (unsigned long *);
 
808
void encode (zword_t, zword_t, zword_t, zword_t);
 
809
void encode_text (int, const char *, short *);
 
810
void flush_buffer (int);
 
811
void new_line (void);
 
812
void print_address (zword_t);
 
813
void print_character (zword_t);
 
814
void print_literal (void);
 
815
void print_number (zword_t);
 
816
void print_object (zword_t);
 
817
void print_offset (zword_t);
 
818
void print_time (int, int);
 
819
void println_return (void);
 
820
void command_opcode (zword_t);
 
821
void set_format_mode (zword_t);
 
822
void set_print_modes (zword_t, zword_t);
 
823
void set_video_attribute (zword_t);
 
824
void write_char (int);
 
825
void write_string (const char *);
 
826
void write_zchar (int);
 
827
#else
 
828
void decode_text ();
 
829
void encode ();
 
830
void encode_text ();
 
831
void flush_buffer ();
 
832
void new_line ();
 
833
void print_address ();
 
834
void print_character ();
 
835
void print_literal ();
 
836
void print_number ();
 
837
void print_object ();
 
838
void print_offset ();
 
839
void print_time ();
 
840
void println_return ();
 
841
void command_opcode ();
 
842
void set_format_mode ();
 
843
void set_print_modes ();
 
844
void set_video_attribute ();
 
845
void write_char ();
 
846
void write_string ();
 
847
void write_zchar ();
 
848
#endif
 
849
 
 
850
/* variable.c */
 
851
 
 
852
#ifdef __STDC__
 
853
void decrement (zword_t);
 
854
void decrement_check (zword_t, zword_t);
 
855
void increment (zword_t);
 
856
void increment_check (zword_t, zword_t);
 
857
void load (zword_t);
 
858
void pop_var (zword_t);
 
859
void push_var (zword_t);
 
860
#else
 
861
void decrement ();
 
862
void decrement_check ();
 
863
void increment ();
 
864
void increment_check ();
 
865
void load ();
 
866
void pop_var ();
 
867
void push_var ();
 
868
#endif
 
869
 
 
870
#endif /* !defined(__ZTYPES_INCLUDED) */