added mapper 4

added mapper 4
but still has some bugs to fix eg line scan
This commit is contained in:
SuzieQ 2022-02-23 00:31:13 +01:00 committed by GitHub
parent 0bf861c58e
commit ac71338de9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 8850 additions and 0 deletions

81
SimpleNES/CMakeLists.txt Normal file
View file

@ -0,0 +1,81 @@
cmake_minimum_required(VERSION 3.1)
project(SimpleNES)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
set(BUILD_STATIC FALSE CACHE STRING "Set this to link external libraries statically")
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
endif()
# Add directory containing FindSFML.cmake to module path
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/;${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}")
# Add sources
file(GLOB SOURCES
"${PROJECT_SOURCE_DIR}/main.cpp"
"${PROJECT_SOURCE_DIR}/src/*.cpp"
)
# Copy keybindings.conf
file(COPY keybindings.conf DESTINATION .)
# Will add __FILENAME__ macros for all source files, which is the filename without full find_path
# Courtesy of SO
function(define_file_basename_for_sources targetname)
get_target_property(source_files "${targetname}" SOURCES)
foreach(sourcefile ${source_files})
# Get source file's current list of compile definitions.
get_property(defs SOURCE "${sourcefile}"
PROPERTY COMPILE_DEFINITIONS)
# Add the FILE_BASENAME=filename compile definition to the list.
get_filename_component(basename "${sourcefile}" NAME)
list(APPEND defs "__FILENAME__=\"${basename}\"")
# Set the updated compile definitions on the source file.
set_property(
SOURCE "${sourcefile}"
PROPERTY COMPILE_DEFINITIONS ${defs})
endforeach()
endfunction()
# Specify include Directory
include_directories("${PROJECT_SOURCE_DIR}/include")
# Set static if BUILD_STATIC is set
if (BUILD_STATIC)
set(SFML_STATIC_LIBRARIES TRUE)
# Link libgcc and libstc++ statically as well
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc")
endif()
endif()
# Find SFML
if (SFML_OS_WINDOWS AND SFML_COMPILER_MSVC)
find_package( SFML 2 COMPONENTS main audio graphics window system REQUIRED)
else()
find_package( SFML 2 COMPONENTS audio graphics window system REQUIRED)
endif()
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
else()
set(SFML_ROOT "" CACHE PATH "SFML top-level directory")
message("\nSFML directory not found. Set SFML_ROOT to SFML's top-level path (containing \"include\" and \"lib\" directories).")
message("Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.\n")
endif()
add_executable(SimpleNES ${SOURCES})
target_link_libraries(SimpleNES ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
set_property(TARGET SimpleNES PROPERTY CXX_STANDARD 11)
set_property(TARGET SimpleNES PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(SimpleNES)
define_file_basename_for_sources(SimpleNES)

View file

@ -0,0 +1,345 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.0, 2022-02-23T00:14:52. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{b7a24fab-4add-4c18-8e0b-e3001b9ddeba}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{bfaa2f32-8ee0-48eb-a3d1-760f6f10c292}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/bb/Video/build-SimpleNES-Desktop-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/bb/Video/build-SimpleNES-Desktop-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/bb/Video/build-SimpleNES-Desktop-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/bb/Video/build-SimpleNES-Desktop-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

674
SimpleNES/LICENSE Normal file
View file

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 3 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, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

151
SimpleNES/README.md Normal file
View file

@ -0,0 +1,151 @@
SimpleNES
=============
An NES emulator written in C++ for nothing but fun.
Roughly 40-50% of games should work (ie. games that use either no mapper or mappers 1, 2 ,3 ,7 & 66 partial 11).
Examples of games that have been tested to run (but NOT limited to):
(USA/Japan or World versions only i.e. NTSC compatible)
* Super Mario Bros.
* Contra
* Adventure Island
* Ninja Gaiden
* Wrecking Crew
* Megaman and Megaman 2
* Mario Bros.
* Donky Kong and Donkey Kong Jr.
* Battle City
* Paperboy
* Legend of Zelda
* Pacman
* Tennis
* Excitebike
* NEW GAME SUPPORT MAPPER 7
* Nightmare Elm Street
* Cabal
* Battletoads
* Battletoads & Double Dragon
* Arch Rivals
* etc...
*
[Here's](https://gist.github.com/amhndu/5b6da39ee06959d93dc706a0b165fb80) a big list of games that match the supported specs from SimpleNES.
(Unlike the list above, these aren't tested. Some may or may not work)
Screenshots
------------------------
![Screenshot 1](http://amhndu.github.io/screenshots/nes1.png)
![Screenshot 2](http://amhndu.github.io/screenshots/nes2.png)
![Screenshot 3](http://amhndu.github.io/screenshots/nes3.png)
![Screenshot 4](http://amhndu.github.io/screenshots/nes4.png)
![Screenshot 5](http://amhndu.github.io/screenshots/nes5.png)
![Screenshot 6](http://amhndu.github.io/screenshots/nes6.png)
![Screenshot 7](https://github.com/SuzieQQ/screennes/blob/main/nes7.png)
![Screenshot 8](https://github.com/SuzieQQ/screennes/blob/main/nes8.png)
![Screenshot 9](https://github.com/SuzieQQ/screennes/blob/main/nes9.png)
![Screenshot 10](https://github.com/SuzieQQ/screennes/blob/main/nes10.png)
![Screenshot 11](https://github.com/SuzieQQ/screennes/blob/main/nes11.png)
![Screenshot 12](https://github.com/SuzieQQ/screennes/blob/main/Metal%20Fighter-11.png)
![Screenshot 13](https://github.com/SuzieQQ/screennes/blob/main/Shockwave-11.png)
![Screenshot 14](https://github.com/SuzieQQ/screennes/blob/main/DBJAPAN-66.png)
![Screenshot 15](https://github.com/SuzieQQ/screennes/blob/main/Gundam-66.png)
![Screenshot 16](https://github.com/SuzieQQ/screennes/blob/main/URBANPOWER-2-66.png)
Videos
------------
[YouTube Playlist](https://www.youtube.com/playlist?list=PLiULt7qySWt2VbHTkvIt9kYPMPcWt01qN)
Download
-----------
Executables:
[Windows 32-bit](https://www.dropbox.com/s/1gqhtbmvzo1ozsz/SimpleNES-win32.rar?dl=0)
[Linux 64-bit](https://www.dropbox.com/s/7eswcdektlkdz65/SimpleNES-linux64?dl=0)
Compiling
-----------
You need:
* SFML 2.0+ development headers and library
* C++11 compliant compiler
* CMake build system
Compiling is straight forward with cmake, just run cmake on the project directory with CMAKE_BUILD_TYPE=Release
and you'll get Makefile or equivalent for your platform, with which you can compile the emulator
For e.g., on Linux/OS X/FreeBSD:
```
$ git clone https://github.com/amhndu/SimpleNES
$ cd SimpleNES
$ mkdir build/ && cd build/
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make -j4 #Replace 4 with however many cores you have to spare
```
Running
-----------------
Just pass the path to a .nes image like
```
$ ./SimpleNES ~/Games/SuperMarioBros.nes
```
To set size of the window,
```
$ ./SimpleNES -w 600 ~/Games/Contra.nes
```
For supported command line options, try
```
$ ./SimpleNES -h
```
Controller
-----------------
Keybindings can be configured with keybindings.conf
Default keybindings:
**Player 1**
Button | Mapped to
--------------|-------------
Start | Return/Enter
Select | Right Shift
A | J
B | K
Up | W
Down | S
Left | A
Right | D
**Player 2**
Button | Mapped to
--------------|-------------
Start | Numpad9
Select | Numpad8
A | Numpad5
B | Numpad6
Up | Up
Down | Down
Left | Left
Right | Right

View file

@ -0,0 +1,446 @@
# This is the CMakeCache file.
# For build in directory: /home/bb/Video/SimpleNES/build
# It was generated by CMake: /usr/local/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//Set this to link external libraries statically
BUILD_STATIC:STRING=FALSE
//Path to a program.
CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line
//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar
//No help, variable specified on the command line.
CMAKE_BUILD_TYPE:STRING=Debug
//CXX compiler
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
//A wrapper around 'ar' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-10
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-10
//Flags used by the CXX compiler during all build types.
CMAKE_CXX_FLAGS:STRING=
//Flags used by the CXX compiler during DEBUG builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
//Flags used by the CXX compiler during MINSIZEREL builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the CXX compiler during RELEASE builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the CXX compiler during RELWITHDEBINFO builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//C compiler
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
//A wrapper around 'ar' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9
//Flags used by the C compiler during all build types.
CMAKE_C_FLAGS:STRING=
//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g
//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Path to a program.
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
//Flags used by the linker during all build types.
CMAKE_EXE_LINKER_FLAGS:STRING=
//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during MINSIZEREL builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during RELEASE builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during RELWITHDEBINFO builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld
//Program used to build from build.ninja files.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/ninja
//Flags used by the linker during the creation of modules during
// all build types.
CMAKE_MODULE_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of modules during
// DEBUG builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of modules during
// MINSIZEREL builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of modules during
// RELEASE builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of modules during
// RELWITHDEBINFO builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=SimpleNES
//Path to a program.
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
//Path to a program.
CMAKE_READELF:FILEPATH=/usr/bin/readelf
//Flags used by the linker during the creation of shared libraries
// during all build types.
CMAKE_SHARED_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of shared libraries
// during DEBUG builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of shared libraries
// during MINSIZEREL builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELEASE builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELWITHDEBINFO builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO
//Flags used by the linker during the creation of static libraries
// during all build types.
CMAKE_STATIC_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of static libraries
// during DEBUG builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of static libraries
// during MINSIZEREL builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of static libraries
// during RELEASE builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of static libraries
// during RELWITHDEBINFO builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_STRIP:FILEPATH=/usr/bin/strip
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make. This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
//Path to a library.
SFML_AUDIO_LIBRARY_DYNAMIC_DEBUG:FILEPATH=SFML_AUDIO_LIBRARY_DYNAMIC_DEBUG-NOTFOUND
//Path to a library.
SFML_AUDIO_LIBRARY_DYNAMIC_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libsfml-audio.so
//Path to a library.
SFML_AUDIO_LIBRARY_STATIC_DEBUG:FILEPATH=SFML_AUDIO_LIBRARY_STATIC_DEBUG-NOTFOUND
//Path to a library.
SFML_AUDIO_LIBRARY_STATIC_RELEASE:FILEPATH=SFML_AUDIO_LIBRARY_STATIC_RELEASE-NOTFOUND
//Path to a library.
SFML_GRAPHICS_LIBRARY_DYNAMIC_DEBUG:FILEPATH=SFML_GRAPHICS_LIBRARY_DYNAMIC_DEBUG-NOTFOUND
//Path to a library.
SFML_GRAPHICS_LIBRARY_DYNAMIC_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libsfml-graphics.so
//Path to a library.
SFML_GRAPHICS_LIBRARY_STATIC_DEBUG:FILEPATH=SFML_GRAPHICS_LIBRARY_STATIC_DEBUG-NOTFOUND
//Path to a library.
SFML_GRAPHICS_LIBRARY_STATIC_RELEASE:FILEPATH=SFML_GRAPHICS_LIBRARY_STATIC_RELEASE-NOTFOUND
//Path to a file.
SFML_INCLUDE_DIR:PATH=/usr/include
//Path to a library.
SFML_SYSTEM_LIBRARY_DYNAMIC_DEBUG:FILEPATH=SFML_SYSTEM_LIBRARY_DYNAMIC_DEBUG-NOTFOUND
//Path to a library.
SFML_SYSTEM_LIBRARY_DYNAMIC_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libsfml-system.so
//Path to a library.
SFML_SYSTEM_LIBRARY_STATIC_DEBUG:FILEPATH=SFML_SYSTEM_LIBRARY_STATIC_DEBUG-NOTFOUND
//Path to a library.
SFML_SYSTEM_LIBRARY_STATIC_RELEASE:FILEPATH=SFML_SYSTEM_LIBRARY_STATIC_RELEASE-NOTFOUND
//Path to a library.
SFML_WINDOW_LIBRARY_DYNAMIC_DEBUG:FILEPATH=SFML_WINDOW_LIBRARY_DYNAMIC_DEBUG-NOTFOUND
//Path to a library.
SFML_WINDOW_LIBRARY_DYNAMIC_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libsfml-window.so
//Path to a library.
SFML_WINDOW_LIBRARY_STATIC_DEBUG:FILEPATH=SFML_WINDOW_LIBRARY_STATIC_DEBUG-NOTFOUND
//Path to a library.
SFML_WINDOW_LIBRARY_STATIC_RELEASE:FILEPATH=SFML_WINDOW_LIBRARY_STATIC_RELEASE-NOTFOUND
//Value Computed by CMake
SimpleNES_BINARY_DIR:STATIC=/home/bb/Video/SimpleNES/build
//Value Computed by CMake
SimpleNES_SOURCE_DIR:STATIC=/home/bb/Video/SimpleNES
########################
# INTERNAL cache entries
########################
//ADVANCED property for variable: CMAKE_ADDR2LINE
CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/home/bb/Video/SimpleNES/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=20
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=0
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/local/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/bin/ctest
//ADVANCED property for variable: CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER_AR
CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB
CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_DLLTOOL
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Ninja
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/home/bb/Video/SimpleNES
//Install .so files without execute permission.
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_READELF
CMAKE_READELF-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/local/share/cmake-3.20
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_AUDIO_LIBRARY_DYNAMIC_DEBUG
SFML_AUDIO_LIBRARY_DYNAMIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_AUDIO_LIBRARY_DYNAMIC_RELEASE
SFML_AUDIO_LIBRARY_DYNAMIC_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_AUDIO_LIBRARY_STATIC_DEBUG
SFML_AUDIO_LIBRARY_STATIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_AUDIO_LIBRARY_STATIC_RELEASE
SFML_AUDIO_LIBRARY_STATIC_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_GRAPHICS_LIBRARY_DYNAMIC_DEBUG
SFML_GRAPHICS_LIBRARY_DYNAMIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_GRAPHICS_LIBRARY_DYNAMIC_RELEASE
SFML_GRAPHICS_LIBRARY_DYNAMIC_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_GRAPHICS_LIBRARY_STATIC_DEBUG
SFML_GRAPHICS_LIBRARY_STATIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_GRAPHICS_LIBRARY_STATIC_RELEASE
SFML_GRAPHICS_LIBRARY_STATIC_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_SYSTEM_LIBRARY_DYNAMIC_DEBUG
SFML_SYSTEM_LIBRARY_DYNAMIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_SYSTEM_LIBRARY_DYNAMIC_RELEASE
SFML_SYSTEM_LIBRARY_DYNAMIC_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_SYSTEM_LIBRARY_STATIC_DEBUG
SFML_SYSTEM_LIBRARY_STATIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_SYSTEM_LIBRARY_STATIC_RELEASE
SFML_SYSTEM_LIBRARY_STATIC_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_WINDOW_LIBRARY_DYNAMIC_DEBUG
SFML_WINDOW_LIBRARY_DYNAMIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_WINDOW_LIBRARY_DYNAMIC_RELEASE
SFML_WINDOW_LIBRARY_DYNAMIC_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_WINDOW_LIBRARY_STATIC_DEBUG
SFML_WINDOW_LIBRARY_STATIC_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SFML_WINDOW_LIBRARY_STATIC_RELEASE
SFML_WINDOW_LIBRARY_STATIC_RELEASE-ADVANCED:INTERNAL=1

View file

@ -0,0 +1,78 @@
set(CMAKE_C_COMPILER "/usr/bin/cc")
set(CMAKE_C_COMPILER_ARG1 "")
set(CMAKE_C_COMPILER_ID "GNU")
set(CMAKE_C_COMPILER_VERSION "9.3.0")
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
set(CMAKE_C_COMPILER_WRAPPER "")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
set(CMAKE_C_PLATFORM_ID "Linux")
set(CMAKE_C_SIMULATE_ID "")
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
set(CMAKE_C_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-9")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_C_ABI_COMPILED TRUE)
set(CMAKE_COMPILER_IS_MINGW )
set(CMAKE_COMPILER_IS_CYGWIN )
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_C_COMPILER_ENV_VAR "CC")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information.
set(CMAKE_C_SIZEOF_DATA_PTR "8")
set(CMAKE_C_COMPILER_ABI "ELF")
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
if(CMAKE_C_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_C_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif()
if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")

View file

@ -0,0 +1,91 @@
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "GNU")
set(CMAKE_CXX_COMPILER_VERSION "10.3.0")
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20")
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
set(CMAKE_CXX23_COMPILE_FEATURES "")
set(CMAKE_CXX_PLATFORM_ID "Linux")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
set(CMAKE_CXX_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-10")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-10")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_CXX_ABI_COMPILED TRUE)
set(CMAKE_COMPILER_IS_MINGW )
set(CMAKE_COMPILER_IS_CYGWIN )
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
foreach (lang C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
endforeach()
endif()
endforeach()
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
set(CMAKE_CXX_COMPILER_ABI "ELF")
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/10;/usr/include/x86_64-linux-gnu/c++/10;/usr/include/c++/10/backward;/usr/lib/gcc/x86_64-linux-gnu/10/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/10;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")

View file

@ -0,0 +1,15 @@
set(CMAKE_HOST_SYSTEM "Linux-5.13.0-28-generic")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "5.13.0-28-generic")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_SYSTEM "Linux-5.13.0-28-generic")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "5.13.0-28-generic")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "FALSE")
set(CMAKE_SYSTEM_LOADED 1)

View file

@ -0,0 +1,743 @@
#ifdef __cplusplus
# error "A C++ compiler has been selected for C."
#endif
#if defined(__18CXX)
# define ID_VOID_MAIN
#endif
#if defined(__CLASSIC_C__)
/* cv-qualifiers did not exist in K&R C */
# define const
# define volatile
#endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# if defined(__GNUC__)
# define SIMULATE_ID "GNU"
# endif
/* __INTEL_COMPILER = VRP */
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# else
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
# define COMPILER_ID "IntelLLVM"
#if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
#endif
#if defined(__GNUC__)
# define SIMULATE_ID "GNU"
#endif
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
* VVVV is no smaller than the current year when a versio is released.
*/
#if __INTEL_LLVM_COMPILER < 1000000L
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
#else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
#endif
#if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
#endif
#if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
#elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
#endif
#if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
#endif
#if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
#endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
# define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_C)
# define COMPILER_ID "SunPro"
# if __SUNPRO_C >= 0x5100
/* __SUNPRO_C = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
# endif
#elif defined(__HP_cc)
# define COMPILER_ID "HP"
/* __HP_cc = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
#elif defined(__DECC)
# define COMPILER_ID "Compaq"
/* __DECC_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
# define COMPILER_ID "XL"
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
# define COMPILER_ID "VisualAge"
/* __IBMC__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
#elif defined(__NVCOMPILER)
# define COMPILER_ID "NVHPC"
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
# define COMPILER_ID "Fujitsu"
#elif defined(__ghs__)
# define COMPILER_ID "GHS"
/* __GHS_VERSION_NUMBER = VVVVRP */
# ifdef __GHS_VERSION_NUMBER
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
# endif
#elif defined(__TINYC__)
# define COMPILER_ID "TinyCC"
#elif defined(__BCC__)
# define COMPILER_ID "Bruce"
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
# define COMPILER_ID "ARMClang"
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# if defined(__GNUC_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
# define COMPILER_ID "ADSP"
#if defined(__VISUALDSPVERSION__)
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
#endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
# if defined(__VER__) && defined(__ICCARM__)
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# endif
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
# define COMPILER_ID "SDCC"
# if defined(__SDCC_VERSION_MAJOR)
# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
# else
/* SDCC = VRP */
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"
#elif defined(__MINGW32__)
# define PLATFORM_ID "MinGW"
#elif defined(__APPLE__)
# define PLATFORM_ID "Darwin"
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
# define PLATFORM_ID "Windows"
#elif defined(__FreeBSD__) || defined(__FreeBSD)
# define PLATFORM_ID "FreeBSD"
#elif defined(__NetBSD__) || defined(__NetBSD)
# define PLATFORM_ID "NetBSD"
#elif defined(__OpenBSD__) || defined(__OPENBSD)
# define PLATFORM_ID "OpenBSD"
#elif defined(__sun) || defined(sun)
# define PLATFORM_ID "SunOS"
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku"
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_ID "QNX"
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
# define PLATFORM_ID "Tru64"
#elif defined(__riscos) || defined(__riscos__)
# define PLATFORM_ID "RISCos"
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
# define PLATFORM_ID "SINIX"
#elif defined(__UNIX_SV__)
# define PLATFORM_ID "UNIX_SV"
#elif defined(__bsdos__)
# define PLATFORM_ID "BSDOS"
#elif defined(_MPRAS) || defined(MPRAS)
# define PLATFORM_ID "MP-RAS"
#elif defined(__osf) || defined(__osf__)
# define PLATFORM_ID "OSF1"
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
# define PLATFORM_ID "SCO_SV"
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
# define PLATFORM_ID "ULTRIX"
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# elif defined(__VXWORKS__)
# define PLATFORM_ID "VxWorks"
# else /* unknown platform */
# define PLATFORM_ID
# endif
#elif defined(__INTEGRITY)
# if defined(INT_178B)
# define PLATFORM_ID "Integrity178"
# else /* regular Integrity */
# define PLATFORM_ID "Integrity"
# endif
#else /* unknown platform */
# define PLATFORM_ID
#endif
/* For windows compilers MSVC and Intel we can determine
the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
#if defined(_WIN32) && defined(_MSC_VER)
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_ARM64EC)
# define ARCHITECTURE_ID "ARM64EC"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM64)
# define ARCHITECTURE_ID "ARM64"
# elif defined(_M_ARM)
# if _M_ARM == 4
# define ARCHITECTURE_ID "ARMV4I"
# elif _M_ARM == 5
# define ARCHITECTURE_ID "ARMV5I"
# else
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# if defined(__ICCARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
# elif defined(__ICCRH850__)
# define ARCHITECTURE_ID "RH850"
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
# elif defined(__ICCRISCV__)
# define ARCHITECTURE_ID "RISCV"
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
# elif defined(__ICC430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
# elif defined(__ICCSTM8__)
# define ARCHITECTURE_ID "STM8"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__ghs__)
# if defined(__PPC64__)
# define ARCHITECTURE_ID "PPC64"
# elif defined(__ppc__)
# define ARCHITECTURE_ID "PPC"
# elif defined(__ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__x86_64__)
# define ARCHITECTURE_ID "x64"
# elif defined(__i386__)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__TI_COMPILER_VERSION__)
# if defined(__TI_ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__MSP430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__TMS320C28XX__)
# define ARCHITECTURE_ID "TMS320C28x"
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
# define ARCHITECTURE_ID "TMS320C6x"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#else
# define ARCHITECTURE_ID
#endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number components. */
#ifdef COMPILER_VERSION_MAJOR
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct a string literal encoding the internal version number. */
#ifdef COMPILER_VERSION_INTERNAL
char const info_version_internal[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
'i','n','t','e','r','n','a','l','[',
COMPILER_VERSION_INTERNAL,']','\0'};
#endif
/* Construct a string literal encoding the version number components. */
#ifdef SIMULATE_VERSION_MAJOR
char const info_simulate_version[] = {
'I', 'N', 'F', 'O', ':',
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
SIMULATE_VERSION_MAJOR,
# ifdef SIMULATE_VERSION_MINOR
'.', SIMULATE_VERSION_MINOR,
# ifdef SIMULATE_VERSION_PATCH
'.', SIMULATE_VERSION_PATCH,
# ifdef SIMULATE_VERSION_TWEAK
'.', SIMULATE_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
#if !defined(__STDC__)
# if (defined(_MSC_VER) && !defined(__clang__)) \
|| (defined(__ibmxl__) || defined(__IBMC__))
# define C_DIALECT "90"
# else
# define C_DIALECT
# endif
#elif __STDC_VERSION__ >= 201000L
# define C_DIALECT "11"
#elif __STDC_VERSION__ >= 199901L
# define C_DIALECT "99"
#else
# define C_DIALECT "90"
#endif
const char* info_language_dialect_default =
"INFO" ":" "dialect_default[" C_DIALECT "]";
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
void main() {}
#else
# if defined(__CLASSIC_C__)
int main(argc, argv) int argc; char *argv[];
# else
int main(int argc, char* argv[])
# endif
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
require += info_arch[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
(void)argv;
return require;
}
#endif

Binary file not shown.

View file

@ -0,0 +1,734 @@
/* This source file must have a .cpp extension so that all C++ compilers
recognize the extension without flags. Borland does not know .cxx for
example. */
#ifndef __cplusplus
# error "A C compiler has been selected for C++."
#endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
/* __COMO_VERSION__ = VRR */
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# if defined(__GNUC__)
# define SIMULATE_ID "GNU"
# endif
/* __INTEL_COMPILER = VRP */
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# else
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
# define COMPILER_ID "IntelLLVM"
#if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
#endif
#if defined(__GNUC__)
# define SIMULATE_ID "GNU"
#endif
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
* VVVV is no smaller than the current year when a versio is released.
*/
#if __INTEL_LLVM_COMPILER < 1000000L
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
#else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
#endif
#if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
#endif
#if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
#elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
#endif
#if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
#endif
#if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
#endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
# define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
# if __SUNPRO_CC >= 0x5100
/* __SUNPRO_CC = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# endif
#elif defined(__HP_aCC)
# define COMPILER_ID "HP"
/* __HP_aCC = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
/* __DECCXX_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
# define COMPILER_ID "XL"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
# define COMPILER_ID "VisualAge"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__NVCOMPILER)
# define COMPILER_ID "NVHPC"
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
# define COMPILER_ID "Fujitsu"
#elif defined(__ghs__)
# define COMPILER_ID "GHS"
/* __GHS_VERSION_NUMBER = VVVVRP */
# ifdef __GHS_VERSION_NUMBER
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
# endif
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
# define COMPILER_ID "ARMClang"
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__GNUC__) || defined(__GNUG__)
# define COMPILER_ID "GNU"
# if defined(__GNUC__)
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# else
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
# define COMPILER_ID "ADSP"
#if defined(__VISUALDSPVERSION__)
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
#endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
# if defined(__VER__) && defined(__ICCARM__)
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"
#elif defined(__MINGW32__)
# define PLATFORM_ID "MinGW"
#elif defined(__APPLE__)
# define PLATFORM_ID "Darwin"
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
# define PLATFORM_ID "Windows"
#elif defined(__FreeBSD__) || defined(__FreeBSD)
# define PLATFORM_ID "FreeBSD"
#elif defined(__NetBSD__) || defined(__NetBSD)
# define PLATFORM_ID "NetBSD"
#elif defined(__OpenBSD__) || defined(__OPENBSD)
# define PLATFORM_ID "OpenBSD"
#elif defined(__sun) || defined(sun)
# define PLATFORM_ID "SunOS"
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku"
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_ID "QNX"
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
# define PLATFORM_ID "Tru64"
#elif defined(__riscos) || defined(__riscos__)
# define PLATFORM_ID "RISCos"
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
# define PLATFORM_ID "SINIX"
#elif defined(__UNIX_SV__)
# define PLATFORM_ID "UNIX_SV"
#elif defined(__bsdos__)
# define PLATFORM_ID "BSDOS"
#elif defined(_MPRAS) || defined(MPRAS)
# define PLATFORM_ID "MP-RAS"
#elif defined(__osf) || defined(__osf__)
# define PLATFORM_ID "OSF1"
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
# define PLATFORM_ID "SCO_SV"
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
# define PLATFORM_ID "ULTRIX"
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# elif defined(__VXWORKS__)
# define PLATFORM_ID "VxWorks"
# else /* unknown platform */
# define PLATFORM_ID
# endif
#elif defined(__INTEGRITY)
# if defined(INT_178B)
# define PLATFORM_ID "Integrity178"
# else /* regular Integrity */
# define PLATFORM_ID "Integrity"
# endif
#else /* unknown platform */
# define PLATFORM_ID
#endif
/* For windows compilers MSVC and Intel we can determine
the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
#if defined(_WIN32) && defined(_MSC_VER)
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_ARM64EC)
# define ARCHITECTURE_ID "ARM64EC"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM64)
# define ARCHITECTURE_ID "ARM64"
# elif defined(_M_ARM)
# if _M_ARM == 4
# define ARCHITECTURE_ID "ARMV4I"
# elif _M_ARM == 5
# define ARCHITECTURE_ID "ARMV5I"
# else
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# if defined(__ICCARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
# elif defined(__ICCRH850__)
# define ARCHITECTURE_ID "RH850"
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
# elif defined(__ICCRISCV__)
# define ARCHITECTURE_ID "RISCV"
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
# elif defined(__ICC430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
# elif defined(__ICCSTM8__)
# define ARCHITECTURE_ID "STM8"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__ghs__)
# if defined(__PPC64__)
# define ARCHITECTURE_ID "PPC64"
# elif defined(__ppc__)
# define ARCHITECTURE_ID "PPC"
# elif defined(__ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__x86_64__)
# define ARCHITECTURE_ID "x64"
# elif defined(__i386__)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__TI_COMPILER_VERSION__)
# if defined(__TI_ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__MSP430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__TMS320C28XX__)
# define ARCHITECTURE_ID "TMS320C28x"
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
# define ARCHITECTURE_ID "TMS320C6x"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#else
# define ARCHITECTURE_ID
#endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number components. */
#ifdef COMPILER_VERSION_MAJOR
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct a string literal encoding the internal version number. */
#ifdef COMPILER_VERSION_INTERNAL
char const info_version_internal[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
'i','n','t','e','r','n','a','l','[',
COMPILER_VERSION_INTERNAL,']','\0'};
#endif
/* Construct a string literal encoding the version number components. */
#ifdef SIMULATE_VERSION_MAJOR
char const info_simulate_version[] = {
'I', 'N', 'F', 'O', ':',
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
SIMULATE_VERSION_MAJOR,
# ifdef SIMULATE_VERSION_MINOR
'.', SIMULATE_VERSION_MINOR,
# ifdef SIMULATE_VERSION_PATCH
'.', SIMULATE_VERSION_PATCH,
# ifdef SIMULATE_VERSION_TWEAK
'.', SIMULATE_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
# if defined(__INTEL_CXX11_MODE__)
# if defined(__cpp_aggregate_nsdmi)
# define CXX_STD 201402L
# else
# define CXX_STD 201103L
# endif
# else
# define CXX_STD 199711L
# endif
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
# define CXX_STD _MSVC_LANG
#else
# define CXX_STD __cplusplus
#endif
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
#if CXX_STD > 202002L
"23"
#elif CXX_STD > 201703L
"20"
#elif CXX_STD >= 201703L
"17"
#elif CXX_STD >= 201402L
"14"
#elif CXX_STD >= 201103L
"11"
#else
"98"
#endif
"]";
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
(void)argv;
return require;
}

Binary file not shown.

View file

@ -0,0 +1,417 @@
The system is: Linux - 5.13.0-28-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is GNU, found in "/home/bb/Video/SimpleNES/build/CMakeFiles/3.20.0/CompilerIdC/a.out"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/c++
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in "/home/bb/Video/SimpleNES/build/CMakeFiles/3.20.0/CompilerIdCXX/a.out"
Detecting C compiler ABI info compiled with the following output:
Change Dir: /home/bb/Video/SimpleNES/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_2ce5e && [1/2] Building C object CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/local/share/cmake-3.20/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccEOy5f1.s
GNU C17 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/9/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C17 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: bbf13931d8de1abe14040c9909cb6969
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
as -v --64 -o CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o /tmp/ccEOy5f1.s
GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
[2/2] Linking C executable cmTC_2ce5e
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_2ce5e' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc3S09Pl.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_2ce5e /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_2ce5e' '-mtune=generic' '-march=x86-64'
Parsed C implicit include dir info from above output: rv=done
found start of include info
found start of implicit include info
add: [/usr/lib/gcc/x86_64-linux-gnu/9/include]
add: [/usr/local/include]
add: [/usr/include/x86_64-linux-gnu]
add: [/usr/include]
end of search list found
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include]
collapse include dir [/usr/local/include] ==> [/usr/local/include]
collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
collapse include dir [/usr/include] ==> [/usr/include]
implicit include dirs: [/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include]
Parsed C implicit link information from above output:
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /home/bb/Video/SimpleNES/build/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command(s):/usr/bin/ninja cmTC_2ce5e && [1/2] Building C object CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
ignore line: [Thread model: posix]
ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/local/share/cmake-3.20/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccEOy5f1.s]
ignore line: [GNU C17 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"]
ignore line: [#include "..." search starts here:]
ignore line: [#include <...> search starts here:]
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include]
ignore line: [ /usr/local/include]
ignore line: [ /usr/include/x86_64-linux-gnu]
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [GNU C17 (Ubuntu 9.3.0-17ubuntu1~20.04) version 9.3.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: bbf13931d8de1abe14040c9909cb6969]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o /tmp/ccEOy5f1.s]
ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [[2/2] Linking C executable cmTC_2ce5e]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
ignore line: [Thread model: posix]
ignore line: [gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) ]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_2ce5e' '-mtune=generic' '-march=x86-64']
link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc3S09Pl.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_2ce5e /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/cc3S09Pl.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [--build-id] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [--as-needed] ==> ignore
arg [-export-dynamic] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-pie] ==> ignore
arg [-znow] ==> ignore
arg [-zrelro] ==> ignore
arg [-o] ==> ignore
arg [cmTC_2ce5e] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib]
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
arg [-L/lib/../lib] ==> dir [/lib/../lib]
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..]
arg [CMakeFiles/cmTC_2ce5e.dir/CMakeCCompilerABI.c.o] ==> ignore
arg [-lgcc] ==> lib [gcc]
arg [--push-state] ==> ignore
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--pop-state] ==> ignore
arg [-lc] ==> lib [c]
arg [-lgcc] ==> lib [gcc]
arg [--push-state] ==> ignore
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--pop-state] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib]
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
collapse library dir [/lib/../lib] ==> [/lib]
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib]
implicit libs: [gcc;gcc_s;c;gcc;gcc_s]
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
implicit fwks: []
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /home/bb/Video/SimpleNES/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_e756f && [1/2] Building CXX object CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.3.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/10/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/local/share/cmake-3.20/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccv5PNY4.s
GNU C++14 (Ubuntu 10.3.0-1ubuntu1~20.04) version 10.3.0 (x86_64-linux-gnu)
compiled by GNU C version 10.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/10"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/10
/usr/include/x86_64-linux-gnu/c++/10
/usr/include/c++/10/backward
/usr/lib/gcc/x86_64-linux-gnu/10/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C++14 (Ubuntu 10.3.0-1ubuntu1~20.04) version 10.3.0 (x86_64-linux-gnu)
compiled by GNU C version 10.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 169ee3a1708a329c07eaf03cc8dfbe6c
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
as -v --64 -o CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccv5PNY4.s
GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
[2/2] Linking CXX executable cmTC_e756f
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.3.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_e756f' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/10/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper -plugin-opt=-fresolution=/tmp/ccSV2yeJ.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_e756f /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_e756f' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
Parsed CXX implicit include dir info from above output: rv=done
found start of include info
found start of implicit include info
add: [/usr/include/c++/10]
add: [/usr/include/x86_64-linux-gnu/c++/10]
add: [/usr/include/c++/10/backward]
add: [/usr/lib/gcc/x86_64-linux-gnu/10/include]
add: [/usr/local/include]
add: [/usr/include/x86_64-linux-gnu]
add: [/usr/include]
end of search list found
collapse include dir [/usr/include/c++/10] ==> [/usr/include/c++/10]
collapse include dir [/usr/include/x86_64-linux-gnu/c++/10] ==> [/usr/include/x86_64-linux-gnu/c++/10]
collapse include dir [/usr/include/c++/10/backward] ==> [/usr/include/c++/10/backward]
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/10/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/10/include]
collapse include dir [/usr/local/include] ==> [/usr/local/include]
collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
collapse include dir [/usr/include] ==> [/usr/include]
implicit include dirs: [/usr/include/c++/10;/usr/include/x86_64-linux-gnu/c++/10;/usr/include/c++/10/backward;/usr/lib/gcc/x86_64-linux-gnu/10/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include]
Parsed CXX implicit link information from above output:
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /home/bb/Video/SimpleNES/build/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command(s):/usr/bin/ninja cmTC_e756f && [1/2] Building CXX object CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.3.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-nvptx/usr amdgcn-amdhsa=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-gcn/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex]
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/10/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/local/share/cmake-3.20/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccv5PNY4.s]
ignore line: [GNU C++14 (Ubuntu 10.3.0-1ubuntu1~20.04) version 10.3.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 10.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/10"]
ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/include-fixed"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include"]
ignore line: [#include "..." search starts here:]
ignore line: [#include <...> search starts here:]
ignore line: [ /usr/include/c++/10]
ignore line: [ /usr/include/x86_64-linux-gnu/c++/10]
ignore line: [ /usr/include/c++/10/backward]
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/10/include]
ignore line: [ /usr/local/include]
ignore line: [ /usr/include/x86_64-linux-gnu]
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [GNU C++14 (Ubuntu 10.3.0-1ubuntu1~20.04) version 10.3.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 10.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: 169ee3a1708a329c07eaf03cc8dfbe6c]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccv5PNY4.s]
ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
ignore line: [[2/2] Linking CXX executable cmTC_e756f]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.3.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-nvptx/usr amdgcn-amdhsa=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-gcn/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex]
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04) ]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_e756f' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
link line: [ /usr/lib/gcc/x86_64-linux-gnu/10/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper -plugin-opt=-fresolution=/tmp/ccSV2yeJ.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_e756f /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/10/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccSV2yeJ.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [--build-id] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [--as-needed] ==> ignore
arg [-export-dynamic] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-pie] ==> ignore
arg [-znow] ==> ignore
arg [-zrelro] ==> ignore
arg [-o] ==> ignore
arg [cmTC_e756f] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o] ==> ignore
arg [-L/usr/lib/gcc/x86_64-linux-gnu/10] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/10]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib]
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
arg [-L/lib/../lib] ==> dir [/lib/../lib]
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/10/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/10/../../..]
arg [CMakeFiles/cmTC_e756f.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [-lc] ==> lib [c]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [/usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o] ==> ignore
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/10] ==> [/usr/lib/gcc/x86_64-linux-gnu/10]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib] ==> [/usr/lib]
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
collapse library dir [/lib/../lib] ==> [/lib]
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/10/../../..] ==> [/usr/lib]
implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc]
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/10;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
implicit fwks: []

