fixed build for linux

This commit is contained in:
Lauchmelder 2022-02-28 17:52:23 +01:00
parent 7ffef5851d
commit 53a7baf91f
No known key found for this signature in database
GPG key ID: C2403C69D78F011D
6 changed files with 9 additions and 8 deletions

View file

@ -6,7 +6,7 @@ cmake_minimum_required (VERSION 3.8)
project ("NES Emulator") project ("NES Emulator")
find_package(glfw3) find_package(glfw3)
if(NOT ${GLFW3_FOUND}) if(NOT GLFW3_FOUND)
add_subdirectory("vendor/glfw") add_subdirectory("vendor/glfw")
endif() endif()
add_subdirectory("vendor/glad") add_subdirectory("vendor/glad")

View file

@ -2,7 +2,7 @@
#include <stdexcept> #include <stdexcept>
#include <glad/glad.h> #include <glad/glad.h>
#include <GLFW/glfw3.h> #include <glfw/glfw3.h>
#include <imgui/backends/imgui_impl_glfw.h> #include <imgui/backends/imgui_impl_glfw.h>
#include <imgui/backends/imgui_impl_opengl3.h> #include <imgui/backends/imgui_impl_opengl3.h>

View file

@ -30,6 +30,7 @@ target_link_libraries(nesemu
spdlog spdlog
glfw glfw
glad glad
${CMAKE_DL_LIBS}
) )
add_custom_command(TARGET nesemu POST_BUILD add_custom_command(TARGET nesemu POST_BUILD

View file

@ -6,8 +6,8 @@
#include "Log.hpp" #include "Log.hpp"
#define BIND(x) (std::bind(&CPU::x, this)) #define BIND(x) (std::bind(&CPU::x, this))
#define NEW_INSTRUCTION(op, addr, size, cyc) { BIND(op), BIND(addr), Addressing::addr, size, cyc, " " #op } #define NEW_INSTRUCTION(op, addr, size, cyc) Instruction{ BIND(op), BIND(addr), Addressing::addr, size, cyc, " " #op }
#define NEW_ILLGL_INSTR(op, addr, size, cyc) { BIND(op), BIND(addr), Addressing::addr, size, cyc, "*" #op } #define NEW_ILLGL_INSTR(op, addr, size, cyc) Instruction{ BIND(op), BIND(addr), Addressing::addr, size, cyc, "*" #op }
#define CHECK_NEGATIVE(x) status.Flag.Negative = (((x) & 0x80) == 0x80) #define CHECK_NEGATIVE(x) status.Flag.Negative = (((x) & 0x80) == 0x80)
#define CHECK_ZERO(x) status.Flag.Zero = ((x) == 0x00) #define CHECK_ZERO(x) status.Flag.Zero = ((x) == 0x00)
@ -64,7 +64,7 @@ uint8_t CPU::Tick()
pastInstructions.pop_front(); pastInstructions.pop_front();
// If the instruction is not set in the lookup table, abort // If the instruction is not set in the lookup table, abort
if (currentInstruction->Operation == nullptr || currentInstruction->Mode == nullptr) if (currentInstruction->Opcode == nullptr || currentInstruction->Mode == nullptr)
{ {
LOG_DEBUG_ERROR("Unknown instruction {0:02X} at ${1:04X}", opcode, pc.Raw); LOG_DEBUG_ERROR("Unknown instruction {0:02X} at ${1:04X}", opcode, pc.Raw);
throw std::runtime_error("Encountered unknown opcode"); throw std::runtime_error("Encountered unknown opcode");
@ -75,7 +75,7 @@ uint8_t CPU::Tick()
// Invoke addressing mode and instruction // Invoke addressing mode and instruction
accumulatorAddressing = false; accumulatorAddressing = false;
currentInstruction->Mode(); currentInstruction->Mode();
currentInstruction->Operation(); currentInstruction->Opcode();
APPEND_DEBUG_STRING(std::string(50 - debugString.str().length(), ' ')); APPEND_DEBUG_STRING(std::string(50 - debugString.str().length(), ' '));

View file

@ -53,7 +53,7 @@ union StatusFlag
*/ */
struct Instruction struct Instruction
{ {
Operation Operation = nullptr; Operation Opcode = nullptr;
AddressingMode Mode = nullptr; AddressingMode Mode = nullptr;
Addressing AddrType = Addressing::IMP; Addressing AddrType = Addressing::IMP;
uint8_t Size = 0; uint8_t Size = 0;

View file

@ -4,7 +4,7 @@
#include <string> #include <string>
#include <glad/glad.h> #include <glad/glad.h>
#include <glfw/glfw3.h> #include <GLFW/glfw3.h>
class Window class Window
{ {