LDFLAGS += -lz -lpthread -ldl
ifdef CROSS_COMPILE
CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp -ffast-math
+ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
endif
ifndef DEBUG
CFLAGS += -O2
OBJS += frontend/main.o frontend/plugin.o frontend/plugin_lib.o
OBJS += frontend/linux/fbdev.o
+ifdef CROSS_COMPILE
+OBJS += frontend/arm_utils.o
+endif
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
--- /dev/null
+/*
+ * (C) GraÅžvydas "notaz" Ignotas, 2010
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+.text
+.align 2
+
+.global bgr555_to_rgb565
+bgr555_to_rgb565:
+ mov r3, #0x03e0
+ vdup.16 q15, r3
+ mov r2, r2, lsr #6
+0:
+ vldmia r1!, {q0-q3}
+ vshr.u16 q4, q0, #10
+ vshr.u16 q5, q1, #10
+ vshr.u16 q6, q2, #10
+ vshr.u16 q7, q3, #10
+ vshl.u16 q8, q0, #11
+ vshl.u16 q9, q1, #11
+ vshl.u16 q10, q2, #11
+ vshl.u16 q11, q3, #11
+ vand q0, q0, q15
+ vand q1, q1, q15
+ vand q2, q2, q15
+ vand q3, q3, q15
+ vshl.u16 q0, q0, #1
+ vshl.u16 q1, q1, #1
+ vshl.u16 q2, q2, #1
+ vshl.u16 q3, q3, #1
+ vorr q0, q0, q4
+ vorr q1, q1, q5
+ vorr q2, q2, q6
+ vorr q3, q3, q7
+ vorr q0, q0, q8
+ vorr q1, q1, q9
+ vorr q2, q2, q10
+ vorr q3, q3, q11
+ vstmia r0!, {q0-q3}
+ subs r2, r2, #1
+ bne 0b
+
+ bx lr
+
+@ vim:filetype=armasm
unsigned short usCursorActive = 0;
char * pCaptionText;
+#ifndef __arm__
+#define bgr555_to_rgb565 memcpy
+#endif
static void blit(void)
{
+ extern void bgr555_to_rgb565(void *dst, void *src, int bytes);
int x = PSXDisplay.DisplayPosition.x;
int y = PSXDisplay.DisplayPosition.y;
int w = PreviousPSXDisplay.Range.x1;
int pitch = PreviousPSXDisplay.DisplayMode.x * 2;
unsigned char *dest = pl_fbdev_buf;
+ if (w <= 0)
+ return;
+
// TODO: clear border if centering
// account for centering
unsigned short *srcs = psxVuw + y * 1024 + x;
for (; h-- > 0; dest += pitch, srcs += 1024)
{
- memcpy(dest, srcs, w * 2);
+ bgr555_to_rgb565(dest, srcs, w * 2);
}
}
}