View file

@ -0,0 +1,3 @@
/home/bb/Video/SimpleNES/build/CMakeFiles/rebuild_cache.dir
/home/bb/Video/SimpleNES/build/CMakeFiles/edit_cache.dir
/home/bb/Video/SimpleNES/build/CMakeFiles/SimpleNES.dir

View file

@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

View file

@ -0,0 +1,64 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Ninja" Generator, CMake Version 3.20
# This file contains all the rules used to get the outputs files
# built from the input files.
# It is included in the main 'build.ninja'.
# =============================================================================
# Project: SimpleNES
# Configurations: Debug
# =============================================================================
# =============================================================================
#############################################
# Rule for running custom commands.
rule CUSTOM_COMMAND
command = $COMMAND
description = $DESC
#############################################
# Rule for compiling CXX files.
rule CXX_COMPILER__SimpleNES_Debug
depfile = $DEP_FILE
deps = gcc
command = /usr/bin/c++ $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building CXX object $out
#############################################
# Rule for linking CXX executable.
rule CXX_EXECUTABLE_LINKER__SimpleNES_Debug
command = $PRE_LINK && /usr/bin/c++ $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD
description = Linking CXX executable $TARGET_FILE
restat = $RESTAT
#############################################
# Rule for re-running cmake.
rule RERUN_CMAKE
command = /usr/local/bin/cmake --regenerate-during-build -S/home/bb/Video/SimpleNES -B/home/bb/Video/SimpleNES/build
description = Re-running CMake...
generator = 1
#############################################
# Rule for cleaning all built files.
rule CLEAN
command = /usr/bin/ninja $FILE_ARG -t clean $TARGETS
description = Cleaning all built files...
#############################################
# Rule for printing all primary targets available.
rule HELP
command = /usr/bin/ninja -t targets
description = All primary targets available:

