Start of a mock-up for MAME-like device handling

This commit is contained in:
PatrickvL 2016-11-04 16:34:49 +01:00
parent 77eb481592
commit 5bc600e462
3 changed files with 111 additions and 0 deletions

View File

@ -200,6 +200,7 @@
<ClInclude Include="..\..\src\Cxbx.h" />
<ClInclude Include="..\..\src\CxbxKrnl\CxbxKrnl.h" />
<ClInclude Include="..\..\src\CxbxKrnl\DbgConsole.h" />
<ClInclude Include="..\..\src\CxbxKrnl\device.h" />
<ClInclude Include="..\..\src\CxbxKrnl\Emu.h" />
<ClInclude Include="..\..\src\CxbxKrnl\EmuAlloc.h" />
<ClInclude Include="..\..\src\CxbxKrnl\EmuD3D8.h" />
@ -469,6 +470,7 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\src\CxbxKrnl\device.cpp" />
<ClCompile Include="..\..\src\CxbxKrnl\Emu.cpp">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>

46
src/CxbxKrnl/device.cpp Normal file
View File

@ -0,0 +1,46 @@
// ******************************************************************
// *
// * .,-::::: .,:: .::::::::. .,:: .:
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
// * $$$ Y$$$P $$""""Y$$ Y$$$P
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
// * Cxbx->Win32->CxbxKrnl->Device.cpp
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program 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 recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2016 Patrick van Logchem <pvanlogchem@gmail.com>
// *
// * All rights reserved
// *
// ******************************************************************
// Some symbols, code and ideas in here are based on MAME diexec.* :
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
diexec.c
Device execution interfaces.
***************************************************************************/
#include "device.h"

63
src/CxbxKrnl/device.h Normal file
View File

@ -0,0 +1,63 @@
// ******************************************************************
// *
// * .,-::::: .,:: .::::::::. .,:: .:
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
// * $$$ Y$$$P $$""""Y$$ Y$$$P
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
// * Cxbx->Win32->CxbxKrnl->Device.h
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program 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 recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2016 Patrick van Logchem <pvanlogchem@gmail.com>
// *
// * All rights reserved
// *
// ******************************************************************
// Some symbols, code and ideas in here are based on MAME diexec.* :
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
device.h
Device execution interfaces.
***************************************************************************/
#pragma once
#ifndef __CXBX_DEVICE_H__
#define __CXBX_DEVICE_H__
// I/O line states
enum line_state
{
CLEAR_LINE = 0, // clear (a fired or held) line
ASSERT_LINE, // assert an interrupt immediately
HOLD_LINE, // hold interrupt line until acknowledged
PULSE_LINE // pulse interrupt line instantaneously (only for NMI, RESET)
};
class device_t; // from MAME emucore.h
#endif /* __CXBX_DEVICE_H__ */