Skip to content

Commit

Permalink
Added more buildable projects
Browse files Browse the repository at this point in the history
  • Loading branch information
OneLoneCoder committed Mar 4, 2023
1 parent f2410b4 commit 60f1249
Show file tree
Hide file tree
Showing 27 changed files with 21,852 additions and 35 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
Part#2 - CPU/NES_VS_PROJECT/.vs/
Part#2 - CPU/NES_VS_PROJECT/x64/
<<<<<<< HEAD
Part #3 - Buses, Rams, Roms & Mappers/NES_VS_PROJECT/.vs/
Part #3 - Buses, Rams, Roms & Mappers/NES_VS_PROJECT/x64/
Part #3 - Buses, Rams, Roms & Mappers/nestest.nes
Part #4 - PPU Backgrounds/NES_VS_PROJECT/.vs/
Part #4 - PPU Backgrounds/NES_VS_PROJECT/x64/
Part #5 - PPU Foregrounds/nestest.nes
Part #5 - PPU Foregrounds/NES_VS_PROJECT/.vs/
Part #5 - PPU Foregrounds/NES_VS_PROJECT/x64/
Part #7 - Mappers & Basic Sounds/NES_VS_PROJECT/.vs/
Part #7 - Mappers & Basic Sounds/NES_VS_PROJECT/x64/
=======
>>>>>>> master
31 changes: 31 additions & 0 deletions Part #4 - PPU Backgrounds/NES_VS_PROJECT/NES_VS_PROJECT.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33110.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NES_VS_PROJECT", "NES_VS_PROJECT.vcxproj", "{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Debug|x64.ActiveCfg = Debug|x64
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Debug|x64.Build.0 = Debug|x64
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Debug|x86.ActiveCfg = Debug|Win32
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Debug|x86.Build.0 = Debug|Win32
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Release|x64.ActiveCfg = Release|x64
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Release|x64.Build.0 = Release|x64
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Release|x86.ActiveCfg = Release|Win32
{53F99EA8-11A7-4C64-A708-0E5D8E7F5BAA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8F04E584-5FAF-4E00-B252-A7BDA1489E90}
EndGlobalSection
EndGlobal
150 changes: 150 additions & 0 deletions Part #4 - PPU Backgrounds/NES_VS_PROJECT/NES_VS_PROJECT.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Bus.cpp" />
<ClCompile Include="..\Cartridge.cpp" />
<ClCompile Include="..\Mapper.cpp" />
<ClCompile Include="..\Mapper_000.cpp" />
<ClCompile Include="..\olc2C02.cpp" />
<ClCompile Include="..\olc6502.cpp" />
<ClCompile Include="..\olcNes_PPU_Backgrounds.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Bus.h" />
<ClInclude Include="..\Cartridge.h" />
<ClInclude Include="..\Mapper.h" />
<ClInclude Include="..\Mapper_000.h" />
<ClInclude Include="..\olc2C02.h" />
<ClInclude Include="..\olc6502.h" />
<ClInclude Include="..\olcPixelGameEngine.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{53f99ea8-11a7-4c64-a708-0e5d8e7f5baa}</ProjectGuid>
<RootNamespace>NESVSPROJECT</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Bus.cpp" />
<ClCompile Include="..\Cartridge.cpp" />
<ClCompile Include="..\Mapper.cpp" />
<ClCompile Include="..\Mapper_000.cpp" />
<ClCompile Include="..\olc2C02.cpp" />
<ClCompile Include="..\olc6502.cpp" />
<ClCompile Include="..\olcNes_PPU_Backgrounds.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Bus.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Cartridge.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Mapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Mapper_000.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\olc2C02.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\olc6502.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\olcPixelGameEngine.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
Binary file added Part #4 - PPU Backgrounds/nestest.nes
Binary file not shown.
20 changes: 15 additions & 5 deletions Part #4 - PPU Backgrounds/olc2C02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,27 @@ olc2C02::olc2C02()
palScreen[0x3E] = olc::Pixel(0, 0, 0);
palScreen[0x3F] = olc::Pixel(0, 0, 0);

