forked from len0rd/rockbox
Grayscale support for rockboy - can't work without markuns patch,
needs rockbox' internal framebuffer in 2 bit (4 pixels / byte) format. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6132 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ee811a3443
commit
ca2e99b4be
4 changed files with 29 additions and 2 deletions
|
@ -22,6 +22,7 @@ SRC = cpu.c emu.c events.c exports.c fastmem.c hw.c lcd.c lcdc.c loader.c \
|
||||||
main.c mem.c nosound.c rccmds.c rcvars.c rtc.c save.c sound.c split.c \
|
main.c mem.c nosound.c rccmds.c rcvars.c rtc.c save.c sound.c split.c \
|
||||||
sys_rockbox.c rockboy.c menu.c
|
sys_rockbox.c rockboy.c menu.c
|
||||||
|
|
||||||
|
#CFLAGS += -DGRAYSCALE
|
||||||
#CFLAGS += -DDYNAREC
|
#CFLAGS += -DDYNAREC
|
||||||
#SRC += dynarec.c
|
#SRC += dynarec.c
|
||||||
|
|
||||||
|
|
|
@ -753,8 +753,12 @@ void lcd_refreshline(void)
|
||||||
L = R_LY;
|
L = R_LY;
|
||||||
#if LCD_HEIGHT == 64
|
#if LCD_HEIGHT == 64
|
||||||
scanline_ind = (L/2) % 8;
|
scanline_ind = (L/2) % 8;
|
||||||
|
#else
|
||||||
|
#ifdef GRAYSCALE
|
||||||
|
scanline_ind = L % 4;
|
||||||
#else
|
#else
|
||||||
scanline_ind = L % 8;
|
scanline_ind = L % 8;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
X = R_SCX;
|
X = R_SCX;
|
||||||
Y = (R_SCY + L) & 0xff;
|
Y = (R_SCY + L) & 0xff;
|
||||||
|
@ -797,7 +801,11 @@ void lcd_refreshline(void)
|
||||||
if (scale == 1) density = 1;
|
if (scale == 1) density = 1;
|
||||||
dest = vdest;
|
dest = vdest;
|
||||||
*/
|
*/
|
||||||
|
#ifdef GRAYSCALE
|
||||||
|
if (scanline_ind == 3)
|
||||||
|
#else
|
||||||
if (scanline_ind == 7)
|
if (scanline_ind == 7)
|
||||||
|
#endif
|
||||||
vid_update(L);
|
vid_update(L);
|
||||||
// vdest += fb.pitch * scale;
|
// vdest += fb.pitch * scale;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,11 @@ struct scan
|
||||||
{
|
{
|
||||||
int bg[64];
|
int bg[64];
|
||||||
int wnd[64];
|
int wnd[64];
|
||||||
byte buf[8][256];
|
#ifdef GRAYSCALE
|
||||||
|
byte buf[4][256];
|
||||||
|
#else
|
||||||
|
byte buf[8][256];
|
||||||
|
#endif
|
||||||
byte pal1[128];
|
byte pal1[128];
|
||||||
un16 pal2[64];
|
un16 pal2[64];
|
||||||
un32 pal4[64];
|
un32 pal4[64];
|
||||||
|
|
|
@ -236,9 +236,22 @@ void vid_update(int scanline)
|
||||||
#else /* LCD_HEIGHT != 64, iRiver */
|
#else /* LCD_HEIGHT != 64, iRiver */
|
||||||
if (fb.mode==1)
|
if (fb.mode==1)
|
||||||
scanline-=16;
|
scanline-=16;
|
||||||
|
#ifdef GRAYSCALE
|
||||||
|
scanline_remapped = scanline / 4;
|
||||||
|
#else
|
||||||
scanline_remapped = scanline / 8;
|
scanline_remapped = scanline / 8;
|
||||||
|
#endif
|
||||||
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
|
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
|
||||||
while (cnt < 160) {
|
while (cnt < 160) {
|
||||||
|
#ifdef GRAYSCALE
|
||||||
|
*(frameb++) = (scan.buf[0][cnt]&0x3) |
|
||||||
|
((scan.buf[1][cnt]&0x3)<<2) |
|
||||||
|
((scan.buf[2][cnt]&0x3)<<4) |
|
||||||
|
((scan.buf[3][cnt]&0x3)<<6);
|
||||||
|
cnt++;
|
||||||
|
}
|
||||||
|
rb->lcd_update_rect(0, scanline & ~3, LCD_WIDTH, 4); //8);
|
||||||
|
#else
|
||||||
register unsigned scrbyte = 0;
|
register unsigned scrbyte = 0;
|
||||||
if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01;
|
if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01;
|
||||||
if (scan.buf[1][cnt] & 0x02) scrbyte |= 0x02;
|
if (scan.buf[1][cnt] & 0x02) scrbyte |= 0x02;
|
||||||
|
@ -252,7 +265,8 @@ void vid_update(int scanline)
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
rb->lcd_update_rect(0, scanline & ~7, LCD_WIDTH, 8);
|
rb->lcd_update_rect(0, scanline & ~7, LCD_WIDTH, 8);
|
||||||
#endif
|
#endif /* GRAYSCALE */
|
||||||
|
#endif /* LCD_HEIGHT */
|
||||||
}
|
}
|
||||||
|
|
||||||
void vid_end(void)
|
void vid_end(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue