osd.h
1 /* 2 ** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com) 3 ** 4 ** 5 ** This program is free software; you can redistribute it and/or 6 ** modify it under the terms of version 2 of the GNU Library General 7 ** Public License as published by the Free Software Foundation. 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 GNU 12 ** Library General Public License for more details. To obtain a 13 ** copy of the GNU Library General Public License, write to the Free 14 ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 15 ** 16 ** Any permitted reproduction of these routines, in whole or in part, 17 ** must bear this legend. 18 ** 19 ** 20 ** osd.h 21 ** 22 ** O/S dependent routine defintions (must be customized) 23 ** $Id: osd.h,v 1.2 2001/04/27 14:37:11 neil Exp $ 24 */ 25 26 #ifndef _OSD_H_ 27 #define _OSD_H_ 28 29 #include <limits.h> 30 #ifndef PATH_MAX 31 #define PATH_MAX 512 32 #endif /* PATH_MAX */ 33 34 #ifdef __GNUC__ 35 #define __PACKED__ __attribute__ ((packed)) 36 37 #ifdef __DJGPP__ 38 #define PATH_SEP '\\' 39 #else /* !__DJGPP__ */ 40 #define PATH_SEP '/' 41 #endif /* !__DJGPP__ */ 42 43 #elif defined(WIN32) 44 #define __PACKED__ 45 #define PATH_SEP '\\' 46 #else /* !defined(WIN32) && !__GNUC__ */ 47 #define __PACKED__ 48 #define PATH_SEP ':' 49 #endif /* !defined(WIN32) && !__GNUC__ */ 50 51 #if !defined(WIN32) && !defined(__DJGPP__) 52 #define stricmp strcasecmp 53 #endif /* !WIN32 && !__DJGPP__ */ 54 55 56 extern void osd_setsound(void (*playfunc)(void *buffer, int size)); 57 58 59 #ifndef NSF_PLAYER 60 #include "noftypes.h" 61 #include "vid_drv.h" 62 63 typedef struct vidinfo_s 64 { 65 int default_width, default_height; 66 viddriver_t *driver; 67 } vidinfo_t; 68 69 typedef struct sndinfo_s 70 { 71 int sample_rate; 72 int bps; 73 } sndinfo_t; 74 75 /* get info */ 76 extern void osd_getvideoinfo(vidinfo_t *info); 77 extern void osd_getsoundinfo(sndinfo_t *info); 78 79 /* init / shutdown */ 80 extern int osd_init(void); 81 extern void osd_shutdown(void); 82 extern int osd_main(int argc, char *argv[]); 83 84 extern int osd_installtimer(int frequency, void *func, int funcsize, 85 void *counter, int countersize); 86 87 /* filename manipulation */ 88 extern void osd_fullname(char *fullname, const char *shortname); 89 extern char *osd_newextension(char *string, char *ext); 90 91 /* input */ 92 extern void osd_getinput(void); 93 extern void osd_getmouse(int *x, int *y, int *button); 94 95 /* build a filename for a snapshot, return -ve for error */ 96 extern int osd_makesnapname(char *filename, int len); 97 98 #endif /* !NSF_PLAYER */ 99 100 #endif /* _OSD_H_ */ 101 102 /* 103 ** $Log: osd.h,v $ 104 ** Revision 1.2 2001/04/27 14:37:11 neil 105 ** wheeee 106 ** 107 ** Revision 1.1.1.1 2001/04/27 07:03:54 neil 108 ** initial 109 ** 110 ** Revision 1.30 2000/11/05 22:53:13 matt 111 ** only one video driver per system, please 112 ** 113 ** Revision 1.29 2000/11/05 06:23:41 matt 114 ** thinlib spawns changes 115 ** 116 ** Revision 1.28 2000/10/22 19:15:39 matt 117 ** more sane timer ISR / autoframeskip 118 ** 119 ** Revision 1.27 2000/10/21 19:25:59 matt 120 ** many more cleanups 121 ** 122 ** Revision 1.26 2000/10/10 13:03:53 matt 123 ** Mr. Clean makes a guest appearance 124 ** 125 ** Revision 1.25 2000/10/02 15:01:12 matt 126 ** frag size has been removed 127 ** 128 ** Revision 1.24 2000/08/31 02:40:18 matt 129 ** fixed some crap 130 ** 131 ** Revision 1.23 2000/08/16 02:57:14 matt 132 ** changed video interface a wee bit 133 ** 134 ** Revision 1.22 2000/08/11 01:46:30 matt 135 ** new OSD sound information interface 136 ** 137 ** Revision 1.21 2000/08/04 15:01:32 neil 138 ** BeOS cleanups 139 ** 140 ** Revision 1.20 2000/08/04 14:36:14 neil 141 ** BeOS is working.. kinda 142 ** 143 ** Revision 1.19 2000/07/26 21:36:13 neil 144 ** Big honkin' change -- see the mailing list 145 ** 146 ** Revision 1.18 2000/07/23 16:21:35 neil 147 ** neither stricmp nor strcasecmp works everywhere 148 ** 149 ** Revision 1.17 2000/07/23 15:17:40 matt 150 ** osd_getfragsize 151 ** 152 ** Revision 1.16 2000/07/21 13:37:20 neil 153 ** snap filenames are OS-dependent 154 ** 155 ** Revision 1.15 2000/07/21 04:58:37 matt 156 ** new osd_main structure 157 ** 158 ** Revision 1.14 2000/07/21 04:26:15 matt 159 ** added some nasty externs 160 ** 161 ** Revision 1.13 2000/07/21 02:42:45 matt 162 ** merged osd_getinput and osd_gethostinput 163 ** 164 ** Revision 1.12 2000/07/19 13:10:35 neil 165 ** PATH_MAX 166 ** 167 ** Revision 1.11 2000/07/10 03:04:15 matt 168 ** removed scanlines, backbuffer from custom blit 169 ** 170 ** Revision 1.10 2000/07/06 16:48:25 matt 171 ** new video driver 172 ** 173 ** Revision 1.9 2000/07/05 17:26:16 neil 174 ** Moved the externs in nofrendo.c to osd.h 175 ** 176 ** Revision 1.8 2000/07/04 23:07:06 matt 177 ** djgpp path separator bugfix 178 ** 179 ** Revision 1.7 2000/07/04 04:45:33 matt 180 ** moved INLINE define into types.h 181 ** 182 ** Revision 1.6 2000/06/29 16:06:18 neil 183 ** Wrapped DOS-specific headers in an ifdef 184 ** 185 ** Revision 1.5 2000/06/09 15:12:25 matt 186 ** initial revision 187 ** 188 */