2011-09-21 22:53:41 +00:00
|
|
|
/**
|
|
|
|
** Supermodel
|
|
|
|
** A Sega Model 3 Arcade Emulator.
|
|
|
|
** Copyright 2011 Bart Trzynadlowski, Nik Henson
|
|
|
|
**
|
|
|
|
** This file is part of Supermodel.
|
|
|
|
**
|
|
|
|
** Supermodel is free software: you can redistribute it and/or modify it under
|
2020-08-31 09:28:35 +00:00
|
|
|
** the terms of the GNU General Public License as published by the Free
|
2011-09-21 22:53:41 +00:00
|
|
|
** Software Foundation, either version 3 of the License, or (at your option)
|
|
|
|
** any later version.
|
|
|
|
**
|
|
|
|
** Supermodel is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
** more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License along
|
|
|
|
** with Supermodel. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**/
|
|
|
|
|
2018-01-21 15:09:11 +00:00
|
|
|
/*
|
|
|
|
* SupermodelDebugger.h
|
2011-09-21 22:53:41 +00:00
|
|
|
*/
|
|
|
|
|
2011-06-27 22:55:03 +00:00
|
|
|
#ifdef SUPERMODEL_DEBUGGER
|
|
|
|
#ifndef INCLUDED_SUPERMODELDEBUGGER_H
|
|
|
|
#define INCLUDED_SUPERMODELDEBUGGER_H
|
|
|
|
|
|
|
|
#include "ConsoleDebugger.h"
|
2021-11-22 17:15:06 +00:00
|
|
|
#include "Model3/Model3.h"
|
2011-06-27 22:55:03 +00:00
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define MODEL3_STATEFILE_VERSION 0
|
|
|
|
|
|
|
|
class CInputs;
|
|
|
|
class CInput;
|
|
|
|
|
|
|
|
namespace Debugger
|
|
|
|
{
|
|
|
|
class CCPUDebug;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Console-based debugger used by Supermodel.
|
|
|
|
*/
|
|
|
|
class CSupermodelDebugger : public CConsoleDebugger
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
::CModel3 *m_model3;
|
|
|
|
::CInputs *m_inputs;
|
2020-08-31 09:28:35 +00:00
|
|
|
std::shared_ptr<CLogger> m_logger;
|
2011-06-27 22:55:03 +00:00
|
|
|
|
2011-06-28 23:20:19 +00:00
|
|
|
bool m_loadEmuState;
|
|
|
|
bool m_saveEmuState;
|
|
|
|
bool m_resetEmu;
|
|
|
|
char m_stateFile[255];
|
|
|
|
|
2011-06-27 22:55:03 +00:00
|
|
|
bool InputIsValid(CInput *input);
|
|
|
|
|
|
|
|
void ListInputs();
|
|
|
|
|
|
|
|
protected:
|
2011-09-18 21:59:23 +00:00
|
|
|
void AddCPUs();
|
|
|
|
|
2011-06-27 22:55:03 +00:00
|
|
|
void WaitCommand(CCPUDebug *cpu);
|
|
|
|
|
|
|
|
bool ProcessToken(const char *token, const char *cmd);
|
|
|
|
|
|
|
|
void Attached();
|
|
|
|
|
|
|
|
void Detaching();
|
2011-06-28 23:20:19 +00:00
|
|
|
|
|
|
|
public:
|
2011-09-18 21:59:23 +00:00
|
|
|
static CCPUDebug *CreateMainBoardCPUDebug(::CModel3 *model3);
|
2020-08-31 09:28:35 +00:00
|
|
|
|
2011-09-18 21:59:23 +00:00
|
|
|
static CCPUDebug *CreateSoundBoardCPUDebug(::CModel3 *model3);
|
|
|
|
|
|
|
|
static CCPUDebug *CreateDSBCPUDebug(::CModel3 *model3);
|
|
|
|
|
|
|
|
static CCPUDebug *CreateDriveBoardCPUDebug(::CModel3 *model3);
|
2018-01-07 14:07:59 +00:00
|
|
|
#ifdef NET_BOARD
|
|
|
|
static CCPUDebug *CreateNetBoardCPUDebug(::CModel3 *model3);
|
|
|
|
#endif
|
2011-09-18 21:59:23 +00:00
|
|
|
|
2020-08-31 09:28:35 +00:00
|
|
|
CSupermodelDebugger(::CModel3 *model3, ::CInputs *inputs, std::shared_ptr<CLogger> logger);
|
2011-06-28 23:20:19 +00:00
|
|
|
|
|
|
|
void Poll();
|
2020-08-31 09:28:35 +00:00
|
|
|
|
2011-06-27 22:55:03 +00:00
|
|
|
bool LoadModel3State(const char *fileName);
|
|
|
|
|
|
|
|
bool SaveModel3State(const char *fileName);
|
|
|
|
|
2011-06-28 23:20:19 +00:00
|
|
|
void ResetModel3();
|
|
|
|
|
2011-06-27 22:55:03 +00:00
|
|
|
void DebugLog(const char *fmt, va_list vl);
|
2020-08-31 09:28:35 +00:00
|
|
|
|
2011-06-27 22:55:03 +00:00
|
|
|
void InfoLog(const char *fmt, va_list vl);
|
2020-08-31 09:28:35 +00:00
|
|
|
|
2011-06-27 22:55:03 +00:00
|
|
|
void ErrorLog(const char *fmt, va_list vl);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // INCLUDED_SUPERMODELDEBUGGER_H
|
|
|
|
#endif // SUPERMODEL_DEBUGGER
|