Removed references to the crystax_static lib, which disappeared from the CrystaX NDK r6 and above
This commit is contained in:
2
build.sh
2
build.sh
@@ -24,6 +24,8 @@ if uname -s | grep -i "windows" > /dev/null ; then
|
||||
MYARCH=windows-x86
|
||||
fi
|
||||
|
||||
rm -f project/bin/*.apk project/bin/*.apk.d project/bin/*.ap_ project/bin/*.ap_.d # New Android SDK introduced some lame-ass optimizations to the build system which we should take care about
|
||||
|
||||
cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build V=1 -j4 && \
|
||||
{ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
|
||||
[ -`which ndk-build | grep '/android-ndk-r[56789]'` != - ] && \
|
||||
|
||||
@@ -56,10 +56,6 @@ LOCAL_C_INCLUDES += $(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/include
|
||||
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/libs/$(TARGET_ARCH_ABI) -lstdc++
|
||||
endif
|
||||
endif
|
||||
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
|
||||
LOCAL_C_INCLUDES += $(NDK_PATH)/sources/crystax/include
|
||||
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/$(TARGET_ARCH_ABI) -lcrystax_static
|
||||
endif
|
||||
|
||||
LIBS_WITH_LONG_SYMBOLS := $(strip $(shell \
|
||||
for f in $(LOCAL_PATH)/../../obj/local/armeabi/*.so ; do \
|
||||
|
||||
@@ -5,8 +5,8 @@ AppName="Ballfield"
|
||||
AppFullName=net.olofson.ballfield
|
||||
ScreenOrientation=h
|
||||
InhibitSuspend=n
|
||||
AppDataDownloadUrl="Game data is 1 Mb|ballfield.zip"
|
||||
VideoDepthBpp=32
|
||||
AppDataDownloadUrl="Game data is 1 Mb|ballfield2.zip"
|
||||
VideoDepthBpp=16
|
||||
NeedDepthBuffer=n
|
||||
NeedStencilBuffer=n
|
||||
NeedGles2=n
|
||||
|
||||
Binary file not shown.
@@ -212,7 +212,27 @@ void print_num(SDL_Surface *dst, SDL_Surface *font, int x, int y, float value)
|
||||
}
|
||||
}
|
||||
|
||||
void print_num_hex(SDL_Surface *dst, SDL_Surface *font, int x, int y, unsigned val)
|
||||
{
|
||||
char buf[8];
|
||||
int pos, p = 0;
|
||||
SDL_Rect from;
|
||||
|
||||
//val = htonl(val); // Big-endian
|
||||
|
||||
/* Render! */
|
||||
from.y = 0;
|
||||
from.w = 7;
|
||||
from.h = 10;
|
||||
for(pos = 0; pos < 8; ++pos)
|
||||
{
|
||||
SDL_Rect to;
|
||||
to.x = 8 * 7 - (x + pos * 7); // Little-endian number wrapped backwards
|
||||
to.y = y;
|
||||
from.x = ( ( val >> (pos * 4) ) & 0xf ) * 7;
|
||||
SDL_BlitSurface(font, &from, dst, &to);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------
|
||||
ballfield_t functions
|
||||
@@ -391,12 +411,18 @@ void tiled_back(SDL_Surface *back, SDL_Surface *screen, int xo, int yo)
|
||||
main()
|
||||
----------------------------------------------------------*/
|
||||
|
||||
extern "C" void unaligned_test(unsigned * data, unsigned * target);
|
||||
extern "C" unsigned val0, val1, val2, val3, val4;
|
||||
|
||||
unsigned char data[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
//unsigned val0 = 0x12345678, val1 = 0x23456789, val2 = 0x34567890, val3 = 0x45678901, val4 = 0x56789012;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
ballfield_t *balls;
|
||||
SDL_Surface *screen;
|
||||
SDL_Surface *temp_image;
|
||||
SDL_Surface *back, *logo, *font;
|
||||
SDL_Surface *back, *logo, *font, *font_hex;
|
||||
SDL_Event event;
|
||||
int bpp = 16,
|
||||
flags = 0,
|
||||
@@ -487,6 +513,17 @@ int main(int argc, char* argv[])
|
||||
font = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
temp_image = SDL_LoadBMP("font7x10-hex.bmp");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load hex font!\n");
|
||||
exit(-1);
|
||||
}
|
||||
SDL_SetColorKey(temp_image, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp_image->format, 255, 0, 255));
|
||||
font_hex = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
last_avg_tick = last_tick = SDL_GetTicks();
|
||||
|
||||
enum { MAX_POINTERS = 16, PTR_PRESSED = 4 };
|
||||
@@ -496,7 +533,7 @@ int main(int argc, char* argv[])
|
||||
SDL_Joystick * joysticks[MAX_POINTERS+1];
|
||||
for(i=0; i<MAX_POINTERS; i++)
|
||||
joysticks[i] = SDL_JoystickOpen(i);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
SDL_Rect r;
|
||||
@@ -526,8 +563,31 @@ int main(int argc, char* argv[])
|
||||
fps = (float)fps_count * 1000.0 / (tick - fps_start);
|
||||
fps_count = 0;
|
||||
fps_start = tick;
|
||||
|
||||
// This wonderful unaligned memory access scenario still fails on my HTC Evo and ADP1 devices, and even on the Beagleboard.
|
||||
// I mean - the test fails, unaligned access works
|
||||
|
||||
// UNALIGNED MEMORY ACCESS HERE! However all the devices that I have won't report it and won't send a signal or write to the /proc/kmsg,
|
||||
// despite the /proc/cpu/alignment flag set.
|
||||
unsigned * ptr = (unsigned *)(data);
|
||||
unaligned_test(ptr, &val0);
|
||||
* ((unsigned *)&ptr) += 1;
|
||||
unaligned_test(ptr, &val1);
|
||||
* ((unsigned *)&ptr) += 1;
|
||||
unaligned_test(ptr, &val2);
|
||||
* ((unsigned *)&ptr) += 1;
|
||||
unaligned_test(ptr, &val3);
|
||||
* ((unsigned *)&ptr) += 1;
|
||||
unaligned_test(ptr, &val4);
|
||||
}
|
||||
print_num(screen, font, screen->w-37, screen->h-12, fps);
|
||||
print_num_hex(screen, font_hex, 0, 40, val0);
|
||||
print_num_hex(screen, font_hex, 0, 60, val1);
|
||||
print_num_hex(screen, font_hex, 0, 80, val2);
|
||||
print_num_hex(screen, font_hex, 0, 100, val3);
|
||||
print_num_hex(screen, font_hex, 0, 120, val4);
|
||||
print_num_hex(screen, font_hex, 0, 180, 0x12345678);
|
||||
|
||||
++fps_count;
|
||||
|
||||
for(i=0; i<MAX_POINTERS; i++)
|
||||
|
||||
22
project/jni/application/ballfield/unaligned.c
Normal file
22
project/jni/application/ballfield/unaligned.c
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
extern void unaligned_test2(int x1, int x2, int x3, int x4, int x5, int x6, int x7, unsigned * data, unsigned * target);
|
||||
extern void unaligned_test(unsigned * data, unsigned * target);
|
||||
extern unsigned val0, val1, val2, val3, val4;
|
||||
|
||||
unsigned val0 = 1, val1 = 2, val2 = 3, val3 = 4, val4 = 5;
|
||||
|
||||
void unaligned_test2(int x1, int x2, int x3, int x4, int x5, int x6, int x7, unsigned * data, unsigned * target)
|
||||
{
|
||||
int xx = x1 + x2 - x3 + x4 - x5 + x6 - x7;
|
||||
*target = xx + data[3];
|
||||
}
|
||||
|
||||
void unaligned_test(unsigned * data, unsigned * target)
|
||||
{
|
||||
//__android_log_print(ANDROID_LOG_INFO, "Ballfield", "data %p target %p", data, target);
|
||||
int x1 = *data, x2 = *target, x3 = *data + *target, x4 = *data - *target, x5 = *data - *target * 2, x6 = *data + *target * 2, x7 = *target * 3 + *data;
|
||||
unaligned_test2(x1, x2, x3, x4, x5, x6, x7, data-3, target);
|
||||
};
|
||||
|
||||
@@ -40,10 +40,10 @@ done
|
||||
MISSING_INCLUDE=
|
||||
MISSING_LIB=
|
||||
|
||||
if [ -n "$CRYSTAX_WCHAR" ]; then
|
||||
MISSING_INCLUDE="$MISSING_INCLUDE -isystem$NDK/sources/crystax/include"
|
||||
MISSING_LIB="$MISSING_LIB $NDK/sources/crystax/libs/armeabi/libcrystax_static.a"
|
||||
fi
|
||||
#if [ -n "$CRYSTAX_WCHAR" ]; then
|
||||
# MISSING_INCLUDE="$MISSING_INCLUDE -isystem$NDK/sources/crystax/include"
|
||||
# MISSING_LIB="$MISSING_LIB $NDK/sources/crystax/libs/armeabi/libcrystax_static.a"
|
||||
#fi
|
||||
#if [ -n "$MISSING_LIBCXX_PATH" ]; then
|
||||
# MISSING_INCLUDE="$MISSING_INCLUDE -isystem$NDK/sources/cxx-stl/gnu-libstdc++/include"
|
||||
# MISSING_LIB="$MISSING_LIB -lgnustl_static -lsupc++"
|
||||
|
||||
@@ -16,9 +16,9 @@ SCRIPT=setEnvironment-r4b.sh
|
||||
CRYSTAX_WCHAR=
|
||||
if [ -n "`echo $NDK | grep 'android-ndk-r[56789]'`" ]; then
|
||||
SCRIPT=setEnvironment-r5b.sh
|
||||
if [ -n "`echo $NDK | grep 'android-ndk-r[56789]-crystax'`" ]; then
|
||||
CRYSTAX_WCHAR=1
|
||||
fi
|
||||
# if [ -n "`echo $NDK | grep 'android-ndk-r[56789]-crystax'`" ]; then
|
||||
# CRYSTAX_WCHAR=1
|
||||
# fi
|
||||
fi
|
||||
|
||||
env CRYSTAX_WCHAR=$CRYSTAX_WCHAR $LOCAL_PATH/$SCRIPT "$@"
|
||||
|
||||
@@ -1 +1 @@
|
||||
frogatto
|
||||
ballfield
|
||||
@@ -79,9 +79,5 @@ LOCAL_SHARED_LIBRARIES :=
|
||||
|
||||
LOCAL_LDLIBS := -lz
|
||||
|
||||
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
|
||||
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/armeabi -lcrystax_static
|
||||
endif
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
@@ -23,10 +23,6 @@ LOCAL_CFLAGS := -Os -DBUILDING_LIBINTL -DBUILDING_DLL \
|
||||
# -DINSTALLDIR=\"/usr/local/lib\"
|
||||
|
||||
LOCAL_SRC_FILES := $(foreach F, $(APP_SUBDIRS), $(addprefix $(F)/,$(notdir $(wildcard $(LOCAL_PATH)/$(F)/*.c))))
|
||||
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
|
||||
LOCAL_C_INCLUDES += $(NDK_PATH)/sources/crystax/include
|
||||
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/armeabi -lcrystax_static
|
||||
endif
|
||||
|
||||
LOCAL_SHARED_LIBRARIES :=
|
||||
|
||||
|
||||
@@ -20,8 +20,4 @@ LOCAL_STATIC_LIBRARIES :=
|
||||
|
||||
LOCAL_LDLIBS := -llog
|
||||
|
||||
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
|
||||
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/armeabi -lcrystax_static # I have no idea how could OpenAL link to C++ wide-char support lib
|
||||
endif
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -58,8 +58,4 @@ LOCAL_SRC_FILES := $(foreach F, $(SDL_SRCS), $(addprefix $(dir $(F)),$(notdir $(
|
||||
|
||||
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog
|
||||
|
||||
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
|
||||
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/armeabi -lcrystax_static
|
||||
endif
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -61,8 +61,4 @@ LOCAL_SRC_FILES := $(foreach F, $(SDL_SRCS), $(addprefix $(dir $(F)),$(notdir $(
|
||||
|
||||
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog
|
||||
|
||||
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
|
||||
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/armeabi -lcrystax_static
|
||||
endif
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
Reference in New Issue
Block a user