MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DoFMVSwitch

Function DoFMVSwitch

pcsx2/Counters.cpp:434–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432static bool s_last_fmv_state = false;
433
434static __fi void DoFMVSwitch()
435{
436 bool new_fmv_state = s_last_fmv_state;
437 if (EnableFMV)
438 {
439 DevCon.WriteLn("FMV started");
440 new_fmv_state = true;
441 EnableFMV = false;
442 }
443 else if (FMVstarted)
444 {
445 const int diff = cpuRegs.cycle - eecount_on_last_vdec;
446 if (diff > 60000000)
447 {
448 DevCon.WriteLn("FMV ended");
449 new_fmv_state = false;
450 FMVstarted = false;
451 }
452 }
453
454 if (new_fmv_state == s_last_fmv_state)
455 return;
456
457 s_last_fmv_state = new_fmv_state;
458
459 switch (EmuConfig.GS.FMVAspectRatioSwitch)
460 {
461 case FMVAspectRatioSwitchType::Off:
462 break;
463 case FMVAspectRatioSwitchType::RAuto4_3_3_2:
464 EmuConfig.CurrentAspectRatio = new_fmv_state ? AspectRatioType::RAuto4_3_3_2 : EmuConfig.GS.AspectRatio;
465 break;
466 case FMVAspectRatioSwitchType::R4_3:
467 EmuConfig.CurrentAspectRatio = new_fmv_state ? AspectRatioType::R4_3 : EmuConfig.GS.AspectRatio;
468 break;
469 case FMVAspectRatioSwitchType::R16_9:
470 EmuConfig.CurrentAspectRatio = new_fmv_state ? AspectRatioType::R16_9 : EmuConfig.GS.AspectRatio;
471 break;
472 case FMVAspectRatioSwitchType::R10_7:
473 EmuConfig.CurrentAspectRatio = new_fmv_state ? AspectRatioType::R10_7 : EmuConfig.GS.AspectRatio;
474 break;
475 default:
476 break;
477 }
478
479 if (EmuConfig.Gamefixes.SoftwareRendererFMVHack && EmuConfig.GS.UseHardwareRenderer())
480 {
481 DevCon.Warning("FMV Switch");
482 // we don't use the sw toggle here, because it'll change back to auto if set to sw
483 MTGS::SetSoftwareRendering(new_fmv_state, new_fmv_state ? GSInterlaceMode::AdaptiveTFF : EmuConfig.GS.InterlaceMode, false);
484 }
485}
486
487static __fi void VSyncStart(u64 sCycle)
488{

Callers 1

VSyncStartFunction · 0.85

Calls 3

UseHardwareRendererMethod · 0.80
WriteLnMethod · 0.45
WarningMethod · 0.45

Tested by

no test coverage detected