mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-04-21 01:16:50 +00:00
GSL + CPP core guidelines changes.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
+1
-1
@@ -70,5 +70,5 @@ void EightBit::Bus::write(register16_t address, uint8_t value) {
|
||||
uint8_t& EightBit::Bus::reference() {
|
||||
bool rom;
|
||||
auto& value = reference(ADDRESS().word, rom);
|
||||
return rom ? placeDATA(value) : referenceDATA(value);
|
||||
return GSL_LIKELY(!rom) ? referenceDATA(value) : placeDATA(value);
|
||||
}
|
||||
@@ -70,16 +70,16 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
||||
+4
-4
@@ -15,7 +15,7 @@ void EightBit::Processor::initialise() {
|
||||
|
||||
int EightBit::Processor::run(int limit) {
|
||||
int current = 0;
|
||||
while (powered() && current < limit) {
|
||||
while (GSL_LIKELY(powered()) && current < limit) {
|
||||
current += singleStep();
|
||||
}
|
||||
return current;
|
||||
@@ -35,7 +35,7 @@ void EightBit::Processor::fetchWord(register16_t& output) {
|
||||
}
|
||||
|
||||
int EightBit::Processor::fetchExecute() {
|
||||
if (!powered())
|
||||
return 0;
|
||||
return execute(fetchByte());
|
||||
if (GSL_LIKELY(powered()))
|
||||
return execute(fetchByte());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -19,3 +19,5 @@
|
||||
#else
|
||||
#include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
#include <gsl/gsl>
|
||||
Reference in New Issue
Block a user