diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-04 20:56:49 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-04 20:56:49 +0000 |
commit | ebd63b52cd22a173106085b79404688d267a801a (patch) | |
tree | d4b1aea7c7c5f1c83539c36d6ba5d430b5e32597 /apps/plugins/rockboy/lcd.c | |
parent | 984cd6e568c841f4110f070161ad28fbe4c85342 (diff) | |
download | rockbox-ebd63b52cd22a173106085b79404688d267a801a.tar.gz rockbox-ebd63b52cd22a173106085b79404688d267a801a.zip |
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/lcd.c')
-rw-r--r-- | apps/plugins/rockboy/lcd.c | 56 |
1 files changed, 27 insertions, 29 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 | ||
53 | static int sprsort = 1; | 53 | static int sprsort = 1; |
54 | static int sprdebug; | 54 | static int sprdebug; |
55 | static int scanline_ind=0; | 55 | static 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 | ||
545 | void wnd_scan_color(void) | 539 | void wnd_scan_color(void) |
546 | { | 540 | { |
547 | int cnt; | 541 | int cnt; |
@@ -735,32 +729,30 @@ void lcd_begin(void) | |||
735 | void lcd_refreshline(void) | 729 | void 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 | ||