summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/rockboy/lcd.c56
-rw-r--r--apps/plugins/rockboy/sys_rockbox.c14
2 files changed, 31 insertions, 39 deletions
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c
index 637a44c9c9..04ca06e958 100644
--- a/apps/plugins/rockboy/lcd.c
+++ b/apps/plugins/rockboy/lcd.c
@@ -52,7 +52,7 @@ static int rgb332;
52 52
53static int sprsort = 1; 53static int sprsort = 1;
54static int sprdebug; 54static int sprdebug;
55static int scanline_ind=0; 55static int scanline_ind=0,insync=0;
56 56
57#define DEF_PAL { 0x98d0e0, 0x68a0b0, 0x60707C, 0x2C3C3C } 57#define DEF_PAL { 0x98d0e0, 0x68a0b0, 0x60707C, 0x2C3C3C }
58 58
@@ -536,12 +536,6 @@ void bg_scan_color(void)
536 blendcpy(dest, src, *(tile++), cnt); 536 blendcpy(dest, src, *(tile++), cnt);
537} 537}
538 538
539// blend in window source WND target BUF
540// WX = starting X in buf where WND starts
541// WV = vertical line selected for this scanline
542// reverse:
543// WY = starting y in buf where WND starts ?
544// W?? = horizontal line selected for this scanline
545void wnd_scan_color(void) 539void wnd_scan_color(void)
546{ 540{
547 int cnt; 541 int cnt;
@@ -735,32 +729,30 @@ void lcd_begin(void)
735void lcd_refreshline(void) 729void lcd_refreshline(void)
736{ 730{
737 if (!fb.enabled) return; 731 if (!fb.enabled) return;
732 if(!insync) {
733 if(R_LY!=0)
734 return;
735 else
736 insync=1;
737 }
738 738
739 if (!(R_LCDC & 0x80)) 739 if (!(R_LCDC & 0x80))
740 return; /* should not happen... */ 740 return; /* should not happen... */
741 741
742 if ( ((fb.mode==0)&&(R_LY >= 128)) || 742 if ( (fb.mode==0&&(R_LY >= 128)) ||
743 ((fb.mode==1)&&(R_LY < 16)) || 743 (fb.mode==1&&(R_LY < 16)) ||
744 ((fb.mode==2)&&((R_LY<8)||(R_LY>=136))) 744 (fb.mode==2&&(R_LY<8||R_LY>=136)) ||
745 (fb.mode==3&&((R_LY%9)==8))
745 746
746#if LCD_HEIGHT == 64 747#if LCD_HEIGHT == 64
747 || (R_LY & 1) /* calculate only even lines */ 748 || (R_LY & 1) /* calculate only even lines */
748#endif 749#endif
749 ) 750 )
750 return; 751 return;
751 752
752 updatepatpix(); 753 updatepatpix();
753 754
754 L = R_LY; 755 L = R_LY;
755#if LCD_HEIGHT == 64
756 scanline_ind = (L/2) % 8;
757#else
758#ifdef GRAYSCALE
759 scanline_ind = L % 4;
760#else
761 scanline_ind = L % 8;
762#endif
763#endif
764 X = R_SCX; 756 X = R_SCX;
765 Y = (R_SCY + L) & 0xff; 757 Y = (R_SCY + L) & 0xff;
766 S = X >> 3; 758 S = X >> 3;
@@ -795,20 +787,26 @@ void lcd_refreshline(void)
795 recolor(BUF+WX, 0x04, 160-WX); 787 recolor(BUF+WX, 0x04, 160-WX);
796 } 788 }
797 spr_scan(); 789 spr_scan();
798/*
799 if (fb.dirty) memset(fb.ptr, 0, fb.pitch * fb.h);
800 fb.dirty = 0;
801 if (density > scale) density = scale;
802 if (scale == 1) density = 1;
803 dest = vdest;
804*/
805#ifdef GRAYSCALE 790#ifdef GRAYSCALE
806 if (scanline_ind == 3) 791 if (scanline_ind == 3)
807#else 792#else
808 if (scanline_ind == 7) 793 if (scanline_ind == 7)
809#endif 794#endif
810 vid_update(L); 795 {
811 // vdest += fb.pitch * scale; 796 if(fb.mode!=3)
797 vid_update(L);
798 else
799 vid_update(L-((int)(L/9)));
800 }
801#if LCD_HEIGHT == 64
802 scanline_ind = (scanline_ind+1) % 8;
803#else
804#ifdef GRAYSCALE
805 scanline_ind = (scanline_ind+1) % 4;
806#else
807 scanline_ind = (scanline_ind+1) % 8;
808#endif
809#endif
812} 810}
813 811
814 812
diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c
index 9bc3a6b350..64c3385169 100644
--- a/apps/plugins/rockboy/sys_rockbox.c
+++ b/apps/plugins/rockboy/sys_rockbox.c
@@ -83,7 +83,7 @@ void ev_poll(void)
83 oldbuttonstate = newbuttonstate; 83 oldbuttonstate = newbuttonstate;
84#if CONFIG_KEYPAD == IRIVER_H100_PAD 84#if CONFIG_KEYPAD == IRIVER_H100_PAD
85 if (rb->button_hold()&~holdbutton) 85 if (rb->button_hold()&~holdbutton)
86 fb.mode=(fb.mode+1)%3; 86 fb.mode=(fb.mode+1)%4;
87 holdbutton=rb->button_hold(); 87 holdbutton=rb->button_hold();
88#endif 88#endif
89 if(released) { 89 if(released) {
@@ -153,7 +153,7 @@ void vid_init(void)
153 fb.enabled=1; 153 fb.enabled=1;
154 fb.dirty=0; 154 fb.dirty=0;
155 video_base_buf=fb.ptr=(byte *)frameb; 155 video_base_buf=fb.ptr=(byte *)frameb;
156 fb.mode=0; 156 fb.mode=3;
157} 157}
158 158
159void vid_update(int scanline) 159void vid_update(int scanline)
@@ -164,11 +164,8 @@ void vid_update(int scanline)
164 int balance = 0; 164 int balance = 0;
165 if (fb.mode==1) 165 if (fb.mode==1)
166 scanline-=16; 166 scanline-=16;
167 else if (fb.mode==2) { 167 else if (fb.mode==2)
168 scanline-=8; 168 scanline-=8;
169 if(scanline>=128)
170 return;
171 }
172 scanline_remapped = scanline / 16; 169 scanline_remapped = scanline / 16;
173 frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH; 170 frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
174 while (cnt < 160) { 171 while (cnt < 160) {
@@ -242,11 +239,8 @@ void vid_update(int scanline)
242#else /* LCD_HEIGHT != 64, iRiver */ 239#else /* LCD_HEIGHT != 64, iRiver */
243 if (fb.mode==1) 240 if (fb.mode==1)
244 scanline-=16; 241 scanline-=16;
245 else if (fb.mode==2) { 242 else if (fb.mode==2)
246 scanline-=8; 243 scanline-=8;
247 if(scanline>=128)
248 return;
249 }
250#ifdef GRAYSCALE 244#ifdef GRAYSCALE
251 scanline_remapped = scanline / 4; 245 scanline_remapped = scanline / 4;
252#else 246#else