diff --git a/.travis.yml b/.travis.yml index e4791043cd..4a7ae74da1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ cache: env: - OPENRCT2_CMAKE_OPTS="-DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON -DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8" + - OPENRCT2_CMAKE_OPTS="-DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++" - OPENRCT2_CMAKE_OPTS="-DDISABLE_NETWORK=OFF -DDISABLE_HTTP_TWITCH=ON -DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8" - OPENRCT2_CMAKE_OPTS="-DDISABLE_NETWORK=OFF -DDISABLE_HTTP_TWITCH=OFF -DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8" - OPENRCT2_CMAKE_OPTS="-DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt" TARGET=windows @@ -27,6 +28,7 @@ env: - OPENRCT2_CMAKE_OPTS="-DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON" TARGET=docker32 sudo: required +dist: trusty services: - docker diff --git a/CMakeLists.txt b/CMakeLists.txt index 435325884e..26f133133e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,8 @@ file(GLOB_RECURSE ORCT2_SOURCES "src/*.c" "src/*.cpp" "lib/argparse/*.c" "lib/cu if (UNIX) # force 32bit build for now and set necessary flags to compile code as is - set(CMAKE_C_FLAGS "-m32 -masm=intel -fvar-tracking-assignments -std=gnu99") - set(CMAKE_CXX_FLAGS "-m32 -std=gnu++11 -fvar-tracking-assignments -masm=intel") + set(CMAKE_C_FLAGS "-m32 -std=gnu99") + set(CMAKE_CXX_FLAGS "-m32 -std=gnu++11") set(CMAKE_SHARED_LINKER_FLAGS "-m32 -Wl,-melf_i386") set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}) endif (UNIX) diff --git a/CMakeLists_mingw.txt b/CMakeLists_mingw.txt index 4be930b8e4..d4817994d1 100644 --- a/CMakeLists_mingw.txt +++ b/CMakeLists_mingw.txt @@ -11,8 +11,8 @@ SET(PKG_CONFIG_EXECUTABLE ${COMPILER_PREFIX}-pkg-config) # potential flags to make code more similar to MSVC: # -fshort-wchar -fshort-enums -mms-bitfields # -set(CMAKE_C_FLAGS "-masm=intel -std=gnu99 -fpack-struct=1" CACHE STRING "" FORCE) -set(CMAKE_CXX_FLAGS "-masm=intel -std=c++0x -std=gnu++0x -fpack-struct=1" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS "-std=gnu99 -fpack-struct=1" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS "-std=c++0x -std=gnu++0x -fpack-struct=1" CACHE STRING "" FORCE) if(${ACTUAL_SYSTEM} MATCHES "Linux") set(CMAKE_SHARED_LINKER_FLAGS "-O3 -static-libgcc -static-libstdc++ -static -lpthread" CACHE STRING "" FORCE) else() diff --git a/install.sh b/install.sh index df1fdcfa76..eb19e49d5e 100755 --- a/install.sh +++ b/install.sh @@ -174,14 +174,12 @@ elif [[ `uname` == "Linux" ]]; then "linux") sudo dpkg --add-architecture i386 sudo apt-get update - sudo apt-get install --no-install-recommends -y --force-yes cmake libsdl2-dev:i386 libsdl2-ttf-dev:i386 gcc-4.8 pkg-config:i386 g++-4.8-multilib gcc-4.8-multilib libjansson-dev:i386 libspeex-dev:i386 libspeexdsp-dev:i386 libcurl4-openssl-dev:i386 libcrypto++-dev:i386 + sudo apt-get install --no-install-recommends -y --force-yes cmake libsdl2-dev:i386 libsdl2-ttf-dev:i386 gcc-4.8 pkg-config:i386 g++-4.8-multilib gcc-4.8-multilib libjansson-dev:i386 libspeex-dev:i386 libspeexdsp-dev:i386 libcurl4-openssl-dev:i386 libcrypto++-dev:i386 clang download https://launchpad.net/ubuntu/+archive/primary/+files/libjansson4_2.7-1ubuntu1_i386.deb libjansson4_2.7-1ubuntu1_i386.deb download https://launchpad.net/ubuntu/+archive/primary/+files/libjansson-dev_2.7-1ubuntu1_i386.deb libjansson-dev_2.7-1ubuntu1_i386.deb sudo dpkg -i libjansson4_2.7-1ubuntu1_i386.deb sudo dpkg -i libjansson-dev_2.7-1ubuntu1_i386.deb sudo apt-get install -f - export CC=gcc-4.8 - export CXX=g++-4.8 ;; "windows") sudo apt-get update diff --git a/src/addresses.h b/src/addresses.h index 19eeb5c03c..1b69c339d4 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -698,23 +698,23 @@ static int RCT2_CALLPROC_X(int address, int _eax, int _ebx, int _ecx, int _edx, #else __asm__ ( "\ \n\ - push ebx \n\ - push ebp \n\ + push %%ebx \n\ + push %%ebp \n\ push %[address] \n\ - mov eax, %[_eax] \n\ - mov ebx, %[_ebx] \n\ - mov ecx, %[_ecx] \n\ - mov edx, %[_edx] \n\ - mov esi, %[_esi] \n\ - mov edi, %[_edi] \n\ - mov ebp, %[_ebp] \n\ - call [esp] \n\ + mov %[_eax], %%eax \n\ + mov %[_ebx], %%ebx \n\ + mov %[_ecx], %%ecx \n\ + mov %[_edx], %%edx \n\ + mov %[_esi], %%esi \n\ + mov %[_edi], %%edi \n\ + mov %[_ebp], %%ebp \n\ + call *(%%esp) \n\ lahf \n\ - add esp, 4 \n\ - pop ebp \n\ - pop ebx \n\ + add $4, %%esp \n\ + pop %%ebp \n\ + pop %%ebx \n\ /* Load result with flags */ \n\ - mov %[result], eax \n\ + mov %%eax, %[result] \n\ " : [address] "+m" (address), [_eax] "+m" (_eax), [_ebx] "+m" (_ebx), [_ecx] "+m" (_ecx), [_edx] "+m" (_edx), [_esi] "+m" (_esi), [_edi] "+m" (_edi), [_ebp] "+m" (_ebp), [result] "+m" (result) : : "eax","ecx","edx","esi","edi" @@ -817,70 +817,70 @@ static int RCT2_CALLFUNC_X(int address, int *_eax, int *_ebx, int *_ecx, int *_e __asm__ ( "\ \n\ /* Store C's base pointer*/ \n\ - push ebp \n\ - push ebx \n\ + push %%ebp \n\ + push %%ebx \n\ \n\ /* Store %[address] to call*/ \n\ push %[address] \n\ \n\ /* Set all registers to the input values*/ \n\ - mov eax, [%[_eax]] \n\ - mov eax, [eax] \n\ - mov ebx, [%[_ebx]] \n\ - mov ebx, [ebx] \n\ - mov ecx, [%[_ecx]] \n\ - mov ecx, [ecx] \n\ - mov edx, [%[_edx]] \n\ - mov edx, [edx] \n\ - mov esi, [%[_esi]] \n\ - mov esi, [esi] \n\ - mov edi, [%[_edi]] \n\ - mov edi, [edi] \n\ - mov ebp, [%[_ebp]] \n\ - mov ebp, [ebp] \n\ + mov %[_eax], %%eax \n\ + mov (%%eax), %%eax \n\ + mov %[_ebx], %%ebx \n\ + mov (%%ebx), %%ebx \n\ + mov %[_ecx], %%ecx \n\ + mov (%%ecx), %%ecx \n\ + mov %[_edx], %%edx \n\ + mov (%%edx), %%edx \n\ + mov %[_esi], %%esi \n\ + mov (%%esi), %%esi \n\ + mov %[_edi], %%edi \n\ + mov (%%edi), %%edi \n\ + mov %[_ebp], %%ebp \n\ + mov (%%ebp), %%ebp \n\ \n\ /* Call function*/ \n\ - call [esp] \n\ + call *(%%esp) \n\ \n\ /* Store output eax */ \n\ - push eax \n\ - push ebp \n\ - push ebx \n\ - mov ebp, [esp + 20] \n\ - mov ebx, [esp + 16] \n\ + push %%eax \n\ + push %%ebp \n\ + push %%ebx \n\ + mov 20(%%esp), %%ebp \n\ + mov 16(%%esp), %%ebx \n\ /* Get resulting ecx, edx, esi, edi registers*/ \n\ - mov eax, [%[_edi]] \n\ - mov [eax], edi \n\ - mov eax, [%[_esi]] \n\ - mov [eax], esi \n\ - mov eax, [%[_edx]] \n\ - mov [eax], edx \n\ - mov eax, [%[_ecx]] \n\ - mov [eax], ecx \n\ + mov %[_edi], %%eax \n\ + mov %%edi, (%%eax) \n\ + mov %[_esi], %%eax \n\ + mov %%esi, (%%eax) \n\ + mov %[_edx], %%eax \n\ + mov %%edx, (%%eax) \n\ + mov %[_ecx], %%eax \n\ + mov %%ecx, (%%eax) \n\ /* Pop ebx reg into ecx*/ \n\ - pop ecx \n\ - mov eax, [%[_ebx]] \n\ - mov [eax], ecx \n\ + pop %%ecx \n\ + mov %[_ebx], %%eax \n\ + mov %%ecx, (%%eax) \n\ \n\ /* Pop ebp reg into ecx */\n\ - pop ecx \n\ - mov eax, [%[_ebp]] \n\ - mov [eax], ecx \n\ + pop %%ecx \n\ + mov %[_ebp], %%eax \n\ + mov %%ecx, (%%eax) \n\ \n\ - pop eax \n\ + pop %%eax \n\ /* Get resulting eax register*/ \n\ - mov ecx, [%[_eax]] \n\ - mov [ecx], eax \n\ + mov %[_eax], %%ecx \n\ + mov %%eax, (%%ecx) \n\ \n\ /* Save flags as return in eax*/ \n\ lahf \n\ /* Pop address*/ \n\ - pop ebp \n\ + pop %%ebp \n\ \n\ - pop ebx \n\ - pop ebp \n\ + pop %%ebx \n\ + pop %%ebp \n\ /* Load result with flags */ \n\ - mov %[result], eax \n\ + mov %%eax, %[result] \n\ " : [address] "+m" (address), [_eax] "+m" (_eax), [_ebx] "+m" (_ebx), [_ecx] "+m" (_ecx), [_edx] "+m" (_edx), [_esi] "+m" (_esi), [_edi] "+m" (_edi), [_ebp] "+m" (_ebp), [result] "+m" (result) : diff --git a/src/rct2.c b/src/rct2.c index 154b1aab9c..560db3ab9a 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -228,8 +228,8 @@ void rct2_update() #else __asm__ ( "\ \n\ - mov eax, 0x009DE564 \n\ - mov [eax], esp \n\ + movl $0x009DE564, %%eax \n\ + movl %%esp, (%%eax) \n\ " : : : "eax" ); #endif diff --git a/src/windows/editor_object_selection.c b/src/windows/editor_object_selection.c index b6e064aed3..39efc7e727 100644 --- a/src/windows/editor_object_selection.c +++ b/src/windows/editor_object_selection.c @@ -1327,13 +1327,13 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf width = w->width - w->widgets[WIDX_LIST].right - 6; // Skip object dat name - text = (char*)(highlightedEntry + 1); - datName = text; + text = (uint8*)(highlightedEntry + 1); + datName = (char*)text; do { text++; } while (*(text - 1) != 0); text += 4; - name = text; + name = (char*)text; RCT2_GLOBAL(0x009BC677, uint8) = 14;