This commit is contained in:
twinaphex 2015-07-25 01:17:30 +02:00
parent c8193ed00d
commit 52b12ae63e
8 changed files with 12 additions and 59 deletions

View File

@ -262,7 +262,6 @@ endif
MEDNAFEN_SOURCES := $(MEDNAFEN_DIR)/error.cpp \
$(MEDNAFEN_DIR)/math_ops.cpp \
$(MEDNAFEN_DIR)/settings.cpp \
$(MEDNAFEN_DIR)/general.cpp \
$(MEDNAFEN_DIR)/FileWrapper.cpp \

View File

@ -86,7 +86,6 @@ endif
MEDNAFEN_SOURCES := $(MEDNAFEN_DIR)/error.cpp \
$(MEDNAFEN_DIR)/math_ops.cpp \
$(MEDNAFEN_DIR)/settings.cpp \
$(MEDNAFEN_DIR)/general.cpp \
$(MEDNAFEN_DIR)/FileWrapper.cpp \

View File

@ -1,36 +0,0 @@
/* Mednafen - Multi-system Emulator
*
* This program is free software; you can redistribute it and/or modify
* it 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 received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mednafen.h"
#include "math_ops.h"
// Source: http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
// Rounds up to the nearest power of 2.
uint32 round_up_pow2(uint32 v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
v += (v == 0);
return(v);
}

View File

@ -3,20 +3,19 @@
// Source: http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
// Rounds up to the nearest power of 2.
static INLINE uint64 round_up_pow2(uint64 v)
static INLINE uint32 round_up_pow2(uint32 v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v |= v >> 32;
v++;
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
v += (v == 0);
v += (v == 0);
return(v);
return(v);
}
static INLINE uint32 uilog2(uint32 v)

View File

@ -253,9 +253,6 @@
<File
RelativePath="..\..\mednafen\general.cpp">
</File>
<File
RelativePath="..\..\mednafen\math_ops.cpp">
</File>
<File
RelativePath="..\..\mednafen\md5.cpp">
</File>

View File

@ -47,7 +47,6 @@
<ClCompile Include="..\..\mednafen\FileWrapper.cpp" />
<ClCompile Include="..\..\mednafen\general.cpp" />
<ClCompile Include="..\..\mednafen\hw_misc\arcade_card\arcade_card.cpp" />
<ClCompile Include="..\..\mednafen\math_ops.cpp" />
<ClCompile Include="..\..\mednafen\md5.cpp" />
<ClCompile Include="..\..\mednafen\MemoryStream.cpp" />
<ClCompile Include="..\..\mednafen\mempatcher.cpp" />

View File

@ -31,7 +31,6 @@
<ClCompile Include="..\..\mednafen\FileWrapper.cpp" />
<ClCompile Include="..\..\mednafen\general.cpp" />
<ClCompile Include="..\..\mednafen\hw_misc\arcade_card\arcade_card.cpp" />
<ClCompile Include="..\..\mednafen\math_ops.cpp" />
<ClCompile Include="..\..\mednafen\md5.cpp" />
<ClCompile Include="..\..\mednafen\MemoryStream.cpp" />
<ClCompile Include="..\..\mednafen\mempatcher.cpp" />
@ -202,4 +201,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -68,9 +68,6 @@
<ClCompile Include="..\..\mednafen\general.cpp">
<Filter>Source Files\mednafen</Filter>
</ClCompile>
<ClCompile Include="..\..\mednafen\math_ops.cpp">
<Filter>Source Files\mednafen</Filter>
</ClCompile>
<ClCompile Include="..\..\mednafen\md5.cpp">
<Filter>Source Files\mednafen</Filter>
</ClCompile>
@ -207,4 +204,4 @@
<Filter>Source Files\mednafen\trio</Filter>
</ClCompile>
</ItemGroup>
</Project>
</Project>