This repository has been archived by the owner on Jan 13, 2020. It is now read-only.
forked from pcercuei/PocketSNES
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from JacopoSantoni/master
Fix libpng bug introduced by my previous pull request + misc fixes
- Loading branch information
Showing
15 changed files
with
144 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
# Define the applications properties here: | ||
|
||
TARGET = PocketSNES | ||
|
||
CC := $(CROSS_COMPILE)clang | ||
CXX := $(CROSS_COMPILE)clang++ | ||
STRIP := $(CROSS_COMPILE)strip | ||
|
||
SDL_CFLAGS := `sdl-config --cflags` | ||
SDL_LIBS := `sdl-config --libs` | ||
|
||
ifdef V | ||
CMD:= | ||
SUM:=@\# | ||
else | ||
CMD:=@ | ||
SUM:=@echo | ||
endif | ||
|
||
INCLUDE = -I pocketsnes \ | ||
-I sal/linux/include -I sal/include \ | ||
-I pocketsnes/include \ | ||
-I menu -I pocketsnes/linux -I pocketsnes/snes9x \ | ||
-I /Library/Frameworks/SDL.framework/headers | ||
|
||
CFLAGS = $(INCLUDE) -DRC_OPTIMIZED -D__LINUX__ -D__DINGUX__ \ | ||
# -g -O3 -pipe -ffast-math \ | ||
$(SDL_CFLAGS) -flto | ||
|
||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -std=c++0x -stdlib=libc++ | ||
|
||
LDFLAGS = $(CXXFLAGS) -lpthread -lz -lpng -lm $(SDL_LIBS) | ||
|
||
# Find all source files | ||
SOURCE = pocketsnes/snes9x menu sal/linux sal | ||
SRC_CPP = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.cpp)) | ||
SRC_C = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.c)) | ||
OBJ_CPP = $(patsubst %.cpp, %.o, $(SRC_CPP)) | ||
OBJ_C = $(patsubst %.c, %.o, $(SRC_C)) | ||
OBJS = $(OBJ_CPP) $(OBJ_C) | ||
|
||
.PHONY : all | ||
all : $(TARGET) | ||
|
||
.PHONY: opk | ||
opk: $(TARGET).opk | ||
|
||
$(TARGET) : $(OBJS) | ||
$(SUM) " LD $@" | ||
$(CMD)$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) | ||
|
||
$(TARGET).opk: $(TARGET) | ||
$(SUM) " OPK $@" | ||
$(CMD)rm -rf .opk_data | ||
$(CMD)cp -r data .opk_data | ||
$(CMD)cp $< .opk_data/pocketsnes.gcw0 | ||
$(CMD)$(STRIP) .opk_data/pocketsnes.gcw0 | ||
$(CMD)mksquashfs .opk_data $@ -all-root -noappend -no-exports -no-xattrs -no-progress >/dev/null | ||
|
||
%.o: %.c | ||
$(SUM) " CC $@" | ||
$(CMD)$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
%.o: %.cpp | ||
$(SUM) " CXX $@" | ||
$(CMD)$(CXX) $(CXXFLAGS) -c $< -o $@ | ||
|
||
.PHONY : clean | ||
clean : | ||
$(SUM) " CLEAN ." | ||
$(CMD)rm -f $(OBJS) $(TARGET) | ||
$(CMD)rm -rf .opk_data $(TARGET).opk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "../../emu_interface.h" | ||
|
||
|
||
extern "C" int mainEntry(int argc, char** argv); | ||
|
||
using namespace std; | ||
|
||
class PocketSnesEmulator : public CoreInterface | ||
{ | ||
private: | ||
|
||
public: | ||
PocketSnesEmulator() | ||
{ | ||
registerInformations(CONSOLE_SUPER_NINTENDO, "pocketsnes", "PocketSNES", "1.0"); | ||
registerExtension("smc"); | ||
} | ||
|
||
virtual void run(int argc, char **argv) { mainEntry(argc, argv); } | ||
}; | ||
|
||
static PocketSnesEmulator emulator; | ||
|
||
extern "C" CoreInterface* retrieve() | ||
{ | ||
return &emulator; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters