X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Fvideo.c;h=3adb17d4a06065304dc5172bc57147e25f1fab06;hb=6516331968f11dd9e5c495572f27cc69fa3d4c48;hp=3e6af589c4db73df0ea9c4aa7c6375322f28558d;hpb=f22d52d646638847ec2ff876f603efa2b173995d;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/video.c b/Usermode/Applications/axwin3_src/WM/video.c index 3e6af589..3adb17d4 100644 --- a/Usermode/Applications/axwin3_src/WM/video.c +++ b/Usermode/Applications/axwin3_src/WM/video.c @@ -15,6 +15,9 @@ #include #include +// === IMPORTS === +extern int giTerminalFD_Input; + // === PROTOTYPES === void Video_Setup(void); void Video_SetCursorPos(short X, short Y); @@ -34,13 +37,25 @@ void Video_Setup(void) int tmpInt; // Open terminal + #if 0 giTerminalFD = open(gsTerminalDevice, OPENFLAG_READ|OPENFLAG_WRITE); if( giTerminalFD == -1 ) { fprintf(stderr, "ERROR: Unable to open '%s' (%i)\n", gsTerminalDevice, _errno); exit(-1); } - + #else + giTerminalFD = 1; + giTerminalFD_Input = 0; + // Check that the console is a VT + // - ioctl(..., 0, NULL) returns the type, which should be 2 + if( ioctl(1, 0, NULL) != 2 ) + { + fprintf(stderr, "stdout is not an Acess VT, can't start"); + _SysDebug("stdout is not an Acess VT, can't start"); + exit(-1); + } + #endif // Set mode to video tmpInt = TERM_MODE_FB; @@ -70,11 +85,12 @@ void Video_Update(void) if( giVideo_LastDirtyLine == 0 ) return; -// _SysDebug("Video_Update - Updating lines %i to %i (0x%x+0x%x px)", -// giVideo_FirstDirtyLine, giVideo_LastDirtyLine, ofs, size); + _SysDebug("Video_Update - Updating lines %i to %i (0x%x+0x%x px)", + giVideo_FirstDirtyLine, giVideo_LastDirtyLine, ofs, size); seek(giTerminalFD, ofs*4, 1); + _SysDebug("Video_Update - Sending"); write(giTerminalFD, gpScreenBuffer+ofs, size*4); -// _SysDebug("Video_Update - Done"); + _SysDebug("Video_Update - Done"); giVideo_FirstDirtyLine = 0; giVideo_LastDirtyLine = 0; }