Path: blob/a-new-beginning/Cherry/Core/include/VgmRecorder.h
2 views
/*1* Gearcoleco - ColecoVision Emulator2* Copyright (C) 2021 Ignacio Sanchez34* This program is free software: you can redistribute it and/or modify5* it under the terms of the GNU General Public License as published by6* the Free Software Foundation, either version 3 of the License, or7* any later version.89* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU General Public License for more details.1314* You should have received a copy of the GNU General Public License15* along with this program. If not, see http://www.gnu.org/licenses/16*17*/1819#ifndef VGM_RECORDER_H20#define VGM_RECORDER_H2122#include "definitions.h"23#include <vector>24#include <string>25#include <fstream>2627class VgmRecorder28{29public:30VgmRecorder();31~VgmRecorder();3233void Start(const char* file_path, int clock_rate, bool is_pal);34void Stop();35bool IsRecording() const { return m_bRecording; }3637void WritePSG(u8 data);38void WriteAY8910(u8 reg, u8 data);39void UpdateTiming(int elapsed_samples);4041private:42void WriteCommand(u8 command);43void WriteCommand(u8 command, u8 data);44void WriteCommand(u8 command, u8 data1, u8 data2);45void WriteWait(int samples);46void FlushPendingWait();4748private:49bool m_bRecording;50std::string m_FilePath;51std::vector<u8> m_CommandBuffer;52int m_PendingWait;53int m_TotalSamples;54int m_ClockRate;55bool m_bPAL;56bool m_bPSGUsed;57bool m_bAY8910Used;58};5960#endif /* VGM_RECORDER_H */616263