comparison sms.c @ 2321:2eda5f81f91e

More fully baked ROM db support for SMS
author Michael Pavone <pavone@retrodev.com>
date Thu, 15 Jun 2023 09:36:11 -0700
parents 8016dbb0fcde
children 26597f9805b4
comparison
equal deleted inserted replaced
2320:8016dbb0fcde 2321:2eda5f81f91e
163 sms->bank_regs[location] = value; 163 sms->bank_regs[location] = value;
164 update_mem_map(location, sms, value); 164 update_mem_map(location, sms, value);
165 return vcontext; 165 return vcontext;
166 } 166 }
167 167
168 static void *cart_ram_write(uint32_t location, void *vcontext, uint8_t value) 168 void *sms_cart_ram_write(uint32_t location, void *vcontext, uint8_t value)
169 { 169 {
170 z80_context *z80 = vcontext; 170 z80_context *z80 = vcontext;
171 sms_context *sms = z80->system; 171 sms_context *sms = z80->system;
172 if (sms->bank_regs[0] & 8) { 172 if (sms->bank_regs[0] & 8) {
173 //cartridge RAM is enabled 173 //cartridge RAM is enabled
708 vdp_type = VDP_GAMEGEAR; 708 vdp_type = VDP_GAMEGEAR;
709 } else if (!strcmp(vdp_str, "genesis")) { 709 } else if (!strcmp(vdp_str, "genesis")) {
710 vdp_type = VDP_GENESIS; 710 vdp_type = VDP_GENESIS;
711 } else { 711 } else {
712 warning("Unrecognized VDP type %s\n", vdp_str); 712 warning("Unrecognized VDP type %s\n", vdp_str);
713 }
714 }
715 for (uint32_t i = 0; i < sms->header.info.map_chunks; i++)
716 {
717 memmap_chunk *chunk = sms->header.info.map + i;
718 if ((chunk->flags == MMAP_READ) && !chunk->buffer && chunk->start > 0xC000) {
719 chunk->buffer = sms->ram + ((chunk->start - 0xC000) & 0x1FFF);
713 } 720 }
714 } 721 }
715 if (is_gamegear) { 722 if (is_gamegear) {
716 init_z80_opts(zopts, sms->header.info.map, sms->header.info.map_chunks, io_gg, 6, 15, 0xFF); 723 init_z80_opts(zopts, sms->header.info.map, sms->header.info.map_chunks, io_gg, 6, 15, 0xFF);
717 sms->start_button_region = 0xC0; 724 sms->start_button_region = 0xC0;