use DYN_DRV and MOUSE_DRIVER defines to decide which driver to use

This commit is contained in:
Christian Groessler
2014-06-01 19:17:02 +02:00
parent 3508b90ee8
commit deddb00a3a

View File

@@ -5,8 +5,15 @@
#include <conio.h> #include <conio.h>
#include <joystick.h> #include <joystick.h>
#ifdef MOUSE_DRIVER
/* A statically linked driver was named on the compiler's command line.
** Make sure that it is used instead of a dynamic one.
*/
# undef DYN_DRV
# define DYN_DRV 0
#endif
#if defined(__NES__) || defined(__ATARI5200__) #if defined(__NES__) || defined(__ATARI5200__)
#define STATIC_DRIVER
#define NO_OSERROR #define NO_OSERROR
#endif #endif
@@ -17,11 +24,14 @@ int main (void)
unsigned char count; unsigned char count;
unsigned char i; unsigned char i;
#ifdef STATIC_DRIVER #if DYN_DRV
unsigned char Res = joy_install (&joy_static_stddrv);
#else
unsigned char Res = joy_load_driver (joy_stddrv); unsigned char Res = joy_load_driver (joy_stddrv);
#elif defined(MOUSE_DRIVER)
unsigned char Res = joy_install (&MOUSE_DRIVER);
#else
unsigned char Res = joy_install (&joy_static_stddrv);
#endif #endif
if (Res != JOY_ERR_OK) { if (Res != JOY_ERR_OK) {
cprintf ("Error in joy_load_driver: %u\r\n", Res); cprintf ("Error in joy_load_driver: %u\r\n", Res);
#ifndef NO_OSERROR #ifndef NO_OSERROR
@@ -64,4 +74,3 @@ int main (void)
} }
return 0; return 0;
} }