aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2011-06-16 18:43:51 +0300
committernotaz2011-07-08 00:14:51 +0300
commit69f0df9cbaed6620a190ac289958c5bf7c079d92 (patch)
treee9b98c14108d0b701f07e2f5edea40993fe21b77
parent04fd948ab0639acff080434f54212af13ab14ef1 (diff)
downloadpcsx_rearmed-69f0df9cbaed6620a190ac289958c5bf7c079d92.tar.gz
pcsx_rearmed-69f0df9cbaed6620a190ac289958c5bf7c079d92.tar.bz2
pcsx_rearmed-69f0df9cbaed6620a190ac289958c5bf7c079d92.zip
arm_utils: relax alignment requirements
the code needing alignment isn't reached often anyway.
-rw-r--r--frontend/arm_utils.s27
-rw-r--r--plugins/dfxvideo/draw_fb.c2
-rw-r--r--plugins/gpu_unai/gpu.cpp2
3 files changed, 24 insertions, 7 deletions
diff --git a/frontend/arm_utils.s b/frontend/arm_utils.s
index 4e561f9..d131923 100644
--- a/frontend/arm_utils.s
+++ b/frontend/arm_utils.s
@@ -15,7 +15,8 @@
bgr555_to_rgb565:
mov r3, #0x07c0
vdup.16 q15, r3
- sub r2, r2, #64
+ subs r2, r2, #64
+ blt btr16_end64
0:
vldmia r1!, {q0-q3}
vshl.u16 q4, q0, #11
@@ -38,20 +39,36 @@ bgr555_to_rgb565:
subs r2, r2, #64
bge 0b
+btr16_end64:
adds r2, r2, #64
bxeq lr
+ subs r2, r2, #16
+ blt btr16_end16
- @ handle the remainder
+ @ handle the remainder (reasonably rare)
0:
- vld1.16 {q0}, [r1, :64]!
+ vld1.16 {q0}, [r1]!
vshl.u16 q1, q0, #11
vshl.u16 q2, q0, #1
vsri.u16 q1, q0, #10
vbit q1, q2, q15
subs r2, r2, #16
- vst1.16 {q1}, [r0, :64]!
- bgt 0b
+ vst1.16 {q1}, [r0]!
+ bge 0b
+btr16_end16:
+ adds r2, r2, #16
+ bxeq lr
+ subs r2, r2, #8
+ bxlt lr
+
+ @ very rare
+ vld1.16 d0, [r1]!
+ vshl.u16 d1, d0, #11
+ vshl.u16 d2, d0, #1
+ vsri.u16 d1, d0, #10
+ vbit d1, d2, d30
+ vst1.16 d1, [r0]!
bx lr
diff --git a/plugins/dfxvideo/draw_fb.c b/plugins/dfxvideo/draw_fb.c
index dbf0fc8..b560813 100644
--- a/plugins/dfxvideo/draw_fb.c
+++ b/plugins/dfxvideo/draw_fb.c
@@ -21,7 +21,7 @@ unsigned long lSetMask;
static void blit(void)
{
- int px = PSXDisplay.DisplayPosition.x & ~3; // XXX: align needed by bgr*_to_...
+ int px = PSXDisplay.DisplayPosition.x & ~1; // XXX: align needed by bgr*_to_...
int py = PSXDisplay.DisplayPosition.y;
int w = PreviousPSXDisplay.Range.x1;
int h = PreviousPSXDisplay.DisplayMode.y;
diff --git a/plugins/gpu_unai/gpu.cpp b/plugins/gpu_unai/gpu.cpp
index 5152327..0ef8f51 100644
--- a/plugins/gpu_unai/gpu.cpp
+++ b/plugins/gpu_unai/gpu.cpp
@@ -879,7 +879,7 @@ static void blit(void)
u16 *srcs;
u8 *dest;
- x0 = DisplayArea[0] & ~3; // alignment needed by blitter
+ x0 = DisplayArea[0] & ~1; // alignment needed by blitter
y0 = DisplayArea[1];
srcs = &((u16*)GPU_FrameBuffer)[FRAME_OFFSET(x0,y0)];