comparison romdb.c @ 2045:b119e0de9a70 proprietary

Strip out mega wifi support and debugger
author Michael Pavone <pavone@retrodev.com>
date Tue, 21 Sep 2021 23:17:34 -0700
parents 8b2ef428d1aa
children
comparison
equal deleted inserted replaced
2043:804954731e3f 2045:b119e0de9a70
9 #include "xband.h" 9 #include "xband.h"
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"
15 #include "jcart.h" 14 #include "jcart.h"
16 #include "blastem.h" 15 #include "blastem.h"
17 16
18 #define DOM_TITLE_START 0x120 17 #define DOM_TITLE_START 0x120
19 #define DOM_TITLE_END 0x150 18 #define DOM_TITLE_END 0x150
295 info->map[8].start = 0xA13000; 294 info->map[8].start = 0xA13000;
296 info->map[8].end = 0xA13100; 295 info->map[8].end = 0xA13100;
297 info->map[8].mask = 0xFF; 296 info->map[8].mask = 0xFF;
298 info->map[8].write_16 = (write_16_fun)write_bank_reg_w; 297 info->map[8].write_16 = (write_16_fun)write_bank_reg_w;
299 info->map[8].write_8 = (write_8_fun)write_bank_reg_b; 298 info->map[8].write_8 = (write_8_fun)write_bank_reg_b;
300 return;
301 } else if(!memcmp("SEGA MEGAWIFI", rom + 0x100, strlen("SEGA MEGAWIFI"))) {
302 info->mapper_type = MAPPER_NONE;
303 info->map_chunks = base_chunks + 2;
304 info->map = malloc(sizeof(memmap_chunk) * info->map_chunks);
305 memset(info->map, 0, sizeof(memmap_chunk)*2);
306 memcpy(info->map+2, base_map, sizeof(memmap_chunk) * base_chunks);
307 info->save_size = 0x400000;
308 info->save_bus = RAM_FLAG_BOTH;
309 info->save_type = SAVE_NOR;
310 info->map[0].start = 0;
311 info->map[0].end = 0x400000;
312 info->map[0].mask = 0xFFFFFF;
313 info->map[0].write_16 = nor_flash_write_w;
314 info->map[0].write_8 = nor_flash_write_b;
315 info->map[0].read_16 = nor_flash_read_w;
316 info->map[0].read_8 = nor_flash_read_b;
317 info->map[0].flags = MMAP_READ_CODE | MMAP_CODE;
318 info->map[0].buffer = info->save_buffer = calloc(info->save_size, 1);
319 uint32_t init_size = size < info->save_size ? size : info->save_size;
320 memcpy(info->save_buffer, rom, init_size);
321 byteswap_rom(info->save_size, (uint16_t *)info->save_buffer);
322 info->nor = calloc(1, sizeof(nor_state));
323 nor_flash_init(info->nor, info->save_buffer, info->save_size, 128, 0xDA45, RAM_FLAG_BOTH);
324 info->nor->cmd_address1 = 0xAAB;
325 info->nor->cmd_address2 = 0x555;
326 info->map[1].start = 0xA130C0;
327 info->map[1].end = 0xA130D0;
328 info->map[1].mask = 0xFFFFFF;
329 if (!strcmp(
330 "on",
331 tern_find_path_default(config, "system\0megawifi\0", (tern_val){.ptrval="off"}, TVAL_PTR).ptrval)
332 ) {
333 info->map[1].write_16 = megawifi_write_w;
334 info->map[1].write_8 = megawifi_write_b;
335 info->map[1].read_16 = megawifi_read_w;
336 info->map[1].read_8 = megawifi_read_b;
337 } else {
338 warning("ROM uses MegaWiFi, but it is disabled\n");
339 }
340 return; 299 return;
341 } else if (has_ram_header(rom, size)) { 300 } else if (has_ram_header(rom, size)) {
342 uint32_t ram_start = read_ram_header(info, rom); 301 uint32_t ram_start = read_ram_header(info, rom);
343 302
344 if (info->save_buffer) { 303 if (info->save_buffer) {
864 map->start = 0xA13000; 823 map->start = 0xA13000;
865 map->end = 0xA13100; 824 map->end = 0xA13100;
866 map->mask = 0xFF; 825 map->mask = 0xFF;
867 map->write_16 = write_multi_game_w; 826 map->write_16 = write_multi_game_w;
868 map->write_8 = write_multi_game_b; 827 map->write_8 = write_multi_game_b;
869 } else if (!strcmp(dtype, "megawifi")) {
870 if (!strcmp(
871 "on",
872 tern_find_path_default(config, "system\0megawifi\0", (tern_val){.ptrval="off"}, TVAL_PTR).ptrval)
873 ) {
874 map->write_16 = megawifi_write_w;
875 map->write_8 = megawifi_write_b;
876 map->read_16 = megawifi_read_w;
877 map->read_8 = megawifi_read_b;
878 map->mask = 0xFFFFFF;
879 } else {
880 warning("ROM uses MegaWiFi, but it is disabled\n");
881 return;
882 }
883 } else if (!strcmp(dtype, "jcart")) { 828 } else if (!strcmp(dtype, "jcart")) {
884 state->info->mapper_type = MAPPER_JCART; 829 state->info->mapper_type = MAPPER_JCART;
885 map->write_16 = jcart_write_w; 830 map->write_16 = jcart_write_w;
886 map->write_8 = jcart_write_b; 831 map->write_8 = jcart_write_b;
887 map->read_16 = jcart_read_w; 832 map->read_16 = jcart_read_w;