# HG changeset patch # User Patrice Mandin # Date 1253367101 0 # Node ID 89c7562eae9b736f14c46c9c94405c2bd433dde0 # Parent 13de8ea401dbaf979bcb0d65a6881fb91eb3059d Enumerates custom modes diff -r 13de8ea401db -r 89c7562eae9b src/video/xbios/SDL_xbios_milan.c --- a/src/video/xbios/SDL_xbios_milan.c Sat Sep 19 13:21:05 2009 +0000 +++ b/src/video/xbios/SDL_xbios_milan.c Sat Sep 19 13:31:41 2009 +0000 @@ -57,6 +57,28 @@ 8, 15, 16, 32 }; +/*--- Variables ---*/ + +static int enum_actually_add; +static SDL_VideoDevice *enum_this; + +/*--- Functions ---*/ + +static unsigned long /*cdecl*/ enumfunc(SCREENINFO *inf, unsigned long flag) +{ + xbiosmode_t modeinfo; + + modeinfo.number = inf->devID; + modeinfo.width = inf->scrWidth; + modeinfo.height = inf->scrHeight; + modeinfo.depth = inf->scrPlanes; + modeinfo.doubleline = SDL_FALSE; + + SDL_XBIOS_AddMode(enum_this, enum_actually_add, &modeinfo); + + return ENUMMODE_CONT; +} + void SDL_XBIOS_ListMilanModes(_THIS, int actually_add) { int i; @@ -84,4 +106,7 @@ } /* Read custom created modes */ + enum_this = this; + enum_actually_add = actually_add; + VsetScreen(-1, &enumfunc, MI_MAGIC, CMD_ENUMMODES); }