/[projet1]/public/oric/games/Dungeon Demo/BAK3/LIB.H
Defence Force logotype

Contents of /public/oric/games/Dungeon Demo/BAK3/LIB.H

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1376 - (show annotations)
Mon Jul 25 19:48:05 2016 UTC (3 years, 3 months ago) by dbug
File MIME type: text/plain
File size: 5007 byte(s)
Added the complete (not cleaned up, pure legacy) source code and assets for the 1996 Dungeon Master tech demo.
To get that to actually work, you need (at least):
- A dos machine (or a Windows 95/Windows 98)
- The Wacom compiler
- The old version of the Oric Compiler toolchain (the OSDK ancestor)

1 extern void exit(int retval);
2
3 extern int getchar(void);
4 extern int putchar(char c);
5 extern int printf(const char *format,...);
6 extern char *itoa(int n);
7
8 extern int isalpha(char c);
9 extern int isupper(char c);
10 extern int islower(char c);
11 extern int isdigit(char c);
12 extern int isspace(char c);
13 extern int ispunct(char c);
14 extern int isprint(char c);
15 extern int iscntrl(char c);
16 extern int isascii(char c);
17 extern char toupper(char c);
18 extern char tolower(char c);
19 extern char toascii(char c);
20
21 extern char* sbrk();
22 extern char* brk();
23
24 extern char *strcpy(char *s1,char * s2);
25 extern int strcmp(char *s1,char * s2);
26 extern int strlen(char *s);
27
28 extern int memcpy(void *dst, void *src, int n);
29
30 /* Oric specific routines, added by Vaggelis Blathras */
31
32 extern void hires(void);
33 extern void text(void);
34 extern void ping(void);
35 extern void shoot(void);
36 extern void zap(void);
37 extern void explode(void);
38 extern void kbdclick1(void);
39 extern void kbdclick2(void);
40 extern int ink(int color);
41 extern int paper(int color);
42 extern int curset(int x,int y,int mode);
43 extern int curmov(int dx,int dy,int mode);
44 extern int draw(int dx,int dy,int mode);
45 extern int circle(int radius,int mode);
46 extern int hchar(char c,int charset,int mode);
47 extern int fill(int height,int width,char c);
48 extern int point(int x,int y);
49 extern int pattern(char style);
50 extern int play(int soundchanels,int noisechanels,int envelop,int volume);
51 extern int music(int chanel,int octave,int key,int volume);
52 extern int sound(int chanel,int period,int volume);
53 extern void w8912(unsigned char reg,unsigned char value);
54 extern char key(void);
55
56 /* Stuff added by Alexios Chouchoulas */
57
58 extern void cls();
59 extern void lores0(void);
60 extern void lores1(void);
61 extern int peek(int address);
62 extern int deek(int address);
63 extern void poke(int address, int value); /* 8 bit values */
64 extern void doke(int address, int value); /* 16 bit values */
65 extern void gotoxy(int x, int y); /* move the cursor: broken for the moment */
66 extern int get(void); /* get character without echoing */
67 extern void cwrite(char c); /* write a byte to 'tape' */
68 extern int cread(); /* read a byte from 'tape' */
69 extern void cwritehdr(); /* write a file header to tape */
70 extern void call(int addr); /* call a machine code routine */
71
72 /* sedoric(): Please use the exclamation mark as well, e.g. sedoric("!DIR") */
73 /* Bear in mind that this might well be broken. I don't know */
74 /* much about SEDORIC yet... No error handling! Anything wrong */
75 /* happens, and you get an error, and go back to the 'Ready' */
76 /* prompt. Can anyone fix things here? I declare my ignorance. */
77
78 extern void sedoric(char *command); /* invoke a sedoric command */
79
80
81 /* lprintf(): Like printf, but sends output to the printer. Maybe this and */
82 /* printf() should be merged, I don't know... */
83
84 extern int lprintf(const char *format,...);
85
86
87 #define TEXTVRAM 0xbb80
88 #define STDCHRTABLE 0xb400
89 #define ALTCHRTABLE 0xb800
90
91
92 #define GETPAPER (peek(0x26b)-16) /* return current paper colour */
93 #define GETINK peek(0x26c) /* return current ink colour */
94
95
96 /* This returns which dead key is currently pressed */
97 /* Use the #defines below to check for the keys */
98
99 #define getdeadkeys() peek(0x209)
100
101 #define NOKEY 0x38
102 #define ALTGR 0xa0 /* Euphoric only */
103 #define CTRL 0xa2
104 #define LSHIFT 0xa4
105 #define FUNC 0xa5 /* Atmos only (and Euphoric, of course) */
106 #define RSHIFT 0xa7
107
108
109 /* Serial Attributes, curses style :-| */
110
111 #define A_FWBLACK 0
112 #define A_FWRED 1
113 #define A_FWGREEN 2
114 #define A_FWYELLOW 3
115 #define A_FWBLUE 4
116 #define A_FWMAGENTA 5
117 #define A_FWCYAN 6
118 #define A_FWWHITE 7
119 #define A_BGBLACK 16
120 #define A_BGRED 17
121 #define A_BGGREEN 18
122 #define A_BGYELLOW 19
123 #define A_BGBLUE 20
124 #define A_BGMAGENTA 21
125 #define A_BGCYAN 22
126 #define A_BGWHITE 23
127 #define A_STD 8
128 #define A_ALT 9
129 #define A_STD2H 10
130 #define A_ALT2H 11
131 #define A_STDFL 12
132 #define A_ALTFL 13
133 #define A_STD2HFL 14
134 #define A_ALT2HFL 15
135 #define A_TEXT60 24
136 #define A_TEXT50 26
137 #define A_HIRES60 28
138 #define A_HIRES50 30
139
140
141 /* This gets and sets some system flags */
142 /* Use the #defines below to set the flags */
143
144 #define getflags() peek(0x26a)
145 #define setflags(x) poke(0x26a,x)
146
147 #define CURSOR 0x01 /* Cursor on (ctrl-q) */
148 #define SCREEN 0x02 /* Printout to screen on (ctrl-s) */
149 #define NOKEYCLICK 0x08 /* Turn keyclick off (ctrl-f) */
150 #define PROTECT 0x20 /* Protect columns 0-1 (ctrl-]) */
151
152
153 /* Get memory size */
154
155 #define getmemsize() peek(0x220)
156
157 #define ORIC16k 1
158 #define ORIC48k 0
159
160 static char *textvram=(char*)48000; /* pointer to the video RAM */
161
162
163 /* This copies a 40x25 buffer onto the screen. Very fast. */
164
165 #define dumpscreen(scr) memcpy((char*)textvram,(char*)scr,1120)
166

  ViewVC Help
Powered by ViewVC 1.1.26