Category : C Source Code
Archive   : LSPD05-2.ZIP
Filename : 179.C

 
Output of file : 179.C contained in archive : LSPD05-2.ZIP
/* Light Speed Reference Example Program */
/* Saving/loading screens */
#include "lspeed.h"

main()
{
/* Set graphics, register font */
set320x200();
registernicefont();

/* Draw some lines */
ega_putline(0, 0, 100, 50, LS_WHITE);
ega_putline(100, 0, 0, 50, LS_YELLOW);
ega_putline(150, 10, 25, 150, LS_RED);

/* Save the file */
switch(ega_capture_screen_byte("scrntest.img"))
{
/* Test return */
case 0 : /* All ok */
break;
case -1 : /* Impossible! */
printf("Not in graphics - system error!\n");
exit(1);
case -2 : /* Could not use file */
set80x25();
printf("Error - could not create SCRNTEST.IMG!\n");
exit(1);
}

/* Clear screen */
ega_clearpage();

/* Write loading message */
ega_writetext(10, 10, LS_YELLOW, LS_BLACK, NICE_FONT,
"Screen cleared - press a key to");
ega_writetext(10, 23, LS_YELLOW, LS_BLACK, NICE_FONT,
"load data!");

/* Get a key, load data */
getxch();
ega_clearpage(); /* Clear off message too */
switch(ega_restore_screen_byte("scrntest.img"))
{
/* Test return */
case 0 : /* All ok */
break;
case -1 : /* Impossible! */
printf("Not in graphics - system error!\n");
exit(1);
case -2 : /* Could not use file */
set80x25();
printf("Error - could not load AREATEST.IMG!\n");
exit(1);
}

/* Wait for key, exit */
ega_writetext(10, 180, LS_WHITE, LS_BLACK, NICE_FONT,
"Screen loaded - press a key...");
getxch();
set80x25();
}


  3 Responses to “Category : C Source Code
Archive   : LSPD05-2.ZIP
Filename : 179.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/