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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 781 - (hide annotations)
Sat Jan 21 22:33:21 2012 UTC (7 years, 10 months ago) by dbug
File MIME type: text/plain
File size: 5426 byte(s)
Updated the depot with the source code of the OSDK 0.019
1 dbug 70
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    
57     /* Stuff added by Alexios Chouchoulas */
58    
59     void cls();
60     void lores0(void);
61     void lores1(void);
62     void gotoxy(int x, int y); /* move the cursor: broken for the moment */
63     int get(void); /* get character without echoing */
64     void cwrite(char c); /* write a byte to 'tape' */
65     int cread(); /* read a byte from 'tape' */
66     void cwritehdr(); /* write a file header to tape */
67     void call(int addr); /* call a machine code routine */
68    
69     /* sedoric(): Please use the exclamation mark as well, e.g. sedoric("!DIR") */
70     /* Bear in mind that this might well be broken. I don't know */
71     /* much about SEDORIC yet... No error handling! Anything wrong */
72     /* happens, and you get an error, and go back to the 'Ready' */
73     /* prompt. Can anyone fix things here? I declare my ignorance. */
74    
75     void sedoric(char *command); /* invoke a sedoric command */
76    
77     /* Disk drive API - Work in progress
78     void init_disk()
79     int sect_read(int sector_number, char * buffer);
80     int sect_write(int sector_number, char * buffer);
81     void switch_to_rom();
82     void switch_to_ram();
83     */
84    
85    
86     /* lprintf(): Like printf, but sends output to the printer. Maybe this and */
87     /* printf() should be merged, I don't know... */
88    
89     int lprintf(const char *format,...);
90    
91    
92     /* Stuff added by Mickael Pointier */
93    
94     void file_unpack(void *ptr_dst,void *ptr_src);
95    
96 dbug 208 #define peek(address) ( *((unsigned char*)address) )
97     #define poke(address,value) ( *((unsigned char*)address)=(unsigned char)value )
98 dbug 70
99 dbug 208 #define deek(address) ( *((unsigned int*)address) )
100     #define doke(address,value) ( *((unsigned int*)address)=(unsigned int)value )
101 dbug 70
102    
103     /* System data */
104    
105     #define TEXTVRAM 0xbb80
106     #define STDCHRTABLE 0xb400
107     #define ALTCHRTABLE 0xb800
108    
109    
110     #define GETPAPER (peek(0x26b)-16) /* return current paper colour */
111     #define GETINK peek(0x26c) /* return current ink colour */
112    
113    
114     /* This returns which dead key is currently pressed */
115     /* Use the #defines below to check for the keys */
116    
117     #define getdeadkeys() peek(0x209)
118    
119     #define NOKEY 0x38
120     #define ALTGR 0xa0 /* Euphoric only */
121     #define CTRL 0xa2
122     #define LSHIFT 0xa4
123     #define FUNC 0xa5 /* Atmos only (and Euphoric, of course) */
124     #define RSHIFT 0xa7
125    
126    
127     /* Serial Attributes, curses style :-| */
128    
129     #define A_FWBLACK 0
130     #define A_FWRED 1
131     #define A_FWGREEN 2
132     #define A_FWYELLOW 3
133     #define A_FWBLUE 4
134     #define A_FWMAGENTA 5
135     #define A_FWCYAN 6
136     #define A_FWWHITE 7
137     #define A_BGBLACK 16
138     #define A_BGRED 17
139     #define A_BGGREEN 18
140     #define A_BGYELLOW 19
141     #define A_BGBLUE 20
142     #define A_BGMAGENTA 21
143     #define A_BGCYAN 22
144     #define A_BGWHITE 23
145     #define A_STD 8
146     #define A_ALT 9
147     #define A_STD2H 10
148     #define A_ALT2H 11
149     #define A_STDFL 12
150     #define A_ALTFL 13
151     #define A_STD2HFL 14
152     #define A_ALT2HFL 15
153     #define A_TEXT60 24
154     #define A_TEXT50 26
155     #define A_HIRES60 28
156     #define A_HIRES50 30
157    
158    
159     /* This gets and sets some system flags */
160     /* Use the #defines below to set the flags */
161    
162     #define getflags() peek(0x26a)
163     #define setflags(x) poke(0x26a,x)
164    
165     #define CURSOR 0x01 /* Cursor on (ctrl-q) */
166     #define SCREEN 0x02 /* Printout to screen on (ctrl-s) */
167     #define NOKEYCLICK 0x08 /* Turn keyclick off (ctrl-f) */
168     #define PROTECT 0x20 /* Protect columns 0-1 (ctrl-]) */
169    
170    
171     /* Get memory size */
172    
173     #define getmemsize() peek(0x220)
174    
175     #define ORIC16k 1
176     #define ORIC48k 0
177    
178     //static char *textvram=(char*)48000; /* pointer to the video RAM */
179    
180    
181     /* This copies a 40x25 buffer onto the screen. Very fast. */
182    
183     #define dumpscreen(scr) memcpy((char*)textvram,(char*)scr,1120)
184    
185    
186    
187     extern unsigned char OsdkTableMod6[];
188     extern unsigned char OsdkTableDiv6[];
189    
190    
191 dbug 781 //
192     // Some 'pseudo standard' library stuff
193     //
194     extern unsigned int randseedLow;
195     extern unsigned int randseedTop;
196     extern unsigned int pcrand();
197 dbug 70
198 dbug 781 #define srand(seed) if (0) {} else {randseedLow=(seed);randseedTop=0;}
199     #define rand() (rand32()?(randseedTop & 0x7fff):(randseedTop & 0x7fff))

  ViewVC Help
Powered by ViewVC 1.1.26