From a3b5bab1c3218a16bfb8515113778d83a4acf78f Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Wed, 21 Jun 2017 08:29:08 +0100 Subject: [PATCH] Added dummy NVNet handlers At least Network hardware writes no longer get reported as "Unknown" --- build/win32/Cxbx.vcxproj | 2 ++ build/win32/Cxbx.vcxproj.filters | 6 ++++ src/CxbxKrnl/EmuNVNet.cpp | 54 ++++++++++++++++++++++++++++++++ src/CxbxKrnl/EmuNVNet.h | 43 +++++++++++++++++++++++++ src/CxbxKrnl/EmuX86.cpp | 8 +++++ 5 files changed, 113 insertions(+) create mode 100644 src/CxbxKrnl/EmuNVNet.cpp create mode 100644 src/CxbxKrnl/EmuNVNet.h diff --git a/build/win32/Cxbx.vcxproj b/build/win32/Cxbx.vcxproj index 68bde927f..69558bd0c 100644 --- a/build/win32/Cxbx.vcxproj +++ b/build/win32/Cxbx.vcxproj @@ -214,6 +214,7 @@ $(SOLUTIONDIR)Export.bat + @@ -502,6 +503,7 @@ $(SOLUTIONDIR)Export.bat %(PreprocessorDefinitions) + diff --git a/build/win32/Cxbx.vcxproj.filters b/build/win32/Cxbx.vcxproj.filters index 347c57664..b576f1568 100644 --- a/build/win32/Cxbx.vcxproj.filters +++ b/build/win32/Cxbx.vcxproj.filters @@ -202,6 +202,9 @@ Emulator + + Emulator + @@ -552,6 +555,9 @@ Emulator + + Emulator + diff --git a/src/CxbxKrnl/EmuNVNet.cpp b/src/CxbxKrnl/EmuNVNet.cpp new file mode 100644 index 000000000..24184b333 --- /dev/null +++ b/src/CxbxKrnl/EmuNVNet.cpp @@ -0,0 +1,54 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// ****************************************************************** +// * +// * .,-::::: .,:: .::::::::. .,:: .: +// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; +// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' +// * $$$ Y$$$P $$""""Y$$ Y$$$P +// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, +// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, +// * +// * Cxbx->Win32->CxbxKrnl->EmuNVNet.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) 2002-2003 Aaron Robinson +// * (c) 2017 Luke Usher +// * +// * All rights reserved +// * +// ****************************************************************** +#define _CXBXKRNL_INTERNAL +#define _XBOXKRNL_DEFEXTRN_ + +#include "CxbxKrnl.h" +#include "Emu.h" +#include "EmuNVNet.h" + +uint32_t EmuNVNet_Read32(xbaddr addr) +{ + EmuWarning("EmuNVNet_Read32: Unhandled Read Address %08X", addr); + return 0; +} + +void EmuNVNet_Write32(xbaddr addr, uint32_t value) +{ + EmuWarning("EmuNVNet_Write32: Unhandled Write Address %08X (value %08X)", addr, value); + return; +} \ No newline at end of file diff --git a/src/CxbxKrnl/EmuNVNet.h b/src/CxbxKrnl/EmuNVNet.h new file mode 100644 index 000000000..3b3f801e4 --- /dev/null +++ b/src/CxbxKrnl/EmuNVNet.h @@ -0,0 +1,43 @@ +// ****************************************************************** +// * +// * .,-::::: .,:: .::::::::. .,:: .: +// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; +// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' +// * $$$ Y$$$P $$""""Y$$ Y$$$P +// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, +// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, +// * +// * Cxbx->Win32->CxbxKrnl->EmuNVNet.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) 2002-2003 Aaron Robinson +// * (c) 2017 Luke Usher +// * All rights reserved +// * +// ****************************************************************** +#ifndef EMUNVNET_H +#define EMUNVNET_H + +#define NVNET_ADDR 0xFEF00000 +#define NVNET_SIZE 0x00000400 + +uint32_t EmuNVNet_Read32(xbaddr addr); +void EmuNVNet_Write32(xbaddr addr, uint32_t value); + +#endif diff --git a/src/CxbxKrnl/EmuX86.cpp b/src/CxbxKrnl/EmuX86.cpp index 4ecdad1ca..77da3a7d1 100644 --- a/src/CxbxKrnl/EmuX86.cpp +++ b/src/CxbxKrnl/EmuX86.cpp @@ -49,6 +49,7 @@ #include "Emu.h" #include "EmuX86.h" #include "EmuNV2A.h" +#include "EmuNVNet.h" #include "HLEIntercept.h" // for bLLE_GPU #include @@ -147,6 +148,8 @@ uint32_t EmuX86_Read32Aligned(xbaddr addr) // Access NV2A regardless weither HLE is disabled or not value = EmuNV2A_Read32(addr - NV2A_ADDR); // Note : EmuNV2A_Read32 does it's own logging + } if (addr >= NVNET_ADDR && addr < NVNET_ADDR + NVNET_SIZE) { + value = EmuNVNet_Read32(addr - NVNET_ADDR); } else { if (g_bEmuException) { EmuWarning("EmuX86_Read32Aligned(0x%08X) [Unknown address]", addr); @@ -219,6 +222,11 @@ void EmuX86_Write32Aligned(xbaddr addr, uint32_t value) return; } + if (addr >= NVNET_ADDR && addr < NVNET_ADDR + NVNET_SIZE) { + EmuNVNet_Write32(addr - NVNET_ADDR, value); + return; + } + if (g_bEmuException) { EmuWarning("EmuX86_Write32Aligned(0x%08X, 0x%08X) [Unknown address]", addr, value); return;