1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michiel Van Der Kolk 2005-03-04 20:56:49 +00:00
parent 984cd6e568
commit ebd63b52cd
2 changed files with 31 additions and 39 deletions

View file

@ -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,13 +729,20 @@ 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 */
@ -752,15 +753,6 @@ void lcd_refreshline(void)
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
{
if(fb.mode!=3)
vid_update(L);
// vdest += fb.pitch * scale;
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
}

View file

@ -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