aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpcsxcore/misc.c4
-rw-r--r--plugins/dfxvideo/swap.h7
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