Path: blob/a-new-beginning/Cherry/Core/include/GearcolecoCore.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 CORE_H20#define CORE_H2122#include "definitions.h"23#include "Cartridge.h"2425class CVMemory;26class Processor;27class Audio;28class Video;29class Input;30class ColecoVisionIOPorts;3132class GearcolecoCore33{3435public:36GearcolecoCore();37~GearcolecoCore();38void Init(GC_Color_Format pixelFormat = GC_PIXEL_RGB888);39bool RunToVBlank(u8* pFrameBuffer, s16* pSampleBuffer, int* pSampleCount, bool step = false, bool stopOnBreakpoints = false);40bool LoadROM(const char* szFilePath, Cartridge::ForceConfiguration* config = NULL);41bool LoadROMFromBuffer(const u8* buffer, int size, Cartridge::ForceConfiguration* config = NULL);42void SaveDisassembledROM();43bool GetRuntimeInfo(GC_RuntimeInfo& runtime_info);44void KeyPressed(GC_Controllers controller, GC_Keys key);45void KeyReleased(GC_Controllers controller, GC_Keys key);46void Spinner1(int movement);47void Spinner2(int movement);48void Pause(bool paused);49bool IsPaused();50void ResetROM(Cartridge::ForceConfiguration* config = NULL);51void ResetROMPreservingRAM(Cartridge::ForceConfiguration* config = NULL);52void ResetSound();53void SaveRam();54void SaveRam(const char* szPath, bool fullPath = false);55void LoadRam();56void LoadRam(const char* szPath, bool fullPath = false);57void SaveState(int index);58void SaveState(const char* szPath, int index);59bool SaveState(u8* buffer, size_t& size);60bool SaveState(std::ostream& stream, size_t& size);61void LoadState(int index);62void LoadState(const char* szPath, int index);63bool LoadState(const u8* buffer, size_t size);64bool LoadState(std::istream& stream);65CVMemory* GetMemory();66Cartridge* GetCartridge();67Processor* GetProcessor();68Audio* GetAudio();69Video* GetVideo();7071private:72void Reset();73void RenderFrameBuffer(u8* finalFrameBuffer);7475private:76CVMemory* m_pMemory;77Processor* m_pProcessor;78Audio* m_pAudio;79Video* m_pVideo;80Input* m_pInput;81Cartridge* m_pCartridge;82ColecoVisionIOPorts* m_pColecoVisionIOPorts;83bool m_bPaused;84GC_Color_Format m_pixelFormat;85};8687#endif /* CORE_H */888990