338
SimpleNES/build/build.ninja Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,54 @@
# Install script for directory: /home/bb/Video/SimpleNES
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Debug")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/home/bb/Video/SimpleNES/build/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")

View file

@ -0,0 +1,124 @@
[Player1]
A = J
B = K
Select = RShift
Start = Return
Up = W
Down = S
Left = A
Right = D
[Player2]
A = Numpad5
B = Numpad6
Select = Numpad8
Start = Numpad9
Up = Up
Down = Down
Left = Left
Right = Right
# Available Keys:
# A,
# B,
# C,
# D,
# E,
# F,
# G,
# H,
# I,
# J,
# K,
# L,
# M,
# N,
# O,
# P,
# Q,
# R,
# S,
# T,
# U,
# V,
# W,
# X,
# Y,
# Z,
# Num0,
# Num1,
# Num2,
# Num3,
# Num4,
# Num5,
# Num6,
# Num7,
# Num8,
# Num9,
# Escape,
# LControl,
# LShift,
# LAlt,
# LSystem,
# RControl,
# RShift,
# RAlt,
# RSystem,
# Menu,
# LBracket,
# RBracket,
# SemiColon,
# Comma,
# Period,
# Quote,
# Slash,
# BackSlash,
# Tilde,
# Equal,
# Dash,
# Space,
# Return,
# BackSpace,
# Tab,
# PageUp,
# PageDown,
# End,
# Home,
# Insert,
# Delete,
# Add,
# Subtract,
# Multiply,
# Divide,
# Left,
# Right,
# Up,
# Down,
# Numpad0,
# Numpad1,
# Numpad2,
# Numpad3,
# Numpad4,
# Numpad5,
# Numpad6,
# Numpad7,
# Numpad8,
# Numpad9,
# F1,
# F2,
# F3,
# F4,
# F5,
# F6,
# F7,
# F8,
# F9,
# F10,
# F11,
# F12,
# F13,
# F14,
# F15,
# Pause

View file

@ -0,0 +1,368 @@
# This script locates the SFML library
# ------------------------------------
#
# Usage
# -----
#
# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
# example:
# find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
#
# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
# If nothing is specified, the version won't be checked (i.e. any version will be accepted).
# example:
# find_package(SFML COMPONENTS ...) // no specific version required
# find_package(SFML 2 COMPONENTS ...) // any 2.x version
# find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater
#
# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
# Since you have to link yourself all the SFML dependencies when you link it statically, the following
# additional variables are defined: SFML_XXX_DEPENDENCIES and SFML_DEPENDENCIES (see their detailed
# description below).
# In case of static linking, the SFML_STATIC macro will also be defined by this script.
# example:
# set(SFML_STATIC_LIBRARIES TRUE)
# find_package(SFML 2 COMPONENTS network system)
#
# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
# are available for both release and debug modes.
#
# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
# to tell CMake where SFML is.
#
# Output
# ------
#
# This script defines the following variables:
# - For each specified module XXX (system, window, graphics, network, audio, main):
# - SFML_XXX_LIBRARY_DEBUG: the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
# - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
# - SFML_XXX_LIBRARY: the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found
# - SFML_XXX_DEPENDENCIES: the list of libraries the module depends on, in case of static linking
# - SFML_LIBRARIES: the list of all libraries corresponding to the required modules
# - SFML_FOUND: true if all the required modules are found
# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
# - SFML_DEPENDENCIES: the list of libraries SFML depends on, in case of static linking
#
# example:
# find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
# include_directories(${SFML_INCLUDE_DIR})
# add_executable(myapp ...)
# target_link_libraries(myapp ${SFML_LIBRARIES})
# define the SFML_STATIC macro if static build was chosen
if(SFML_STATIC_LIBRARIES)
add_definitions(-DSFML_STATIC)
endif()
# define the list of search paths for headers and libraries
set(FIND_SFML_PATHS
${SFML_ROOT}
$ENV{SFML_ROOT}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt)
# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
PATH_SUFFIXES include
PATHS ${FIND_SFML_PATHS})
# check the version number
set(SFML_VERSION_OK TRUE)
if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
# extract the major and minor version numbers from SFML/Config.hpp
# we have to handle framework a little bit differently:
if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
else()
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
endif()
FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_PATCH ([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
if (NOT "${SFML_VERSION_PATCH}" MATCHES "^[0-9]+$")
set(SFML_VERSION_PATCH 0)
endif()
math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}")
# if we could extract them, compare with the requested version number
if (SFML_VERSION_MAJOR)
# transform version numbers to an integer
math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}")
# compare them
if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
set(SFML_VERSION_OK FALSE)
endif()
else()
# SFML version is < 2.0
if (SFML_REQUESTED_VERSION GREATER 10900)
set(SFML_VERSION_OK FALSE)
set(SFML_VERSION_MAJOR 1)
set(SFML_VERSION_MINOR x)
set(SFML_VERSION_PATCH x)
endif()
endif()
endif()
# find the requested modules
set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
# no suffix for sfml-main, it is always a static library
if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
# release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
else()
# static release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}-s
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# static debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-s-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# dynamic release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# dynamic debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# choose the entries that fit the requested link type
if(SFML_STATIC_LIBRARIES)
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE})
endif()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG})
endif()
else()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE})
endif()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG})
endif()
endif()
endif()
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# library found
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
# if both are found, set SFML_XXX_LIBRARY to contain both
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
endif()
# if only one debug/release variant is found, set the other to be equal to the found one
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# debug and not release
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
endif()
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
# release and not debug
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
endif()
else()
# library not found
set(SFML_FOUND FALSE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
endif()
# mark as advanced
MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
# add to the global list of libraries
set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
endforeach()
# in case of static linking, we must also define the list of all the dependencies of SFML libraries
if(SFML_STATIC_LIBRARIES)
# detect the OS
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(FIND_SFML_OS_WINDOWS 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(FIND_SFML_OS_LINUX 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(FIND_SFML_OS_FREEBSD 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(FIND_SFML_OS_MACOSX 1)
endif()
# start with an empty list
set(SFML_DEPENDENCIES)
set(FIND_SFML_DEPENDENCIES_NOTFOUND)
# macro that searches for a 3rd-party library
macro(find_sfml_dependency output friendlyname)
# No lookup in environment variables (PATH on Windows), as they may contain wrong library versions
find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
if(${${output}} STREQUAL "${output}-NOTFOUND")
unset(output)
set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
endif()
endmacro()
# sfml-system
list(FIND SFML_FIND_COMPONENTS "system" FIND_SFML_SYSTEM_COMPONENT)
if(NOT ${FIND_SFML_SYSTEM_COMPONENT} EQUAL -1)
# update the list -- these are only system libraries, no need to find them
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_MACOSX)
set(SFML_SYSTEM_DEPENDENCIES "pthread")
endif()
if(FIND_SFML_OS_LINUX)
set(SFML_SYSTEM_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} "rt")
endif()
if(FIND_SFML_OS_WINDOWS)
set(SFML_SYSTEM_DEPENDENCIES "winmm")
endif()
set(SFML_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-network
list(FIND SFML_FIND_COMPONENTS "network" FIND_SFML_NETWORK_COMPONENT)
if(NOT ${FIND_SFML_NETWORK_COMPONENT} EQUAL -1)
# update the list -- these are only system libraries, no need to find them
if(FIND_SFML_OS_WINDOWS)
set(SFML_NETWORK_DEPENDENCIES "ws2_32")
endif()
set(SFML_DEPENDENCIES ${SFML_NETWORK_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-window
list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT)
if(NOT ${FIND_SFML_WINDOW_COMPONENT} EQUAL -1)
# find libraries
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
find_sfml_dependency(X11_LIBRARY "X11" X11)
find_sfml_dependency(LIBXCB_LIBRARIES "XCB" xcb libxcb)
find_sfml_dependency(X11_XCB_LIBRARY "X11-xcb" X11-xcb libX11-xcb)
find_sfml_dependency(XCB_RANDR_LIBRARY "xcb-randr" xcb-randr libxcb-randr)
find_sfml_dependency(XCB_IMAGE_LIBRARY "xcb-image" xcb-image libxcb-image)
endif()
if(FIND_SFML_OS_LINUX)
find_sfml_dependency(UDEV_LIBRARIES "UDev" udev libudev)
endif()
# update the list
if(FIND_SFML_OS_WINDOWS)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "opengl32" "winmm" "gdi32")
elseif(FIND_SFML_OS_LINUX)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} ${UDEV_LIBRARIES})
elseif(FIND_SFML_OS_FREEBSD)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} "usbhid")
elseif(FIND_SFML_OS_MACOSX)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "-framework OpenGL -framework Foundation -framework AppKit -framework IOKit -framework Carbon")
endif()
set(SFML_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-graphics
list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT)
if(NOT ${FIND_SFML_GRAPHICS_COMPONENT} EQUAL -1)
# find libraries
find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype)
find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg)
# update the list
set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY})
set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-audio
list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT)
if(NOT ${FIND_SFML_AUDIO_COMPONENT} EQUAL -1)
# find libraries
find_sfml_dependency(OPENAL_LIBRARY "OpenAL" openal openal32)
find_sfml_dependency(OGG_LIBRARY "Ogg" ogg)
find_sfml_dependency(VORBIS_LIBRARY "Vorbis" vorbis)
find_sfml_dependency(VORBISFILE_LIBRARY "VorbisFile" vorbisfile)
find_sfml_dependency(VORBISENC_LIBRARY "VorbisEnc" vorbisenc)
find_sfml_dependency(FLAC_LIBRARY "FLAC" FLAC)
# update the list
set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${FLAC_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_AUDIO_DEPENDENCIES})
endif()
endif()
# handle errors
if(NOT SFML_VERSION_OK)
# SFML version not ok
set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH})")
set(SFML_FOUND FALSE)
elseif(SFML_STATIC_LIBRARIES AND FIND_SFML_DEPENDENCIES_NOTFOUND)
set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})")
set(SFML_FOUND FALSE)
elseif(NOT SFML_FOUND)
# include directory or library not found
set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
endif()
if (NOT SFML_FOUND)
if(SFML_FIND_REQUIRED)
# fatal error
message(FATAL_ERROR ${FIND_SFML_ERROR})
elseif(NOT SFML_FIND_QUIETLY)
# error but continue
message("${FIND_SFML_ERROR}")
endif()
endif()
# handle success
if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}")
endif()

72
SimpleNES/include/CPU.h Normal file
View file

@ -0,0 +1,72 @@
#ifndef CPU_H
#define CPU_H
#include "MainBus.h"
namespace sn
{
class CPU
{
public:
enum InterruptType
{
IRQ,
NMI,
BRK_
};
CPU(MainBus &mem);
//Assuming sequential execution, for asynchronously calling this with Execute, further work needed
void interrupt(InterruptType type);
void step();
void reset();
void reset(Address start_addr);
void log();
Address getPC() { return r_PC; }
void skipDMACycles();
private:
//Instructions are split into five sets to make decoding easier.
//These functions return true if they succeed
bool executeImplied(Byte opcode);
bool executeBranch(Byte opcode);
bool executeType0(Byte opcode);
bool executeType1(Byte opcode);
bool executeType2(Byte opcode);
Address readAddress(Address addr);
void pushStack(Byte value);
Byte pullStack();
//If a and b are in different pages, increases the m_SkipCycles by inc
void setPageCrossed(Address a, Address b, int inc = 1);
void setZN(Byte value);
int m_skipCycles;
int m_cycles;
//Registers
Address r_PC;
Byte r_SP;
Byte r_A;
Byte r_X;
Byte r_Y;
//Status flags.
//Is storing them in one byte better ?
bool f_C;
bool f_Z;
bool f_I;
// bool f_B;
bool f_D;
bool f_V;
bool f_N;
MainBus &m_bus;
};
};
#endif // CPU_H

View file

@ -0,0 +1,144 @@
#ifndef CPUOPCODES_H_INCLUDED
#define CPUOPCODES_H_INCLUDED
namespace sn
{
const auto InstructionModeMask = 0x3;
const auto OperationMask = 0xe0;
const auto OperationShift = 5;
const auto AddrModeMask = 0x1c;
const auto AddrModeShift = 2;
const auto BranchInstructionMask = 0x1f;
const auto BranchInstructionMaskResult = 0x10;
const auto BranchConditionMask = 0x20;
const auto BranchOnFlagShift = 6;
const auto NMIVector = 0xfffa;
const auto ResetVector = 0xfffc;
const auto IRQVector = 0xfffe;
enum BranchOnFlag
{
Negative,
Overflow,
Carry,
Zero
};
enum Operation1
{
ORA,
AND,
EOR,
ADC,
STA,
LDA,
CMP,
SBC,
};
enum AddrMode1
{
IndexedIndirectX,
ZeroPage,
Immediate,
Absolute,
IndirectY,
IndexedX,
AbsoluteY,
AbsoluteX,
};
enum Operation2
{
ASL,
ROL,
LSR,
ROR,
STX,
LDX,
DEC,
INC,
};
enum AddrMode2
{
Immediate_,
ZeroPage_,
Accumulator,
Absolute_,
Indexed = 5,
AbsoluteIndexed = 7,
};
enum Operation0
{
BIT = 1,
STY = 4,
LDY,
CPY,
CPX,
};
enum OperationImplied
{
NOP = 0xea,
BRK = 0x00,
JSR = 0x20,
RTI = 0x40,
RTS = 0x60,
JMP = 0x4C,
JMPI = 0x6C, //JMP Indirect
PHP = 0x08,
PLP = 0x28,
PHA = 0x48,
PLA = 0x68,
DEY = 0x88,
DEX = 0xca,
TAY = 0xa8,
INY = 0xc8,
INX = 0xe8,
CLC = 0x18,
SEC = 0x38,
CLI = 0x58,
SEI = 0x78,
TYA = 0x98,
CLV = 0xb8,
CLD = 0xd8,
SED = 0xf8,
TXA = 0x8a,
TXS = 0x9a,
TAX = 0xaa,
TSX = 0xba,
};
//0 implies unused opcode
int OperationCycles[0x100] = {
7, 6, 0, 0, 0, 3, 5, 0, 3, 2, 2, 0, 0, 4, 6, 0,
2, 5, 0, 0, 0, 4, 6, 0, 2, 4, 0, 0, 0, 4, 7, 0,
6, 6, 0, 0, 3, 3, 5, 0, 4, 2, 2, 0, 4, 4, 6, 0,
2, 5, 0, 0, 0, 4, 6, 0, 2, 4, 0, 0, 0, 4, 7, 0,
6, 6, 0, 0, 0, 3, 5, 0, 3, 2, 2, 0, 3, 4, 6, 0,
2, 5, 0, 0, 0, 4, 6, 0, 2, 4, 0, 0, 0, 4, 7, 0,
6, 6, 0, 0, 0, 3, 5, 0, 4, 2, 2, 0, 5, 4, 6, 0,
2, 5, 0, 0, 0, 4, 6, 0, 2, 4, 0, 0, 0, 4, 7, 0,
0, 6, 0, 0, 3, 3, 3, 0, 2, 0, 2, 0, 4, 4, 4, 0,
2, 6, 0, 0, 4, 4, 4, 0, 2, 5, 2, 0, 0, 5, 0, 0,
2, 6, 2, 0, 3, 3, 3, 0, 2, 2, 2, 0, 4, 4, 4, 0,
2, 5, 0, 0, 4, 4, 4, 0, 2, 4, 2, 0, 4, 4, 4, 0,
2, 6, 0, 0, 3, 3, 5, 0, 2, 2, 2, 0, 4, 4, 6, 0,
2, 5, 0, 0, 0, 4, 6, 0, 2, 4, 0, 0, 0, 4, 7, 0,
2, 6, 0, 0, 3, 3, 5, 0, 2, 2, 2, 2, 4, 4, 6, 0,
2, 5, 0, 0, 0, 4, 6, 0, 2, 4, 0, 0, 0, 4, 7, 0,
};
};
#endif // CPUOPCODES_H_INCLUDED

View file

@ -0,0 +1,33 @@
#ifndef CARTRIDGE_H
#define CARTRIDGE_H
#include <vector>
#include <string>
#include <cstdint>
namespace sn
{
using Byte = std::uint8_t;
using Address = std::uint16_t;
class Cartridge
{
public:
Cartridge();
bool loadFromFile(std::string path);
const std::vector<Byte>& getROM();
const std::vector<Byte>& getVROM();
Byte getMapper();
Byte getNameTableMirroring();
bool hasExtendedRAM();
private:
std::vector<Byte> m_PRG_ROM;
std::vector<Byte> m_CHR_ROM;
Byte m_nameTableMirroring;
Byte m_mapperNumber;
bool m_extendedRAM;
bool m_chrRAM;
};
};
#endif // CARTRIDGE_H

View file

@ -0,0 +1,39 @@
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <SFML/Window.hpp>
#include <cstdint>
#include <vector>
namespace sn
{
using Byte = std::uint8_t;
class Controller
{
public:
Controller();
enum Buttons
{
A,
B,
Select,
Start,
Up,
Down,
Left,
Right,
TotalButtons,
};
void strobe(Byte b);
Byte read();
void setKeyBindings(const std::vector<sf::Keyboard::Key>& keys);
private:
bool m_strobe;
unsigned int m_keyStates;
std::vector<sf::Keyboard::Key> m_keyBindings;
// sf::Keyboard::Key m_keyBindings[TotalButtons];
};
}
#endif // CONTROLLER_H

View file

@ -0,0 +1,50 @@
#ifndef EMULATOR_H
#define EMULATOR_H
#include <SFML/Graphics.hpp>
#include <chrono>
#include "CPU.h"
#include "PPU.h"
#include "MainBus.h"
#include "PictureBus.h"
#include "Controller.h"
namespace sn
{
using TimePoint = std::chrono::high_resolution_clock::time_point;
const int NESVideoWidth = ScanlineVisibleDots;
const int NESVideoHeight = VisibleScanlines;
class Emulator
{
public:
Emulator();
void run(std::string rom_path);
void setVideoWidth(int width);
void setVideoHeight(int height);
void setVideoScale(float scale);
void setKeys(std::vector<sf::Keyboard::Key>& p1, std::vector<sf::Keyboard::Key>& p2);
private:
void DMA(Byte page);
MainBus m_bus;
PictureBus m_pictureBus;
CPU m_cpu;
PPU m_ppu;
Cartridge m_cartridge;
std::unique_ptr<Mapper> m_mapper;
Controller m_controller1, m_controller2;
sf::RenderWindow m_window;
VirtualScreen m_emulatorScreen;
float m_screenScale;
TimePoint m_cycleTimer;
std::chrono::high_resolution_clock::duration m_elapsedTime;
std::chrono::nanoseconds m_cpuCycleDuration;
};
}
#endif // EMULATOR_H

79
SimpleNES/include/Log.h Normal file
View file

