comparison src/video/ipod/SDL_ipodvideo.c @ 2735:204be4fc2726

Final merge of Google Summer of Code 2008 work... Port SDL 1.3 to the Nintendo DS by Darren Alton, mentored by Sam Lantinga
author Sam Lantinga <slouken@libsdl.org>
date Wed, 27 Aug 2008 15:10:03 +0000
parents c121d94672cb
children 99210400e8b9
comparison
equal deleted inserted replaced
2734:dd25eabe441c 2735:204be4fc2726
524 iPod_keyboard(); 524 iPod_keyboard();
525 posted++; 525 posted++;
526 } 526 }
527 if (dbgout) 527 if (dbgout)
528 fprintf(dbgout, "\n"); 528 fprintf(dbgout, "\n");
529 } 529 } while (posted);
530 while (posted);
531 } 530 }
532 531
533 // enough space for 160x128x2 532 // enough space for 160x128x2
534 static char ipod_scr[160 * (128 / 4)]; 533 static char ipod_scr[160 * (128 / 4)];
535 534
568 int start = M_timer_get_current(); 567 int start = M_timer_get_current();
569 568
570 do { 569 do {
571 if ((inl(lcd_base) & (unsigned int) 0x8000) == 0) 570 if ((inl(lcd_base) & (unsigned int) 0x8000) == 0)
572 break; 571 break;
573 } 572 } while (M_timer_check(start, 1000) == 0);
574 while (M_timer_check(start, 1000) == 0);
575 } 573 }
576 } 574 }
577 575
578 576
579 /* send LCD data */ 577 /* send LCD data */
679 int start = C_timer_get_current(); 677 int start = C_timer_get_current();
680 678
681 do { 679 do {
682 if ((inl(0x70008A0C) & 0x80000000) == 0) 680 if ((inl(0x70008A0C) & 0x80000000) == 0)
683 break; 681 break;
684 } 682 } while (C_timer_check(start, 1000) == 0);
685 while (C_timer_check(start, 1000) == 0); 683 }
686 } 684 }
687 } 685
688 static void 686 static void
689 C_lcd_cmd_data(int cmd, int data) 687 C_lcd_cmd_data(int cmd, int data)
690 { 688 {
691 C_lcd_wait_write(); 689 C_lcd_wait_write();
692 outl(cmd | 0x80000000, 0x70008A0C); 690 outl(cmd | 0x80000000, 0x70008A0C);
778 ipod_scr[y * (lcd_width / 4) + x / 4] &= 776 ipod_scr[y * (lcd_width / 4) + x / 4] &=
779 ~(3 << (2 * (x % 4))); 777 ~(3 << (2 * (x % 4)));
780 ipod_scr[y * (lcd_width / 4) + x / 4] |= 778 ipod_scr[y * (lcd_width / 4) + x / 4] |=
781 (((Uint8 *) (SDL_VideoSurface->pixels))[y * 779 (((Uint8 *) (SDL_VideoSurface->pixels))[y *
782 SDL_VideoSurface-> 780 SDL_VideoSurface->
783 pitch 781 pitch +
784 + 782 x] & 3) << (2
785 x] & 783 *
786 3) << (2 * (x % 4)); 784 (x
785 %
786 4));
787 } 787 }
788 } 788 }
789 } 789 }
790 790
791 M_update_display(0, 0, lcd_width, lcd_height); 791 M_update_display(0, 0, lcd_width, lcd_height);