diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/rockboy/Makefile | 1 | ||||
-rw-r--r-- | apps/plugins/rockboy/lcd.c | 8 | ||||
-rw-r--r-- | apps/plugins/rockboy/lcd.h | 6 | ||||
-rw-r--r-- | apps/plugins/rockboy/sys_rockbox.c | 16 |
4 files changed, 29 insertions, 2 deletions
diff --git a/apps/plugins/rockboy/Makefile b/apps/plugins/rockboy/Makefile index c257f00dc5..f40783c720 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 \ | |||
22 | main.c mem.c nosound.c rccmds.c rcvars.c rtc.c save.c sound.c split.c \ | 22 | main.c mem.c nosound.c rccmds.c rcvars.c rtc.c save.c sound.c split.c \ |
23 | sys_rockbox.c rockboy.c menu.c | 23 | sys_rockbox.c rockboy.c menu.c |
24 | 24 | ||
25 | #CFLAGS += -DGRAYSCALE | ||
25 | #CFLAGS += -DDYNAREC | 26 | #CFLAGS += -DDYNAREC |
26 | #SRC += dynarec.c | 27 | #SRC += dynarec.c |
27 | 28 | ||
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c index 16a97e3ef0..e202e72b8b 100644 --- a/apps/plugins/rockboy/lcd.c +++ b/apps/plugins/rockboy/lcd.c | |||
@@ -754,8 +754,12 @@ void lcd_refreshline(void) | |||
754 | #if LCD_HEIGHT == 64 | 754 | #if LCD_HEIGHT == 64 |
755 | scanline_ind = (L/2) % 8; | 755 | scanline_ind = (L/2) % 8; |
756 | #else | 756 | #else |
757 | #ifdef GRAYSCALE | ||
758 | scanline_ind = L % 4; | ||
759 | #else | ||
757 | scanline_ind = L % 8; | 760 | scanline_ind = L % 8; |
758 | #endif | 761 | #endif |
762 | #endif | ||
759 | X = R_SCX; | 763 | X = R_SCX; |
760 | Y = (R_SCY + L) & 0xff; | 764 | Y = (R_SCY + L) & 0xff; |
761 | S = X >> 3; | 765 | S = X >> 3; |
@@ -797,7 +801,11 @@ void lcd_refreshline(void) | |||
797 | if (scale == 1) density = 1; | 801 | if (scale == 1) density = 1; |
798 | dest = vdest; | 802 | dest = vdest; |
799 | */ | 803 | */ |
804 | #ifdef GRAYSCALE | ||
805 | if (scanline_ind == 3) | ||
806 | #else | ||
800 | if (scanline_ind == 7) | 807 | if (scanline_ind == 7) |
808 | #endif | ||
801 | vid_update(L); | 809 | vid_update(L); |
802 | // vdest += fb.pitch * scale; | 810 | // vdest += fb.pitch * scale; |
803 | } | 811 | } |
diff --git a/apps/plugins/rockboy/lcd.h b/apps/plugins/rockboy/lcd.h index 4911f857de..776c8592f4 100644 --- a/apps/plugins/rockboy/lcd.h +++ b/apps/plugins/rockboy/lcd.h | |||
@@ -16,7 +16,11 @@ struct scan | |||
16 | { | 16 | { |
17 | int bg[64]; | 17 | int bg[64]; |
18 | int wnd[64]; | 18 | int wnd[64]; |
19 | byte buf[8][256]; | 19 | #ifdef GRAYSCALE |
20 | byte buf[4][256]; | ||
21 | #else | ||
22 | byte buf[8][256]; | ||
23 | #endif | ||
20 | byte pal1[128]; | 24 | byte pal1[128]; |
21 | un16 pal2[64]; | 25 | un16 pal2[64]; |
22 | un32 pal4[64]; | 26 | un32 pal4[64]; |
diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c index 1cce81478b..9f6b588b47 100644 --- a/apps/plugins/rockboy/sys_rockbox.c +++ b/apps/plugins/rockboy/sys_rockbox.c | |||
@@ -236,9 +236,22 @@ void vid_update(int scanline) | |||
236 | #else /* LCD_HEIGHT != 64, iRiver */ | 236 | #else /* LCD_HEIGHT != 64, iRiver */ |
237 | if (fb.mode==1) | 237 | if (fb.mode==1) |
238 | scanline-=16; | 238 | scanline-=16; |
239 | #ifdef GRAYSCALE | ||
240 | scanline_remapped = scanline / 4; | ||
241 | #else | ||
239 | scanline_remapped = scanline / 8; | 242 | scanline_remapped = scanline / 8; |
243 | #endif | ||
240 | frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH; | 244 | frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH; |
241 | while (cnt < 160) { | 245 | while (cnt < 160) { |
246 | #ifdef GRAYSCALE | ||
247 | *(frameb++) = (scan.buf[0][cnt]&0x3) | | ||
248 | ((scan.buf[1][cnt]&0x3)<<2) | | ||
249 | ((scan.buf[2][cnt]&0x3)<<4) | | ||
250 | ((scan.buf[3][cnt]&0x3)<<6); | ||
251 | cnt++; | ||
252 | } | ||
253 | rb->lcd_update_rect(0, scanline & ~3, LCD_WIDTH, 4); //8); | ||
254 | #else | ||
242 | register unsigned scrbyte = 0; | 255 | register unsigned scrbyte = 0; |
243 | if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01; | 256 | if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01; |
244 | if (scan.buf[1][cnt] & 0x02) scrbyte |= 0x02; | 257 | if (scan.buf[1][cnt] & 0x02) scrbyte |= 0x02; |
@@ -252,7 +265,8 @@ void vid_update(int scanline) | |||
252 | cnt++; | 265 | cnt++; |
253 | } | 266 | } |
254 | rb->lcd_update_rect(0, scanline & ~7, LCD_WIDTH, 8); | 267 | rb->lcd_update_rect(0, scanline & ~7, LCD_WIDTH, 8); |
255 | #endif | 268 | #endif /* GRAYSCALE */ |
269 | #endif /* LCD_HEIGHT */ | ||
256 | } | 270 | } |
257 | 271 | ||
258 | void vid_end(void) | 272 | void vid_end(void) |