1 /* pMARS -- a portable Memory Array Redcode Simulator
2  * Copyright (C) 1993-1996 Albert Ma, Na'ndor Sieben, Stefan Strack and Mintardjo Wangsawidjaja
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 /*
20  * alldisp.c: functions for combined DOS graphics/text mode display
21  * $Id: alldisp.c,v 1.1.1.1 2000/08/20 13:29:25 iltzu Exp $
22  */
23 
24 void    display_init(void);
25 void    display_read(int addr);
26 void    display_close(void);
27 
28 void
display_init()29 display_init()
30 {
31   if (displayMode == TEXT)
32     text_display_init();
33   else
34     bgi_display_init();
35 }
36 
37 void
display_read(addr)38 display_read(addr)
39 {
40   if (displayLevel > 3)
41     if (displayMode == TEXT)
42       text_display_read(addr);
43     else
44       bgi_display_read(addr);
45 }
46 
47 
48 #define display_dec(addr)\
49 do {\
50 if (displayLevel > 2)\
51 if (displayMode==TEXT) text_display_dec(addr);\
52   else bgi_display_dec(addr);\
53 } while (0)
54 
55 #define display_inc(addr)\
56 do {\
57 if (displayLevel > 2)\
58 if (displayMode==TEXT) text_display_inc(addr);\
59   else bgi_display_inc(addr);\
60 } while (0)
61 
62 #define display_write(addr)\
63 do {\
64 if (displayLevel > 1)\
65 if (displayMode==TEXT) text_display_write(addr);\
66   else bgi_display_write(addr);\
67 } while (0)
68 
69 #define display_exec(addr)\
70 do {\
71 if (displayLevel > 0)\
72 if (displayMode==TEXT) text_display_exec(addr);\
73   else bgi_display_exec(addr);\
74 } while (0)
75 
76 #define display_spl(warrior,tasks) \
77 do {\
78   if (displayMode==TEXT) {\
79     if (displayLevel > 0)\
80         text_display_spl(warrior,tasks);\
81   } else bgi_display_spl(warrior,tasks);\
82 } while (0)
83 
84 #define display_dat(addr,warNum,tasks) \
85 do {\
86   if (displayMode==TEXT) {\
87     if (displayLevel > 0)\
88         text_display_dat(addr);\
89   } else bgi_display_dat(addr,warNum,tasks);\
90 } while (0)
91 
92 #define display_clear() \
93 do {\
94 if (displayMode==TEXT) text_display_clear();\
95   else bgi_display_clear();\
96 } while (0)
97 
98 void
display_close()99 display_close()
100 {
101   if (displayMode == TEXT)
102     text_display_close();
103   else
104     bgi_display_close(WAIT);
105 }
106