--- apps/plugins/rockboy/lcd-gb.h 2008-06-05 22:47:58.000000000 +1000 +++ lcd-gb.h 2008-06-05 22:09:59.000000000 +1000 @@ -18,9 +18,9 @@ int wnd[64]; #if LCD_DEPTH == 1 byte buf[8][256]; -#elif LCD_DEPTH == 2 +#elif LCD_DEPTH == 2 && (LCD_PIXELFORMAT == VERTICAL_PACKING) byte buf[4][256]; -#elif LCD_DEPTH > 4 +#elif LCD_DEPTH > 4 || (LCD_PIXELFORMAT == HORIZONTAL_PACKING) byte buf[256]; #endif un16 pal[64]; --- apps/plugins/rockboy/lcd.c 2008-06-05 22:47:58.000000000 +1000 +++ lcd.c 2008-06-05 22:39:33.000000000 +1000 @@ -19,12 +19,16 @@ #define BG (scan.bg) #define WND (scan.wnd) -#if LCD_DEPTH ==16 +#if (LCD_DEPTH ==16) || ( (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == HORIZONTAL_PACKING) ) #define BUF (scan.buf) #else #define BUF (scan.buf[scanline_ind]) #endif +#if LCD_PIXELFORMAT == HORIZONTAL_PACKING +#define FB_WIDTH ((LCD_WIDTH+3)/4) +#endif + #define PRI (scan.pri) #define PAL (scan.pal) @@ -52,9 +56,17 @@ byte patdirty[1024]; byte anydirty; -#if LCD_DEPTH < 16 -static int scanline_ind=0; +#if LCD_DEPTH < 16 +static int scanline_ind; +#endif + + +/* +#if LCD_DEPTH < 16 +int scanline_ind; #endif +*/ + static int dmg_pal[4][4]; @@ -995,7 +1007,13 @@ if (!(R_LCDC & 0x80)) return; /* should not happen... */ -#if (LCD_HEIGHT <= 128) && !defined(HAVE_LCD_COLOR) +#if (LCD_PIXELFORMAT == HORIZONTAL_PACKING) + if ( R_LY == 0 ){ + scanline_ind = 0; + rb->lcd_update(); + } +#endif +#if (LCD_HEIGHT == 128) && !defined(HAVE_LCD_COLOR) if ( (fb.mode==0&&(R_LY >= 128)) || (fb.mode==1&&(R_LY < 16)) || (fb.mode==2&&(R_LY<8||R_LY>=136)) || @@ -1008,6 +1026,17 @@ return; #endif +#if LCD_HEIGHT == 110 + if ( (fb.mode==0&&(R_LY >= 110)) || + (fb.mode==1&&(R_LY < 34)) || + (fb.mode==2&&(R_LY<17||R_LY>=127)) || + (fb.mode==3&&( + ((R_LY%4)==0) && (R_LY!=4) && (R_LY != 136 ) ) ) + ) + return; + #endif + + updatepatpix(); L = R_LY; @@ -1048,14 +1077,54 @@ #if !defined(HAVE_LCD_COLOR) #if LCD_DEPTH == 1 if (scanline_ind == 7) -#elif LCD_DEPTH == 2 +#elif (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_PACKING) if (scanline_ind == 3) #endif +#if (LCD_HEIGHT < 144) && ((LCD_PIXELFORMAT == VERTICAL_PACKING) || (LCD_DEPTH == 1 )) { if(fb.mode!=3) vid_update(L); else vid_update(L-((int)(L/9))); +#endif +#if (LCD_HEIGHT < 144) && (LCD_PIXELFORMAT == HORIZONTAL_PACKING) && (LCD_DEPTH == 2) + unsigned char pixmask[4] = { + 0xC0, 0x30, 0x0C, 0x03 + }; + int cnt = 0; + +#if LCD_WIDTH < 160 + int balance = 0; + int x = 0; +#endif + fb_data *frameb = rb->lcd_framebuffer + scanline_ind * FB_WIDTH; + + while (cnt < 160) { +#if LCD_WIDTH < 160 + balance += LCD_WIDTH; + if (balance > 0) + { +#endif + +#if LCD_WIDTH < 160 + unsigned mask = pixmask[x & 3]; + frameb[x >> 2] = (frameb[x >> 2] & ~mask) | ((scan.buf[cnt]&0x3) << ((3-(x & 3 )) * 2 )) ; + +#else + + unsigned mask = pixmask[cnt & 3]; + frameb[cnt >> 2] = (frameb[cnt >> 2] & ~mask) | ((scan.buf[cnt]&0x3) << ((3-(cnt & 3 )) * 2 )) ; +#endif + +#if LCD_WIDTH < 160 + x++; + balance -= 160; + } +#endif + cnt++; + } +#endif + #else { /* Universal Scaling pulled from PrBoom and modified for rockboy */ @@ -1094,15 +1163,20 @@ } #endif - } +// } + + #if LCD_DEPTH == 1 scanline_ind = (scanline_ind+1) % 8; -#elif LCD_DEPTH == 2 +#elif (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_PACKING) scanline_ind = (scanline_ind+1) % 4; +#elif (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == HORIZONTAL_PACKING) +// scanline_ind = (scanline_ind+1) % 4; + scanline_ind++; #endif } -#ifdef HAVE_LCD_COLOR +#if HAVE_LCD_COLOR void set_pal(void) { memcpy(dmg_pal,palettes[options.pal], sizeof(dmg_pal)); --- apps/plugins/rockboy/sys_rockbox.c 2008-06-05 22:47:58.000000000 +1000 +++ sys_rockbox.c 2008-06-05 22:24:02.000000000 +1000 @@ -221,7 +221,7 @@ #endif } -#if !defined(HAVE_LCD_COLOR) +#if !defined(HAVE_LCD_COLOR) && ((LCD_PIXELFORMAT == VERTICAL_PACKING) || (LCD_DEPTH == 1)) //not on ipd4g /* Color targets are handled in lcd.c */ fb_data *frameb; void vid_update(int scanline) @@ -304,7 +304,7 @@ cnt ++; } rb->lcd_update_rect(0, (scanline/2) & ~7, LCD_WIDTH, 8); -#elif (LCD_HEIGHT == 128) && (LCD_DEPTH == 2) /* iriver H1x0 */ +#elif (LCD_HEIGHT == 128) && (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_PACKING) /* iriver H1x0 */ if (fb.mode==1) scanline-=16; else if (fb.mode==2) --- apps/plugins/SUBDIRS 2008-06-05 22:47:58.000000000 +1000 +++ SUBDIRS 2008-06-05 22:25:27.000000000 +1000 @@ -2,6 +2,7 @@ /* For all targets */ shortcuts +rockboy /* For various targets... */ @@ -11,7 +12,6 @@ #if (CONFIG_KEYPAD == RECORDER_PAD) || defined(HAVE_LCD_COLOR) \ || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5) -rockboy #endif /* For all targets with a bitmap display */