diff --git a/contrib/games/wolf3d/kolibri.cpp b/contrib/games/wolf3d/kolibri.cpp index 499367e127..6e15b1e22b 100644 --- a/contrib/games/wolf3d/kolibri.cpp +++ b/contrib/games/wolf3d/kolibri.cpp @@ -113,6 +113,7 @@ ksys_pos_t _ksys_screen_size() "int $0x40" :"=a"(size_tmp) :"a"(14) + :"memory" ); size.x = size_tmp.y; size.y = size_tmp.x; @@ -206,6 +207,39 @@ void setcwd(char* path){ asm_inline( "int $0x40" ::"a"(30), "b"(1), "c"(path) + :"memory" ); } +extern unsigned screenWidth; +extern unsigned screenHeight; +void kolibri_set_win_max(void){ + unsigned multip1, multip2; + ksys_pos_t screen_size = _ksys_screen_size(); + + screen_size.y++; + screen_size.x++; + + multip1 = (screen_size.y)/240; + multip2 = (screen_size.y)/200; + + do{ + screenWidth = 320 * multip1; + screenHeight = 240 * multip1; + + if(screenWidth<=screen_size.x){ + break; + } + + screenWidth = 320 * multip2; + screenHeight = 200 * multip2; + + if(screenWidth<=screen_size.y){ + break; + } + + multip1--; + multip2--; + + }while(multip1>0 && multip2>0); +} diff --git a/contrib/games/wolf3d/wl_main.cpp b/contrib/games/wolf3d/wl_main.cpp index 2e828ee3bd..f38f7276eb 100755 --- a/contrib/games/wolf3d/wl_main.cpp +++ b/contrib/games/wolf3d/wl_main.cpp @@ -1965,10 +1965,13 @@ void CheckParameters(int argc, char *argv[]) ========================== */ +extern void kolibri_set_win_max(void); + int main (int argc, char *argv[]) { #ifdef _KOLIBRI setcwd(dirname(argv[0])); + kolibri_set_win_max(); #endif #if defined(_arch_dreamcast)