@ -0,0 +1,79 @@
#ifndef LOG_H
#define LOG_H
#include <iostream>
#include <string>
#include <fstream>
#include <memory>
#include <cstring>
#ifndef __FILENAME__
#define __FILENAME__ __FILE__
#endif
#define LOG(level) \
if (level > sn::Log::get().getLevel()) ; \
else sn::Log::get().getStream() << '[' << __FILENAME__ << ":" << std::dec << __LINE__ << "] "
#define LOG_CPU \
if (sn::CpuTrace != sn::Log::get().getLevel()) ; \
else sn::Log::get().getCpuTraceStream()
namespace sn
{
enum Level
{
None,
Error,
Info,
InfoVerbose,
CpuTrace
};
class Log
{
public:
~Log();
void setLogStream(std::ostream& stream);
void setCpuTraceStream(std::ostream& stream);
Log& setLevel(Level level);
Level getLevel();
std::ostream& getStream();
std::ostream& getCpuTraceStream();
static Log& get();
private:
Level m_logLevel;
std::ostream* m_logStream;
std::ostream* m_cpuTrace;
};
//Courtesy of http://wordaligned.org/articles/cpp-streambufs#toctee-streams
class TeeBuf : public std::streambuf
{
public:
// Construct a streambuf which tees output to both input
// streambufs.
TeeBuf(std::streambuf* sb1, std::streambuf* sb2);
private:
// This tee buffer has no buffer. So every character "overflows"
// and can be put directly into the teed buffers.
virtual int overflow(int c);
// Sync both teed buffers.
virtual int sync();
private:
std::streambuf* m_sb1;
std::streambuf* m_sb2;
};
class TeeStream : public std::ostream
{
public:
// Construct an ostream which tees output to the supplied
// ostreams.
TeeStream(std::ostream& o1, std::ostream& o2);
private:
TeeBuf m_tbuf;
};
};
#endif // LOG_H

View file

@ -0,0 +1,47 @@
#ifndef MEMORY_H
#define MEMORY_H
#include <vector>
#include <map>
#include <functional>
#include <memory>
#include "Cartridge.h"
#include "Mapper.h"
namespace sn
{
enum IORegisters
{
PPUCTRL = 0x2000,
PPUMASK,
PPUSTATUS,
OAMADDR,
OAMDATA,
PPUSCROL,
PPUADDR,
PPUDATA,
OAMDMA = 0x4014,
JOY1 = 0x4016,
JOY2 = 0x4017,
};
class MainBus
{
public:
MainBus();
Byte read(Address addr);
void write(Address addr, Byte value);
bool setMapper(Mapper* mapper);
bool setWriteCallback(IORegisters reg, std::function<void(Byte)> callback);
bool setReadCallback(IORegisters reg, std::function<Byte(void)> callback);
const Byte* getPagePtr(Byte page);
private:
std::vector<Byte> m_RAM;
std::vector<Byte> m_extRAM;
Mapper* m_mapper;
std::map<IORegisters, std::function<void(Byte)>> m_writeCallbacks;
std::map<IORegisters, std::function<Byte(void)>> m_readCallbacks;;
};
};
#endif // MEMORY_H

View file

@ -0,0 +1,57 @@
#ifndef MAPPER_H
#define MAPPER_H
#include "Cartridge.h"
#include <memory>
#include <functional>
namespace sn
{
enum NameTableMirroring
{
Horizontal = 0,
Vertical = 1,
FourScreen = 8,
OneScreenLower,
OneScreenHigher,
};
class Mapper
{
public:
enum Type
{
NROM = 0,
SxROM = 1,
UxROM = 2,
CNROM = 3,
MMC3 = 4,
AxROM = 7,
ColorDreams = 11,
GxROM = 66,
};
Mapper(Cartridge& cart, Type t) : m_cartridge(cart), m_type(t) {};
virtual void writePRG (Address addr, Byte value) = 0;
virtual Byte readPRG (Address addr) = 0;
virtual const Byte* getPagePtr (Address addr) = 0; //for DMAs
virtual Byte readCHR (Address addr) = 0;
virtual void writeCHR (Address addr, Byte value) = 0;
virtual NameTableMirroring getNameTableMirroring();
bool inline hasExtendedRAM()
{
return m_cartridge.hasExtendedRAM();
}
static std::unique_ptr<Mapper> createMapper (Type mapper_t, Cartridge& cart, std::function<void(void)> mirroring_cb);
protected:
Cartridge& m_cartridge;
Type m_type;
};
}
#endif //MAPPER_H

View file

@ -0,0 +1,22 @@
#include "Mapper.h"
namespace sn
{
class Mapper11 : public Mapper
{
public:
Mapper11(Cartridge &cart, std::function<void(void)> mirroring_cb);
NameTableMirroring getNameTableMirroring();
void writePRG(Address address, Byte value);
Byte readPRG(Address address);
const Byte *getPagePtr(Address address);
Byte readCHR(Address address);
void writeCHR(Address address, Byte value);
private:
NameTableMirroring m_mirroring;
Byte prgbank;
Byte chrbank;
std::function<void(void)> m_mirroringCallback;
};
}

View file

@ -0,0 +1,27 @@
#include "Mapper.h"
#include "PictureBus.h"
namespace sn
{
class MapperAxROM : public Mapper
{
public:
MapperAxROM(Cartridge &cart, std::function<void(void)> mirroring_cb);
void writePRG(Address address, Byte value);
Byte readPRG(Address address);
const Byte *getPagePtr(Address address);
NameTableMirroring getNameTableMirroring();
Byte readCHR(Address address);
void writeCHR(Address address, Byte value);
private:
NameTableMirroring m_mirroring;
PictureBus m_ppubus;
std::function<void(void)> m_mirroringCallback;
Byte PRGBank;
std::vector<Byte> m_characterRAM;
};
}

View file

@ -0,0 +1,23 @@
#ifndef MAPPERCNROM_H
#define MAPPERCNROM_H
#include "Mapper.h"
namespace sn
{
class MapperCNROM : public Mapper
{
public:
MapperCNROM(Cartridge& cart);
void writePRG (Address addr, Byte value);
Byte readPRG (Address addr);
const Byte* getPagePtr(Address addr);
Byte readCHR (Address addr);
void writeCHR (Address addr, Byte value);
private:
bool m_oneBank;
Address m_selectCHR;
};
}
#endif // MAPPERCNROM_H

View file

@ -0,0 +1,30 @@
#include"Mapper.h"
namespace sn
{
class MapperGxROM : public Mapper
{
public:
MapperGxROM(Cartridge &cart , std::function<void(void)> mirroring_cb);
NameTableMirroring getNameTableMirroring();
void writePRG(Address address, Byte value);
Byte readPRG(Address address);
const Byte *getPagePtr(Address address);
Byte readCHR(Address address);
void writeCHR(Address address, Byte value);
Byte prgbank;
Byte chrbank;
private:
NameTableMirroring m_mirroring;
std::vector<Byte> m_characterRAM;
std::function<void(void)> m_mirroringCallback;
};
}

View file

@ -0,0 +1,58 @@
#pragma once
#include "Mapper.h"
namespace sn
{
class MapperMMC3 : public Mapper
{
public:
MapperMMC3(Cartridge &cart, std::function<void(void)> mirroring_cb);
Byte readPRG(Address addr);
void writePRG(Address addr, Byte value);
const Byte *getPagePtr(Address addr);
NameTableMirroring getNameTableMirroring();
Byte readCHR(Address addr);
void writeCHR(Address addr, Byte value);
bool irqState();
void irqClear();
void scanline();
private:
// Control variables
uint32_t nTargetRegister;
bool bPRGBankMode;
bool bCHRInversion;
NameTableMirroring mirrormode;
uint32_t pRegister[8];
Byte chram[0x2000];
Byte ppuram[0x800];
Byte banks;
Byte lastread;
bool bIRQActive;
bool bIRQEnable;
Address nIRQCounter;
Address nIRQReload;
bool m_irqReloadPending;
const Byte *prgbank0;
const Byte *prgbank1;
const Byte *prgbank2;
const Byte *prgbank3;
const Byte *chrbank0;
const Byte *chrbank1;
const Byte *chrbank2;
const Byte *chrbank3;
const Byte *chrbank4;
const Byte *chrbank5;
const Byte *chrbank6;
const Byte *chrbank7;
std::vector<Byte> ramstatic;
std::function<void(void)> m_mirroringCallback;
};
} // namespace sn

View file

@ -0,0 +1,25 @@
#ifndef MAPPERNROM_H
#define MAPPERNROM_H
#include "Mapper.h"
namespace sn
{
class MapperNROM : public Mapper
{
public:
MapperNROM(Cartridge& cart);
void writePRG (Address addr, Byte value);
Byte readPRG (Address addr);
const Byte* getPagePtr(Address addr);
Byte readCHR (Address addr);
void writeCHR (Address addr, Byte value);
private:
bool m_oneBank;
bool m_usesCharacterRAM;
std::vector<Byte> m_characterRAM;
};
}
#endif // MAPPERNROM_H

View file

@ -0,0 +1,45 @@
#ifndef MAPPERSXROM_H
#define MAPPERSXROM_H
#include "Mapper.h"
namespace sn
{
class MapperSxROM : public Mapper
{
public:
MapperSxROM(Cartridge& cart, std::function<void(void)> mirroring_cb);
void writePRG (Address addr, Byte value);
Byte readPRG (Address addr);
const Byte* getPagePtr(Address addr);
Byte readCHR (Address addr);
void writeCHR (Address addr, Byte value);
NameTableMirroring getNameTableMirroring();
private:
void calculatePRGPointers();
std::function<void(void)> m_mirroringCallback;
NameTableMirroring m_mirroing;
bool m_usesCharacterRAM;
int m_modeCHR;
int m_modePRG;
Byte m_tempRegister;
int m_writeCounter;
Byte m_regPRG;
Byte m_regCHR0;
Byte m_regCHR1;
const Byte* m_firstBankPRG;
const Byte* m_secondBankPRG;
const Byte* m_firstBankCHR;
const Byte* m_secondBankCHR;
std::vector<Byte> m_characterRAM;
};
}
#endif // MAPPERSXROM_H

View file

@ -0,0 +1,27 @@
#ifndef MAPPERUXROM_H
#define MAPPERUXROM_H
#include "Mapper.h"
namespace sn
{
class MapperUxROM : public Mapper
{
public:
MapperUxROM(Cartridge& cart);
void writePRG (Address addr, Byte value);
Byte readPRG (Address addr);
const Byte* getPagePtr(Address addr);
Byte readCHR (Address addr);
void writeCHR (Address addr, Byte value);
private:
bool m_usesCharacterRAM;
const Byte* m_lastBankPtr;
Address m_selectPRG;
std::vector<Byte> m_characterRAM;
};
}
#endif // MAPPERUXROM_H

103
SimpleNES/include/PPU.h Normal file
View file

@ -0,0 +1,103 @@
#ifndef PPU_H
#define PPU_H
#include <functional>
#include <array>
#include "PictureBus.h"
#include "MainBus.h"
#include "VirtualScreen.h"
#include "PaletteColors.h"
namespace sn
{
const int ScanlineCycleLength = 341;
const int ScanlineEndCycle = 340;
const int VisibleScanlines = 240;
const int ScanlineVisibleDots = 256;
const int FrameEndScanline = 261;
const int AttributeOffset = 0x3C0;
class PPU
{
public:
PPU(PictureBus &bus, VirtualScreen &screen);
void step();
void reset();
void setInterruptCallback(std::function<void(void)> cb);
void doDMA(const Byte* page_ptr);
//Callbacks mapped to CPU address space
//Addresses written to by the program
void control(Byte ctrl);
void setMask(Byte mask);
void setOAMAddress(Byte addr);
void setDataAddress(Byte addr);
void setScroll(Byte scroll);
void setData(Byte data);
//Read by the program
Byte getStatus();
Byte getData();
Byte getOAMData();
void setOAMData(Byte value);
private:
Byte readOAM(Byte addr);
void writeOAM(Byte addr, Byte value);
Byte read(Address addr);
PictureBus &m_bus;
VirtualScreen &m_screen;
std::function<void(void)> m_vblankCallback;
std::vector<Byte> m_spriteMemory;
std::vector<Byte> m_scanlineSprites;
enum State
{
PreRender,
Render,
PostRender,
VerticalBlank
} m_pipelineState;
int m_cycle;
int m_scanline;
bool m_evenFrame;
bool m_vblank;
bool m_sprZeroHit;
//Registers
Address m_dataAddress;
Address m_tempAddress;
Byte m_fineXScroll;
bool m_firstWrite;
Byte m_dataBuffer;
Byte m_spriteDataAddress;
//Setup flags and variables
bool m_longSprites;
bool m_generateInterrupt;
bool m_greyscaleMode;
bool m_showSprites;
bool m_showBackground;
bool m_hideEdgeSprites;
bool m_hideEdgeBackground;
enum CharacterPage
{
Low,
High,
} m_bgPage,
m_sprPage;
Address m_dataAddrIncrement;
std::vector<std::vector<sf::Color>> m_pictureBuffer;
};
}
#endif // PPU_H

View file

@ -0,0 +1,13 @@
#include <SFML/Config.hpp>
//Colors in RGBA (8 bit colors)
const sf::Uint32 colors[] = {
0x666666ff, 0x002a88ff, 0x1412a7ff, 0x3b00a4ff, 0x5c007eff, 0x6e0040ff, 0x6c0600ff, 0x561d00ff,
0x333500ff, 0x0b4800ff, 0x005200ff, 0x004f08ff, 0x00404dff, 0x000000ff, 0x000000ff, 0x000000ff,
0xadadadff, 0x155fd9ff, 0x4240ffff, 0x7527feff, 0xa01accff, 0xb71e7bff, 0xb53120ff, 0x994e00ff,
0x6b6d00ff, 0x388700ff, 0x0c9300ff, 0x008f32ff, 0x007c8dff, 0x000000ff, 0x000000ff, 0x000000ff,
0xfffeffff, 0x64b0ffff, 0x9290ffff, 0xc676ffff, 0xf36affff, 0xfe6eccff, 0xfe8170ff, 0xea9e22ff,
0xbcbe00ff, 0x88d800ff, 0x5ce430ff, 0x45e082ff, 0x48cddeff, 0x4f4f4fff, 0x000000ff, 0x000000ff,
0xfffeffff, 0xc0dfffff, 0xd3d2ffff, 0xe8c8ffff, 0xfbc2ffff, 0xfec4eaff, 0xfeccc5ff, 0xf7d8a5ff,
0xe4e594ff, 0xcfef96ff, 0xbdf4abff, 0xb3f3ccff, 0xb5ebf2ff, 0xb8b8b8ff, 0x000000ff, 0x000000ff,
};

View file

@ -0,0 +1,28 @@
#ifndef PICTUREBUS_H
#define PICTUREBUS_H
#include <vector>
#include "Cartridge.h"
#include "Mapper.h"
namespace sn
{
class PictureBus
{
public:
PictureBus();
Byte read(Address addr);
void write(Address addr, Byte value);
bool setMapper(Mapper *mapper);
Byte readPalette(Byte paletteAddr);
std::vector<Byte> m_RAM;
void updateMirroring();
private:
std::size_t NameTable0, NameTable1, NameTable2, NameTable3; //indices where they start in RAM vector
std::vector<Byte> m_palette;
Mapper* m_mapper;
};
}
#endif // PICTUREBUS_H

View file

@ -0,0 +1,21 @@
#ifndef VIRTUALSCREEN_H
#define VIRTUALSCREEN_H
#include <SFML/Graphics.hpp>
namespace sn
{
class VirtualScreen : public sf::Drawable
{
public:
void create (unsigned int width, unsigned int height, float pixel_size, sf::Color color);
void setPixel (std::size_t x, std::size_t y, sf::Color color);
private:
void draw(sf::RenderTarget& target, sf::RenderStates states) const;
sf::Vector2u m_screenSize;
float m_pixelSize; //virtual pixel size in real pixels
sf::VertexArray m_vertices;
};
};
#endif // VIRTUALSCREEN_H

124
SimpleNES/keybindings.conf Normal file
View file

@ -0,0 +1,124 @@
[Player1]
A = J
B = K
Select = RShift
Start = Return
Up = W
Down = S
Left = A
Right = D
[Player2]
A = Numpad5
B = Numpad6
Select = Numpad8
Start = Numpad9
Up = Up
Down = Down
Left = Left
Right = Right
# Available Keys:
# A,
# B,
# C,
# D,
# E,
# F,
# G,
# H,
# I,
# J,
# K,
# L,
# M,
# N,
# O,
# P,
# Q,
# R,
# S,
# T,
# U,
# V,
# W,
# X,
# Y,
# Z,
# Num0,
# Num1,
# Num2,
# Num3,
# Num4,
# Num5,
# Num6,
# Num7,
# Num8,
# Num9,
# Escape,
# LControl,
# LShift,
# LAlt,
# LSystem,
# RControl,
# RShift,
# RAlt,
# RSystem,
# Menu,
# LBracket,
# RBracket,
# SemiColon,
# Comma,
# Period,
# Quote,
# Slash,
# BackSlash,
# Tilde,
# Equal,
# Dash,
# Space,
# Return,
# BackSpace,
# Tab,
# PageUp,
# PageDown,
# End,
# Home,
# Insert,
# Delete,
# Add,
# Subtract,
# Multiply,
# Divide,
# Left,
# Right,
# Up,
# Down,
# Numpad0,
# Numpad1,
# Numpad2,
# Numpad3,
# Numpad4,
# Numpad5,
# Numpad6,
# Numpad7,
# Numpad8,
# Numpad9,
# F1,
# F2,
# F3,
# F4,
# F5,
# F6,
# F7,
# F8,
# F9,
# F10,
# F11,
# F12,
# F13,
# F14,
# F15,
# Pause

108
SimpleNES/main.cpp Normal file
View file

@ -0,0 +1,108 @@
#include "Emulator.h"
#include "Log.h"
#include <string>
#include <sstream>
namespace sn
{
void parseControllerConf(std::string filepath,
std::vector<sf::Keyboard::Key>& p1,
std::vector<sf::Keyboard::Key>& p2);
}
int main(int argc, char** argv)
{
std::ofstream logFile ("simplenes.log"), cpuTraceFile;
sn::TeeStream logTee (logFile, std::cout);
if (logFile.is_open() && logFile.good())
sn::Log::get().setLogStream(logTee);
else
sn::Log::get().setLogStream(std::cout);
sn::Log::get().setLevel(sn::Info);
std::string path;
//Default keybindings
std::vector<sf::Keyboard::Key> p1 {sf::Keyboard::J, sf::Keyboard::K, sf::Keyboard::RShift, sf::Keyboard::Return,
sf::Keyboard::W, sf::Keyboard::S, sf::Keyboard::A, sf::Keyboard::D},
p2 {sf::Keyboard::Numpad5, sf::Keyboard::Numpad6, sf::Keyboard::Numpad8, sf::Keyboard::Numpad9,
sf::Keyboard::Up, sf::Keyboard::Down, sf::Keyboard::Left, sf::Keyboard::Right};
sn::Emulator emulator;
for (int i = 1; i < argc; ++i)
{
std::string arg (argv[i]);
if (arg == "-h" || arg == "--help")
{
std::cout << "SimpleNES is a simple NES emulator.\n"
<< "It can run off .nes images.\n"
<< "Set keybindings with keybindings.conf\n\n"
<< "Usage: SimpleNES [options] rom-path\n\n"
<< "Options:\n"
<< "-h, --help Print this help text and exit\n"
<< "-s, --scale Set video scale. Default: 2.\n"
<< " Scale of 1 corresponds to " << sn::NESVideoWidth << "x" << sn::NESVideoHeight << std::endl
<< "-w, --width Set the width of the emulation screen (height is\n"
<< " set automatically to fit the aspect ratio)\n"
<< "-H, --height Set the height of the emulation screen (width is\n"
<< " set automatically to fit the aspect ratio)\n"
<< " This option is mutually exclusive to --width\n"
<< std::endl;
return 0;
}
else if (std::strcmp(argv[i], "--log-cpu") == 0)
{
sn::Log::get().setLevel(sn::CpuTrace);
cpuTraceFile.open("sn.cpudump");
sn::Log::get().setCpuTraceStream(cpuTraceFile);
LOG(sn::Info) << "CPU logging set." << std::endl;
}
else if (std::strcmp(argv[i], "-s") == 0 || std::strcmp(argv[i], "--scale") == 0)
{
float scale;
std::stringstream ss;
if (i + 1 < argc && ss << argv[i + 1] && ss >> scale)
emulator.setVideoScale(scale);
else
LOG(sn::Error) << "Setting scale from argument failed" << std::endl;
++i;
}
else if (std::strcmp(argv[i], "-w") == 0 || std::strcmp(argv[i], "--width") == 0)
{
int width;
std::stringstream ss;
if (i + 1 < argc && ss << argv[i + 1] && ss >> width)
emulator.setVideoWidth(width);
else
LOG(sn::Error) << "Setting width from argument failed" << std::endl;
++i;
}
else if (std::strcmp(argv[i], "-H") == 0 || std::strcmp(argv[i], "--height") == 0)
{
int height;
std::stringstream ss;
if (i + 1 < argc && ss << argv[i + 1] && ss >> height)
emulator.setVideoHeight(height);
else
LOG(sn::Error) << "Setting height from argument failed" << std::endl;
++i;
}
else if (argv[i][0] != '-')
path = argv[i];
else
std::cerr << "Unrecognized argument: " << argv[i] << std::endl;
}
if (path.empty())
{
std::cout << "Argument required: ROM path" << std::endl;
return 1;
}
sn::parseControllerConf("keybindings.conf", p1, p2);
emulator.setKeys(p1, p2);
emulator.run(path);
return 0;
}

