Mercurial > hg > dmlib
comparison 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 |
comparison
equal
deleted
inserted
replaced
2570:1559011d749f | 2571:bb44c48cffac |
---|---|
5 * | 5 * |
6 * Please read file 'COPYING' for information on license and distribution. | 6 * Please read file 'COPYING' for information on license and distribution. |
7 */ | 7 */ |
8 #include "lib64util.h" | 8 #include "lib64util.h" |
9 #include "dmfile.h" | 9 #include "dmfile.h" |
10 | |
11 // Default character file ROM path, if not defined yet | |
12 #ifndef DM_DEF_CHARGEN | |
13 #define DM_DEF_CHARGEN "/usr/local/lib64/vice/C64/chargen" | |
14 #endif | |
10 | 15 |
11 | 16 |
12 // | 17 // |
13 // Some common C64 palettes | 18 // Some common C64 palettes |
14 // | 19 // |
426 dmImageFree(inImage); | 431 dmImageFree(inImage); |
427 dmFree(dataBuf); | 432 dmFree(dataBuf); |
428 | 433 |
429 return res; | 434 return res; |
430 } | 435 } |
436 | |
437 | |
438 const char *dmGetChargenROMPath() | |
439 { | |
440 const char *path = getenv("CHARGEN_ROM"); | |
441 if (path != NULL) | |
442 return path; | |
443 else | |
444 return DM_DEF_CHARGEN; | |
445 } | |
446 |