comparison romdb.c @ 1548:94ba407a5ec1

Allow MegaWiFi support to be toggled in config file. Defaults to off due to security concerns
author Michael Pavone <pavone@retrodev.com>
date Mon, 26 Mar 2018 22:13:22 -0700
parents 1f745318f10a
children 31effaadf877
comparison
equal deleted inserted replaced
1547:cb12667aa83e 1548:94ba407a5ec1
10 #include "realtec.h" 10 #include "realtec.h"
11 #include "nor.h" 11 #include "nor.h"
12 #include "sega_mapper.h" 12 #include "sega_mapper.h"
13 #include "multi_game.h" 13 #include "multi_game.h"
14 #include "megawifi.h" 14 #include "megawifi.h"
15 #include "blastem.h"
15 16
16 #define DOM_TITLE_START 0x120 17 #define DOM_TITLE_START 0x120
17 #define DOM_TITLE_END 0x150 18 #define DOM_TITLE_END 0x150
18 #define TITLE_START DOM_TITLE_END 19 #define TITLE_START DOM_TITLE_END
19 #define TITLE_END (TITLE_START+48) 20 #define TITLE_END (TITLE_START+48)
801 map->end = 0xA13100; 802 map->end = 0xA13100;
802 map->mask = 0xFF; 803 map->mask = 0xFF;
803 map->write_16 = write_multi_game_w; 804 map->write_16 = write_multi_game_w;
804 map->write_8 = write_multi_game_b; 805 map->write_8 = write_multi_game_b;
805 } else if (!strcmp(dtype, "megawifi")) { 806 } else if (!strcmp(dtype, "megawifi")) {
806 map->write_16 = megawifi_write_w; 807 if (!strcmp(
807 map->write_8 = megawifi_write_b; 808 "on",
808 map->read_16 = megawifi_read_w; 809 tern_find_path_default(config, "system\0megawifi\0", (tern_val){.ptrval="off"}, TVAL_PTR).ptrval)
809 map->read_8 = megawifi_read_b; 810 ) {
810 map->mask = 0xFFFFFF; 811 map->write_16 = megawifi_write_w;
812 map->write_8 = megawifi_write_b;
813 map->read_16 = megawifi_read_w;
814 map->read_8 = megawifi_read_b;
815 map->mask = 0xFFFFFF;
816 } else {
817 warning("ROM uses MegaWiFi, but it is disabled\n");
818 return;
819 }
811 } else { 820 } else {
812 fatal_error("Invalid device type %s for ROM DB map entry %d with address %s\n", dtype, state->index, key); 821 fatal_error("Invalid device type %s for ROM DB map entry %d with address %s\n", dtype, state->index, key);
813 } 822 }
814 state->index++; 823 state->index++;
815 } 824 }