summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-03-04 20:56:49 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-03-04 20:56:49 +0000
commitebd63b52cd22a173106085b79404688d267a801a (patch)
treed4b1aea7c7c5f1c83539c36d6ba5d430b5e32597 /apps/plugins/rockboy
parent984cd6e568c841f4110f070161ad28fbe4c85342 (diff)
New lcd mode: drop every 9th line; set as default.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6136 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy')
-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;
static int sprsort = 1;
static int sprdebug;
-static int scanline_ind=0;
+static int scanline_ind=0,insync=0;
#define DEF_PAL { 0x98d0e0, 0x68a0b0, 0x60707C, 0x2C3C3C }
@@ -536,12 +536,6 @@ void bg_scan_color(void)
blendcpy(dest, src, *(tile++), cnt);
}
-// blend in window source WND target BUF
-// WX = starting X in buf where WND starts
-// WV = vertical line selected for this scanline
-// reverse:
-// WY = starting y in buf where WND starts ?
-// W?? = horizontal line selected for this scanline
void wnd_scan_color(void)
{
int cnt;
@@ -735,32 +729,30 @@ void lcd_begin(void)
void lcd_refreshline(void)
{
if (!fb.enabled) return;
+ if(!insync) {
+ if(R_LY!=0)
+ return;
+ else
+ insync=1;
+ }
if (!(R_LCDC & 0x80))
return; /* should not happen... */
- if ( ((fb.mode==0)&&(R_LY >= 128)) ||
- ((fb.mode==1)&&(R_LY < 16)) ||
- ((fb.mode==2)&&((R_LY<8)||(R_LY>=136)))
+ if ( (fb.mode==0&&(R_LY >= 128)) ||
+ (fb.mode==1&&(R_LY < 16)) ||
+ (fb.mode==2&&(R_LY<8||R_LY>=136)) ||
+ (fb.mode==3&&((R_LY%9)==8))
#if LCD_HEIGHT == 64
|| (R_LY & 1) /* calculate only even lines */
#endif
)
- return;
+ return;
updatepatpix();
L = R_LY;
-#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;
@@ -795,20 +787,26 @@ void lcd_refreshline(void)
recolor(BUF+WX, 0x04, 160-WX);
}
spr_scan();
-/*
- if (fb.dirty) memset(fb.ptr, 0, fb.pitch * fb.h);
- fb.dirty = 0;
- if (density > scale) density = scale;
- 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;
+ {
+ if(fb.mode!=3)
+ vid_update(L);
+ else
+ vid_update(L-((int)(L/9)));
+ }
+#if LCD_HEIGHT == 64
+ scanline_ind = (scanline_ind+1) % 8;
+#else
+#ifdef GRAYSCALE
+ scanline_ind = (scanline_ind+1) % 4;
+#else
+ scanline_ind = (scanline_ind+1) % 8;
+#endif
+#endif
}
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)
oldbuttonstate = newbuttonstate;
#if CONFIG_KEYPAD == IRIVER_H100_PAD
if (rb->button_hold()&~holdbutton)
- fb.mode=(fb.mode+1)%3;
+ fb.mode=(fb.mode+1)%4;
holdbutton=rb->button_hold();
#endif
if(released) {
@@ -153,7 +153,7 @@ void vid_init(void)
fb.enabled=1;
fb.dirty=0;
video_base_buf=fb.ptr=(byte *)frameb;
- fb.mode=0;
+ fb.mode=3;
}
void vid_update(int scanline)
@@ -164,11 +164,8 @@ void vid_update(int scanline)
int balance = 0;
if (fb.mode==1)
scanline-=16;
- else if (fb.mode==2) {
+ else if (fb.mode==2)
scanline-=8;
- if(scanline>=128)
- return;
- }
scanline_remapped = scanline / 16;
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
while (cnt < 160) {
@@ -242,11 +239,8 @@ void vid_update(int scanline)
#else /* LCD_HEIGHT != 64, iRiver */
if (fb.mode==1)
scanline-=16;
- else if (fb.mode==2) {
+ else if (fb.mode==2)
scanline-=8;
- if(scanline>=128)
- return;
- }
#ifdef GRAYSCALE
scanline_remapped = scanline / 4;
#else