From 672b29e658ee1ea1ece9a0697aa56811323cf759 Mon Sep 17 00:00:00 2001 From: kub Date: Wed, 26 Feb 2020 20:31:40 +0100 Subject: [PATCH] bugfix for ARM asm sprite rendering --- pico/draw.c | 2 +- pico/draw_arm.S | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pico/draw.c b/pico/draw.c index da87ede2..e6545017 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -1243,7 +1243,7 @@ static void DrawAllSprites(unsigned char *sprited, int prio, int sh, struct PicoEState *est) { unsigned char *p; - int cnt, w = sprited[2]; + int cnt, w; cnt = sprited[0] & 0x7f; if (cnt == 0) return; diff --git a/pico/draw_arm.S b/pico/draw_arm.S index 967bf6aa..0eb161e3 100644 --- a/pico/draw_arm.S +++ b/pico/draw_arm.S @@ -1169,7 +1169,9 @@ DrawSprite: mov r2, r0, lsl #24 cmp r0, #0xff ldmeqfd sp!, {r1,r3-r11,pc} @ end of list - eor r2, r2, r4, lsl #30 + eors r2, r2, r4, lsl #30 + bic r2, r4, #0xff000000 + str r2, [sp] bmi DrawSprite @ wrong priority ldr r1, [r7, #OFS_EST_HighPreSpr] and r0, r0, #0x7f @@ -1210,8 +1212,6 @@ DrawSprite: add r6, r6, #1 @ inc now cmp r4, #0x1000000 @ check width of last sprite movhs r6, r4, lsr #24 - bichs r4, r4, #0xff000000 - strhs r4, [sp] @ cache some stuff to avoid mem access mov r5, r5, lsl #4 @ delta<<=4; // Delta of address -- 2.39.5