1 #ifndef _INCLUDE_SYS_MISC_H 2 #define _INCLUDE_SYS_MISC_H 3 4 /* 5 * Miscellaneous section 6 * 7 * Here are function that don't belong to a set of function. It doesn't mean 8 * they shouldn't be implemented but rather that they are important enough 9 * to have their own section :) 10 */ 11 12 /* 13 * osd_init_machine 14 * 15 * This function is called once at the very beginning of the emulation and 16 * must set once for all certain variables. 17 * e.g. it should allocate mem for the osd_gfx_buffer variable, init joypad 18 * stuff e.g. or anything else that will last the whole emulation session. 19 * return 0 on success else non zero value 20 */ 21 int osd_init_machine(void); 22 23 /* 24 * osd_shut_machine 25 * 26 * This is called once at the end of the emulation should be used to free 27 * resources allocated in osd_init_machine 28 */ 29 void osd_shut_machine(void); 30 31 /* 32 * osd_keypressed 33 * 34 * Behaves like kbhit, returning 0 is case no key have been pressed and a 35 * non zero value if there's any key that can be read from osd_readkey 36 */ 37 SChar osd_keypressed(void); 38 39 /* 40 * osd_readkey 41 * 42 * Return info concerning the first keystroke, lower byte is the ascii code 43 * while the higher byte contains the scancode of the key. 44 * Once called, discard the value in the keystroke buffer 45 */ 46 UInt16 osd_readkey(void); 47 48 /* 49 * osd_fix_filename_slashes 50 * 51 * Update a string in parameter, converting the "wrong slashes" into slashes 52 * expected by the current os 53 */ 54 void osd_fix_filename_slashes(char* s); 55 56 /* 57 * osd_init_paths 58 * 59 * Set global path and filename variables : 60 * - short_exe_name 61 * - log_filename 62 * - sav_basepath 63 * - tmp_basepath 64 * - video_path 65 */ 66 void osd_init_paths(); 67 68 /* 69 * gamepad_driver 70 * 71 * When needed, represents the type of the joypad(s) to expect 72 */ 73 extern int gamepad_driver; 74 75 /* 76 * synchro 77 * 78 * On ports where speed isn't auto regulated, tell whether we need to manually 79 * reduce the speed or not 80 */ 81 extern char synchro; 82 83 #endif 84