2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
7 #include <acess/devices/terminal.h>
21 giTerminalFD = open(gsTerminalDevice, OPENFLAG_READ|OPENFLAG_WRITE);
22 if( giTerminalFD == -1 )
24 fprintf(stderr, "ERROR: Unable to open '%s' (%i)\n", gsTerminalDevice, _errno);
29 tmpInt = giScreenWidth;
30 tmpInt = ioctl( giTerminalFD, TERM_IOCTL_WIDTH, &tmpInt );
31 if(tmpInt != giScreenWidth)
33 fprintf(stderr, "Warning: Selected width (%i) is invalid, clipped to %i\n",
34 giScreenWidth, tmpInt);
35 giScreenWidth = tmpInt;
39 tmpInt = giScreenHeight;
40 tmpInt = ioctl( giTerminalFD, TERM_IOCTL_HEIGHT, &tmpInt );
41 if(tmpInt != giScreenHeight)
43 fprintf(stderr, "Warning: Selected height (%i) is invalid, clipped to %i\n",
44 giScreenHeight, tmpInt);
45 giScreenHeight = tmpInt;
49 tmpInt = TERM_MODE_FB;
50 ioctl( giTerminalFD, TERM_IOCTL_MODETYPE, &tmpInt );
52 // Force VT8 to be shown
53 ioctl( giTerminalFD, TERM_IOCTL_FORCESHOW, NULL );
55 // Create local framebuffer (back buffer)
56 gpScreenBuffer = malloc( giScreenWidth*giScreenHeight*4 );
57 memset32( gpScreenBuffer, 0x8888FF, giScreenWidth*giScreenHeight );
63 seek(giTerminalFD, 0, SEEK_SET);
64 write(giTerminalFD, giScreenWidth*giScreenHeight*4, gpScreenBuffer);