| 806 | } |
| 807 | |
| 808 | void 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 | |
| 837 | void CSoundGen::LoadSoundConfig() { // // // |
| 838 | ASSERT(GetCurrentThreadId() == FTEnv.GetMainApp()->m_nThreadID); |
no test coverage detected