Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CXX = g++
LIBS = -lstdc++fs -lSDL2 -lfmt
LIBS = -lSDL2 -lfmt
CXXFLAGS = -g -std=c++2a -I $(INCLUDE) -I $(BACKUPDIR)
BIN = bin
SOURCE = src
Expand Down Expand Up @@ -27,10 +27,16 @@ OBJ = \
LIST = $(addprefix $(BIN)/, $(OBJ))
VPATH = $(SOURCE) $(SOURCE)/backup

# Handle compiler version caveats
OS = $(uname -s)
ifeq ($(OS), Linux)
LIBS += -lstdc++fs
endif

# Use compiler optimizations
# run `make opt=1`
ifdef opt
CXXFLAGS += -Ofast
CXXFLAGS += -Ofast
endif

all: discovery
Expand Down
2 changes: 1 addition & 1 deletion include/util.inl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inline u16 bitseq(u16 val)

inline s8 signum(double val)
{
if(std::isnan(val)) throw std::invalid_argument("Invalid argument passed to util::signum");
if(val != val) throw std::invalid_argument("Invalid argument passed to util::signum");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val != val will never be true, so this check should probably be deleted

else return (s8) (0. < val) - (val < 0.);
}

4 changes: 2 additions & 2 deletions src/Arm7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ void Arm7::updateCPSR(u32 value, bool flags_only)
log(LogLevel::Warning, "Software is changing T-Bit in CPSR!\n");

// validate CPSR wasn't given an invalid state
assert(getMode());
assert((u8) getMode());

// if (sr.state == IRQ && registers.cpsr.i == 1) return; // irq disabled bit set
// if (sr.state == FIQ && registers.cpsr.f == 1) return; // fiq disabled bit set
Expand Down Expand Up @@ -1337,4 +1337,4 @@ void Arm7::print() {

// #include "HandlerArm.cpp"
// #include "HandlerThumb.cpp"
// #include "swi.cpp"
// #include "swi.cpp"
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main(int argc, char **argv)
// Click X on window
running = false;
break;
case SDL_KEYDOWN: [[fallthrough]]
case SDL_KEYDOWN: [[fallthrough]];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the only [[fallthrough]] statement in the codebase. Is only this one broken on Mac?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, all the other fallthroughs I took a look at have semicolons after actually (though I didn't look at all of them).. not sure how it was compiling without it

case SDL_KEYUP:
// Key press event
if (e.key.keysym.sym == SDLK_ESCAPE)
Expand Down