sprScreen = new olc::Sprite(256, 240);
sprNameTable[0] = new olc::Sprite(256, 240);
sprNameTable[1] = new olc::Sprite(256, 240);
sprPatternTable[0] = new olc::Sprite(128, 128);
sprPatternTable[1] = new olc::Sprite(128, 128);
}


olc2C02::~olc2C02()
{
delete sprScreen;
delete sprNameTable[0];
delete sprNameTable[1];
delete sprPatternTable[0];
delete sprPatternTable[1];
}

olc::Sprite& olc2C02::GetScreen()
{
// Simply returns the current sprite holding the rendered screen
return sprScreen;
return *sprScreen;
}


Expand Down Expand Up @@ -215,7 +225,7 @@ olc::Sprite& olc2C02::GetPatternTable(uint8_t i, uint8_t palette)
// Now we know the location and NES pixel value for a specific location
// in the pattern table, we can translate that to a screen colour, and an
// (x,y) location in the sprite
sprPatternTable[i].SetPixel
sprPatternTable[i]->SetPixel
(
nTileX * 8 + (7 - col), // Because we are using the lsb of the row word first
// we are effectively reading the row from right
Expand All @@ -229,7 +239,7 @@ olc::Sprite& olc2C02::GetPatternTable(uint8_t i, uint8_t palette)
}

// Finally return the updated sprite representing the pattern table
return sprPatternTable[i];
return *sprPatternTable[i];
}


Expand All @@ -250,7 +260,7 @@ olc::Pixel& olc2C02::GetColourFromPaletteRam(uint8_t palette, uint8_t pixel)
olc::Sprite& olc2C02::GetNameTable(uint8_t i)
{
// As of now unused, but a placeholder for nametable visualisation in teh future
return sprNameTable[i];
return *sprNameTable[i];
}


Expand Down Expand Up @@ -1000,7 +1010,7 @@ void olc2C02::clock()
// Now we have a final pixel colour, and a palette for this cycle
// of the current scanline. Let's at long last, draw that ^&%*er :P

sprScreen.SetPixel(cycle - 1, scanline, GetColourFromPaletteRam(bg_palette, bg_pixel));
sprScreen->SetPixel(cycle - 1, scanline, GetColourFromPaletteRam(bg_palette, bg_pixel));

// Fake some noise for now
//sprScreen.SetPixel(cycle - 1, scanline, palScreen[(rand() % 2) ? 0x3F : 0x30]);
Expand Down
13 changes: 10 additions & 3 deletions Part #4 - PPU Backgrounds/olc2C02.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ class olc2C02

private:
olc::Pixel palScreen[0x40];
olc::Sprite sprScreen = olc::Sprite(256, 240);
olc::Sprite sprNameTable[2] = { olc::Sprite(256, 240), olc::Sprite(256, 240) };
olc::Sprite sprPatternTable[2] = { olc::Sprite(128, 128), olc::Sprite(128, 128) };
// In Video
// olc::Sprite sprScreen = olc::Sprite(256, 240);
// olc::Sprite sprNameTable[2] = { olc::Sprite(256, 240), olc::Sprite(256, 240) };
// olc::Sprite sprPatternTable[2] = { olc::Sprite(128, 128), olc::Sprite(128, 128) };

// Changed To for API breaking subsequent PGE Update
olc::Sprite* sprScreen;
olc::Sprite* sprNameTable[2];
olc::Sprite* sprPatternTable[2];


public:
// Debugging Utilities
Expand Down
2 changes: 1 addition & 1 deletion Part #4 - PPU Backgrounds/olcNes_PPU_Backgrounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Demo_olc2C02 : public olc::PixelGameEngine
bool OnUserCreate()
{
// Load the cartridge
cart = std::make_shared<Cartridge>("roms/nestest.nes");
cart = std::make_shared<Cartridge>("../nestest.nes");

if (!cart->ImageValid())
return false;
Expand Down
Loading

0 comments on commit 60f1249

Please sign in to comment.