4 functions for compatibility to doslib
6 ( mainly contains file-oriented functions )
8 Made by Studio Breeze. 1998, 2002
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is
16 furnished to do so, subject to the following conditions:
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31 #include "sted_screen.h"
36 //char fnc_func[10][32];
37 //char fnc_sfunc[10][32];
38 //char fnc_key[12][6];
40 /* ROLL UP, ROLL DOWN, INS, DEL,
41 UP, LEFT, RIGHT, DOWN,
42 CLR, HELP, HOME, UNDO */
44 /* console-oriented functions */
47 _dos_c_cls_al ( void )
67 scr->SetCursor(EButtonOff);
78 scr->SetCursor(EButtonOn);
83 _dos_c_fnkmod( int in_mode )
90 _dos_c_window( int in_x, int in_y )
96 scr->SetTextWindow(in_x, in_y);
102 _dos_fnckeygt( int in_fno, char *in_buff )
104 /* not implemented */
109 _dos_fnckeyst( int fno, const char *buff )
114 CSTedScreenBase* scr;
122 for ( i=0 ; i<10 ; i++ ) {
123 for ( j=0 ; j<32 ; j++ ) {
127 for ( i=0 ; i<10 ; i++ ) {
128 for ( j=0 ; j<32 ; j++ ) {
129 fnc_sfunc[i][j]=*p++;
132 for ( i=0 ; i<12 ; i++ ) {
133 for ( j=0 ; j<6 ; j++ ) {
137 } else if ( fno<=10 ) {
138 for ( j=0 ; j<32 ; j++ ) {
139 fnc_func[fno-1][j]=*p++;
141 } else if ( fno<=20 ) {
142 for ( j=0 ; j<32 ; j++ ) {
143 fnc_sfunc[fno-11][j]=*p++;
145 } else if ( fno<=32 ) {
146 for ( j=0 ; j<6 ; j++ ) {
147 fnc_key[fno-21][j]=*p++;
151 scr->SetFncKey(fnc_key);
156 _dos_inpout( int in_code )
158 CSTedScreenBase* scr;
163 if ( (in_code==0xfe) || (in_code==0xff) ) {
164 return scr->KeyIn(in_code);
171 _dos_malloc(int in_size)
175 tmp = (void *)malloc(in_size);
176 if ( tmp == NULL ) tmp = (void *)0x82000000;
186 _dos_chmod( const char *in_name, dosmode_t in_atr )
188 /* returns only one flag : is the file "name" directory? */
190 CSTedScreenBase* scr;
195 return scr->FileChmod(in_name, in_atr);
199 _dos_chdir( const char *in_name )
201 CSTedScreenBase* scr;
206 return scr->FileChdir(in_name);
210 _dos_curdir( int in_drive, char *out_buff )
212 CSTedScreenBase* scr;
217 return scr->FileCurdir(in_drive, out_buff);
223 CSTedScreenBase* scr;
228 return scr->FileCurdrv();
232 _dos_delete( const char *in_name )
234 CSTedScreenBase* scr;
239 return scr->FileDelete(in_name);
242 int _dos_drvctrl( int mode, int drive ) {
244 return 2; /* media inserted, ready, not protected, enable eject by user,
245 no buffer, enable eject, not blink LED */
249 _dos_rename( const char *in_name, const char *in_nname )
251 CSTedScreenBase* scr;
256 return scr->FileRename(in_name, in_nname);
259 int _dos_super( int stack ) {
261 return 1; /* ignore */
265 _dos_files (struct _x68_filbuf *in_buff, const char *in_name, int in_atr )
267 CSTedScreenBase* scr;
272 return scr->FileFiles(in_buff, in_name, in_atr);
276 _dos_nfiles( struct _x68_filbuf *in_buff )
278 CSTedScreenBase* scr;
283 return scr->FileNfiles(in_buff);
286 int _dos_setblock( void *memptr, int newsize ) {
288 /* not implemented */
292 int dskf( char drive_number ) {
299 *fopen2( char *in_name, char *in_mode)
301 CSTedScreenBase* scr;
304 if (!scr) return NULL;
306 return scr->FileFopen(in_name, in_mode);