Mercurial > repos > blastem
comparison genesis.c @ 2623:07faf0f5466f
Add option to force use of the default region
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 22 Feb 2025 19:52:50 -0800 |
parents | 251cc75574af |
children | 6068d32b756c |
comparison
equal
deleted
inserted
replaced
2622:adff015dc94f | 2623:07faf0f5466f |
---|---|
1918 | 1918 |
1919 void set_region(genesis_context *gen, rom_info *info, uint8_t region) | 1919 void set_region(genesis_context *gen, rom_info *info, uint8_t region) |
1920 { | 1920 { |
1921 if (!region) { | 1921 if (!region) { |
1922 char * def_region = tern_find_path_default(config, "system\0default_region\0", (tern_val){.ptrval = "U"}, TVAL_PTR).ptrval; | 1922 char * def_region = tern_find_path_default(config, "system\0default_region\0", (tern_val){.ptrval = "U"}, TVAL_PTR).ptrval; |
1923 if (!info->regions || (info->regions & translate_region_char(toupper(*def_region)))) { | 1923 char * force_region = tern_find_path_default(config, "system\0force_region\0", (tern_val){.ptrval = "off"}, TVAL_PTR).ptrval; |
1924 | |
1925 if (!info->regions || (info->regions & translate_region_char(toupper(*def_region))) || !strcmp(force_region, "on")) { | |
1924 region = translate_region_char(toupper(*def_region)); | 1926 region = translate_region_char(toupper(*def_region)); |
1925 } else { | 1927 } else { |
1926 region = info->regions; | 1928 region = info->regions; |
1927 } | 1929 } |
1928 } | 1930 } |