649
SimpleNES/src/CPU.cpp Normal file
View file

@ -0,0 +1,649 @@
#include "CPU.h"
#include "CPUOpcodes.h"
#include "Log.h"
#include <iomanip>
namespace sn
{
CPU::CPU(MainBus &mem) :
m_bus(mem)
{}
void CPU::reset()
{
reset(readAddress(ResetVector));
}
void CPU::reset(Address start_addr)
{
m_skipCycles = m_cycles = 0;
r_A = r_X = r_Y = 0;
f_I = true;
f_C = f_D = f_N = f_V = f_Z = false;
r_PC = start_addr;
r_SP = 0xfd; //documented startup state
}
void CPU::interrupt(InterruptType type)
{
if (f_I && type != NMI && type != BRK_)
return;
if (type == BRK_) //Add one if BRK, a quirk of 6502
++r_PC;
pushStack(r_PC >> 8);
pushStack(r_PC);
Byte flags = f_N << 7 |
f_V << 6 |
1 << 5 | //unused bit, supposed to be always 1
(type == BRK_) << 4 | //B flag set if BRK
f_D << 3 |
f_I << 2 |
f_Z << 1 |
f_C;
pushStack(flags);
f_I = true;
switch (type)
{
case IRQ:
case BRK_:
r_PC = readAddress(IRQVector);
break;
case NMI:
r_PC = readAddress(NMIVector);
break;
}
m_skipCycles += 7;
}
void CPU::pushStack(Byte value)
{
m_bus.write(0x100 | r_SP, value);
--r_SP; //Hardware stacks grow downward!
}
Byte CPU::pullStack()
{
return m_bus.read(0x100 | ++r_SP);
}
void CPU::setZN(Byte value)
{
f_Z = !value;
f_N = value & 0x80;
}
void CPU::setPageCrossed(Address a, Address b, int inc)
{
//Page is determined by the high byte
if ((a & 0xff00) != (b & 0xff00))
m_skipCycles += inc;
}
void CPU::skipDMACycles()
{
m_skipCycles += 513; //256 read + 256 write + 1 dummy read
m_skipCycles += (m_cycles & 1); //+1 if on odd cycle
}
void CPU::step()
{
++m_cycles;
if (m_skipCycles-- > 1)
return;
m_skipCycles = 0;
int psw = f_N << 7 |
f_V << 6 |
1 << 5 |
f_D << 3 |
f_I << 2 |
f_Z << 1 |
f_C;
LOG_CPU << std::hex << std::setfill('0') << std::uppercase
<< std::setw(4) << +r_PC
<< " "
<< std::setw(2) << +m_bus.read(r_PC)
<< " "
<< "A:" << std::setw(2) << +r_A << " "
<< "X:" << std::setw(2) << +r_X << " "
<< "Y:" << std::setw(2) << +r_Y << " "
<< "P:" << std::setw(2) << psw << " "
<< "SP:" << std::setw(2) << +r_SP << /*std::endl;*/" "
<< "CYC:" << std::setw(3) << std::setfill(' ') << std::dec << ((m_cycles - 1) * 3) % 341
<< std::endl;
Byte opcode = m_bus.read(r_PC++);
auto CycleLength = OperationCycles[opcode];
//Using short-circuit evaluation, call the other function only if the first failed
//ExecuteImplied must be called first and ExecuteBranch must be before ExecuteType0
if (CycleLength && (executeImplied(opcode) || executeBranch(opcode) ||
executeType1(opcode) || executeType2(opcode) || executeType0(opcode)))
{
m_skipCycles += CycleLength;
//m_cycles %= 340; //compatibility with Nintendulator log
//m_skipCycles = 0; //for TESTING
}
else
{
LOG(Error) << "Unrecognized opcode: " << std::hex << +opcode << std::endl;
}
}
bool CPU::executeImplied(Byte opcode)
{
switch (static_cast<OperationImplied>(opcode))
{
case NOP:
break;
case BRK:
interrupt(BRK_);
break;
case JSR:
//Push address of next instruction - 1, thus r_PC + 1 instead of r_PC + 2
//since r_PC and r_PC + 1 are address of subroutine
pushStack(static_cast<Byte>((r_PC + 1) >> 8));
pushStack(static_cast<Byte>(r_PC + 1));
r_PC = readAddress(r_PC);
break;
case RTS:
r_PC = pullStack();
r_PC |= pullStack() << 8;
++r_PC;
break;
case RTI:
{
Byte flags = pullStack();
f_N = flags & 0x80;
f_V = flags & 0x40;
f_D = flags & 0x8;
f_I = flags & 0x4;
f_Z = flags & 0x2;
f_C = flags & 0x1;
}
r_PC = pullStack();
r_PC |= pullStack() << 8;
break;
case JMP:
r_PC = readAddress(r_PC);
break;
case JMPI:
{
Address location = readAddress(r_PC);
//6502 has a bug such that the when the vector of anindirect address begins at the last byte of a page,
//the second byte is fetched from the beginning of that page rather than the beginning of the next
//Recreating here:
Address Page = location & 0xff00;
r_PC = m_bus.read(location) |
m_bus.read(Page | ((location + 1) & 0xff)) << 8;
}
break;
case PHP:
{
Byte flags = f_N << 7 |
f_V << 6 |
1 << 5 | //supposed to always be 1
1 << 4 | //PHP pushes with the B flag as 1, no matter what
f_D << 3 |
f_I << 2 |
f_Z << 1 |
f_C;
pushStack(flags);
}
break;
case PLP:
{
Byte flags = pullStack();
f_N = flags & 0x80;
f_V = flags & 0x40;
f_D = flags & 0x8;
f_I = flags & 0x4;
f_Z = flags & 0x2;
f_C = flags & 0x1;
}
break;
case PHA:
pushStack(r_A);
break;
case PLA:
r_A = pullStack();
setZN(r_A);
break;
case DEY:
--r_Y;
setZN(r_Y);
break;
case DEX:
--r_X;
setZN(r_X);
break;
case TAY:
r_Y = r_A;
setZN(r_Y);
break;
case INY:
++r_Y;
setZN(r_Y);
break;
case INX:
++r_X;
setZN(r_X);
break;
case CLC:
f_C = false;
break;
case SEC:
f_C = true;
break;
case CLI:
f_I = false;
break;
case SEI:
f_I = true;
break;
case CLD:
f_D = false;
break;
case SED:
f_D = true;
break;
case TYA:
r_A = r_Y;
setZN(r_A);
break;
case CLV:
f_V = false;
break;
case TXA:
r_A = r_X;
setZN(r_A);
break;
case TXS:
r_SP = r_X;
break;
case TAX:
r_X = r_A;
setZN(r_X);
break;
case TSX:
r_X = r_SP;
setZN(r_X);
break;
default:
return false;
};
return true;
}
bool CPU::executeBranch(Byte opcode)
{
if ((opcode & BranchInstructionMask) == BranchInstructionMaskResult)
{
//branch is initialized to the condition required (for the flag specified later)
bool branch = opcode & BranchConditionMask;
//set branch to true if the given condition is met by the given flag
//We use xnor here, it is true if either both operands are true or false
switch (opcode >> BranchOnFlagShift)
{
case Negative:
branch = !(branch ^ f_N);
break;
case Overflow:
branch = !(branch ^ f_V);
break;
case Carry:
branch = !(branch ^ f_C);
break;
case Zero:
branch = !(branch ^ f_Z);
break;
default:
return false;
}
if (branch)
{
int8_t offset = m_bus.read(r_PC++);
++m_skipCycles;
auto newPC = static_cast<Address>(r_PC + offset);
setPageCrossed(r_PC, newPC, 2);
r_PC = newPC;
}
else
++r_PC;
return true;
}
return false;
}
bool CPU::executeType1(Byte opcode)
{
if ((opcode & InstructionModeMask) == 0x1)
{
Address location = 0; //Location of the operand, could be in RAM
auto op = static_cast<Operation1>((opcode & OperationMask) >> OperationShift);
switch (static_cast<AddrMode1>(
(opcode & AddrModeMask) >> AddrModeShift))
{
case IndexedIndirectX:
{
Byte zero_addr = r_X + m_bus.read(r_PC++);
//Addresses wrap in zero page mode, thus pass through a mask
location = m_bus.read(zero_addr & 0xff) | m_bus.read((zero_addr + 1) & 0xff) << 8;
}
break;
case ZeroPage:
location = m_bus.read(r_PC++);
break;
case Immediate:
location = r_PC++;
break;
case Absolute:
location = readAddress(r_PC);
r_PC += 2;
break;
case IndirectY:
{
Byte zero_addr = m_bus.read(r_PC++);
location = m_bus.read(zero_addr & 0xff) | m_bus.read((zero_addr + 1) & 0xff) << 8;
if (op != STA)
setPageCrossed(location, location + r_Y);
location += r_Y;
}
break;
case IndexedX:
// Address wraps around in the zero page
location = (m_bus.read(r_PC++) + r_X) & 0xff;
break;
case AbsoluteY:
location = readAddress(r_PC);
r_PC += 2;
if (op != STA)
setPageCrossed(location, location + r_Y);
location += r_Y;
break;
case AbsoluteX:
location = readAddress(r_PC);
r_PC += 2;
if (op != STA)
setPageCrossed(location, location + r_X);
location += r_X;
break;
default:
return false;
}
switch (op)
{
case ORA:
r_A |= m_bus.read(location);
setZN(r_A);
break;
case AND:
r_A &= m_bus.read(location);
setZN(r_A);
break;
case EOR:
r_A ^= m_bus.read(location);
setZN(r_A);
break;
case ADC:
{
Byte operand = m_bus.read(location);
std::uint16_t sum = r_A + operand + f_C;
//Carry forward or UNSIGNED overflow
f_C = sum & 0x100;
//SIGNED overflow, would only happen if the sign of sum is
//different from BOTH the operands
f_V = (r_A ^ sum) & (operand ^ sum) & 0x80;
r_A = static_cast<Byte>(sum);
setZN(r_A);
}
break;
case STA:
m_bus.write(location, r_A);
break;
case LDA:
r_A = m_bus.read(location);
setZN(r_A);
break;
case SBC:
{
//High carry means "no borrow", thus negate and subtract
std::uint16_t subtrahend = m_bus.read(location),
diff = r_A - subtrahend - !f_C;
//if the ninth bit is 1, the resulting number is negative => borrow => low carry
f_C = !(diff & 0x100);
//Same as ADC, except instead of the subtrahend,
//substitute with it's one complement
f_V = (r_A ^ diff) & (~subtrahend ^ diff) & 0x80;
r_A = diff;
setZN(diff);
}
break;
case CMP:
{
std::uint16_t diff = r_A - m_bus.read(location);
f_C = !(diff & 0x100);
setZN(diff);
}
break;
default:
return false;
}
return true;
}
return false;
}
bool CPU::executeType2(Byte opcode)
{
if ((opcode & InstructionModeMask) == 2)
{
Address location = 0;
auto op = static_cast<Operation2>((opcode & OperationMask) >> OperationShift);
auto addr_mode =
static_cast<AddrMode2>((opcode & AddrModeMask) >> AddrModeShift);
switch (addr_mode)
{
case Immediate_:
location = r_PC++;
break;
case ZeroPage_:
location = m_bus.read(r_PC++);
break;
case Accumulator:
break;
case Absolute_:
location = readAddress(r_PC);
r_PC += 2;
break;
case Indexed:
{
location = m_bus.read(r_PC++);
Byte index;
if (op == LDX || op == STX)
index = r_Y;
else
index = r_X;
//The mask wraps address around zero page
location = (location + index) & 0xff;
}
break;
case AbsoluteIndexed:
{
location = readAddress(r_PC);
r_PC += 2;
Byte index;
if (op == LDX || op == STX)
index = r_Y;
else
index = r_X;
setPageCrossed(location, location + index);
location += index;
}
break;
default:
return false;
}
std::uint16_t operand = 0;
switch (op)
{
case ASL:
case ROL:
if (addr_mode == Accumulator)
{
auto prev_C = f_C;
f_C = r_A & 0x80;
r_A <<= 1;
//If Rotating, set the bit-0 to the the previous carry
r_A = r_A | (prev_C && (op == ROL));
setZN(r_A);
}
else
{
auto prev_C = f_C;
operand = m_bus.read(location);
f_C = operand & 0x80;
operand = operand << 1 | (prev_C && (op == ROL));
setZN(operand);
m_bus.write(location, operand);
}
break;
case LSR:
case ROR:
if (addr_mode == Accumulator)
{
auto prev_C = f_C;
f_C = r_A & 1;
r_A >>= 1;
//If Rotating, set the bit-7 to the previous carry
r_A = r_A | (prev_C && (op == ROR)) << 7;
setZN(r_A);
}
else
{
auto prev_C = f_C;
operand = m_bus.read(location);
f_C = operand & 1;
operand = operand >> 1 | (prev_C && (op == ROR)) << 7;
setZN(operand);
m_bus.write(location, operand);
}
break;
case STX:
m_bus.write(location, r_X);
break;
case LDX:
r_X = m_bus.read(location);
setZN(r_X);
break;
case DEC:
{
auto tmp = m_bus.read(location) - 1;
setZN(tmp);
m_bus.write(location, tmp);
}
break;
case INC:
{
auto tmp = m_bus.read(location) + 1;
setZN(tmp);
m_bus.write(location, tmp);
}
break;
default:
return false;
}
return true;
}
return false;
}
bool CPU::executeType0(Byte opcode)
{
if ((opcode & InstructionModeMask) == 0x0)
{
Address location = 0;
switch (static_cast<AddrMode2>((opcode & AddrModeMask) >> AddrModeShift))
{
case Immediate_:
location = r_PC++;
break;
case ZeroPage_:
location = m_bus.read(r_PC++);
break;
case Absolute_:
location = readAddress(r_PC);
r_PC += 2;
break;
case Indexed:
// Address wraps around in the zero page
location = (m_bus.read(r_PC++) + r_X) & 0xff;
break;
case AbsoluteIndexed:
location = readAddress(r_PC);
r_PC += 2;
setPageCrossed(location, location + r_X);
location += r_X;
break;
default:
return false;
}
std::uint16_t operand = 0;
switch (static_cast<Operation0>((opcode & OperationMask) >> OperationShift))
{
case BIT:
operand = m_bus.read(location);
f_Z = !(r_A & operand);
f_V = operand & 0x40;
f_N = operand & 0x80;
break;
case STY:
m_bus.write(location, r_Y);
break;
case LDY:
r_Y = m_bus.read(location);
setZN(r_Y);
break;
case CPY:
{
std::uint16_t diff = r_Y - m_bus.read(location);
f_C = !(diff & 0x100);
setZN(diff);
}
break;
case CPX:
{
std::uint16_t diff = r_X - m_bus.read(location);
f_C = !(diff & 0x100);
setZN(diff);
}
break;
default:
return false;
}
return true;
}
return false;
}
Address CPU::readAddress(Address addr)
{
return m_bus.read(addr) | m_bus.read(addr + 1) << 8;
}
};

126
SimpleNES/src/Cartridge.cpp Normal file
View file

@ -0,0 +1,126 @@
#include "Cartridge.h"
#include "Log.h"
#include <fstream>
#include <string>
namespace sn
{
Cartridge::Cartridge() :
m_nameTableMirroring(0),
m_mapperNumber(0),
m_extendedRAM(false)
{
}
const std::vector<Byte>& Cartridge::getROM()
{
return m_PRG_ROM;
}
const std::vector<Byte>& Cartridge::getVROM()
{
return m_CHR_ROM;
}
Byte Cartridge::getMapper()
{
return m_mapperNumber;
}
Byte Cartridge::getNameTableMirroring()
{
return m_nameTableMirroring;
}
bool Cartridge::hasExtendedRAM()
{
return m_extendedRAM;
}
bool Cartridge::loadFromFile(std::string path)
{
std::ifstream romFile (path, std::ios_base::binary | std::ios_base::in);
if (!romFile)
{
LOG(Error) << "Could not open ROM file from path: " << path << std::endl;
return false;
}
std::vector<Byte> header;
LOG(Info) << "Reading ROM from path: " << path << std::endl;
//Header
header.resize(0x10);
if (!romFile.read(reinterpret_cast<char*>(&header[0]), 0x10))
{
LOG(Error) << "Reading iNES header failed." << std::endl;
return false;
}
if (std::string{&header[0], &header[4]} != "NES\x1A")
{
LOG(Error) << "Not a valid iNES image. Magic number: "
<< std::hex << header[0] << " "
<< header[1] << " " << header[2] << " " << int(header[3]) << std::endl
<< "Valid magic number : N E S 1a" << std::endl;
return false;
}
LOG(Info) << "Reading header, it dictates: \n";
Byte banks = header[4];
LOG(Info) << "16KB PRG-ROM Banks: " << +banks << std::endl;
if (!banks)
{
LOG(Error) << "ROM has no PRG-ROM banks. Loading ROM failed." << std::endl;
return false;
}
Byte vbanks = header[5];
LOG(Info) << "8KB CHR-ROM Banks: " << +vbanks << std::endl;
m_nameTableMirroring = header[6] & 0xB;
LOG(Info) << "Name Table Mirroring: " << +m_nameTableMirroring << std::endl;
m_mapperNumber = ((header[6] >> 4) & 0xf) | (header[7] & 0xf0);
LOG(Info) << "Mapper #: " << +m_mapperNumber << std::endl;
m_extendedRAM = header[6] & 0x2;
LOG(Info) << "Extended (CPU) RAM: " << std::boolalpha << m_extendedRAM << std::endl;
if (header[6] & 0x4)
{
LOG(Error) << "Trainer is not supported." << std::endl;
return false;
}
if ((header[0xA] & 0x3) == 0x2 || (header[0xA] & 0x1))
{
LOG(Error) << "PAL ROM not supported." << std::endl;
return false;
}
else
LOG(Info) << "ROM is NTSC compatible.\n";
//PRG-ROM 16KB banks
m_PRG_ROM.resize(0x4000 * banks);
if (!romFile.read(reinterpret_cast<char*>(&m_PRG_ROM[0]), 0x4000 * banks))
{
LOG(Error) << "Reading PRG-ROM from image file failed." << std::endl;
return false;
}
//CHR-ROM 8KB banks
if (vbanks)
{
m_CHR_ROM.resize(0x2000 * vbanks);
if (!romFile.read(reinterpret_cast<char*>(&m_CHR_ROM[0]), 0x2000 * vbanks))
{
LOG(Error) << "Reading CHR-ROM from image file failed." << std::endl;
return false;
}
}
else
LOG(Info) << "Cartridge with CHR-RAM." << std::endl;
return true;
}
}

