diff options
author | notaz | 2010-12-05 22:51:00 +0200 |
---|---|---|
committer | notaz | 2010-12-05 22:51:00 +0200 |
commit | 507aaf98de47ca11c52ced9957d4f190aff71777 (patch) | |
tree | 36885743250429ff90806f6fbc8c992a42d97aad | |
parent | 67ba0fb4fa3f120c4156ca7d6155c51b7623e84f (diff) | |
download | pcsx_rearmed-507aaf98de47ca11c52ced9957d4f190aff71777.tar.gz pcsx_rearmed-507aaf98de47ca11c52ced9957d4f190aff71777.tar.bz2 pcsx_rearmed-507aaf98de47ca11c52ced9957d4f190aff71777.zip |
fix some alignment issues
-rw-r--r-- | libpcsxcore/misc.c | 4 | ||||
-rw-r--r-- | plugins/dfxvideo/swap.h | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index ef49244..38a516c 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -54,7 +54,9 @@ struct iso_directory_record { void mmssdd( char *b, char *p ) { int m, s, d; -#if defined(__BIGENDIAN__) +#if defined(__arm__) + int block = (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]; +#elif defined(__BIGENDIAN__) int block = (b[0] & 0xff) | ((b[1] & 0xff) << 8) | ((b[2] & 0xff) << 16) | (b[3] << 24); #else int block = *((int*)b); diff --git a/plugins/dfxvideo/swap.h b/plugins/dfxvideo/swap.h index 3f7ac21..e559759 100644 --- a/plugins/dfxvideo/swap.h +++ b/plugins/dfxvideo/swap.h @@ -64,8 +64,13 @@ static __inline__ void PUTLE32(uint32_t *ptr, uint32_t val) { #else #define GETLE16(X) LE2HOST16(*(uint16_t *)X) -#define GETLE32(X) LE2HOST32(*(uint32_t *)X) #define GETLE16D(X) ({uint32_t val = GETLE32(X); (val<<16 | val >> 16);}) #define PUTLE16(X, Y) do{*((uint16_t *)X)=HOST2LE16((uint16_t)Y);}while(0) +#ifdef __arm__ +#define GETLE32(X) (*(uint16_t *)X|(((uint16_t *)X)[1]<<16)) +#define PUTLE32(X, Y) do{*((uint16_t *)X)=(uint32_t)Y;((uint16_t *)X)[1]=(uint32_t)(Y)>>16;}while(0) +#else +#define GETLE32(X) LE2HOST32(*(uint32_t *)X) #define PUTLE32(X, Y) do{*((uint32_t *)X)=HOST2LE16((uint32_t)Y);}while(0) #endif +#endif |