diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2009-04-09 04:22:14 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2009-04-09 04:22:14 +0000 |
commit | 93fccc763b97323cb3112bf9afee819cd03ba195 (patch) | |
tree | 8b3da3ecd807da715478fe4cc1697fcffea1bd67 /apps/plugins/doom | |
parent | 49fcfe81b861f866c4e9e16e272f33654a1be450 (diff) | |
download | rockbox-93fccc763b97323cb3112bf9afee819cd03ba195.tar.gz rockbox-93fccc763b97323cb3112bf9afee819cd03ba195.zip |
M:Robe 500: More LCD initialization, QVGA (vs. VGA) is now enabled by default for performance, 256 color palette mode added, include some linker cleanups and reorganization. Doom and MPEGPlayer now run reaonably well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20664 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom')
-rw-r--r-- | apps/plugins/doom/i_video.c | 95 |
1 files changed, 61 insertions, 34 deletions
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index c148d17077..418fcd4404 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c | |||
@@ -140,6 +140,12 @@ static fb_data *paldata=NULL; | |||
140 | // | 140 | // |
141 | void I_ShutdownGraphics(void) | 141 | void I_ShutdownGraphics(void) |
142 | { | 142 | { |
143 | #if defined(HAVE_LCD_MODES) | ||
144 | #if (HAVE_LCD_MODES & LCD_MODE_PAL256) | ||
145 | rb->lcd_set_mode(LCD_MODE_RGB565); | ||
146 | #endif | ||
147 | #endif | ||
148 | |||
143 | #ifndef HAVE_LCD_COLOR | 149 | #ifndef HAVE_LCD_COLOR |
144 | grey_release(); | 150 | grey_release(); |
145 | #endif | 151 | #endif |
@@ -597,13 +603,19 @@ static void I_UploadNewPalette(int pal) | |||
597 | } | 603 | } |
598 | 604 | ||
599 | #ifdef RANGECHECK | 605 | #ifdef RANGECHECK |
600 | if ((size_t)pal >= num_pals) | 606 | if ((size_t)pal >= num_pals) |
601 | I_Error("I_UploadNewPalette: Palette number out of range (%d>=%d)", | 607 | I_Error("I_UploadNewPalette: Palette number out of range (%d>=%d)", |
602 | pal, num_pals); | 608 | pal, num_pals); |
603 | #endif | 609 | #endif |
604 | memcpy(palette,paldata+256*pal,256*sizeof(fb_data)); | ||
605 | } | ||
606 | 610 | ||
611 | memcpy(palette,paldata+256*pal,256*sizeof(fb_data)); | ||
612 | |||
613 | #if defined(HAVE_LCD_MODES) | ||
614 | #if (HAVE_LCD_MODES & LCD_MODE_PAL256) | ||
615 | rb->lcd_pal256_update_pal(paldata+256*pal); | ||
616 | #endif | ||
617 | #endif | ||
618 | } | ||
607 | 619 | ||
608 | // | 620 | // |
609 | // I_FinishUpdate | 621 | // I_FinishUpdate |
@@ -613,36 +625,37 @@ void I_FinishUpdate (void) | |||
613 | { | 625 | { |
614 | int count; | 626 | int count; |
615 | byte *src = d_screens[0]; | 627 | byte *src = d_screens[0]; |
628 | |||
616 | #if (CONFIG_LCD == LCD_H300) && !defined(SIMULATOR) | 629 | #if (CONFIG_LCD == LCD_H300) && !defined(SIMULATOR) |
617 | count = SCREENWIDTH*SCREENHEIGHT; | 630 | count = SCREENWIDTH*SCREENHEIGHT; |
618 | 631 | ||
619 | /* ASM screen update (drops ~300 tics) */ | 632 | /* ASM screen update (drops ~300 tics) */ |
620 | asm volatile ( | 633 | asm volatile ( |
621 | "move.w #33, (%[LCD]) \n" /* Setup the LCD controller */ | 634 | "move.w #33, (%[LCD]) \n" /* Setup the LCD controller */ |
622 | "nop \n" | 635 | "nop \n" |
623 | "clr.w (%[LCD2]) \n" | 636 | "clr.w (%[LCD2]) \n" |
624 | "nop \n" | 637 | "nop \n" |
625 | "move.w #34, (%[LCD]) \n" /* End LCD controller setup */ | 638 | "move.w #34, (%[LCD]) \n" /* End LCD controller setup */ |
626 | "clr.l %%d1 \n" | 639 | "clr.l %%d1 \n" |
627 | ".loop: \n" | 640 | ".loop: \n" |
628 | "move.l (%[scrp])+, %%d0 \n" | 641 | "move.l (%[scrp])+, %%d0 \n" |
629 | "swap.w %%d0 \n" | 642 | "swap.w %%d0 \n" |
630 | "move.w %%d0, %%d1 \n" | 643 | "move.w %%d0, %%d1 \n" |
631 | "lsr.l #8,%%d1 \n" | 644 | "lsr.l #8,%%d1 \n" |
632 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" | 645 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" |
633 | "move.b %%d0,%%d1 \n" | 646 | "move.b %%d0,%%d1 \n" |
634 | "swap.w %%d0 \n" | 647 | "swap.w %%d0 \n" |
635 | "nop \n" | 648 | "nop \n" |
636 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" | 649 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" |
637 | "move.w %%d0, %%d1 \n" | 650 | "move.w %%d0, %%d1 \n" |
638 | "lsr.l #8,%%d1 \n" | 651 | "lsr.l #8,%%d1 \n" |
639 | "nop \n" | 652 | "nop \n" |
640 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" | 653 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" |
641 | "move.b %%d0,%%d1 \n" | 654 | "move.b %%d0,%%d1 \n" |
642 | "nop \n" | 655 | "nop \n" |
643 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" | 656 | "move.w (%[pal], %%d1.l:2), (%[LCD2]) \n" |
644 | "subq.l #4,%[cnt] \n" | 657 | "subq.l #4,%[cnt] \n" |
645 | "bne.b .loop \n" | 658 | "bne.b .loop \n" |
646 | : /* outputs */ | 659 | : /* outputs */ |
647 | [scrp]"+a"(src), | 660 | [scrp]"+a"(src), |
648 | [cnt] "+d"(count) | 661 | [cnt] "+d"(count) |
@@ -713,7 +726,14 @@ void I_FinishUpdate (void) | |||
713 | "d0", "d1", "d2", "d3" | 726 | "d0", "d1", "d2", "d3" |
714 | ); | 727 | ); |
715 | #else | 728 | #else |
716 | #ifdef HAVE_LCD_COLOR | 729 | |
730 | /* If the hardware has support for a paletted mode it takes precidence */ | ||
731 | #if defined(HAVE_LCD_MODES) | ||
732 | #if (HAVE_LCD_MODES & LCD_MODE_PAL256) | ||
733 | (void) count; | ||
734 | rb->lcd_blit_pal256(src, 0, 0, 0, 0, LCD_WIDTH, LCD_HEIGHT); | ||
735 | #endif | ||
736 | #elif defined(HAVE_LCD_COLOR) | ||
717 | #if(LCD_HEIGHT>LCD_WIDTH) | 737 | #if(LCD_HEIGHT>LCD_WIDTH) |
718 | if(rotate_screen) | 738 | if(rotate_screen) |
719 | { | 739 | { |
@@ -742,8 +762,9 @@ void I_FinishUpdate (void) | |||
742 | *dst++ = palette[*src++]; | 762 | *dst++ = palette[*src++]; |
743 | while (--count); | 763 | while (--count); |
744 | } | 764 | } |
745 | rb->lcd_update(); | 765 | rb->lcd_update(); |
746 | #else /* !HAVE_LCD_COLOR */ | 766 | #else /* !HAVE_LCD_COLOR */ |
767 | |||
747 | unsigned char *dst; | 768 | unsigned char *dst; |
748 | int y; | 769 | int y; |
749 | 770 | ||
@@ -758,8 +779,8 @@ void I_FinishUpdate (void) | |||
758 | 779 | ||
759 | grey_ub_gray_bitmap(greybuffer, 0, y, SCREENWIDTH, 1); | 780 | grey_ub_gray_bitmap(greybuffer, 0, y, SCREENWIDTH, 1); |
760 | } | 781 | } |
761 | #endif /* !HAVE_LCD_COLOR */ | 782 | #endif |
762 | #endif | 783 | #endif |
763 | } | 784 | } |
764 | 785 | ||
765 | // | 786 | // |
@@ -786,6 +807,12 @@ void I_InitGraphics(void) | |||
786 | printf("Starting Graphics engine\n"); | 807 | printf("Starting Graphics engine\n"); |
787 | 808 | ||
788 | noprintf=1; | 809 | noprintf=1; |
810 | |||
811 | #if defined(HAVE_LCD_MODES) | ||
812 | #if (HAVE_LCD_MODES & LCD_MODE_PAL256) | ||
813 | rb->lcd_set_mode(LCD_MODE_PAL256); | ||
814 | #endif | ||
815 | #endif | ||
789 | 816 | ||
790 | /* Note: The other screens are allocated as needed */ | 817 | /* Note: The other screens are allocated as needed */ |
791 | 818 | ||