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:
parent
984cd6e568
commit
ebd63b52cd
2 changed files with 31 additions and 39 deletions
|
|
@ -52,7 +52,7 @@ static int rgb332;
|
||||||
|
|
||||||
static int sprsort = 1;
|
static int sprsort = 1;
|
||||||
static int sprdebug;
|
static int sprdebug;
|
||||||
static int scanline_ind=0;
|
static int scanline_ind=0,insync=0;
|
||||||
|
|
||||||
#define DEF_PAL { 0x98d0e0, 0x68a0b0, 0x60707C, 0x2C3C3C }
|
#define DEF_PAL { 0x98d0e0, 0x68a0b0, 0x60707C, 0x2C3C3C }
|
||||||
|
|
||||||
|
|
@ -536,12 +536,6 @@ void bg_scan_color(void)
|
||||||
blendcpy(dest, src, *(tile++), cnt);
|
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)
|
void wnd_scan_color(void)
|
||||||
{
|
{
|
||||||
int cnt;
|
int cnt;
|
||||||
|
|
@ -735,32 +729,30 @@ void lcd_begin(void)
|
||||||
void lcd_refreshline(void)
|
void lcd_refreshline(void)
|
||||||
{
|
{
|
||||||
if (!fb.enabled) return;
|
if (!fb.enabled) return;
|
||||||
|
if(!insync) {
|
||||||
|
if(R_LY!=0)
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
insync=1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(R_LCDC & 0x80))
|
if (!(R_LCDC & 0x80))
|
||||||
return; /* should not happen... */
|
return; /* should not happen... */
|
||||||
|
|
||||||
if ( ((fb.mode==0)&&(R_LY >= 128)) ||
|
if ( (fb.mode==0&&(R_LY >= 128)) ||
|
||||||
((fb.mode==1)&&(R_LY < 16)) ||
|
(fb.mode==1&&(R_LY < 16)) ||
|
||||||
((fb.mode==2)&&((R_LY<8)||(R_LY>=136)))
|
(fb.mode==2&&(R_LY<8||R_LY>=136)) ||
|
||||||
|
(fb.mode==3&&((R_LY%9)==8))
|
||||||
|
|
||||||
#if LCD_HEIGHT == 64
|
#if LCD_HEIGHT == 64
|
||||||
|| (R_LY & 1) /* calculate only even lines */
|
|| (R_LY & 1) /* calculate only even lines */
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updatepatpix();
|
updatepatpix();
|
||||||
|
|
||||||
L = R_LY;
|
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;
|
X = R_SCX;
|
||||||
Y = (R_SCY + L) & 0xff;
|
Y = (R_SCY + L) & 0xff;
|
||||||
S = X >> 3;
|
S = X >> 3;
|
||||||
|
|
@ -795,20 +787,26 @@ void lcd_refreshline(void)
|
||||||
recolor(BUF+WX, 0x04, 160-WX);
|
recolor(BUF+WX, 0x04, 160-WX);
|
||||||
}
|
}
|
||||||
spr_scan();
|
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
|
#ifdef GRAYSCALE
|
||||||
if (scanline_ind == 3)
|
if (scanline_ind == 3)
|
||||||
#else
|
#else
|
||||||
if (scanline_ind == 7)
|
if (scanline_ind == 7)
|
||||||
#endif
|
#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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ void ev_poll(void)
|
||||||
oldbuttonstate = newbuttonstate;
|
oldbuttonstate = newbuttonstate;
|
||||||
#if CONFIG_KEYPAD == IRIVER_H100_PAD
|
#if CONFIG_KEYPAD == IRIVER_H100_PAD
|
||||||
if (rb->button_hold()&~holdbutton)
|
if (rb->button_hold()&~holdbutton)
|
||||||
fb.mode=(fb.mode+1)%3;
|
fb.mode=(fb.mode+1)%4;
|
||||||
holdbutton=rb->button_hold();
|
holdbutton=rb->button_hold();
|
||||||
#endif
|
#endif
|
||||||
if(released) {
|
if(released) {
|
||||||
|
|
@ -153,7 +153,7 @@ void vid_init(void)
|
||||||
fb.enabled=1;
|
fb.enabled=1;
|
||||||
fb.dirty=0;
|
fb.dirty=0;
|
||||||
video_base_buf=fb.ptr=(byte *)frameb;
|
video_base_buf=fb.ptr=(byte *)frameb;
|
||||||
fb.mode=0;
|
fb.mode=3;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vid_update(int scanline)
|
void vid_update(int scanline)
|
||||||
|
|
@ -164,11 +164,8 @@ void vid_update(int scanline)
|
||||||
int balance = 0;
|
int balance = 0;
|
||||||
if (fb.mode==1)
|
if (fb.mode==1)
|
||||||
scanline-=16;
|
scanline-=16;
|
||||||
else if (fb.mode==2) {
|
else if (fb.mode==2)
|
||||||
scanline-=8;
|
scanline-=8;
|
||||||
if(scanline>=128)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
scanline_remapped = scanline / 16;
|
scanline_remapped = scanline / 16;
|
||||||
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
|
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
|
||||||
while (cnt < 160) {
|
while (cnt < 160) {
|
||||||
|
|
@ -242,11 +239,8 @@ void vid_update(int scanline)
|
||||||
#else /* LCD_HEIGHT != 64, iRiver */
|
#else /* LCD_HEIGHT != 64, iRiver */
|
||||||
if (fb.mode==1)
|
if (fb.mode==1)
|
||||||
scanline-=16;
|
scanline-=16;
|
||||||
else if (fb.mode==2) {
|
else if (fb.mode==2)
|
||||||
scanline-=8;
|
scanline-=8;
|
||||||
if(scanline>=128)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#ifdef GRAYSCALE
|
#ifdef GRAYSCALE
|
||||||
scanline_remapped = scanline / 4;
|
scanline_remapped = scanline / 4;
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue