comparison sms.c @ 1551:ce1f93be0104

Small cleanup to audio interface between emulation code and renderer backend
author Michael Pavone <pavone@retrodev.com>
date Wed, 28 Mar 2018 23:36:08 -0700
parents 8464a3f09b94
children 6ce36c3f250b
comparison
equal deleted inserted replaced
1550:b525491b4e5b 1551:ce1f93be0104
334 return ret; 334 return ret;
335 } 335 }
336 336
337 static void run_sms(system_header *system) 337 static void run_sms(system_header *system)
338 { 338 {
339 render_disable_ym();
340 sms_context *sms = (sms_context *)system; 339 sms_context *sms = (sms_context *)system;
341 uint32_t target_cycle = sms->z80->current_cycle + 3420*16; 340 uint32_t target_cycle = sms->z80->current_cycle + 3420*16;
342 //TODO: PAL support 341 //TODO: PAL support
343 render_set_video_standard(VID_NTSC); 342 render_set_video_standard(VID_NTSC);
344 while (!sms->should_return) 343 while (!sms->should_return)
385 sms->psg->cycles -= adjust; 384 sms->psg->cycles -= adjust;
386 target_cycle -= adjust; 385 target_cycle -= adjust;
387 } 386 }
388 } 387 }
389 vdp_release_framebuffer(sms->vdp); 388 vdp_release_framebuffer(sms->vdp);
389 render_pause_source(sms->psg->audio);
390 sms->should_return = 0; 390 sms->should_return = 0;
391 render_enable_ym();
392 } 391 }
393 392
394 static void resume_sms(system_header *system) 393 static void resume_sms(system_header *system)
395 { 394 {
396 sms_context *sms = (sms_context *)system; 395 sms_context *sms = (sms_context *)system;
397 vdp_reacquire_framebuffer(sms->vdp); 396 vdp_reacquire_framebuffer(sms->vdp);
397 render_resume_source(sms->psg->audio);
398 run_sms(system); 398 run_sms(system);
399 } 399 }
400 400
401 static void start_sms(system_header *system, char *statefile) 401 static void start_sms(system_header *system, char *statefile)
402 { 402 {