From d3c03e27f9a9089ca28ad6103c5eb6d56ffe4422 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Sat, 19 Sep 2009 13:21:05 +0000 Subject: [PATCH] Start Milan video support --HG-- branch : SDL-1.2 --- src/video/xbios/SDL_xbios.c | 11 ++- src/video/xbios/SDL_xbios.h | 3 +- src/video/xbios/SDL_xbios_milan.c | 87 +++++++++++++++++++++ src/video/xbios/SDL_xbios_milan.h | 125 ++++++++++++++++++++++++++++++ 4 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 src/video/xbios/SDL_xbios_milan.c create mode 100644 src/video/xbios/SDL_xbios_milan.h diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index 4f1581e0f..f441f702c 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -50,6 +50,7 @@ #include "SDL_xbios_centscreen.h" #include "SDL_xbios_sb3.h" #include "SDL_xbios_tveille.h" +#include "SDL_xbios_milan.h" #define XBIOS_VID_DRIVER_NAME "xbios" @@ -183,6 +184,8 @@ static int XBIOS_Available(void) } } break; + case VDO_MILAN: + break; default: return 0; } @@ -488,6 +491,9 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat) } } break; + case VDO_MILAN: + SDL_XBIOS_ListMilanModes(this, 0); + break; } for ( i=0; i + +#include "SDL_xbios.h" +#include "SDL_xbios_milan.h" + +#ifndef Validmode +#define Validmode(mode) \ + (short)trap_14_ww((short)0x5f,(short)(mode)) +#endif + +#define NUM_PREDEFINED_MODES 7 + +typedef struct { + Uint16 width, height; +} predefined_mode_t; + +static const predefined_mode_t mode_list[NUM_PREDEFINED_MODES]={ + {640,400}, + {640,480}, + {800,608}, + {1024,768}, + {1152,864}, + {1280,1024}, + {1600,1200} +}; + +static const Uint8 mode_bpp[4]={ + 8, 15, 16, 32 +}; + +void SDL_XBIOS_ListMilanModes(_THIS, int actually_add) +{ + int i; + + /* Read infos about current mode */ + + /* Read validated predefined modes */ + for (i=0; i