View file

@ -0,0 +1,52 @@
#include "Controller.h"
namespace sn
{
Controller::Controller() :
m_keyStates(0),
m_keyBindings(TotalButtons)
{
// m_keyBindings[A] = sf::Keyboard::J;
// m_keyBindings[B] = sf::Keyboard::K;
// m_keyBindings[Select] = sf::Keyboard::RShift;
// m_keyBindings[Start] = sf::Keyboard::Return;
// m_keyBindings[Up] = sf::Keyboard::W;
// m_keyBindings[Down] = sf::Keyboard::S;
// m_keyBindings[Left] = sf::Keyboard::A;
// m_keyBindings[Right] = sf::Keyboard::D;
}
void Controller::setKeyBindings(const std::vector<sf::Keyboard::Key>& keys)
{
m_keyBindings = keys;
}
void Controller::strobe(Byte b)
{
m_strobe = (b & 1);
if (!m_strobe)
{
m_keyStates = 0;
int shift = 0;
for (int button = A; button < TotalButtons; ++button)
{
m_keyStates |= (sf::Keyboard::isKeyPressed(m_keyBindings[static_cast<Buttons>(button)]) << shift);
++shift;
}
}
}
Byte Controller::read()
{
Byte ret;
if (m_strobe)
ret = sf::Keyboard::isKeyPressed(m_keyBindings[A]);
else
{
ret = (m_keyStates & 1);
m_keyStates >>= 1;
}
return ret | 0x40;
}
}

184
SimpleNES/src/Emulator.cpp Normal file
View file

@ -0,0 +1,184 @@
#include "Emulator.h"
#include "Log.h"
#include <thread>
#include <chrono>
namespace sn
{
Emulator::Emulator() :
m_cpu(m_bus),
m_ppu(m_pictureBus, m_emulatorScreen),
m_screenScale(2.f),
m_cycleTimer(),
m_cpuCycleDuration(std::chrono::nanoseconds(559))
{
if(!m_bus.setReadCallback(PPUSTATUS, [&](void) {return m_ppu.getStatus();}) ||
!m_bus.setReadCallback(PPUDATA, [&](void) {return m_ppu.getData();}) ||
!m_bus.setReadCallback(JOY1, [&](void) {return m_controller1.read();}) ||
!m_bus.setReadCallback(JOY2, [&](void) {return m_controller2.read();}) ||
!m_bus.setReadCallback(OAMDATA, [&](void) {return m_ppu.getOAMData();}))
{
LOG(Error) << "Critical error: Failed to set I/O callbacks" << std::endl;
}
if(!m_bus.setWriteCallback(PPUCTRL, [&](Byte b) {m_ppu.control(b);}) ||
!m_bus.setWriteCallback(PPUMASK, [&](Byte b) {m_ppu.setMask(b);}) ||
!m_bus.setWriteCallback(OAMADDR, [&](Byte b) {m_ppu.setOAMAddress(b);}) ||
!m_bus.setWriteCallback(PPUADDR, [&](Byte b) {m_ppu.setDataAddress(b);}) ||
!m_bus.setWriteCallback(PPUSCROL, [&](Byte b) {m_ppu.setScroll(b);}) ||
!m_bus.setWriteCallback(PPUDATA, [&](Byte b) {m_ppu.setData(b);}) ||
!m_bus.setWriteCallback(OAMDMA, [&](Byte b) {DMA(b);}) ||
!m_bus.setWriteCallback(JOY1, [&](Byte b) {m_controller1.strobe(b); m_controller2.strobe(b);}) ||
!m_bus.setWriteCallback(OAMDATA, [&](Byte b) {m_ppu.setOAMData(b);}))
{
LOG(Error) << "Critical error: Failed to set I/O callbacks" << std::endl;
}
m_ppu.setInterruptCallback([&](){ m_cpu.interrupt(CPU::NMI); });
}
void Emulator::run(std::string rom_path)
{
if (!m_cartridge.loadFromFile(rom_path))
return;
m_mapper = Mapper::createMapper(static_cast<Mapper::Type>(m_cartridge.getMapper()),
m_cartridge,
[&](){ m_pictureBus.updateMirroring(); });
if (!m_mapper)
{
LOG(Error) << "Creating Mapper failed. Probably unsupported." << std::endl;
return;
}
if (!m_bus.setMapper(m_mapper.get()) ||
!m_pictureBus.setMapper(m_mapper.get()))
return;
m_cpu.reset();
m_ppu.reset();
m_window.create(sf::VideoMode(NESVideoWidth * m_screenScale, NESVideoHeight * m_screenScale),
"SimpleNES", sf::Style::Titlebar | sf::Style::Close | sf::Style::Resize);
m_window.setVerticalSyncEnabled(true);
m_emulatorScreen.create(NESVideoWidth, NESVideoHeight, m_screenScale, sf::Color::White);
m_cycleTimer = std::chrono::high_resolution_clock::now();
m_elapsedTime = m_cycleTimer - m_cycleTimer;
sf::Event event;
bool focus = true, pause = false;
while (m_window.isOpen())
{
while (m_window.pollEvent(event))
{
if (event.type == sf::Event::Closed ||
(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape))
{
m_window.close();
return;
}
else if (event.type == sf::Event::GainedFocus)
{
focus = true;
m_cycleTimer = std::chrono::high_resolution_clock::now();
}
else if (event.type == sf::Event::LostFocus)
focus = false;
else if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::F2)
{
pause = !pause;
if (!pause)
m_cycleTimer = std::chrono::high_resolution_clock::now();
}
else if (pause && event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::F3)
{
for (int i = 0; i < 29781; ++i) //Around one frame
{
//PPU
m_ppu.step();
m_ppu.step();
m_ppu.step();
//CPU
m_cpu.step();
}
}
else if (focus && event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::F4)
{
Log::get().setLevel(Info);
}
else if (focus && event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::F5)
{
Log::get().setLevel(InfoVerbose);
}
else if (focus && event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::F6)
{
Log::get().setLevel(CpuTrace);
}
}
if (focus && !pause)
{
m_elapsedTime += std::chrono::high_resolution_clock::now() - m_cycleTimer;
m_cycleTimer = std::chrono::high_resolution_clock::now();
while (m_elapsedTime > m_cpuCycleDuration)
{
//PPU
m_ppu.step();
m_ppu.step();
m_ppu.step();
//CPU
m_cpu.step();
m_elapsedTime -= m_cpuCycleDuration;
}
m_window.draw(m_emulatorScreen);
m_window.display();
}
else
{
sf::sleep(sf::milliseconds(1000/60));
//std::this_thread::sleep_for(std::chrono::milliseconds(1000/60)); //1/60 second
}
}
}
void Emulator::DMA(Byte page)
{
m_cpu.skipDMACycles();
auto page_ptr = m_bus.getPagePtr(page);
m_ppu.doDMA(page_ptr);
}
void Emulator::setVideoHeight(int height)
{
m_screenScale = height / float(NESVideoHeight);
LOG(Info) << "Scale: " << m_screenScale << " set. Screen: "
<< int(NESVideoWidth * m_screenScale) << "x" << int(NESVideoHeight * m_screenScale) << std::endl;
}
void Emulator::setVideoWidth(int width)
{
m_screenScale = width / float(NESVideoWidth);
LOG(Info) << "Scale: " << m_screenScale << " set. Screen: "
<< int(NESVideoWidth * m_screenScale) << "x" << int(NESVideoHeight * m_screenScale) << std::endl;
}
void Emulator::setVideoScale(float scale)
{
m_screenScale = scale;
LOG(Info) << "Scale: " << m_screenScale << " set. Screen: "
<< int(NESVideoWidth * m_screenScale) << "x" << int(NESVideoHeight * m_screenScale) << std::endl;
}
void Emulator::setKeys(std::vector<sf::Keyboard::Key>& p1, std::vector<sf::Keyboard::Key>& p2)
{
m_controller1.setKeyBindings(p1);
m_controller2.setKeyBindings(p2);
}
}

View file

@ -0,0 +1,184 @@
#include <string>
#include <vector>
#include <fstream>
#include <algorithm>
#include <cctype>
#include "Controller.h"
#include "Log.h"
namespace sn
{
// trim from start (construct new string)
inline std::string ltrim(const std::string &str)
{
std::string s(str);
s.erase(s.begin(), std::find_if_not<decltype(s.begin()), int(int)>(s.begin(), s.end(),
std::isspace));
return s;
}
// trim from end (construct new string)
inline std::string rtrim(const std::string &str)
{
std::string s(str);
s.erase(std::find_if_not<decltype(s.rbegin()), int(int)>(s.rbegin(), s.rend(),
std::isspace).base(), s.end());
return s;
}
void parseControllerConf(std::string filepath,
std::vector<sf::Keyboard::Key>& p1,
std::vector<sf::Keyboard::Key>& p2)
{
const std::string buttonStrings[] = { "A",
"B",
"Select",
"Start",
"Up",
"Down",
"Left",
"Right" };
const std::string keys[] = {"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"Num0",
"Num1",
"Num2",
"Num3",
"Num4",
"Num5",
"Num6",
"Num7",
"Num8",
"Num9",
"Escape",
"LControl",
"LShift",
"LAlt",
"LSystem",
"RControl",
"RShift",
"RAlt",
"RSystem",
"Menu",
"LBracket",
"RBracket",
"SemiColon",
"Comma",
"Period",
"Quote",
"Slash",
"BackSlash",
"Tilde",
"Equal",
"Dash",
"Space",
"Return",
"BackSpace",
"Tab",
"PageUp",
"PageDown",
"End",
"Home",
"Insert",
"Delete",
"Add",
"Subtract",
"Multiply",
"Divide",
"Left",
"Right",
"Up",
"Down",
"Numpad0",
"Numpad1",
"Numpad2",
"Numpad3",
"Numpad4",
"Numpad5",
"Numpad6",
"Numpad7",
"Numpad8",
"Numpad9",
"F1",
"F2",
"F3",
"F4",
"F5",
"F6",
"F7",
"F8",
"F9",
"F10",
"F11",
"F12",
"F13",
"F14",
"F15",
"Pause"
};
std::ifstream file(filepath);
std::string line;
enum { Player1, Player2, None } state;
unsigned int line_no = 0;
while (std::getline(file, line))
{
line = rtrim(ltrim(line));
if (line[0] == '#' || line.empty())
continue;
else if (line == "[Player1]")
{
state = Player1;
}
else if (line == "[Player2]")
{
state = Player2;
}
else if (state == Player1 || state == Player2)
{
auto divider = line.find("=");
auto it = std::find(std::begin(buttonStrings), std::end(buttonStrings), ltrim(rtrim(line.substr(0, divider)))),
it2 = std::find(std::begin(keys), std::end(keys), ltrim(rtrim(line.substr(divider + 1))));
if (it == std::end(buttonStrings) || it2 == std::end(keys))
{
LOG(Error) << "Invalid key in configuration file at Line " << line_no << std::endl;
continue;
}
auto i = std::distance(std::begin(buttonStrings), it);
auto key = std::distance(std::begin(keys), it2);
(state == Player1 ? p1 : p2)[i] = static_cast<sf::Keyboard::Key>(key);
}
else
LOG(Error) << "Invalid line in key configuration at Line " << line_no << std::endl;
++line_no;
}
}
}

77
SimpleNES/src/Log.cpp Normal file
View file

@ -0,0 +1,77 @@
#include "Log.h"
namespace sn
{
Log::~Log()
{
}
Log& Log::get()
{
static Log instance;
return instance;
}
std::ostream& Log::getCpuTraceStream()
{
return *m_cpuTrace;
}
std::ostream& Log::getStream()
{
return *m_logStream;
}
void Log::setLogStream(std::ostream& stream)
{
m_logStream = &stream;
}
void Log::setCpuTraceStream(std::ostream& stream)
{
m_cpuTrace = &stream;
}
Log& Log::setLevel(Level level)
{
m_logLevel = level;
return *this;
}
Level Log::getLevel()
{
return m_logLevel;
}
TeeBuf::TeeBuf(std::streambuf * sb1, std::streambuf * sb2) :
m_sb1(sb1),
m_sb2(sb2)
{}
int TeeBuf::overflow(int c)
{
if (c == EOF)
{
return !EOF;
}
else
{
int const r1 = m_sb1->sputc(c);
int const r2 = m_sb2->sputc(c);
return r1 == EOF || r2 == EOF ? EOF : c;
}
}
int TeeBuf::sync()
{
int const r1 = m_sb1->pubsync();
int const r2 = m_sb2->pubsync();
return r1 == 0 && r2 == 0 ? 0 : -1;
}
TeeStream::TeeStream(std::ostream& o1, std::ostream& o2) :
std::ostream(&m_tbuf),
m_tbuf(o1.rdbuf(), o2.rdbuf())
{}
}

168
SimpleNES/src/MainBus.cpp Normal file
View file

@ -0,0 +1,168 @@
#include "MainBus.h"
#include <cstring>
#include "Log.h"
namespace sn
{
MainBus::MainBus() :
m_RAM(0x800, 0),
m_mapper(nullptr)
{
}
Byte MainBus::read(Address addr)
{
if (addr < 0x2000)
return m_RAM[addr & 0x7ff];
else if (addr < 0x4020)
{
if (addr < 0x4000) //PPU registers, mirrored
{
auto it = m_readCallbacks.find(static_cast<IORegisters>(addr & 0x2007));
if (it != m_readCallbacks.end())
return (it -> second)();
//Second object is the pointer to the function object
//Dereference the function pointer and call it
else
LOG(InfoVerbose) << "No read callback registered for I/O register at: " << std::hex << +addr << std::endl;
}
else if (addr < 0x4018 && addr >= 0x4014) //Only *some* IO registers
{
auto it = m_readCallbacks.find(static_cast<IORegisters>(addr));
if (it != m_readCallbacks.end())
return (it -> second)();
//Second object is the pointer to the function object
//Dereference the function pointer and call it
else
LOG(InfoVerbose) << "No read callback registered for I/O register at: " << std::hex << +addr << std::endl;
}
else
LOG(InfoVerbose) << "Read access attempt at: " << std::hex << +addr << std::endl;
}
else if (addr < 0x6000)
{
LOG(InfoVerbose) << "Expansion ROM read attempted. This is currently unsupported" << std::endl;
}
else if (addr < 0x8000)
{
if (m_mapper->hasExtendedRAM())
{
return m_extRAM[addr - 0x6000];
}
}
else
{
return m_mapper->readPRG(addr);
}
return 0;
}
void MainBus::write(Address addr, Byte value)
{
if (addr < 0x2000)
m_RAM[addr & 0x7ff] = value;
else if (addr < 0x4020)
{
if (addr < 0x4000) //PPU registers, mirrored
{
auto it = m_writeCallbacks.find(static_cast<IORegisters>(addr & 0x2007));
if (it != m_writeCallbacks.end())
(it -> second)(value);
//Second object is the pointer to the function object
//Dereference the function pointer and call it
else
LOG(InfoVerbose) << "No write callback registered for I/O register at: " << std::hex << +addr << std::endl;
}
else if (addr < 0x4017 && addr >= 0x4014) //only some registers
{
auto it = m_writeCallbacks.find(static_cast<IORegisters>(addr));
if (it != m_writeCallbacks.end())
(it -> second)(value);
//Second object is the pointer to the function object
//Dereference the function pointer and call it
else
LOG(InfoVerbose) << "No write callback registered for I/O register at: " << std::hex << +addr << std::endl;
}
else
LOG(InfoVerbose) << "Write access attmept at: " << std::hex << +addr << std::endl;
}
else if (addr < 0x6000)
{
LOG(InfoVerbose) << "Expansion ROM access attempted. This is currently unsupported" << std::endl;
}
else if (addr < 0x8000)
{
if (m_mapper->hasExtendedRAM())
{
m_extRAM[addr - 0x6000] = value;
}
}
else
{
m_mapper->writePRG(addr, value);
}
}
const Byte* MainBus::getPagePtr(Byte page)
{
Address addr = page << 8;
if (addr < 0x2000)
return &m_RAM[addr & 0x7ff];
else if (addr < 0x4020)
{
LOG(Error) << "Register address memory pointer access attempt" << std::endl;
}
else if (addr < 0x6000)
{
LOG(Error) << "Expansion ROM access attempted, which is unsupported" << std::endl;
}
else if (addr < 0x8000)
{
if (m_mapper->hasExtendedRAM())
{
return &m_extRAM[addr - 0x6000];
}
}
else
{
}
return nullptr;
}
bool MainBus::setMapper(Mapper* mapper)
{
m_mapper = mapper;
if (!mapper)
{
LOG(Error) << "Mapper pointer is nullptr" << std::endl;
return false;
}
if (mapper->hasExtendedRAM())
m_extRAM.resize(0x2000);
return true;
}
bool MainBus::setWriteCallback(IORegisters reg, std::function<void(Byte)> callback)
{
if (!callback)
{
LOG(Error) << "callback argument is nullptr" << std::endl;
return false;
}
return m_writeCallbacks.emplace(reg, callback).second;
}
bool MainBus::setReadCallback(IORegisters reg, std::function<Byte(void)> callback)
{
if (!callback)
{
LOG(Error) << "callback argument is nullptr" << std::endl;
return false;
}
return m_readCallbacks.emplace(reg, callback).second;
}
};

52
SimpleNES/src/Mapper.cpp Normal file
View file

@ -0,0 +1,52 @@
#include "Mapper.h"
#include "MapperNROM.h"
#include "MapperSxROM.h"
#include "MapperMMC3.h"
#include "MapperUxROM.h"
#include "MapperCNROM.h"
#include "MapperAxROM.h"
#include "Mapper11.h"
#include "MapperGxROM.h"
namespace sn
{
NameTableMirroring Mapper::getNameTableMirroring()
{
return static_cast<NameTableMirroring>(m_cartridge.getNameTableMirroring());
}
std::unique_ptr<Mapper> Mapper::createMapper(Mapper::Type mapper_t, sn::Cartridge& cart, std::function<void(void)> mirroring_cb)
{
std::unique_ptr<Mapper> ret(nullptr);
switch (mapper_t)
{
case NROM:
ret.reset(new MapperNROM(cart));
break;
case SxROM:
ret.reset(new MapperSxROM(cart, mirroring_cb));
break;
case UxROM:
ret.reset(new MapperUxROM(cart));
break;
case CNROM:
ret.reset(new MapperCNROM(cart));
break;
case MMC3:
ret.reset(new MapperMMC3(cart,mirroring_cb));
break;
case AxROM:
ret.reset(new MapperAxROM(cart,mirroring_cb));
break;
case ColorDreams:
ret.reset(new Mapper11(cart,mirroring_cb));
break;
case GxROM:
ret.reset(new MapperGxROM(cart,mirroring_cb));
break;
default:
break;
}
return ret;
}
}

View file

@ -0,0 +1,60 @@
#include "Mapper11.h"
#include "Log.h"
namespace sn
{
Mapper11::Mapper11(Cartridge &cart,std::function<void(void)> mirroring_cb) :
Mapper(cart, Mapper::ColorDreams),
m_mirroringCallback(mirroring_cb),
m_mirroring(Vertical)
{}
Byte Mapper11::readPRG(Address address)
{
if (address >= 0x8000 )
{
return m_cartridge.getROM()[(prgbank * 0x8000) + address & 0x7fff];
}
}
void Mapper11::writePRG(Address address, Byte value)
{
if (address >= 0x8000)
{
prgbank = ((value >> 0) & 0x3);
chrbank = ((value >> 4) & 0xF);
}
}
Byte Mapper11::readCHR(Address address)
{
if (address <= 0x1FFF)
{
return m_cartridge.getVROM()[(chrbank * 0x2000) + address];
}
}
NameTableMirroring Mapper11::getNameTableMirroring()
{
return m_mirroring;
}
void Mapper11::writeCHR(Address address, Byte value)
{}
const Byte *Mapper11::getPagePtr(Address address)
{}
}

