Mercurial > hg > dmlib
diff tools/lib64util.c @ 2571:bb44c48cffac
Add helper function for getting C64 chargen ROM path from environment
variable 'CHARGEN_ROM' and use it instead of the compile-time hardcoded
value.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 02 Mar 2022 23:23:05 +0200 |
parents | c6ee41fd98dd |
children | 9807ae37ad69 |
line wrap: on
line diff
--- a/tools/lib64util.c Wed Mar 02 00:31:27 2022 +0200 +++ b/tools/lib64util.c Wed Mar 02 23:23:05 2022 +0200 @@ -8,6 +8,11 @@ #include "lib64util.h" #include "dmfile.h" +// Default character file ROM path, if not defined yet +#ifndef DM_DEF_CHARGEN +#define DM_DEF_CHARGEN "/usr/local/lib64/vice/C64/chargen" +#endif + // // Some common C64 palettes @@ -428,3 +433,14 @@ return res; } + + +const char *dmGetChargenROMPath() +{ + const char *path = getenv("CHARGEN_ROM"); + if (path != NULL) + return path; + else + return DM_DEF_CHARGEN; +} +