Added option to build samples with statically linked drivers - and have the targets use it by default which don't support dynamically loaded drivers.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5913 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -98,6 +98,13 @@
|
|||||||
#define CH_LIRA 95
|
#define CH_LIRA 95
|
||||||
#define CH_ESC 27
|
#define CH_ESC 27
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* No support for dynamically loadable drivers */
|
||||||
|
#define DYN_DRV 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void __fastcall__ atmos_load(const char* name);
|
void __fastcall__ atmos_load(const char* name);
|
||||||
/* Load Atmos tape. */
|
/* Load Atmos tape. */
|
||||||
|
|
||||||
@@ -108,6 +115,3 @@ void __fastcall__ atmos_save(const char* name, const void* start, const void* en
|
|||||||
|
|
||||||
/* End of atmos.h */
|
/* End of atmos.h */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,8 @@
|
|||||||
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
|
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
|
||||||
#define TGI_COLOR_WHITE COLOR_WHITE
|
#define TGI_COLOR_WHITE COLOR_WHITE
|
||||||
|
|
||||||
|
/* No support for dynamically loadable drivers */
|
||||||
|
#define DYN_DRV 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -194,6 +195,3 @@ unsigned __fastcall__ lynx_eewrite (unsigned cell, unsigned val);
|
|||||||
|
|
||||||
/* End of lynx.h */
|
/* End of lynx.h */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,6 @@
|
|||||||
#define CH_LRCORNER 0x08
|
#define CH_LRCORNER 0x08
|
||||||
#define CH_PI 0x05
|
#define CH_PI 0x05
|
||||||
|
|
||||||
|
|
||||||
/* Color defines */
|
/* Color defines */
|
||||||
#define COLOR_BLACK 0x00
|
#define COLOR_BLACK 0x00
|
||||||
#define COLOR_WHITE 0x01
|
#define COLOR_WHITE 0x01
|
||||||
@@ -88,6 +87,9 @@
|
|||||||
#define TV_PAL 1
|
#define TV_PAL 1
|
||||||
#define TV_OTHER 2
|
#define TV_OTHER 2
|
||||||
|
|
||||||
|
/* No support for dynamically loadable drivers */
|
||||||
|
#define DYN_DRV 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void waitvblank (void);
|
void waitvblank (void);
|
||||||
@@ -100,6 +102,3 @@ unsigned char get_tv (void);
|
|||||||
|
|
||||||
/* End of nes.h */
|
/* End of nes.h */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,11 @@
|
|||||||
# define CLK_TCK 1
|
# define CLK_TCK 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Use dynamically loaded driver by default */
|
||||||
|
#ifndef DYN_DRV
|
||||||
|
# define DYN_DRV 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Use static local variables for speed */
|
/* Use static local variables for speed */
|
||||||
#pragma static-locals (1);
|
#pragma static-locals (1);
|
||||||
|
|
||||||
@@ -90,9 +95,14 @@ int main (void)
|
|||||||
|
|
||||||
clrscr ();
|
clrscr ();
|
||||||
|
|
||||||
|
#if DYN_DRV
|
||||||
/* Load the graphics driver */
|
/* Load the graphics driver */
|
||||||
cprintf ("initializing... mompls\r\n");
|
cprintf ("initializing... mompls\r\n");
|
||||||
tgi_load_driver (tgi_stddrv);
|
tgi_load_driver (tgi_stddrv);
|
||||||
|
#else
|
||||||
|
/* Install the graphics driver */
|
||||||
|
tgi_install (tgi_static_stddrv);
|
||||||
|
#endif
|
||||||
err = tgi_geterror ();
|
err = tgi_geterror ();
|
||||||
if (err != TGI_ERR_OK) {
|
if (err != TGI_ERR_OK) {
|
||||||
cprintf ("Error #%d initializing graphics.\r\n%s\r\n",
|
cprintf ("Error #%d initializing graphics.\r\n%s\r\n",
|
||||||
@@ -132,5 +142,4 @@ int main (void)
|
|||||||
|
|
||||||
/* Done */
|
/* Done */
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,12 @@ static const unsigned char MouseSprite[64] = {
|
|||||||
#endif /* __C64__ or __C128__ */
|
#endif /* __C64__ or __C128__ */
|
||||||
|
|
||||||
|
|
||||||
|
/* Dynamically loaded driver by default */
|
||||||
|
#ifndef DYN_DRV
|
||||||
|
# define DYN_DRV 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
@@ -133,12 +139,18 @@ int main (void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if DYN_DRV
|
||||||
/* Output a warning about the driver that is needed */
|
/* Output a warning about the driver that is needed */
|
||||||
DoWarning ();
|
DoWarning ();
|
||||||
|
|
||||||
/* Load and install the mouse driver */
|
/* Load and install the mouse driver */
|
||||||
CheckError ("mouse_load_driver",
|
CheckError ("mouse_load_driver",
|
||||||
mouse_load_driver (&mouse_def_callbacks, mouse_stddrv));
|
mouse_load_driver (&mouse_def_callbacks, mouse_stddrv));
|
||||||
|
#else
|
||||||
|
/* Install the mouse driver */
|
||||||
|
CheckError ("mouse_install",
|
||||||
|
mouse_install (&mouse_def_callbacks, mouse_static_stddrv));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Get the initial mouse bounding box */
|
/* Get the initial mouse bounding box */
|
||||||
mouse_getbox (&full_box);
|
mouse_getbox (&full_box);
|
||||||
@@ -210,8 +222,13 @@ int main (void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DYN_DRV
|
||||||
/* Uninstall and unload the mouse driver */
|
/* Uninstall and unload the mouse driver */
|
||||||
CheckError ("mouse_unload", mouse_unload ());
|
CheckError ("mouse_unload", mouse_unload ());
|
||||||
|
#else
|
||||||
|
/* Uninstall the mouse driver */
|
||||||
|
CheckError ("mouse_uninstall", mouse_uninstall ());
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Say goodbye */
|
/* Say goodbye */
|
||||||
clrscr ();
|
clrscr ();
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DYN_DRV
|
||||||
|
# define DYN_DRV 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define COLOR_BACK TGI_COLOR_BLACK
|
#define COLOR_BACK TGI_COLOR_BLACK
|
||||||
#define COLOR_FORE TGI_COLOR_WHITE
|
#define COLOR_FORE TGI_COLOR_WHITE
|
||||||
|
|
||||||
@@ -180,12 +184,19 @@ int main (void)
|
|||||||
{
|
{
|
||||||
unsigned char Border;
|
unsigned char Border;
|
||||||
|
|
||||||
|
#if DYN_DRV
|
||||||
/* Warn the user that the tgi driver is needed */
|
/* Warn the user that the tgi driver is needed */
|
||||||
DoWarning ();
|
DoWarning ();
|
||||||
|
|
||||||
/* Load and initialize the driver */
|
/* Load and initialize the driver */
|
||||||
tgi_load_driver (tgi_stddrv);
|
tgi_load_driver (tgi_stddrv);
|
||||||
CheckError ("tgi_load_driver");
|
CheckError ("tgi_load_driver");
|
||||||
|
#else
|
||||||
|
/* Install the driver */
|
||||||
|
tgi_install (tgi_static_stddrv);
|
||||||
|
CheckError ("tgi_install");
|
||||||
|
#endif
|
||||||
|
|
||||||
tgi_init ();
|
tgi_init ();
|
||||||
CheckError ("tgi_init");
|
CheckError ("tgi_init");
|
||||||
tgi_clear ();
|
tgi_clear ();
|
||||||
@@ -204,8 +215,13 @@ int main (void)
|
|||||||
DoDiagram ();
|
DoDiagram ();
|
||||||
DoLines ();
|
DoLines ();
|
||||||
|
|
||||||
|
#if DYN_DRV
|
||||||
/* Unload the driver */
|
/* Unload the driver */
|
||||||
tgi_unload ();
|
tgi_unload ();
|
||||||
|
#else
|
||||||
|
/* Uninstall the driver */
|
||||||
|
tgi_uninstall ();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Reset the border */
|
/* Reset the border */
|
||||||
(void) bordercolor (Border);
|
(void) bordercolor (Border);
|
||||||
|
|||||||
Reference in New Issue
Block a user