View file

@ -0,0 +1,91 @@
#include "MapperAxROM.h"
#include "Log.h"
namespace sn
{
MapperAxROM::MapperAxROM(Cartridge &cart, std::function<void(void)> mirroring_cb) :
Mapper(cart, Mapper::AxROM),
m_mirroringCallback(mirroring_cb),
m_mirroring(OneScreenLower)
{
if (cart.getROM().size() >= 0x8000)
{
LOG(Info) << "Using PRG-ROM OK" << std::endl;
}
if (cart.getVROM().size() <= 0x2000)
{
m_characterRAM.resize(0x2000);
m_ppubus.m_RAM.resize(0x400);
std::cout << "Uses Character RAM OK" << std::endl;
for (int i = 0; i < 0x2000; i++)
{
m_characterRAM[i] = 0;
//CHR RESET
}
for (int i = 0; i < 0x400; i++)
{
m_ppubus.m_RAM[i] = 0;
//PPU RAM RESET
}
}
}
Byte MapperAxROM::readPRG(Address address)
{
if (address >= 0x8000)
{
return m_cartridge.getROM()[PRGBank * 0x8000 + (address & 0x7FFF)];
}
}
const Byte *MapperAxROM::getPagePtr(Address address)
{
if (address >= 0x8000)
{
return &m_cartridge.getROM()[PRGBank * 0x8000 + (address & 0x7FFF)];
}
}
void MapperAxROM::writePRG(Address address, Byte value)
{
if (address >= 0x8000)
{
PRGBank = value & 0x07;
m_mirroring = value & 0x10 ? OneScreenHigher : OneScreenLower;
}
m_mirroringCallback();
}
NameTableMirroring MapperAxROM::getNameTableMirroring()
{
return m_mirroring;
}
Byte MapperAxROM::readCHR(Address address)
{
if (address < 0x2000)
{
return m_characterRAM[address];
}
}
void MapperAxROM::writeCHR(Address address, Byte value)
{
if (address < 0x2000)
{
m_characterRAM[address] = value;
}
}
}

View file

@ -0,0 +1,50 @@
#include "MapperCNROM.h"
#include "Log.h"
namespace sn
{
MapperCNROM::MapperCNROM(Cartridge &cart) :
Mapper(cart, Mapper::CNROM),
m_selectCHR(0)
{
if (cart.getROM().size() == 0x4000) //1 bank
{
m_oneBank = true;
}
else //2 banks
{
m_oneBank = false;
}
}
Byte MapperCNROM::readPRG(Address addr)
{
if (!m_oneBank)
return m_cartridge.getROM()[addr - 0x8000];
else //mirrored
return m_cartridge.getROM()[(addr - 0x8000) & 0x3fff];
}
void MapperCNROM::writePRG(Address addr, Byte value)
{
m_selectCHR = value & 0x3;
}
const Byte* MapperCNROM::getPagePtr(Address addr)
{
if (!m_oneBank)
return &m_cartridge.getROM()[addr - 0x8000];
else //mirrored
return &m_cartridge.getROM()[(addr - 0x8000) & 0x3fff];
}
Byte MapperCNROM::readCHR(Address addr)
{
return m_cartridge.getVROM()[addr | (m_selectCHR << 13)];
}
void MapperCNROM::writeCHR(Address addr, Byte value)
{
LOG(Info) << "Read-only CHR memory write attempt at " << std::hex << addr << std::endl;
}
}

View file

@ -0,0 +1,52 @@
#include "MapperGxROM.h"
#include "Log.h"
namespace sn
{
MapperGxROM::MapperGxROM(Cartridge &cart, std::function<void(void)> mirroring_cb) :
Mapper(cart, Mapper::GxROM),
m_mirroringCallback(mirroring_cb),
m_mirroring(Vertical){}
Byte MapperGxROM::readPRG(Address address)
{
if (address >= 0x8000)
{
return m_cartridge.getROM()[(prgbank * 0x8000) + (address & 0x7fff)];
}
}
void MapperGxROM::writePRG(Address address, Byte value)
{
int v;
if (address >= 0x8000)
{
prgbank = ((value & 0x30) >> 4);
chrbank = (value & 0x3);
m_mirroring = Vertical;
}
m_mirroringCallback();
}
Byte MapperGxROM::readCHR(Address address)
{
if (address <= 0x1FFF)
{
return m_cartridge.getVROM()[chrbank * 0x2000 + address];
}
}
NameTableMirroring MapperGxROM::getNameTableMirroring()
{
return m_mirroring;
}
void MapperGxROM::writeCHR(Address address, Byte value)
{
m_cartridge.getVROM()[chrbank + address, value];
}
const Byte *MapperGxROM::getPagePtr(Address address)
{
}
}

View file

@ -0,0 +1,283 @@
#include "MapperMMC3.h"
namespace sn
{
MapperMMC3::MapperMMC3(Cartridge &cart, std::function<void(void)> mirroring_cb) :
Mapper(cart, Mapper::MMC3),
m_mirroringCallback(mirroring_cb),
mirrormode(Horizontal),
nTargetRegister(0),
bPRGBankMode(false),
bCHRInversion(false),
bIRQActive(false),
bIRQEnable(false),
nIRQCounter(0),
nIRQReload(0),
lastread(0),
banks(0)
{
ramstatic.resize(32 * 1024);
prgbank0 = &cart.getROM()[cart.getROM().size() - 0x4000];
prgbank1 = &cart.getROM()[cart.getROM().size() - 0x2000];
prgbank2 = &cart.getROM()[cart.getROM().size() - 0x4000];
prgbank3 = &cart.getROM()[cart.getROM().size() - 0x2000];
chrbank0 = &cart.getVROM()[cart.getVROM().size() * 0x800];
chrbank1 = &cart.getVROM()[cart.getVROM().size() * 0x800];
chrbank2 = &cart.getVROM()[cart.getVROM().size() * 0x400];
chrbank3 = &cart.getVROM()[cart.getVROM().size() * 0x400];
chrbank4 = &cart.getVROM()[cart.getVROM().size() * 0x400];
chrbank5 = &cart.getVROM()[cart.getVROM().size() * 0x400];
chrbank6 = &cart.getVROM()[cart.getVROM().size() * 0x400];
chrbank7 = &cart.getVROM()[cart.getVROM().size() * 0x400];
}
Byte MapperMMC3::readPRG(Address addr)
{
if (addr >= 0x6000 && addr <= 0x7FFF)
{
return ramstatic[addr & 0x1fff];
Byte &value = ramstatic[addr & 0x1FFF];
}
if (addr >= 0x8000 && addr <= 0x9FFF)
{
return *(prgbank0 + (addr & 0x1fff));
}
if (addr >= 0xA000 && addr <= 0xBFFF)
{
return *(prgbank1 + (addr & 0x1fff));
}
if (addr >= 0xC000 && addr <= 0xDFFF)
{
return *(prgbank2 + (addr & 0x1fff));
}
if (addr >= 0xE000 && addr <= 0xFFFF)
{
return *(prgbank3 + (addr & 0x1fff));
}
}
Byte MapperMMC3::readCHR(Address addr)
{
if (addr >= 0x0000 && addr <= 0x03FF)
{
return *(chrbank0 + (addr & 0x03ff));
}
if (addr >= 0x0400 && addr <= 0x07FF)
{
return *(chrbank1 + (addr & 0x03ff));
}
if (addr >= 0x0800 && addr <= 0x0BFF)
{
return *(chrbank2 + (addr & 0x03ff));
}
if (addr >= 0x0C00 && addr <= 0x0FFF)
{
return *(chrbank3 + (addr & 0x03ff));
}
if (addr >= 0x1000 && addr <= 0x13FF)
{
return *(chrbank4 + (addr & 0x03ff));
}
if (addr >= 0x1400 && addr <= 0x17FF)
{
return *(chrbank5 + (addr & 0x03ff));
}
if (addr >= 0x1800 && addr <= 0x1BFF)
{
return *(chrbank6 + (addr & 0x03ff));
}
if (addr >= 0x1C00 && addr <= 0x1FFF)
{
return *(chrbank7 + (addr & 0x03ff));
}
}
void MapperMMC3::writePRG(Address addr, Byte value)
{
if (addr >= 0x6000 && addr <= 0x7FFF)
{
ramstatic[addr & 0x1fff];
ramstatic[addr & 0x1FFF] = value;
return;
}
if (addr >= 0x8000 && addr <= 0x9FFF)
{
// Bank Select
if (!(addr & 0x01))
{
nTargetRegister = value & 0x7;
bPRGBankMode = (value & 0x40);
bCHRInversion = (value & 0x80);
}
else
{
pRegister[nTargetRegister] = value;
if (bCHRInversion == 0)
{
chrbank0 = &m_cartridge.getVROM()[(pRegister[0] & 0xFE) * 0x0400];
chrbank1 = &m_cartridge.getVROM()[pRegister[0] * 0x0400 + 0x0400];
chrbank2 = &m_cartridge.getVROM()[(pRegister[1] & 0xFE) * 0x0400];
chrbank3 = &m_cartridge.getVROM()[pRegister[1] * 0x0400 + 0x0400];
chrbank4 = &m_cartridge.getVROM()[pRegister[2] * 0x0400];
chrbank5 = &m_cartridge.getVROM()[pRegister[3] * 0x0400];
chrbank6 = &m_cartridge.getVROM()[pRegister[4] * 0x0400];
chrbank7 = &m_cartridge.getVROM()[pRegister[5] * 0x0400];
}
else if (bCHRInversion == 1)
{
chrbank0 = &m_cartridge.getVROM()[pRegister[2] * 0x0400];
chrbank1 = &m_cartridge.getVROM()[pRegister[3] * 0x0400];
chrbank2 = &m_cartridge.getVROM()[pRegister[4] * 0x0400];
chrbank3 = &m_cartridge.getVROM()[pRegister[5] * 0x0400];
chrbank4 = &m_cartridge.getVROM()[(pRegister[0] & 0xFE) * 0x0400];
chrbank5 = &m_cartridge.getVROM()[pRegister[0] * 0x0800 + 0x0400];
chrbank6 = &m_cartridge.getVROM()[(pRegister[1] & 0xFE) * 0x0400];
chrbank7 = &m_cartridge.getVROM()[pRegister[1] * 0x0400 + 0x0400];
}
if (bPRGBankMode == 0)
{
prgbank0 = &m_cartridge.getROM()[(pRegister[6] & 0x3F) * 0x2000];
} else if(bPRGBankMode == 1){
prgbank2 = &m_cartridge.getROM()[(pRegister[6] & 0x3F) * 0x2000];
}
prgbank1 = &m_cartridge.getROM()[(pRegister[7] & 0x3F) * 0x2000];
}
}
if (addr >= 0xA000 && addr <= 0xBFFF)
{
if (!(addr & 0x01))
{
// Mirroring
if (value & 0x01)
{
mirrormode = NameTableMirroring::Horizontal;
}
else
{
mirrormode = NameTableMirroring::Vertical;
}
m_mirroringCallback();
}
else
{
// PRG Ram Protect
}
}
if (addr >= 0xC000 && addr <= 0xDFFF)
{
if (!(addr & 0x01))
{
nIRQReload = value;
}
else
{
nIRQCounter = 0;
}
}
if (addr >= 0xE000 && addr <= 0xFFFF)
{
if (!(addr & 0x01))
{
bIRQEnable = false;
bIRQActive = false;
}
else
{
bIRQEnable = true;
}
}
}
void MapperMMC3::writeCHR(Address addr, Byte value)
{}
bool MapperMMC3::irqState()
{
return bIRQActive;
}
void MapperMMC3::irqClear()
{
bIRQActive = false;
}
void MapperMMC3::scanline()
{
if (nIRQCounter == 0)
{
nIRQCounter = nIRQReload;
}
else
nIRQCounter--;
if (nIRQCounter == 0 && bIRQEnable)
{
bIRQActive = true;
}
}
NameTableMirroring MapperMMC3::getNameTableMirroring()
{
return mirrormode;
}
const Byte *MapperMMC3::getPagePtr(Address addr)
{}
} // namespace sn

View file

@ -0,0 +1,64 @@
#include "MapperNROM.h"
#include "Log.h"
namespace sn
{
MapperNROM::MapperNROM(Cartridge &cart) :
Mapper(cart, Mapper::NROM)
{
if (cart.getROM().size() == 0x4000) //1 bank
{
m_oneBank = true;
}
else //2 banks
{
m_oneBank = false;
}
if (cart.getVROM().size() == 0)
{
m_usesCharacterRAM = true;
m_characterRAM.resize(0x2000);
LOG(Info) << "Uses character RAM" << std::endl;
}
else
m_usesCharacterRAM = false;
}
Byte MapperNROM::readPRG(Address addr)
{
if (!m_oneBank)
return m_cartridge.getROM()[addr - 0x8000];
else //mirrored
return m_cartridge.getROM()[(addr - 0x8000) & 0x3fff];
}
void MapperNROM::writePRG(Address addr, Byte value)
{
LOG(InfoVerbose) << "ROM memory write attempt at " << +addr << " to set " << +value << std::endl;
}
const Byte* MapperNROM::getPagePtr(Address addr)
{
if (!m_oneBank)
return &m_cartridge.getROM()[addr - 0x8000];
else //mirrored
return &m_cartridge.getROM()[(addr - 0x8000) & 0x3fff];
}
Byte MapperNROM::readCHR(Address addr)
{
if (m_usesCharacterRAM)
return m_characterRAM[addr];
else
return m_cartridge.getVROM()[addr];
}
void MapperNROM::writeCHR(Address addr, Byte value)
{
if (m_usesCharacterRAM)
m_characterRAM[addr] = value;
else
LOG(Info) << "Read-only CHR memory write attempt at " << std::hex << addr << std::endl;
}
}

View file

@ -0,0 +1,173 @@
#include "MapperSxROM.h"
#include "Log.h"
namespace sn
{
MapperSxROM::MapperSxROM(Cartridge &cart, std::function<void(void)> mirroring_cb) :
Mapper(cart, Mapper::SxROM),
m_mirroringCallback(mirroring_cb),
m_mirroing(Horizontal),
m_modeCHR(0),
m_modePRG(3),
m_tempRegister(0),
m_writeCounter(0),
m_regPRG(0),
m_regCHR0(0),
m_regCHR1(0),
m_firstBankPRG(nullptr),
m_secondBankPRG(nullptr),
m_firstBankCHR(nullptr),
m_secondBankCHR(nullptr)
{
if (cart.getVROM().size() == 0)
{
m_usesCharacterRAM = true;
m_characterRAM.resize(0x2000);
LOG(Info) << "Uses character RAM" << std::endl;
}
else
{
LOG(Info) << "Using CHR-ROM" << std::endl;
m_usesCharacterRAM = false;
m_firstBankCHR = &cart.getVROM()[0];
m_secondBankCHR = &cart.getVROM()[0x1000 * m_regCHR1];
}
m_firstBankPRG = &cart.getROM()[0]; //first bank
m_secondBankPRG = &cart.getROM()[cart.getROM().size() - 0x4000/*0x2000 * 0x0e*/]; //last bank
}
Byte MapperSxROM::readPRG(Address addr)
{
if (addr < 0xc000)
return *(m_firstBankPRG + (addr & 0x3fff));
else
return *(m_secondBankPRG + (addr & 0x3fff));
}
NameTableMirroring MapperSxROM::getNameTableMirroring()
{
return m_mirroing;
}
void MapperSxROM::writePRG(Address addr, Byte value)
{
if (!(value & 0x80)) //if reset bit is NOT set
{
m_tempRegister = (m_tempRegister >> 1) | ((value & 1) << 4);
++m_writeCounter;
if (m_writeCounter == 5)
{
if (addr <= 0x9fff)
{
switch (m_tempRegister & 0x3)
{
case 0: m_mirroing = OneScreenLower; break;
case 1: m_mirroing = OneScreenHigher; break;
case 2: m_mirroing = Vertical; break;
case 3: m_mirroing = Horizontal; break;
}
m_mirroringCallback();
m_modeCHR = (m_tempRegister & 0x10) >> 4;
m_modePRG = (m_tempRegister & 0xc) >> 2;
calculatePRGPointers();
//Recalculate CHR pointers
if (m_modeCHR == 0) //one 8KB bank
{
m_firstBankCHR = &m_cartridge.getVROM()[0x1000 * (m_regCHR0 | 1)]; //ignore last bit
m_secondBankCHR = m_firstBankCHR + 0x1000;
}
else //two 4KB banks
{
m_firstBankCHR = &m_cartridge.getVROM()[0x1000 * m_regCHR0];
m_secondBankCHR = &m_cartridge.getVROM()[0x1000 * m_regCHR1];
}
}
else if (addr <= 0xbfff) //CHR Reg 0
{
m_regCHR0 = m_tempRegister;
m_firstBankCHR = &m_cartridge.getVROM()[0x1000 * (m_tempRegister | (1 - m_modeCHR))]; //OR 1 if 8KB mode
if (m_modeCHR == 0)
m_secondBankCHR = m_firstBankCHR + 0x1000;
}
else if (addr <= 0xdfff)
{
m_regCHR1 = m_tempRegister;
if(m_modeCHR == 1)
m_secondBankCHR = &m_cartridge.getVROM()[0x1000 * m_tempRegister];
}
else
{
//TODO PRG-RAM
if ((m_tempRegister & 0x10) == 0x10)
{
LOG(Info) << "PRG-RAM activated" << std::endl;
}
m_tempRegister &= 0xf;
m_regPRG = m_tempRegister;
calculatePRGPointers();
}
m_tempRegister = 0;
m_writeCounter = 0;
}
}
else //reset
{
m_tempRegister = 0;
m_writeCounter = 0;
m_modePRG = 3;
calculatePRGPointers();
}
}
void MapperSxROM::calculatePRGPointers()
{
if (m_modePRG <= 1) //32KB changeable
{
// equivalent to multiplying 0x8000 * (m_regPRG >> 1)
m_firstBankPRG = &m_cartridge.getROM()[0x4000 * (m_regPRG & ~1)];
m_secondBankPRG = m_firstBankPRG + 0x4000; //add 16KB
}
else if (m_modePRG == 2) //fix first switch second
{
m_firstBankPRG = &m_cartridge.getROM()[0];
m_secondBankPRG = m_firstBankPRG + 0x4000 * m_regPRG;
}
else //switch first fix second
{
m_firstBankPRG = &m_cartridge.getROM()[0x4000 * m_regPRG];
m_secondBankPRG = &m_cartridge.getROM()[m_cartridge.getROM().size() - 0x4000/*0x2000 * 0x0e*/];
}
}
const Byte* MapperSxROM::getPagePtr(Address addr)
{
if (addr < 0xc000)
return (m_firstBankPRG + (addr & 0x3fff));
else
return (m_secondBankPRG + (addr & 0x3fff));
}
Byte MapperSxROM::readCHR(Address addr)
{
if (m_usesCharacterRAM)
return m_characterRAM[addr];
else if (addr < 0x1000)
return *(m_firstBankCHR + addr);
else
return *(m_secondBankCHR + (addr & 0xfff));
}
void MapperSxROM::writeCHR(Address addr, Byte value)
{
if (m_usesCharacterRAM)
m_characterRAM[addr] = value;
else
LOG(Info) << "Read-only CHR memory write attempt at " << std::hex << addr << std::endl;
}
}

View file

@ -0,0 +1,58 @@
#include "MapperUxROM.h"
#include "Log.h"
namespace sn
{
MapperUxROM::MapperUxROM(Cartridge &cart) :
Mapper(cart, Mapper::UxROM),
m_selectPRG(0)
{
if (cart.getVROM().size() == 0)
{
m_usesCharacterRAM = true;
m_characterRAM.resize(0x2000);
LOG(Info) << "Uses character RAM" << std::endl;
}
else
m_usesCharacterRAM = false;
m_lastBankPtr = &cart.getROM()[cart.getROM().size() - 0x4000]; //last - 16KB
}
Byte MapperUxROM::readPRG(Address addr)
{
if (addr < 0xc000)
return m_cartridge.getROM()[((addr - 0x8000) & 0x3fff) | (m_selectPRG << 14)];
else
return *(m_lastBankPtr + (addr & 0x3fff));
}
void MapperUxROM::writePRG(Address addr, Byte value)
{
m_selectPRG = value;
}
const Byte* MapperUxROM::getPagePtr(Address addr)
{
if (addr < 0xc000)
return &m_cartridge.getROM()[((addr - 0x8000) & 0x3fff) | (m_selectPRG << 14)];
else
return m_lastBankPtr + (addr & 0x3fff);
}
Byte MapperUxROM::readCHR(Address addr)
{
if (m_usesCharacterRAM)
return m_characterRAM[addr];
else
return m_cartridge.getVROM()[addr];
}
void MapperUxROM::writeCHR(Address addr, Byte value)
{
if (m_usesCharacterRAM)
m_characterRAM[addr] = value;
else
LOG(Info) << "Read-only CHR memory write attempt at " << std::hex << addr << std::endl;
}
}

432
SimpleNES/src/PPU.cpp Normal file
View file

@ -0,0 +1,432 @@
#include "PPU.h"
#include "Log.h"
namespace sn
{
PPU::PPU(PictureBus& bus, VirtualScreen& screen) :
m_bus(bus),
m_screen(screen),
m_spriteMemory(64 * 4),
m_pictureBuffer(ScanlineVisibleDots, std::vector<sf::Color>(VisibleScanlines, sf::Color::Magenta))
{}
void PPU::reset()
{
m_longSprites = m_generateInterrupt = m_greyscaleMode = m_vblank = false;
m_showBackground = m_showSprites = m_evenFrame = m_firstWrite = true;
m_bgPage = m_sprPage = Low;
m_dataAddress = m_cycle = m_scanline = m_spriteDataAddress = m_fineXScroll = m_tempAddress = 0;
//m_baseNameTable = 0x2000;
m_dataAddrIncrement = 1;
m_pipelineState = PreRender;
m_scanlineSprites.reserve(8);
m_scanlineSprites.resize(0);
}
void PPU::setInterruptCallback(std::function<void(void)> cb)
{
m_vblankCallback = cb;
}
void PPU::step()
{
switch (m_pipelineState)
{
case PreRender:
if (m_cycle == 1)
m_vblank = m_sprZeroHit = false;
else if (m_cycle == ScanlineVisibleDots + 2 && m_showBackground && m_showSprites)
{
//Set bits related to horizontal position
m_dataAddress &= ~0x41f; //Unset horizontal bits
m_dataAddress |= m_tempAddress & 0x41f; //Copy
}
else if (m_cycle > 280 && m_cycle <= 304 && m_showBackground && m_showSprites)
{
//Set vertical bits
m_dataAddress &= ~0x7be0; //Unset bits related to horizontal
m_dataAddress |= m_tempAddress & 0x7be0; //Copy
}
// if (m_cycle > 257 && m_cycle < 320)
// m_spriteDataAddress = 0;
//if rendering is on, every other frame is one cycle shorter
if (m_cycle >= ScanlineEndCycle - (!m_evenFrame && m_showBackground && m_showSprites))
{
m_pipelineState = Render;
m_cycle = m_scanline = 0;
}
break;
case Render:
if (m_cycle > 0 && m_cycle <= ScanlineVisibleDots)
{
Byte bgColor = 0, sprColor = 0;
bool bgOpaque = false, sprOpaque = true;
bool spriteForeground = false;
int x = m_cycle - 1;
int y = m_scanline;
if (m_showBackground)
{
auto x_fine = (m_fineXScroll + x) % 8;
if (!m_hideEdgeBackground || x >= 8)
{
//fetch tile
auto addr = 0x2000 | (m_dataAddress & 0x0FFF); //mask off fine y
//auto addr = 0x2000 + x / 8 + (y / 8) * (ScanlineVisibleDots / 8);
Byte tile = read(addr);
//fetch pattern
//Each pattern occupies 16 bytes, so multiply by 16
addr = (tile * 16) + ((m_dataAddress >> 12/*y % 8*/) & 0x7); //Add fine y
addr |= m_bgPage << 12; //set whether the pattern is in the high or low page
//Get the corresponding bit determined by (8 - x_fine) from the right
bgColor = (read(addr) >> (7 ^ x_fine)) & 1; //bit 0 of palette entry
bgColor |= ((read(addr + 8) >> (7 ^ x_fine)) & 1) << 1; //bit 1
bgOpaque = bgColor; //flag used to calculate final pixel with the sprite pixel
//fetch attribute and calculate higher two bits of palette
addr = 0x23C0 | (m_dataAddress & 0x0C00) | ((m_dataAddress >> 4) & 0x38)
| ((m_dataAddress >> 2) & 0x07);
auto attribute = read(addr);
int shift = ((m_dataAddress >> 4) & 4) | (m_dataAddress & 2);
//Extract and set the upper two bits for the color
bgColor |= ((attribute >> shift) & 0x3) << 2;
}
//Increment/wrap coarse X
if (x_fine == 7)
{
if ((m_dataAddress & 0x001F) == 31) // if coarse X == 31
{
m_dataAddress &= ~0x001F; // coarse X = 0
m_dataAddress ^= 0x0400; // switch horizontal nametable
}
else
m_dataAddress += 1; // increment coarse X
}
}
if (m_showSprites && (!m_hideEdgeSprites || x >= 8))
{
for (auto i : m_scanlineSprites)
{
Byte spr_x = m_spriteMemory[i * 4 + 3];
if (0 > x - spr_x || x - spr_x >= 8)
continue;
Byte spr_y = m_spriteMemory[i * 4 + 0] + 1,
tile = m_spriteMemory[i * 4 + 1],
attribute = m_spriteMemory[i * 4 + 2];
int length = (m_longSprites) ? 16 : 8;
int x_shift = (x - spr_x) % 8, y_offset = (y - spr_y) % length;
if ((attribute & 0x40) == 0) //If NOT flipping horizontally
x_shift ^= 7;
if ((attribute & 0x80) != 0) //IF flipping vertically
y_offset ^= (length - 1);
Address addr = 0;
if (!m_longSprites)
{
addr = tile * 16 + y_offset;
if (m_sprPage == High) addr += 0x1000;
}
else //8x16 sprites
{
//bit-3 is one if it is the bottom tile of the sprite, multiply by two to get the next pattern
y_offset = (y_offset & 7) | ((y_offset & 8) << 1);
addr = (tile >> 1) * 32 + y_offset;
addr |= (tile & 1) << 12; //Bank 0x1000 if bit-0 is high
}
sprColor |= (read(addr) >> (x_shift)) & 1; //bit 0 of palette entry
sprColor |= ((read(addr + 8) >> (x_shift)) & 1) << 1; //bit 1
if (!(sprOpaque = sprColor))
{
sprColor = 0;
continue;
}
sprColor |= 0x10; //Select sprite palette
sprColor |= (attribute & 0x3) << 2; //bits 2-3
spriteForeground = !(attribute & 0x20);
//Sprite-0 hit detection
if (!m_sprZeroHit && m_showBackground && i == 0 && sprOpaque && bgOpaque)
{
m_sprZeroHit = true;
}
break; //Exit the loop now since we've found the highest priority sprite
}
}
Byte paletteAddr = bgColor;
if ( (!bgOpaque && sprOpaque) ||
(bgOpaque && sprOpaque && spriteForeground) )
paletteAddr = sprColor;
else if (!bgOpaque && !sprOpaque)
paletteAddr = 0;
//else bgColor
// m_screen.setPixel(x, y, sf::Color(colors[m_bus.readPalette(paletteAddr)]));
m_pictureBuffer[x][y] = sf::Color(colors[m_bus.readPalette(paletteAddr)]);
}
else if (m_cycle == ScanlineVisibleDots + 1 && m_showBackground)
{
//Shamelessly copied from nesdev wiki
if ((m_dataAddress & 0x7000) != 0x7000) // if fine Y < 7
m_dataAddress += 0x1000; // increment fine Y
else
{
m_dataAddress &= ~0x7000; // fine Y = 0
int y = (m_dataAddress & 0x03E0) >> 5; // let y = coarse Y
if (y == 29)
{
y = 0; // coarse Y = 0
m_dataAddress ^= 0x0800; // switch vertical nametable
}
else if (y == 31)
y = 0; // coarse Y = 0, nametable not switched
else
y += 1; // increment coarse Y
m_dataAddress = (m_dataAddress & ~0x03E0) | (y << 5);
// put coarse Y back into m_dataAddress
}
}
else if (m_cycle == ScanlineVisibleDots + 2 && m_showBackground && m_showSprites)
{
//Copy bits related to horizontal position
m_dataAddress &= ~0x41f;
m_dataAddress |= m_tempAddress & 0x41f;
}
// if (m_cycle > 257 && m_cycle < 320)
// m_spriteDataAddress = 0;
if (m_cycle >= ScanlineEndCycle)
{
//Find and index sprites that are on the next Scanline
//This isn't where/when this indexing, actually copying in 2C02 is done
//but (I think) it shouldn't hurt any games if this is done here
m_scanlineSprites.resize(0);
int range = 8;
if (m_longSprites)
range = 16;
std::size_t j = 0;
for (std::size_t i = m_spriteDataAddress / 4; i < 64; ++i)
{
auto diff = (m_scanline - m_spriteMemory[i * 4]);
if (0 <= diff && diff < range)
{
m_scanlineSprites.push_back(i);
++j;
if (j >= 8)
{
break;
}
}
}
++m_scanline;
m_cycle = 0;
}
if (m_scanline >= VisibleScanlines)
m_pipelineState = PostRender;
break;
case PostRender:
if (m_cycle >= ScanlineEndCycle)
{
++m_scanline;
m_cycle = 0;
m_pipelineState = VerticalBlank;
for (int x = 0; x < m_pictureBuffer.size(); ++x)
{
for (int y = 0; y < m_pictureBuffer[0].size(); ++y)
{
m_screen.setPixel(x, y, m_pictureBuffer[x][y]);
}
}
//Should technically be done at first dot of VBlank, but this is close enough
// m_vblank = true;
// if (m_generateInterrupt) m_vblankCallback();
}
break;
case VerticalBlank:
if (m_cycle == 1 && m_scanline == VisibleScanlines + 1)
{
m_vblank = true;
if (m_generateInterrupt) m_vblankCallback();
}
if (m_cycle >= ScanlineEndCycle)
{
++m_scanline;
m_cycle = 0;
}
if (m_scanline >= FrameEndScanline)
{
m_pipelineState = PreRender;
m_scanline = 0;
m_evenFrame = !m_evenFrame;
// m_vblank = false;
}
break;
default:
LOG(Error) << "Well, this shouldn't have happened." << std::endl;
}
++m_cycle;
}
Byte PPU::readOAM(Byte addr)
{
return m_spriteMemory[addr];
}
void PPU::writeOAM(Byte addr, Byte value)
{
m_spriteMemory[addr] = value;
}
void PPU::doDMA(const Byte* page_ptr)
{
std::memcpy(m_spriteMemory.data() + m_spriteDataAddress, page_ptr, 256 - m_spriteDataAddress);
if (m_spriteDataAddress)
std::memcpy(m_spriteMemory.data(), page_ptr + (256 - m_spriteDataAddress), m_spriteDataAddress);
//std::memcpy(m_spriteMemory.data(), page_ptr, 256);
}
void PPU::control(Byte ctrl)
{
m_generateInterrupt = ctrl & 0x80;
m_longSprites = ctrl & 0x20;
m_bgPage = static_cast<CharacterPage>(!!(ctrl & 0x10));
m_sprPage = static_cast<CharacterPage>(!!(ctrl & 0x8));
if (ctrl & 0x4)
m_dataAddrIncrement = 0x20;
else
m_dataAddrIncrement = 1;
//m_baseNameTable = (ctrl & 0x3) * 0x400 + 0x2000;
//Set the nametable in the temp address, this will be reflected in the data address during rendering
m_tempAddress &= ~0xc00; //Unset
m_tempAddress |= (ctrl & 0x3) << 10; //Set according to ctrl bits
}
void PPU::setMask(Byte mask)
{
m_greyscaleMode = mask & 0x1;
m_hideEdgeBackground = !(mask & 0x2);
m_hideEdgeSprites = !(mask & 0x4);
m_showBackground = mask & 0x8;
m_showSprites = mask & 0x10;
}
Byte PPU::getStatus()
{
Byte status = m_sprZeroHit << 6 |
m_vblank << 7;
//m_dataAddress = 0;
m_vblank = false;
m_firstWrite = true;
return status;
}
void PPU::setDataAddress(Byte addr)
{
//m_dataAddress = ((m_dataAddress << 8) & 0xff00) | addr;
if (m_firstWrite)
{
m_tempAddress &= ~0xff00; //Unset the upper byte
m_tempAddress |= (addr & 0x3f) << 8;
m_firstWrite = false;
}
else
{
m_tempAddress &= ~0xff; //Unset the lower byte;
m_tempAddress |= addr;
m_dataAddress = m_tempAddress;
m_firstWrite = true;
}
}
Byte PPU::getData()
{
auto data = m_bus.read(m_dataAddress);
m_dataAddress += m_dataAddrIncrement;
//Reads are delayed by one byte/read when address is in this range
if (m_dataAddress < 0x3f00)
{
//Return from the data buffer and store the current value in the buffer
std::swap(data, m_dataBuffer);
}
return data;
}
Byte PPU::getOAMData()
{
return readOAM(m_spriteDataAddress);
}
void PPU::setData(Byte data)
{
m_bus.write(m_dataAddress, data);
m_dataAddress += m_dataAddrIncrement;
}
void PPU::setOAMAddress(Byte addr)
{
m_spriteDataAddress = addr;
}
void PPU::setOAMData(Byte value)
{
writeOAM(m_spriteDataAddress++, value);
}
void PPU::setScroll(Byte scroll)
{
if (m_firstWrite)
{
m_tempAddress &= ~0x1f;
m_tempAddress |= (scroll >> 3) & 0x1f;
m_fineXScroll = scroll & 0x7;
m_firstWrite = false;
}
else
{
m_tempAddress &= ~0x73e0;
m_tempAddress |= ((scroll & 0x7) << 12) |
((scroll & 0xf8) << 2);
m_firstWrite = true;
}
}
Byte PPU::read(Address addr)
{
return m_bus.read(addr);
}
}

View file

@ -0,0 +1,111 @@
#include "PictureBus.h"
#include "Log.h"
namespace sn
{
PictureBus::PictureBus() :
m_RAM(0x800),
m_palette(0x20),
m_mapper(nullptr)
{}
Byte PictureBus::read(Address addr)
{
if (addr < 0x2000)
{
return m_mapper->readCHR(addr);
}
else if (addr < 0x3eff) //Name tables upto 0x3000, then mirrored upto 3eff
{
auto index = addr & 0x3ff;
if (addr < 0x2400) //NT0
return m_RAM[NameTable0 + index];
else if (addr < 0x2800) //NT1
return m_RAM[NameTable1 + index];
else if (addr < 0x2c00) //NT2
return m_RAM[NameTable2 + index];
else //NT3
return m_RAM[NameTable3 + index];
}
else if (addr < 0x3fff)
{
return m_palette[addr & 0x1f];
}
return 0;
}
Byte PictureBus::readPalette(Byte paletteAddr)
{
return m_palette[paletteAddr];
}
void PictureBus::write(Address addr, Byte value)
{
if (addr < 0x2000)
{
m_mapper->writeCHR(addr, value);
}
else if (addr < 0x3eff) //Name tables upto 0x3000, then mirrored upto 3eff
{
auto index = addr & 0x3ff;
if (addr < 0x2400) //NT0
m_RAM[NameTable0 + index] = value;
else if (addr < 0x2800) //NT1
m_RAM[NameTable1 + index] = value;
else if (addr < 0x2c00) //NT2
m_RAM[NameTable2 + index] = value;
else //NT3
m_RAM[NameTable3 + index] = value;
}
else if (addr < 0x3fff)
{
if (addr == 0x3f10)
m_palette[0] = value;
else
m_palette[addr & 0x1f] = value;
}
}
void PictureBus::updateMirroring()
{
switch (m_mapper->getNameTableMirroring())
{
case Horizontal:
NameTable0 = NameTable1 = 0;
NameTable2 = NameTable3 = 0x400;
LOG(InfoVerbose) << "Horizontal Name Table mirroring set. (Vertical Scrolling)" << std::endl;
break;
case Vertical:
NameTable0 = NameTable2 = 0;
NameTable1 = NameTable3 = 0x400;
LOG(InfoVerbose) << "Vertical Name Table mirroring set. (Horizontal Scrolling)" << std::endl;
break;
case OneScreenLower:
NameTable0 = NameTable1 = NameTable2 = NameTable3 = 0;
LOG(InfoVerbose) << "Single Screen mirroring set with lower bank." << std::endl;
break;
case OneScreenHigher:
NameTable0 = NameTable1 = NameTable2 = NameTable3 = 0x400;
LOG(InfoVerbose) << "Single Screen mirroring set with higher bank." << std::endl;
break;
default:
NameTable0 = NameTable1 = NameTable2 = NameTable3 = 0;
LOG(Error) << "Unsupported Name Table mirroring : " << m_mapper->getNameTableMirroring() << std::endl;
}
}
bool PictureBus::setMapper(Mapper *mapper)
{
if (!mapper)
{
LOG(Error) << "Mapper argument is nullptr" << std::endl;
return false;
}
m_mapper = mapper;
updateMirroring();
return true;
}
}

View file

@ -0,0 +1,82 @@
#include "VirtualScreen.h"
namespace sn
{
void VirtualScreen::create(unsigned int w, unsigned int h, float pixel_size, sf::Color color)
{
m_vertices.resize(w * h * 6);
m_screenSize = {w, h};
m_vertices.setPrimitiveType(sf::Triangles);
m_pixelSize = pixel_size;
for (std::size_t x = 0; x < w; ++x)
{
for (std::size_t y = 0; y < h; ++y)
{
auto index = (x * m_screenSize.y + y) * 6;
sf::Vector2f coord2d (x * m_pixelSize, y * m_pixelSize);
//Triangle-1
//top-left
m_vertices[index].position = coord2d;
m_vertices[index].color = color;
//top-right
m_vertices[index + 1].position = coord2d + sf::Vector2f{m_pixelSize, 0};
m_vertices[index + 1].color = color;
//bottom-right
m_vertices[index + 2].position = coord2d + sf::Vector2f{m_pixelSize, m_pixelSize};
m_vertices[index + 2].color = color;
//Triangle-2
//bottom-right
m_vertices[index + 3].position = coord2d + sf::Vector2f{m_pixelSize, m_pixelSize};
m_vertices[index + 3].color = color;
//bottom-left
m_vertices[index + 4].position = coord2d + sf::Vector2f{0, m_pixelSize};
m_vertices[index + 4].color = color;
//top-left
m_vertices[index + 5].position = coord2d;
m_vertices[index + 5].color = color;
}
}
}
void VirtualScreen::setPixel(std::size_t x, std::size_t y, sf::Color color)
{
auto index = (x * m_screenSize.y + y) * 6;
if (index >= m_vertices.getVertexCount())
return;
sf::Vector2f coord2d (x * m_pixelSize, y * m_pixelSize);
//Triangle-1
//top-left
m_vertices[index].color = color;
//top-right
m_vertices[index + 1].color = color;
//bottom-right
m_vertices[index + 2].color = color;
//Triangle-2
//bottom-right
m_vertices[index + 3].color = color;
//bottom-left
m_vertices[index + 4].color = color;
//top-left
m_vertices[index + 5].color = color;
}
void VirtualScreen::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
target.draw(m_vertices, states);
}
}