/[projet1]/public/pc/tools/osdk/main/Osdk/_final_/include/LIB.H
Defence Force logotype

Contents of /public/pc/tools/osdk/main/Osdk/_final_/include/LIB.H

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1002 - (show annotations)
Sun Dec 8 10:50:26 2013 UTC (6 years ago) by dbug
File MIME type: text/plain
File size: 5456 byte(s)
Resynchronized my own changes to the OSDK with what was in the depot.
From now on I will continue the changes directly with the depot version, and try to update more regularly.
The reason I had this big change is that I had two computers with local changes done in demo parties when working on demos, where I did the fixes to handle Euphoric and Oricutron, plus new tools, modified tools, etc... giant mess.
I do not guarantee that what is on the depot is bug free, but it's the version I'm using right now (My OSDK var points to the public\pc\tools\osdk\main\Osdk\_final_ folder.
1
2 void exit(int retval);
3
4 int getchar(void);
5 int putchar(char c);
6 int printf(const char *format,...);
7 char *itoa(int n);
8
9 int isalpha(char c);
10 int isupper(char c);
11 int islower(char c);
12 int isdigit(char c);
13 int isspace(char c);
14 int ispunct(char c);
15 int isprint(char c);
16 int iscntrl(char c);
17 int isascii(char c);
18 char toupper(char c);
19 char tolower(char c);
20 char toascii(char c);
21
22 char* sbrk();
23 char* brk();
24
25 char *strcpy(char *s1,const char * s2);
26 int strcmp(const char *s1,const char * s2);
27 int strlen(const char *s);
28
29 int memcpy(void *dst, void *src, int n);
30
31 /* Oric specific routines, added by Vaggelis Blathras */
32
33 void hires(void);
34 void text(void);
35 void ping(void);
36 void shoot(void);
37 void zap(void);
38 void explode(void);
39 void kbdclick1(void);
40 void kbdclick2(void);
41 int ink(int color);
42 int paper(int color);
43 int curset(int x,int y,int mode);
44 int curmov(int dx,int dy,int mode);
45 int draw(int dx,int dy,int mode);
46 int circle(int radius,int mode);
47 int hchar(char c,int charset,int mode);
48 int fill(int height,int width,char c);
49 int point(int x,int y);
50 int pattern(char style);
51 int play(int soundchanels,int noisechanels,int envelop,int volume);
52 int music(int chanel,int octave,int key,int volume);
53 int sound(int chanel,int period,int volume);
54 void w8912(unsigned char reg,unsigned char value);
55 char key(void);
56 char is_overlay_enabled();
57
58
59 /* Stuff added by Alexios Chouchoulas */
60
61 void cls();
62 void lores0(void);
63 void lores1(void);
64 void gotoxy(int x, int y); /* move the cursor: broken for the moment */
65 int get(void); /* get character without echoing */
66 void cwrite(char c); /* write a byte to 'tape' */
67 int cread(); /* read a byte from 'tape' */
68 void cwritehdr(); /* write a file header to tape */
69 void call(int addr); /* call a machine code routine */
70
71 /* sedoric(): Please use the exclamation mark as well, e.g. sedoric("!DIR") */
72 /* Bear in mind that this might well be broken. I don't know */
73 /* much about SEDORIC yet... No error handling! Anything wrong */
74 /* happens, and you get an error, and go back to the 'Ready' */
75 /* prompt. Can anyone fix things here? I declare my ignorance. */
76
77 void sedoric(char *command); /* invoke a sedoric command */
78
79 /* Disk drive API - Work in progress
80 void init_disk()
81 int sect_read(int sector_number, char * buffer);
82 int sect_write(int sector_number, char * buffer);
83 void switch_to_rom();
84 void switch_to_ram();
85 */
86
87
88 /* lprintf(): Like printf, but sends output to the printer. Maybe this and */
89 /* printf() should be merged, I don't know... */
90
91 int lprintf(const char *format,...);
92
93
94 /* Stuff added by Mickael Pointier */
95
96 void file_unpack(void *ptr_dst,void *ptr_src);
97
98 #define peek(address) ( *((unsigned char*)address) )
99 #define poke(address,value) ( *((unsigned char*)address)=(unsigned char)value )
100
101 #define deek(address) ( *((unsigned int*)address) )
102 #define doke(address,value) ( *((unsigned int*)address)=(unsigned int)value )
103
104
105 /* System data */
106
107 #define TEXTVRAM 0xbb80
108 #define STDCHRTABLE 0xb400
109 #define ALTCHRTABLE 0xb800
110
111
112 #define GETPAPER (peek(0x26b)-16) /* return current paper colour */
113 #define GETINK peek(0x26c) /* return current ink colour */
114
115
116 /* This returns which dead key is currently pressed */
117 /* Use the #defines below to check for the keys */
118
119 #define getdeadkeys() peek(0x209)
120
121 #define NOKEY 0x38
122 #define ALTGR 0xa0 /* Euphoric only */
123 #define CTRL 0xa2
124 #define LSHIFT 0xa4
125 #define FUNC 0xa5 /* Atmos only (and Euphoric, of course) */
126 #define RSHIFT 0xa7
127
128
129 /* Serial Attributes, curses style :-| */
130
131 #define A_FWBLACK 0
132 #define A_FWRED 1
133 #define A_FWGREEN 2
134 #define A_FWYELLOW 3
135 #define A_FWBLUE 4
136 #define A_FWMAGENTA 5
137 #define A_FWCYAN 6
138 #define A_FWWHITE 7
139 #define A_BGBLACK 16
140 #define A_BGRED 17
141 #define A_BGGREEN 18
142 #define A_BGYELLOW 19
143 #define A_BGBLUE 20
144 #define A_BGMAGENTA 21
145 #define A_BGCYAN 22
146 #define A_BGWHITE 23
147 #define A_STD 8
148 #define A_ALT 9
149 #define A_STD2H 10
150 #define A_ALT2H 11
151 #define A_STDFL 12
152 #define A_ALTFL 13
153 #define A_STD2HFL 14
154 #define A_ALT2HFL 15
155 #define A_TEXT60 24
156 #define A_TEXT50 26
157 #define A_HIRES60 28
158 #define A_HIRES50 30
159
160
161 /* This gets and sets some system flags */
162 /* Use the #defines below to set the flags */
163
164 #define getflags() peek(0x26a)
165 #define setflags(x) poke(0x26a,x)
166
167 #define CURSOR 0x01 /* Cursor on (ctrl-q) */
168 #define SCREEN 0x02 /* Printout to screen on (ctrl-s) */
169 #define NOKEYCLICK 0x08 /* Turn keyclick off (ctrl-f) */
170 #define PROTECT 0x20 /* Protect columns 0-1 (ctrl-]) */
171
172
173 /* Get memory size */
174
175 #define getmemsize() peek(0x220)
176
177 #define ORIC16k 1
178 #define ORIC48k 0
179
180 //static char *textvram=(char*)48000; /* pointer to the video RAM */
181
182
183 /* This copies a 40x25 buffer onto the screen. Very fast. */
184
185 #define dumpscreen(scr) memcpy((char*)textvram,(char*)scr,1120)
186
187
188
189 extern unsigned char OsdkTableMod6[];
190 extern unsigned char OsdkTableDiv6[];
191
192
193 //
194 // Some 'pseudo standard' library stuff
195 //
196 extern unsigned int randseedLow;
197 extern unsigned int randseedTop;
198 extern unsigned int pcrand();
199
200 #define srand(seed) if (0) {} else {randseedLow=(seed);randseedTop=0;}
201 #define rand() (rand32()?(randseedTop & 0x7fff):(randseedTop & 0x7fff))

  ViewVC Help
Powered by ViewVC 1.1.26