comparison sms.c @ 1120:e9369d6f0101

Somewhat broken implementation of Mode 4
author Michael Pavone <pavone@retrodev.com>
date Tue, 27 Dec 2016 11:31:17 -0800
parents 55ea7f9a4e92
children 63cd87d910cc
comparison
equal deleted inserted replaced
1119:55ea7f9a4e92 1120:e9369d6f0101
167 { 167 {
168 sms_context *sms = (sms_context *)system; 168 sms_context *sms = (sms_context *)system;
169 sms->should_return = 1; 169 sms->should_return = 1;
170 } 170 }
171 171
172 static void inc_debug_mode(system_header *system)
173 {
174 sms_context *sms = (sms_context *)system;
175 sms->vdp->debug++;
176 if (sms->vdp->debug == 7) {
177 sms->vdp->debug = 0;
178 }
179 }
180
181 static void inc_debug_pal(system_header *system)
182 {
183 sms_context *sms = (sms_context *)system;
184 sms->vdp->debug_pal++;
185 if (sms->vdp->debug_pal == 4) {
186 sms->vdp->debug_pal = 0;
187 }
188 }
189
172 sms_context *alloc_configure_sms(void *rom, uint32_t rom_size, void *extra_rom, uint32_t extra_rom_size, uint32_t opts, uint8_t force_region, rom_info *info_out) 190 sms_context *alloc_configure_sms(void *rom, uint32_t rom_size, void *extra_rom, uint32_t extra_rom_size, uint32_t opts, uint8_t force_region, rom_info *info_out)
173 { 191 {
174 memset(info_out, 0, sizeof(*info_out)); 192 memset(info_out, 0, sizeof(*info_out));
175 sms_context *sms = calloc(1, sizeof(sms_context)); 193 sms_context *sms = calloc(1, sizeof(sms_context));
176 rom_size = nearest_pow2(rom_size); 194 rom_size = nearest_pow2(rom_size);
212 sms->header.load_save = NULL; 230 sms->header.load_save = NULL;
213 sms->header.persist_save = NULL; 231 sms->header.persist_save = NULL;
214 sms->header.free_context = free_sms; 232 sms->header.free_context = free_sms;
215 sms->header.get_open_bus_value = get_open_bus_value; 233 sms->header.get_open_bus_value = get_open_bus_value;
216 sms->header.request_exit = request_exit; 234 sms->header.request_exit = request_exit;
217 sms->header.inc_debug_mode = NULL; 235 sms->header.inc_debug_mode = inc_debug_mode;
218 sms->header.inc_debug_pal = NULL; 236 sms->header.inc_debug_pal = inc_debug_pal;
219 237
220 return sms; 238 return sms;
221 } 239 }