Skip to content

Commit

Permalink
removing some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
710lucas committed Aug 5, 2024
1 parent 6053a66 commit 4d2448b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/emulator/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ int Cpu::cycle(){
byte instruction = this->bus.readData();


if(instruction == NULL){
std::cerr<<"Invalid instruction" << static_cast<int>(instruction) << "\n";
if(instruction == 0){
std::cerr<<"Invalid instruction\n" << "PC: "<< pc << "\n";
return -1;
}

Expand Down
5 changes: 3 additions & 2 deletions src/emulator/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdio.h>
#include <cstdint>
#include <iostream>
#include <limits.h>
#include "./BUS/bus_module/busModule.hpp"
#include "./stack/stack.h"
#include "./BUS/systemBus.hpp"
Expand All @@ -20,8 +21,8 @@ class Cpu{

long pc = 0;

const int maxValue = (1 << (sizeof(int) * 8 - 1)) - 1;
const int minValue = -(1 << (sizeof(short) * 8 - 1));
const long maxValue = INT_MAX;
const long minValue = INT_MIN;

Stack stack = Stack();

Expand Down

0 comments on commit 4d2448b

Please sign in to comment.