Skip to content
Snippets Groups Projects
Commit 1ceddeb2 authored by deuce's avatar deuce
Browse files

Do not initialize console mode to BW40!

parent 75682c26
No related branches found
No related tags found
No related merge requests found
...@@ -158,7 +158,7 @@ int try_ansi_init(int mode) ...@@ -158,7 +158,7 @@ int try_ansi_init(int mode)
int try_conio_init(int mode) int try_conio_init(int mode)
{ {
/* This should test for something or other */ /* This should test for something or other */
if(win32_initciolib(mode)) { if(win32_initciolib(C80)) {
cio_api.mode=CIOLIB_MODE_CONIO; cio_api.mode=CIOLIB_MODE_CONIO;
cio_api.mouse=1; cio_api.mouse=1;
cio_api.puttext=win32_puttext; cio_api.puttext=win32_puttext;
......
...@@ -247,13 +247,21 @@ int win32_initciolib(long inmode) ...@@ -247,13 +247,21 @@ int win32_initciolib(long inmode)
if(!isatty(fileno(stdin))) if(!isatty(fileno(stdin)))
return(0); return(0);
win32_textmode(inmode);
if(!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &conmode)) if(!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &conmode))
return(0); return(0);
conmode&=~ENABLE_PROCESSED_INPUT; conmode&=~ENABLE_PROCESSED_INPUT;
conmode|=ENABLE_MOUSE_INPUT; conmode|=ENABLE_MOUSE_INPUT;
if(!SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), conmode)) if(!SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), conmode))
return(0); return(0);
if(!GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &conmode))
return(0);
conmode&=~ENABLE_PROCESSED_OUTPUT;
conmode&=~ENABLE_WRAP_AT_EOL_OUTPUT;
if(!SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), conmode))
return(0);
win32_textmode(inmode);
cio_api.mouse=1; cio_api.mouse=1;
return(1); return(1);
} }
...@@ -384,7 +392,7 @@ int win32_puttext(int left, int top, int right, int bottom, void* buf) ...@@ -384,7 +392,7 @@ int win32_puttext(int left, int top, int right, int bottom, void* buf)
ci=(CHAR_INFO *)malloc(sizeof(CHAR_INFO)*(bs.X*bs.Y)); ci=(CHAR_INFO *)malloc(sizeof(CHAR_INFO)*(bs.X*bs.Y));
for(y=0;y<bs.Y;y++) { for(y=0;y<bs.Y;y++) {
for(x=0;x<bs.X;x++) { for(x=0;x<bs.X;x++) {
ci[(y*bs.X)+x].Char.AsciiChar=bu[((y*bs.X)+x)*2]; ci[(y*bs.X)+x].Char.AsciiChar=ch;
ci[(y*bs.X)+x].Attributes=DOStoWinAttr(bu[(((y*bs.X)+x)*2)+1]); ci[(y*bs.X)+x].Attributes=DOStoWinAttr(bu[(((y*bs.X)+x)*2)+1]);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment