summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-03-04 11:01:33 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-03-04 11:01:33 +0000
commitca2e99b4be0155abc90033ba2757f39d3ede9713 (patch)
tree2e6db5b2c392bc3ef53f31bdaf4dd71eac514410 /apps/plugins
parentee811a34433e88c965090fc9e936dc46db48f737 (diff)
downloadrockbox-ca2e99b4be0155abc90033ba2757f39d3ede9713.zip
rockbox-ca2e99b4be0155abc90033ba2757f39d3ede9713.tar.gz
rockbox-ca2e99b4be0155abc90033ba2757f39d3ede9713.tar.bz2
rockbox-ca2e99b4be0155abc90033ba2757f39d3ede9713.tar.xz
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
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/rockboy/Makefile1
-rw-r--r--apps/plugins/rockboy/lcd.c8
-rw-r--r--apps/plugins/rockboy/lcd.h6
-rw-r--r--apps/plugins/rockboy/sys_rockbox.c16
4 files changed, 29 insertions, 2 deletions
diff --git a/apps/plugins/rockboy/Makefile b/apps/plugins/rockboy/Makefile
index c257f00..f40783c 100644
--- a/apps/plugins/rockboy/Makefile
+++ b/apps/plugins/rockboy/Makefile
@@ -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 \
sys_rockbox.c rockboy.c menu.c
+#CFLAGS += -DGRAYSCALE
#CFLAGS += -DDYNAREC
#SRC += dynarec.c
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c
index 16a97e3..e202e72 100644
--- a/apps/plugins/rockboy/lcd.c
+++ b/apps/plugins/rockboy/lcd.c
@@ -754,8 +754,12 @@ void lcd_refreshline(void)
#if LCD_HEIGHT == 64
scanline_ind = (L/2) % 8;
#else
+#ifdef GRAYSCALE
+ scanline_ind = L % 4;
+#else
scanline_ind = L % 8;
#endif
+#endif
X = R_SCX;
Y = (R_SCY + L) & 0xff;
S = X >> 3;
@@ -797,7 +801,11 @@ void lcd_refreshline(void)
if (scale == 1) density = 1;
dest = vdest;
*/
+#ifdef GRAYSCALE
+ if (scanline_ind == 3)
+#else
if (scanline_ind == 7)
+#endif
vid_update(L);
// vdest += fb.pitch * scale;
}
diff --git a/apps/plugins/rockboy/lcd.h b/apps/plugins/rockboy/lcd.h
index 4911f85..776c859 100644
--- a/apps/plugins/rockboy/lcd.h
+++ b/apps/plugins/rockboy/lcd.h
@@ -16,7 +16,11 @@ struct scan
{
int bg[64];
int wnd[64];
- byte buf[8][256];
+#ifdef GRAYSCALE
+ byte buf[4][256];
+#else
+ byte buf[8][256];
+#endif
byte pal1[128];
un16 pal2[64];
un32 pal4[64];
diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c
index 1cce814..9f6b588 100644
--- a/apps/plugins/rockboy/sys_rockbox.c
+++ b/apps/plugins/rockboy/sys_rockbox.c
@@ -236,9 +236,22 @@ void vid_update(int scanline)
#else /* LCD_HEIGHT != 64, iRiver */
if (fb.mode==1)
scanline-=16;
+#ifdef GRAYSCALE
+ scanline_remapped = scanline / 4;
+#else
scanline_remapped = scanline / 8;
+#endif
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
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;
if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01;
if (scan.buf[1][cnt] & 0x02) scrbyte |= 0x02;
@@ -252,7 +265,8 @@ void vid_update(int scanline)
cnt++;
}
rb->lcd_update_rect(0, scanline & ~7, LCD_WIDTH, 8);
-#endif
+#endif /* GRAYSCALE */
+#endif /* LCD_HEIGHT */
}
void vid_end(void)