diff options
author | Franklin Wei <git@fwei.tk> | 2019-07-07 21:51:41 -0400 |
---|---|---|
committer | Franklin Wei <git@fwei.tk> | 2019-07-09 11:20:55 -0400 |
commit | 71922db6cf64fde49deb0ce12fc2828ca0129b53 (patch) | |
tree | 41788b64d9fa35b9ca5035f365019a6017cf5d43 /apps | |
parent | c7f26de2bfc25865286bfe11b551ff1d3ca7104f (diff) | |
download | rockbox-71922db6cf64fde49deb0ce12fc2828ca0129b53.tar.gz rockbox-71922db6cf64fde49deb0ce12fc2828ca0129b53.zip |
sdl: a couple minor fixes
Prevents system SDL from interfering with thread driver selection. Also
adds test code for alignment faults.
Change-Id: I8bc181922c4a9e764429897dbbaa1ffaabd01126
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/sdl/include/SDL_config_rockbox.h | 2 | ||||
-rw-r--r-- | apps/plugins/sdl/main.c | 13 | ||||
-rw-r--r-- | apps/plugins/sdl/src/thread/SDL_thread_c.h | 23 |
3 files changed, 18 insertions, 20 deletions
diff --git a/apps/plugins/sdl/include/SDL_config_rockbox.h b/apps/plugins/sdl/include/SDL_config_rockbox.h index 90e79ccede..e268a73a8b 100644 --- a/apps/plugins/sdl/include/SDL_config_rockbox.h +++ b/apps/plugins/sdl/include/SDL_config_rockbox.h | |||
@@ -163,7 +163,7 @@ | |||
163 | #define vsnprintf rb->vsnprintf | 163 | #define vsnprintf rb->vsnprintf |
164 | #define vsprintf vsprintf_wrapper | 164 | #define vsprintf vsprintf_wrapper |
165 | 165 | ||
166 | #define M_PI 3.141592 | 166 | #define M_PI 3.14159265358979323846 |
167 | #define EOF 0xff | 167 | #define EOF 0xff |
168 | 168 | ||
169 | #define LOAD_XPM | 169 | #define LOAD_XPM |
diff --git a/apps/plugins/sdl/main.c b/apps/plugins/sdl/main.c index 384055e660..478debc1ad 100644 --- a/apps/plugins/sdl/main.c +++ b/apps/plugins/sdl/main.c | |||
@@ -174,10 +174,21 @@ enum plugin_status plugin_start(const void *param) | |||
174 | (void) param; | 174 | (void) param; |
175 | 175 | ||
176 | #if defined(CPU_ARM) && !defined(SIMULATOR) | 176 | #if defined(CPU_ARM) && !defined(SIMULATOR) |
177 | /* (don't) set alignment trap */ | 177 | /* (don't) set alignment trap. Will generate a data abort |
178 | * exception on ARM. */ | ||
178 | //set_cr(get_cr() | CR_A); | 179 | //set_cr(get_cr() | CR_A); |
179 | #endif | 180 | #endif |
180 | 181 | ||
182 | #if 0 | ||
183 | char c = *((char*)NULL); | ||
184 | |||
185 | /* test alignment trap */ | ||
186 | unsigned int x = 0x12345678; | ||
187 | char *p = ((char*)&x) + 1; | ||
188 | unsigned short *p2 = (unsigned short*)p; | ||
189 | rb->splashf(HZ, "%04x, %02x%02x", *p2, *(p+1), *p); | ||
190 | #endif | ||
191 | |||
181 | /* don't confuse this with the main SDL thread! */ | 192 | /* don't confuse this with the main SDL thread! */ |
182 | main_thread_id = rb->thread_self(); | 193 | main_thread_id = rb->thread_self(); |
183 | 194 | ||
diff --git a/apps/plugins/sdl/src/thread/SDL_thread_c.h b/apps/plugins/sdl/src/thread/SDL_thread_c.h index d0804e9a81..1cd6835d6f 100644 --- a/apps/plugins/sdl/src/thread/SDL_thread_c.h +++ b/apps/plugins/sdl/src/thread/SDL_thread_c.h | |||
@@ -24,24 +24,11 @@ | |||
24 | #ifndef _SDL_thread_c_h | 24 | #ifndef _SDL_thread_c_h |
25 | #define _SDL_thread_c_h | 25 | #define _SDL_thread_c_h |
26 | 26 | ||
27 | /* Need the definitions of SYS_ThreadHandle */ | 27 | #ifndef SDL_THREAD_ROCKBOX |
28 | #if SDL_THREADS_DISABLED | 28 | #define SDL_THREAD_ROCKBOX 1 |
29 | #include "generic/SDL_systhread_c.h" | 29 | #endif |
30 | #elif SDL_THREAD_BEOS | 30 | |
31 | #include "beos/SDL_systhread_c.h" | 31 | #if SDL_THREAD_ROCKBOX |
32 | #elif SDL_THREAD_DC | ||
33 | #include "dc/SDL_systhread_c.h" | ||
34 | #elif SDL_THREAD_OS2 | ||
35 | #include "os2/SDL_systhread_c.h" | ||
36 | #elif SDL_THREAD_PTH | ||
37 | #include "pth/SDL_systhread_c.h" | ||
38 | #elif SDL_THREAD_SPROC | ||
39 | #include "irix/SDL_systhread_c.h" | ||
40 | #elif SDL_THREAD_WIN32 | ||
41 | #include "win32/SDL_systhread_c.h" | ||
42 | #elif SDL_THREAD_SYMBIAN | ||
43 | #include "symbian/SDL_systhread_c.h" | ||
44 | #elif SDL_THREAD_ROCKBOX | ||
45 | #include "rockbox/SDL_systhread_c.h" | 32 | #include "rockbox/SDL_systhread_c.h" |
46 | #else | 33 | #else |
47 | #error Need thread implementation for this platform | 34 | #error Need thread implementation for this platform |