comparison genesis.c @ 2278:5a21bc0ec583

Implement turbo/slo mo for Sega CD
author Michael Pavone <pavone@retrodev.com>
date Mon, 02 Jan 2023 13:08:49 -0800
parents 9e578fd493e1
children 9ead0fe69d9b
comparison
equal deleted inserted replaced
2277:9e578fd493e1 2278:5a21bc0ec583
1353 genesis_context *context = (genesis_context *)system; 1353 genesis_context *context = (genesis_context *)system;
1354 uint32_t old_clock = context->master_clock; 1354 uint32_t old_clock = context->master_clock;
1355 context->master_clock = ((uint64_t)context->normal_clock * (uint64_t)percent) / 100; 1355 context->master_clock = ((uint64_t)context->normal_clock * (uint64_t)percent) / 100;
1356 while (context->ym->current_cycle != context->psg->cycles) { 1356 while (context->ym->current_cycle != context->psg->cycles) {
1357 sync_sound(context, context->psg->cycles + MCLKS_PER_PSG); 1357 sync_sound(context, context->psg->cycles + MCLKS_PER_PSG);
1358 }
1359 if (context->expansion) {
1360 segacd_context *cd = context->expansion;
1361 segacd_set_speed_percent(cd, percent);
1358 } 1362 }
1359 ym_adjust_master_clock(context->ym, context->master_clock); 1363 ym_adjust_master_clock(context->ym, context->master_clock);
1360 psg_adjust_master_clock(context->psg, context->master_clock); 1364 psg_adjust_master_clock(context->psg, context->master_clock);
1361 } 1365 }
1362 1366