comparison src/video/xbios/SDL_xbios.c @ 801:ff1058d642dc

Video modes must be sorted by Y size, for SDL_GetVideoMode() to operate properly
author Patrice Mandin <patmandin@gmail.com>
date Sat, 07 Feb 2004 11:25:56 +0000
parents d0f1e34290d6
children 15a7d0c44e73
comparison
equal deleted inserted replaced
800:60a4293ffea9 801:ff1058d642dc
91 91
92 /* Falcon RVB modes */ 92 /* Falcon RVB modes */
93 static int xbiosnummodes_f30rvb=16; 93 static int xbiosnummodes_f30rvb=16;
94 static xbiosmode_t xbiosmodelist_f30rvb[]={ 94 static xbiosmode_t xbiosmodelist_f30rvb[]={
95 {BPS16|COL80|OVERSCAN|VERTFLAG,768,480,16,SDL_FALSE}, 95 {BPS16|COL80|OVERSCAN|VERTFLAG,768,480,16,SDL_FALSE},
96 {BPS16|OVERSCAN|VERTFLAG,384,480,16,SDL_FALSE},
97 {BPS16|COL80|VERTFLAG,640,400,16,SDL_FALSE},
98 {BPS16|VERTFLAG,320,400,16,SDL_FALSE},
96 {BPS16|COL80|OVERSCAN,768,240,16,SDL_FALSE}, 99 {BPS16|COL80|OVERSCAN,768,240,16,SDL_FALSE},
97 {BPS16|COL80|VERTFLAG,640,400,16,SDL_FALSE}, 100 {BPS16|OVERSCAN,384,240,16,SDL_FALSE},
98 {BPS16|COL80,640,200,16,SDL_FALSE}, 101 {BPS16|COL80,640,200,16,SDL_FALSE},
99 {BPS16|OVERSCAN|VERTFLAG,384,480,16,SDL_FALSE},
100 {BPS16|OVERSCAN,384,240,16,SDL_FALSE},
101 {BPS16|VERTFLAG,320,400,16,SDL_FALSE},
102 {BPS16,320,200,16,SDL_FALSE}, 102 {BPS16,320,200,16,SDL_FALSE},
103 103
104 {BPS8|COL80|OVERSCAN|VERTFLAG,768,480,8,SDL_FALSE}, 104 {BPS8|COL80|OVERSCAN|VERTFLAG,768,480,8,SDL_FALSE},
105 {BPS8|OVERSCAN|VERTFLAG,384,480,8,SDL_FALSE},
106 {BPS8|COL80|VERTFLAG,640,400,8,SDL_FALSE},
107 {BPS8|VERTFLAG,320,400,8,SDL_FALSE},
105 {BPS8|COL80|OVERSCAN,768,240,8,SDL_FALSE}, 108 {BPS8|COL80|OVERSCAN,768,240,8,SDL_FALSE},
106 {BPS8|COL80|VERTFLAG,640,400,8,SDL_FALSE}, 109 {BPS8|OVERSCAN,384,240,8,SDL_FALSE},
107 {BPS8|COL80,640,200,8,SDL_FALSE}, 110 {BPS8|COL80,640,200,8,SDL_FALSE},
108 {BPS8|OVERSCAN|VERTFLAG,384,480,8,SDL_FALSE},
109 {BPS8|OVERSCAN,384,240,8,SDL_FALSE},
110 {BPS8|VERTFLAG,320,400,8,SDL_FALSE},
111 {BPS8,320,200,8,SDL_FALSE} 111 {BPS8,320,200,8,SDL_FALSE}
112 }; 112 };
113 113
114 /* Falcon VGA modes */ 114 /* Falcon VGA modes */
115 static int xbiosnummodes_f30vga=6; 115 static int xbiosnummodes_f30vga=6;
116 static xbiosmode_t xbiosmodelist_f30vga[]={ 116 static xbiosmode_t xbiosmodelist_f30vga[]={
117 {BPS16,320,480,16,SDL_FALSE}, 117 {BPS16,320,480,16,SDL_FALSE},
118 {BPS16|VERTFLAG,320,240,16,SDL_FALSE}, 118 {BPS16|VERTFLAG,320,240,16,SDL_FALSE},
119 119
120 {BPS8|COL80,640,480,8,SDL_FALSE}, 120 {BPS8|COL80,640,480,8,SDL_FALSE},
121 {BPS8,320,480,8,SDL_FALSE},
121 {BPS8|COL80|VERTFLAG,640,240,8,SDL_FALSE}, 122 {BPS8|COL80|VERTFLAG,640,240,8,SDL_FALSE},
122 {BPS8,320,480,8,SDL_FALSE},
123 {BPS8|VERTFLAG,320,240,8,SDL_FALSE} 123 {BPS8|VERTFLAG,320,240,8,SDL_FALSE}
124 }; 124 };
125 125
126 /* To setup palette */ 126 /* To setup palette */
127 127
435 Uint32 modeflags; 435 Uint32 modeflags;
436 436
437 /* Free current buffers */ 437 /* Free current buffers */
438 XBIOS_FreeBuffers(this); 438 XBIOS_FreeBuffers(this);
439 439
440 /* Limit bpp */
441 if (bpp>16) {
442 bpp = 16;
443 }
444 bpp >>= 4;
445
440 /* Search if the mode exists (width, height, bpp) */ 446 /* Search if the mode exists (width, height, bpp) */
441 bpp >>= 4;
442 for ( mode=0; SDL_modelist[bpp][mode]; ++mode ) { 447 for ( mode=0; SDL_modelist[bpp][mode]; ++mode ) {
443 if ( (SDL_modelist[bpp][mode]->w == width) && 448 if ( (SDL_modelist[bpp][mode]->w == width) &&
444 (SDL_modelist[bpp][mode]->h == height) ) { 449 (SDL_modelist[bpp][mode]->h == height) ) {
445 450
446 break; 451 break;
783 int i,j; 788 int i,j;
784 789
785 Atari_ShutdownEvents(); 790 Atari_ShutdownEvents();
786 791
787 /* Restore video mode and palette */ 792 /* Restore video mode and palette */
793 #ifndef DEBUG_VIDEO_XBIOS
788 switch(XBIOS_cvdo >> 16) { 794 switch(XBIOS_cvdo >> 16) {
789 case VDO_ST: 795 case VDO_ST:
790 case VDO_STE: 796 case VDO_STE:
791 Setscreen(-1,XBIOS_oldvbase,XBIOS_oldvmode); 797 Setscreen(-1,XBIOS_oldvbase,XBIOS_oldvmode);
792 if (XBIOS_oldnumcol) { 798 if (XBIOS_oldnumcol) {
807 VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette); 813 VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
808 } 814 }
809 break; 815 break;
810 } 816 }
811 Vsync(); 817 Vsync();
818 #endif
812 819
813 if (XBIOS_oldpalette) { 820 if (XBIOS_oldpalette) {
814 free(XBIOS_oldpalette); 821 free(XBIOS_oldpalette);
815 XBIOS_oldpalette=NULL; 822 XBIOS_oldpalette=NULL;
816 } 823 }