MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / LoadMachineSettings

Method LoadMachineSettings

Source/SoundGen.cpp:808–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806}
807
808void CSoundGen::LoadMachineSettings() // // //
809{
810 // Setup machine-type and speed
811 //
812 // Machine = NTSC or PAL
813 //
814 // Rate = frame rate (0 means machine default)
815 //
816
817 // Called from main thread
818 ASSERT(GetCurrentThreadId() == FTEnv.GetMainApp()->m_nThreadID);
819 ASSERT(m_pAPU != NULL);
820
821 m_iMachineType = m_pModule->GetMachine(); // // // 050B
822
823 int BaseFreq = (m_iMachineType == machine_t::NTSC) ? MASTER_CLOCK_NTSC : MASTER_CLOCK_PAL;
824
825 // Choose a default rate if not predefined
826 int Rate = m_pModule->GetFrameRate(); // // //
827
828 // Number of cycles between each APU update
829 m_iUpdateCycles = BaseFreq / Rate;
830
831 {
832 CSingleLock l(&m_csAPULock, TRUE); // // //
833 m_pAPU->ChangeMachineRate(m_iMachineType, Rate); // // //
834 }
835}
836
837void CSoundGen::LoadSoundConfig() { // // //
838 ASSERT(GetCurrentThreadId() == FTEnv.GetMainApp()->m_nThreadID);

Callers 4

OnTrackerPalMethod · 0.80
OnTrackerNtscMethod · 0.80
OnSpeedDefaultMethod · 0.80
OnSpeedCustomMethod · 0.80

Calls 4

GetMainAppMethod · 0.80
GetMachineMethod · 0.80
ChangeMachineRateMethod · 0.80
GetFrameRateMethod · 0.45

Tested by

no test coverage detected