Mercurial > repos > blastem
comparison sms.c @ 2257:1e626d0ecf9c
WIP SG-1000/TMS9918A mode support
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 17 Dec 2022 23:32:34 -0800 |
parents | cbe1ba70c247 |
children | 3e0d463eb9b3 |
comparison
equal
deleted
inserted
replaced
2256:cbe1ba70c247 | 2257:1e626d0ecf9c |
---|---|
688 memory_map[1] = (memmap_chunk){0xC000, 0x10000, sizeof(sms->ram)-1, 0, 0, .flags = MMAP_READ|MMAP_WRITE|MMAP_CODE, .buffer = sms->ram}; | 688 memory_map[1] = (memmap_chunk){0xC000, 0x10000, sizeof(sms->ram)-1, 0, 0, .flags = MMAP_READ|MMAP_WRITE|MMAP_CODE, .buffer = sms->ram}; |
689 }; | 689 }; |
690 sms->header.info.map = malloc(sizeof(memmap_chunk) * sms->header.info.map_chunks); | 690 sms->header.info.map = malloc(sizeof(memmap_chunk) * sms->header.info.map_chunks); |
691 memcpy(sms->header.info.map, memory_map, sizeof(memmap_chunk) * sms->header.info.map_chunks); | 691 memcpy(sms->header.info.map, memory_map, sizeof(memmap_chunk) * sms->header.info.map_chunks); |
692 z80_options *zopts = malloc(sizeof(z80_options)); | 692 z80_options *zopts = malloc(sizeof(z80_options)); |
693 tern_node *model_def; | |
693 uint8_t is_gamegear = !strcasecmp(media->extension, "gg"); | 694 uint8_t is_gamegear = !strcasecmp(media->extension, "gg"); |
694 tern_node *model_def = is_gamegear ? tern_find_node(get_systems_config(), "gg") : get_model(config, SYSTEM_SMS); | 695 if (is_gamegear) { |
696 model_def = tern_find_node(get_systems_config(), "gg"); | |
697 } else if (!strcasecmp(media->extension, "sg")) { | |
698 model_def = tern_find_node(get_systems_config(), "sg1000"); | |
699 } else { | |
700 model_def = get_model(config, SYSTEM_SMS); | |
701 } | |
695 char *vdp_str = tern_find_ptr(model_def, "vdp"); | 702 char *vdp_str = tern_find_ptr(model_def, "vdp"); |
696 uint8_t vdp_type = is_gamegear ? VDP_GENESIS : VDP_GAMEGEAR; | 703 uint8_t vdp_type = is_gamegear ? VDP_GENESIS : VDP_GAMEGEAR; |
697 if (vdp_str) { | 704 if (vdp_str) { |
698 if (!strcmp(vdp_str, "sms1")) { | 705 if (!strcmp(vdp_str, "sms1")) { |
699 vdp_type = VDP_SMS; | 706 vdp_type = VDP_SMS; |