@ (c) Copyright 2006, notaz\r
@ All Rights Reserved\r
\r
+.include "port_config.s"\r
+\r
\r
@ Convert 0000bbb0 ggg0rrr0 0000bbb0 ggg0rrr0\r
@ to 00000000 rrr00000 ggg00000 bbb00000 ...\r
mov r6, #0\r
stmia r0!, {r3-r6}\r
stmia r0!, {r3-r6}\r
- add r7, r0, #256*4-8*4\r
+ add r7, r0, #(240+BORDER_R)*4-8*4\r
stmia r7!, {r3-r6}\r
stmia r7!, {r3-r6}\r
- add r7, r7, #256*4-8*4\r
+ add r7, r7, #(240+BORDER_R)*4-8*4\r
stmia r7!, {r3-r6}\r
stmia r7!, {r3-r6}\r
- add r7, r7, #256*4-8*4\r
+ add r7, r7, #(240+BORDER_R)*4-8*4\r
stmia r7!, {r3-r6}\r
stmia r7!, {r3-r6}\r
\r
mode2_4pix 0\r
.endif\r
stmia r0, {r7,r8,r10,lr}\r
- add r0, r0, #256*4\r
+ add r0, r0, #(240+BORDER_R)*4\r
\r
.if \is270\r
mode2_4pix 16\r
mode2_4pix 8\r
.endif\r
stmia r0, {r7,r8,r10,lr}\r
- add r0, r0, #256*4\r
+ add r0, r0, #(240+BORDER_R)*4\r
\r
.if \is270\r
mode2_4pix 8\r
mode2_4pix 16\r
.endif\r
stmia r0, {r7,r8,r10,lr}\r
- add r0, r0, #256*4\r
+ add r0, r0, #(240+BORDER_R)*4\r
\r
.if \is270\r
mode2_4pix 0\r
mode2_4pix 24\r
.endif\r
stmia r0!,{r7,r8,r10,lr}\r
- sub r0, r0, #256*4*3\r
+ sub r0, r0, #(240+BORDER_R)*4*3\r
\r
bpl 0b @ .loopM2RGB32_270\r
\r
mov r6, #0\r
stmia r0!, {r3-r6}\r
stmia r0!, {r3-r6}\r
- add r0, r0, #256*4-8*4\r
+ add r0, r0, #(240+BORDER_R)*4-8*4\r
stmia r0!, {r3-r6}\r
stmia r0!, {r3-r6}\r
- add r0, r0, #256*4-8*4\r
+ add r0, r0, #(240+BORDER_R)*4-8*4\r
stmia r0!, {r3-r6}\r
stmia r0!, {r3-r6}\r
- add r0, r0, #256*4-8*4\r
+ add r0, r0, #(240+BORDER_R)*4-8*4\r
stmia r0!, {r3-r6}\r
nop @ phone crashes if this is commented out. Do I stress it too much?\r
stmia r0!, {r3-r6}\r
subs r12, r12, #1\r
ldmeqfd sp!, {r4-r11,pc} @ return\r
\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
.if \is270\r
sub r9, r9, #4 @ fix src pointer\r
.else\r
\r
stmia r0!, {r3-r6} @ top border\r
stmia r0!, {r3-r6}\r
- add r7, r0, #256*4-8*4\r
+ add r7, r0, #(240+BORDER_R)*4-8*4\r
stmia r7!, {r3-r6}\r
stmia r7!, {r3-r6}\r
- add r7, r7, #256*4-8*4\r
+ add r7, r7, #(240+BORDER_R)*4-8*4\r
stmia r7!, {r3-r6}\r
stmia r7!, {r3-r6}\r
- add r7, r7, #256*4-8*4\r
+ add r7, r7, #(240+BORDER_R)*4-8*4\r
stmia r7!, {r3-r6}\r
stmia r7!, {r3-r6}\r
\r
sub r12, r12, #1\r
adds r12, r12, #1<<16\r
ldmeqfd sp!, {r4-r6,r11,pc} @ return\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
add r1, r1, #88\r
orr r12, #(240/4-1)<<16\r
b .loopRGB32_c0\r
sub r12, r12, #1\r
adds r12, r12, #1<<16\r
ldmeqfd sp!, {r4-r6,r11,pc} @ return\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
sub r1, r1, #88\r
orr r12, #(240/4-1)<<16\r
b .loopRGB32_c180\r
sub r12, r12, #1\r
adds r12, r12, #1<<16\r
ldmeqfd sp!, {r4-r6,r10,r11,pc} @ return\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
add r1, r1, #8\r
orr r12, #(240/3-1)<<16\r
b .loopRGB32_c2_40c_0\r
sub r12, r12, #1\r
adds r12, r12, #1<<16\r
ldmeqfd sp!, {r4-r6,r10,r11,pc} @ return\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
sub r1, r1, #8\r
orr r12, #(240/3-1)<<16\r
b .loop_c2_40c_180\r
sub r12, r12, #1\r
adds r12, r12, #1<<16\r
ldmeqfd sp!, {r4-r11,pc} @ return\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
add r1, r1, #64+8\r
orr r12, #(240/15-1)<<16\r
b .loop_c2_32c_0\r
sub r12, r12, #1\r
adds r12, r12, #1<<16\r
ldmeqfd sp!, {r4-r11,pc} @ return\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
sub r1, r1, #64+8\r
orr r12, #(240/15-1)<<16\r
b .loop_c2_32c_180\r
sub r12, r12, #1\r
adds r12, r12, #1<<16\r
ldmeqfd sp!, {pc} @ return\r
- add r0, r0, #16*4\r
+.if BORDER_R\r
+ add r0, r0, #BORDER_R*4\r
+.endif\r
orr r12, #(240/16-1)<<16\r
b .loopVidClear\r
\r
static void *screenbuff = 0; // pointer to real device video memory\r
//static\r
extern "C" { unsigned char *PicoDraw2FB = 0; } // temporary buffer\r
-const int framebuffsize = (8+320)*(8+240+8)*2+8*2; // actual framebuffer size (in bytes+to support new rendering mode)\r
+const int framebuffsize = (8+320)*(8+240+8)*2+8*2; // PicoDraw2FB size (in bytes+to support new rendering mode)\r
\r
// drawer function pointers\r
static void (*drawTextFps)(const char *text) = 0;\r
vidConvCpy_90(pd, ps, localPal, 320/8);\r
else {\r
if(full) vidClear(pd, 32);\r
- pd += 256*32;\r
+ pd += (240+VID_BORDER_R)*32;\r
vidConvCpy_90(pd, ps, localPal, 256/8);\r
- if(full) vidClear(pd + 256*256, 32);\r
+ if(full) vidClear(pd + (240+VID_BORDER_R)*256, 32);\r
}\r
}\r
\r
vidConvCpy_270(pd, ps, localPal, 320/8);\r
else {\r
if(full) vidClear(pd, 32);\r
- pd += 256*32;\r
+ pd += (240+VID_BORDER_R)*32;\r
ps -= 64; // the blitter starts copying from the right border, so we need to adjust\r
vidConvCpy_270(pd, ps, localPal, 256/8);\r
- if(full) vidClear(pd + 256*256, 32);\r
+ if(full) vidClear(pd + (240+VID_BORDER_R)*256, 32);\r
}\r
}\r
\r
\r
if(Pico.video.reg[12]&1) ps += 32;\r
vidConvCpy_center_0(pd, ps, localPal);\r
- if(full) vidClear(pd + 224*256, 96);\r
+ if(full) vidClear(pd + (240+VID_BORDER_R)*224, 96);\r
}\r
\r
\r
\r
if(Pico.video.reg[12]&1) ps += 32;\r
vidConvCpy_center_180(pd, ps, localPal);\r
- if(full) vidClear(pd + 224*256, 96);\r
+ if(full) vidClear(pd + (240+VID_BORDER_R)*224, 96);\r
}\r
\r
\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168);\r
else vidConvCpy_center2_32c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168);\r
- if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-168);\r
+ if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*168, 320-168);\r
}\r
\r
\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_center2_40c_180(screenbuff, PicoDraw2FB+328*8, localPal, 168);\r
else vidConvCpy_center2_32c_180(screenbuff, PicoDraw2FB+328*8-64, localPal, 168);\r
- if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-168);\r
+ if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*168, 320-168);\r
}\r
\r
\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 224);\r
else vidConvCpy_center2_32c_0(screenbuff, PicoDraw2FB+328*8, localPal, 224);\r
- if(full) vidClear((unsigned long *)screenbuff + 224*256, 96);\r
+ if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*224, 96);\r
}\r
\r
\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_center2_40c_180(screenbuff, PicoDraw2FB+328*8, localPal, 224);\r
else vidConvCpy_center2_32c_180(screenbuff, PicoDraw2FB+328*8-64, localPal, 224);\r
- if(full) vidClear((unsigned long *)screenbuff + 224*256, 96);\r
+ if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*224, 96);\r
}\r
\r
-\r
static void vidBlitCfg(void)\r
{\r
unsigned short *ps = (unsigned short *) PicoDraw2FB;\r
//for (int i = 1; i < 320; i++, ps += 240, pd += 256)\r
// vidConvCpyRGB32(pd, ps, 240);\r
\r
- for (i = 0; i < 320; i++, pd += 16)\r
+ for (i = 0; i < 320; i++, pd += VID_BORDER_R)\r
for (int u = 0; u < 240; u++, ps++, pd++)\r
*pd = ((*ps & 0xf) << 20) | ((*ps & 0xf0) << 8) | ((*ps & 0xf00) >> 4);\r
}\r