7 Commits
master ... 0.3

Author SHA1 Message Date
t-moe
97a3f1114a Added missing platform dll. 2015-06-08 15:31:42 +02:00
t-moe
01ba3713f9 Merge remote-tracking branch 'origin/master' into windows
Conflicts:
	emulator/qt/ll_tft.cpp
2015-06-08 15:31:24 +02:00
t-moe
cc18c175b5 Modified emulator makefile for windows. 2015-06-08 00:41:16 +02:00
t-moe
cafa320e9e Merge remote-tracking branch 'origin/master' into windows 2015-06-08 00:17:18 +02:00
t-moe
c32bfde94e Font fix for windows. 2015-06-06 14:35:01 +02:00
t-moe
129b7e0ee7 Cleaned up windows build, added readme. Added Boost binaries. 2015-06-06 14:29:37 +02:00
t-moe
0fa18290dd Changed makefile of emulator to run on windows. 2015-06-06 13:47:28 +02:00
13 changed files with 2032 additions and 23 deletions

5
emulator/.gitignore vendored
View File

@@ -5,8 +5,9 @@ qt/*.o
qt/*.a
qt/ui_*
qt/moc_*
qt/Makefile
qt/Makefile*
qt/debug
qt/release
libs/*/obj
libs/*/*.a

View File

@@ -10,7 +10,7 @@ QT_DIR=./qt
COMMON_DIR=../common
#Tools
CC=gcc -fdiagnostics-color=auto
CC=gcc #-fdiagnostics=auto
GDB=gdb
@@ -24,17 +24,22 @@ INCLUDES:=$(addprefix -I,$(INCLUDES))
QT_LIB=$(QT_DIR)/libemulatorqt.a
CPPFLAGS= -march=x86-64 -mtune=generic -fPIC $(INCLUDES)
CFLAGS= -O0 -g -std=c99
CPPFLAGS= -march=x86-64 -mtune=generic #-fPIC
CPPFLAGS+= $(INCLUDES)
CFLAGS= -O0 -g -std=c99 -mwindows
LIBS= pixy usb-1.0 boost_system boost_timer boost_chrono
LIBS+=Qt5Core Qt5Gui Qt5Widgets emulatorqt m stdc++
LIBS= emulatorqt pixy usb-1.0
LIBS+= boost_system-mgw49-mt-1_58 boost_timer-mgw49-mt-1_58 boost_chrono-mgw49-mt-1_58
LIBS+= Qt5Core Qt5Gui Qt5Widgets m stdc++
LDFLAGS= -L$(QT_DIR) $(addprefix -l,$(LIBS))
LDFLAGS= -static-libgcc -static-libstdc++ #-Wl,-t -Wl,--Map=a.map
LDFLAGS+= -L$(QT_DIR)
LDFLAGS+= -L$(LIB_DIR)/Pixy
LDFLAGS+= -L$(LIB_DIR)/boost/lib
LDFLAGS+= -LC:/Qt/5.4/mingw491_32/lib
LDFLAGS+= -L$(LIB_DIR)/Pixy/windows
LDFLAGS+= $(addprefix -l,$(LIBS))
#Finding Input files
CFILES=$(shell find . -maxdepth 1 -name '*.c')
@@ -58,7 +63,7 @@ debug: all
$(GDB) ./build/emulator
$(QT_LIB):
cd $(QT_DIR) && qmake &&make
cd $(QT_DIR) && qmake && $(MAKE)
#objects to elf
$(BUILD_DIR)/$(TARGET): $(OBJS) $(COMMON_OBJS) $(QT_LIB)
@@ -83,7 +88,7 @@ $(OBJ_DIR)/%.o: $(COMMON_DIR)/%.c
#Clean Obj files and builded stuff
clean:
cd $(QT_DIR) && $(MAKE) clean && $(RM) Makefile && $(RM) *.a
cd $(QT_DIR) && $(MAKE) clean && $(RM) Makefile* && $(RM) *.a && $(RMDIR) debug release
$(RMDIR) $(BUILD_DIR) $(OBJ_DIR)

View File

@@ -17,11 +17,13 @@ OBJ_DIR=./obj
#Architecture flags
#Compiler, Linker Options
CPPFLAGS=-I$(INC_DIR) -D__LINUX__=1 -DHOST=1 #-DDEBUG=1
CPPFLAGS=-I$(INC_DIR) -DHOST=1 #-D__LINUX__=1 -DDEBUG=1
CFLAGS=$(ARCH_FLAGS) -O0 -g #-ffunction-sections -fdata-sections -g
#CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
#CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
CFLAGS+=-I/usr/include/libusb-1.0
CFLAGS+=-I../boost/include/
CFLAGS+=-I./windows/
#Finding Input files
CFILES=$(shell find $(SRC_DIR) -name '*.cpp')

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

2
emulator/libs/boost/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
include
lib

Binary file not shown.

View File

@@ -0,0 +1,2 @@
This directory is only needed on windows, and if you do not have boost installed.
Extract the rar file here, to get boost 1.58 header files and the libraries that we need for discoverpixy

View File

@@ -8,7 +8,7 @@ QT += widgets gui
TARGET = emulatorqt
TEMPLATE = lib
CONFIG += staticlib
CONFIG += staticlib debug
SOURCES += \
mainwindow.cpp \
@@ -30,3 +30,6 @@ INCLUDEPATH+= ../../common/lowlevel/ \
FORMS += \
mainwindow.ui
DESTDIR = $$_PRO_FILE_PWD_ #force windows to not create subfolders
#QMAKE_CXXFLAGS+= -v

View File

@@ -81,11 +81,9 @@ QFont get_font(uint8_t fontnum)
{
switch(fontnum) {
case 0:
return QFont("Monospace", 8);
return QFont("Courier New",8);
case 1:
return QFont("DejaVu Sans Mono", 14);
return QFont("Courier New",14);
default:
return QFont();
}

View File

@@ -0,0 +1,26 @@
Prerequisites:
- Qt5 for Windows (provides C:\Qt\5.4\mingw491_32 and C:\Qt\Tools\mingw491_32)
- Mingw msys-base (provides C:\MinGW\msys\1.0 and make, find )
- Boost (check emulator\libs\boost)
Steps:
- Open up the msys shell using the batchfile
- Navigate to the emulator folder of the project
- Source the qt binaries (qmake, gcc, g++) by executing
export PATH=$PATH:/c/Qt/Tools/mingw491_32/bin:/c/Qt/5.4/mingw491_32/bin
- navigate to libs/Pixy and execute make
- navigate back into the emulator folder and execute make
- this should generate you build/emulator.exe
Starting:
- Extract windows_dlls.rar to the build folder
- Copy the emulated folder into the build folder
- Make sure that you installed the pixy usb driver (e.g. by installing pixymon http://cmucam.org/projects/cmucam5/wiki/Latest_release)
- Start emulator.exe
Pitfalls:
- libstdc++ must be provided by qt. do not use one of msys or mingw. you will waste hours with debugging of the make process
Sources:
- libusb for windows was taken from https://github.com/charmedlabs/pixy/tree/master/src/host/windows
- Boost was compiled from sources, using http://andres.jaimes.net/718/how-to-install-the-c-boost-libraries-on-windows/ and http://www.boost.org/doc/libs/1_58_0/more/getting_started/windows.html

BIN
emulator/windows_dlls.rar Normal file

Binary file not shown.