addeq r0, r0, #32*2\r
\r
.fl_no32colRGB555:\r
-.fl_loopRGB555:\r
\r
+.if UNALIGNED_DRAWLINEDEST\r
+ @ this is basically for Gizmondo, which has unaligned odd lines in the framebuffer\r
+ tst r0, #2\r
+ bne .fl_RGB555u\r
+.endif\r
+\r
+.fl_loopRGB555:\r
ldr r12, [r1], #4\r
ldr r7, [r1], #4\r
\r
ldrh r6, [r3, r6]\r
and r12,lr, r7, lsr #15\r
ldrh r12,[r3, r12]\r
+ and r7, lr, r7, lsr #23\r
+ ldrh r7, [r3, r7]\r
orr r8, r8, r6, lsl #16\r
\r
- and r6, lr, r7, lsr #23\r
- ldrh r6, [r3, r6] @ 1 cycle interlock here (r6)\r
subs r2, r2, #1\r
- orr r12,r12, r6, lsl #16\r
+ orr r12,r12, r7, lsl #16\r
\r
stmia r0!, {r4,r5,r8,r12}\r
bne .fl_loopRGB555\r
mov r9, #0x3900 @ f800 07e0 001f | e000 0780 001c | 3800 01e0 0007\r
orr r9, r9, #0x00e7\r
\r
+.if UNALIGNED_DRAWLINEDEST\r
+ tst r0, #2\r
+ bne .fl_32scale_RGB555u\r
+.endif\r
+\r
.fl_loop32scale_RGB555:\r
ldr r12, [r1], #4\r
ldr r7, [r1], #4\r
ldmfd sp!, {r4-r8,lr}\r
bx lr\r
\r
+.if UNALIGNED_DRAWLINEDEST\r
+ @ unaligned versions of loops\r
+\r
+.fl_RGB555u:\r
+ ldr r12, [r1], #4\r
+ ldr r7, [r1], #4\r
+\r
+ and r4, lr, r12, lsl #1\r
+ ldrh r4, [r3, r4]\r
+ and r5, lr, r12, lsr #7\r
+ ldrh r5, [r3, r5]\r
+ strh r4, [r0], #2\r
+ b .fl_loopRGB555u_enter\r
+\r
+.fl_loopRGB555u:\r
+ ldr r12, [r1], #4\r
+ ldr r7, [r1], #4\r
+\r
+ and r4, lr, r12, lsl #1\r
+ ldrh r4, [r3, r4]\r
+ and r5, lr, r12, lsr #7\r
+ ldrh r5, [r3, r5]\r
+\r
+ orr r4, r8, r4, lsl #16\r
+ str r4, [r0], #4\r
+\r
+.fl_loopRGB555u_enter:\r
+ and r6, lr, r12, lsr #15\r
+ ldrh r6, [r3, r6]\r
+ and r8, lr, r12, lsr #23\r
+ ldrh r8, [r3, r8]\r
+ orr r4, r5, r6, lsl #16\r
+\r
+ and r5, lr, r7, lsl #1\r
+ ldrh r5, [r3, r5]\r
+ and r6, lr, r7, lsr #7\r
+ ldrh r6, [r3, r6]\r
+ orr r5, r8, r5, lsl #16\r
+\r
+ and r12,lr, r7, lsr #15\r
+ ldrh r12,[r3, r12]\r
+ and r8, lr, r7, lsr #23\r
+ ldrh r8, [r3, r8]\r
+ orr r6, r6, r12,lsl #16\r
+\r
+ subs r2, r2, #1\r
+ stmia r0!, {r4,r5,r6}\r
+ bne .fl_loopRGB555u\r
+\r
+ strh r8, [r0], #2\r
+\r
+ ldmfd sp!, {r4-r8,lr}\r
+ bx lr\r
+\r
+\r
+.fl_32scale_RGB555u:\r
+\r
+ @ r9 f800 07e0 001f | e000 0780 001c | 3800 01e0 0007\r
+.fl_loop32scale_RGB555u:\r
+ ldr r12, [r1], #4\r
+ ldr r7, [r1], #4\r
+\r
+ and r4, lr, r12,lsl #1\r
+ ldrh r4, [r3, r4]\r
+ and r5, lr, r12,lsr #7\r
+ ldrh r5, [r3, r5]\r
+ and r4, r4, r9, lsl #2\r
+@ orr r4, rx, r4, lsl #16\r
+ str r4, [r0], #4 @ pix_d -1, 0\r
+\r
+.fl_loop32scale_RGB555u_enter:\r
+ and r4, r9, r4, lsr #2 @ r4=1/4 pix_s 0\r
+\r
+ and r5, r5, r9, lsl #2\r
+ sub r6, r5, r5, lsr #2 @ r6 = 3/4 pix_s 1\r
+ add r4, r6, r4, lsr #2 @ r4=(1/4 pix_s 0) + (3/4 pix_s 1)\r
+ orr r4, r4, r5, lsl #15\r
+\r
+ and r6, lr, r12,lsr #15\r
+ ldrh r6, [r3, r6]\r
+ and r12,lr, r12,lsr #23\r
+ ldrh r12,[r3, r12]\r
+ and r6, r6, r9, lsl #2\r
+ add r4, r4, r6, lsl #15 @ pix_d 1, 2\r
+\r
+@@ TODO...\r
+\r
+ mov r5, r5, lsr #1\r
+ sub r6, r6, r6, lsr #2 @ r6 = 3/4 pix_s 2\r
+ orr r5, r5, r6, lsl #16\r
+\r
+ and r6, lr, r7, lsl #1\r
+ ldrh r6, [r3, r6]\r
+ and r12,r12,r9, lsl #2\r
+ add r5, r5, r12,lsl #14 @ pix_d 2, 3\r
+ and r6, r6, r9, lsl #2\r
+ orr r6, r12,r6, lsl #16 @ pix_d 4, 5\r
+\r
+ and r12,lr, r7, lsr #7\r
+ ldrh r12,[r3, r12]\r
+ and r10,lr, r7, lsr #15\r
+ ldrh r10,[r3, r10]\r
+ and r12,r12,r9, lsl #2\r
+ sub r8, r12,r12,lsr #2 @ r8 = 3/4 pix_s 1\r
+ add r8, r8, r6, lsr #18\r
+ and r7, lr, r7, lsr #23\r
+ ldrh r7, [r3, r7]\r
+ and r10,r10,r9, lsl #2\r
+ orr r8, r8, r10,lsl #15\r
+ add r8, r8, r12,lsl #15 @ pix_d 6, 7\r
+ sub r10,r10,r10,lsr #2 @ r10= 3/4 pix_s 2\r
+ and r7, r7, r9, lsl #2\r
+ add r10,r10,r7, lsr #2 @ += 1/4 pix_s 3\r
+ orr r10,r10,r7, lsl #16 @ pix_d 8, 9\r
+\r
+ subs r2, r2, #1\r
+\r
+ stmia r0!, {r4,r5,r6,r8,r10}\r
+ bne .fl_loop32scale_RGB555u\r
+\r
+ ldmfd sp!, {r9,r10}\r
+ ldmfd sp!, {r4-r8,lr}\r
+ bx lr\r
+\r
+.endif @ UNALIGNED_DRAWLINEDEST\r
+\r
\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
static void osd_text(int x, int y, const char *text)
{
- int len = strlen(text) * 8;
- int *p, i, h;
- len = (len+1) >> 1;
+ int len = strlen(text) * 8 / 2;
+ int *p, h;
for (h = 0; h < 8; h++) {
p = (int *) ((unsigned short *) giz_screen+x+321*(y+h));
p = (int *) ((int)p & ~3); // align
- for (i = len; i; i--, p++) *p = 0;
+ memset32(p, 0, len);
}
emu_textOut16(x, y, text);
}
+/*
+void log1(void *p1, void *p2)
+{
+ lprintf("%p %p %p\n", p1, p2, DrawLineDest);
+}
+*/
short localPal[0x100];
static void (*vidCpy8to16)(void *dest, void *src, short *pal, int lines) = NULL;
} */
}
// TODO...
- //lprintf("vidCpy8to16 %p %p\n", (unsigned short *)giz_screen+321*8, PicoDraw2FB+328*8);
vidCpy8to16((unsigned short *)giz_screen+321*8, PicoDraw2FB+328*8, localPal, 224);
- //lprintf("after vidCpy8to16\n");
}
if (notice || (emu_opt & 2)) {
// if ((emu_opt & 0x400) && (PicoMCD & 1))
// cd_leds();
- //gp2x_video_wait_vsync();
-
- if (!(PicoOpt&0x10)) {
- if (Pico.video.reg[1] & 8) {
- if (currentConfig.EmuOpt&0x80)
- DrawLineDest = (unsigned short *) giz_screen;
- else
- HighCol = gfx_buffer;
- } else {
- if (currentConfig.EmuOpt&0x80)
- DrawLineDest = (unsigned short *) giz_screen + 320*8;
- else
- HighCol = gfx_buffer + 328*8;
- }
- }
}
// clears whole screen or just the notice area (in all buffers)
if (giz_screen == NULL)
giz_screen = Framework2D_LockBuffer();
if (full) memset32(giz_screen, 0, 320*240*2/4);
- else memset32((int *)((char *)giz_screen + 320*232*2), 0, 320*8*2/4);
+ else memset32((int *)((char *)giz_screen + 321*232*2), 0, 321*8*2/4);
}
static void vidResetMode(void)
{
- void *screen;
+ giz_screen = Framework2D_LockBuffer();
+
if (PicoOpt&0x10) {
} else if (currentConfig.EmuOpt&0x80) {
PicoDrawSetColorFormat(1);
PicoScan = EmuScan16;
} else {
- PicoDrawSetColorFormat(0);
+ PicoDrawSetColorFormat(-1);
PicoScan = EmuScan8;
}
- if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) {
+ if ((PicoOpt&0x10) || !(currentConfig.EmuOpt&0x80)) {
// setup pal for 8-bit modes
localPal[0xc0] = 0x0600;
localPal[0xd0] = 0xc000;
localPal[0xf0] = 0xffff;
}
Pico.m.dirtyPal = 1;
- screen = Framework2D_LockBuffer();
- memset32(screen, 0, 320*240*2/4);
+
+ memset32(giz_screen, 0, 321*240*2/4);
Framework2D_UnlockBuffer();
giz_screen = NULL;
}
updateKeys();
- if (giz_screen == NULL)
+ if (giz_screen == NULL && (currentConfig.EmuOpt&0x80))
giz_screen = Framework2D_LockBuffer();
+ if (!(PicoOpt&0x10))
+ PicoScan((unsigned) -1, NULL);
PicoFrame();
+
+ if (giz_screen == NULL)
+ giz_screen = Framework2D_LockBuffer();
+
blit(fpsbuff, notice);
if (giz_screen != NULL) {