.text\r
.align 4\r
\r
-@ Convert 0000bbb0 ggg0rrr0 0000bbb0 ggg0rrr0\r
-@ to 00000000 rrr00000 ggg00000 bbb00000 ...\r
+@ Convert 0000bbbb ggggrrrr 0000bbbb ggggrrrr\r
+@ to 00000000 rrrr0000 gggg0000 bbbb0000 ...\r
\r
-@ lr = 0x00e000e0, out: r3=lower_pix, r2=higher_pix; trashes rin\r
+@ lr = 0x00f000f0, out: r3=lower_pix, r2=higher_pix; trashes rin\r
.macro convRGB32_2 rin sh=0\r
and r2, lr, \rin, lsr #4 @ blue\r
and r3, \rin, lr\r
mov r3, r3, ror #17 @ shadow mode\r
.elseif \sh == 2\r
adds r3, r3, #0x40000000 @ green\r
- orrcs r3, r3, #0xe0000000\r
+ orrcs r3, r3, lr, lsl #24\r
mov r3, r3, ror #8\r
adds r3, r3, #0x40000000\r
- orrcs r3, r3, #0xe0000000\r
+ orrcs r3, r3, lr, lsl #24\r
mov r3, r3, ror #16\r
adds r3, r3, #0x40000000\r
- orrcs r3, r3, #0xe0000000\r
+ orrcs r3, r3, lr, lsl #24\r
mov r3, r3, ror #24\r
.else\r
mov r3, r3, ror #16 @ r3=low\r
.elseif \sh == 2\r
mov r2, r2, ror #8\r
adds r2, r2, #0x40000000 @ blue\r
- orrcs r2, r2, #0xe0000000\r
+ orrcs r2, r2, lr, lsl #24\r
mov r2, r2, ror #8\r
adds r2, r2, #0x40000000\r
- orrcs r2, r2, #0xe0000000\r
+ orrcs r2, r2, lr, lsl #24\r
mov r2, r2, ror #8\r
adds r2, r2, #0x40000000\r
- orrcs r2, r2, #0xe0000000\r
+ orrcs r2, r2, lr, lsl #24\r
mov r2, r2, ror #8\r
.endif\r
\r
stmfd sp!, {r4-r7,lr}\r
\r
mov r12, #0x40>>3 @ repeats\r
- mov lr, #0x00e00000\r
- orr lr, lr, #0x00e0\r
+ mov lr, #0x00f00000\r
+ orr lr, lr, #0x00f0\r
\r
.loopRGB32:\r
- subs r12, r12, #1\r
-\r
ldmia r1!, {r4-r7}\r
convRGB32_2 r4\r
convRGB32_2 r5\r
convRGB32_2 r6\r
convRGB32_2 r7\r
+\r
+ subs r12, r12, #1\r
bgt .loopRGB32\r
\r
ldmfd sp!, {r4-r7,pc}\r
\r
mov r12, #0x40>>3 @ repeats\r
add r0, r0, #0x40*4\r
- mov lr, #0x00e00000\r
- orr lr, lr, #0x00e0\r
+ mov lr, #0x00f00000\r
+ orr lr, lr, #0x00f0\r
\r
.loopRGB32sh:\r
- subs r12, r12, #1\r
-\r
ldmia r1!, {r4-r7}\r
convRGB32_2 r4, 2\r
convRGB32_2 r5, 2\r
convRGB32_2 r6, 2\r
convRGB32_2 r7, 2\r
+\r
+ subs r12, r12, #1\r
bgt .loopRGB32sh\r
\r
mov r12, #0x40>>3 @ repeats\r
sub r1, r1, #0x40*2\r
+ and lr, lr, lr, lsl #1 @ kill LSB for correct shadow colors\r
\r
.loopRGB32hi:\r
- ldmia r1!, {r4-r7}\r
+ ldmia r1!, {r4-r7}\r
convRGB32_2 r4, 1\r
convRGB32_2 r5, 1\r
convRGB32_2 r6, 1\r
\r
static int get_renderer(void)\r
{\r
+ if (doing_bg_frame)\r
+ return RT_16BIT;\r
+ if ((PicoIn.AHW & PAHW_SMS) && currentConfig.renderer == RT_8BIT_FAST)\r
+ return RT_8BIT_ACC; // 8bpp fast is not there (yet?)\r
if (PicoIn.AHW & PAHW_32X)\r
return currentConfig.renderer32x;\r
else\r
stride *= 2;\r
// the fast renderer has overlap areas and can't directly render to\r
// screen buffers. Its output is copied to screen in finalize_frame\r
- if (currentConfig.renderer != RT_8BIT_FAST || (PicoIn.AHW & PAHW_32X))\r
+ if (get_renderer() != RT_8BIT_FAST || (PicoIn.AHW & PAHW_32X))\r
PicoDrawSetOutBuf(g_screen_ptr, stride);\r
}\r
\r
int gp2x_mode = 16;\r
int renderer = get_renderer();\r
\r
- if (doing_bg_frame)\r
- renderer = RT_16BIT;\r
-\r
PicoIn.opt &= ~POPT_ALT_RENDERER;\r
emu_scan_begin = NULL;\r
emu_scan_end = NULL;\r
if (currentConfig.scaling == EOPT_SCALE_SW) {\r
PicoIn.opt |= POPT_EN_SOFTSCALE;\r
PicoIn.filter = EOPT_FILTER_BILINEAR2;\r
- } else if (currentConfig.scaling == EOPT_SCALE_HW && is_16bit_mode())\r
+ } else if (currentConfig.scaling == EOPT_SCALE_HW)\r
// hw scaling, render without any padding\r
PicoIn.opt |= POPT_DIS_32C_BORDER;\r
\r