intro.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // File: intro.c
  3. // intro.c plays the introduction sequence
  4. // @author Josh Bicking <josh1147582>
  5. // // // // // // // // // // // // // // // // // // // // // // //
  6. #define _BSD_SOURCE /* for unistd.h */
  7. #ifdef _WIN32
  8. // Windows implements sleep in Windows.h with Sleep(milliseconds)
  9. # include <curses.h>
  10. # include <Windows.h>
  11. # define SLEEP(delay) Sleep(delay/1000)
  12. #else
  13. // Unix requires unistd.h for usleep(microseconds).
  14. // usleep/1000 = Sleep
  15. # include <ncurses.h>
  16. # include <unistd.h>
  17. # define SLEEP(delay) usleep(delay)
  18. #endif
  19. #include <string.h>
  20. #include "print.h"
  21. #include "intro.h"
  22. /// Plays the introduction sequence.
  23. ///
  24. void intro(){
  25. clear();
  26. SLEEP(250000);
  27. // Get the size of the terminal window.
  28. // The size of the game window is 53x22.
  29. int BUFF_Y = 0, BUFF_X = 0;
  30. int y, x;
  31. getmaxyx(stdscr, y, x);
  32. if(y > 22)
  33. BUFF_Y = y/2 - 22/2;
  34. if(x > 53)
  35. BUFF_X = x/2 - 53/2;
  36. slowPrint("WELCOME TO ROBCO INDUSTRIES (TM) TERMLINK", 0, BUFF_Y, BUFF_X);
  37. move(1, 0);
  38. refresh();
  39. SLEEP(30000);
  40. mvprintw(2,0,"%c", '>');
  41. move(2,1);
  42. refresh();
  43. SLEEP(1500000);
  44. slowType("SET TERMINAL/INQUIRE", 2, BUFF_Y, BUFF_X);
  45. slowPrint("RIT-V300", 4, BUFF_Y, BUFF_X);
  46. mvprintw(6,0,"%c", '>');
  47. refresh();
  48. SLEEP(1500000);
  49. slowType("SET FILE/PROTECTION=OWNER:RWED ACCOUNTS.F",6, BUFF_Y, BUFF_X);
  50. mvprintw(7,0,"%c", '>');
  51. refresh();
  52. SLEEP(1500000);
  53. slowType("SET HALT RESTART/MAINT",7, BUFF_Y, BUFF_X);
  54. slowPrint("Initializing Robco Industries(TM) Boot Agent v2.3.0",9, BUFF_Y, BUFF_X);
  55. slowPrint("RBIOS-4.02.08.00 53EE5.E7.E8",10, BUFF_Y, BUFF_X);
  56. slowPrint("Copyright 2201-22-3 Robco Ind.",11, BUFF_Y, BUFF_X);
  57. slowPrint( "Uppermem: 64 KB",12, BUFF_Y, BUFF_X);
  58. slowPrint("Root (5A8)",13, BUFF_Y, BUFF_X);
  59. slowPrint("Maintenance Mode",14, BUFF_Y, BUFF_X);
  60. mvprintw(16,0,"%c",'>');
  61. refresh();
  62. SLEEP(1500000);
  63. slowType("RUN DEBUG/ACCOUNTS.F",16, BUFF_Y, BUFF_X);
  64. move(16,0);
  65. refresh();
  66. SLEEP(50000);
  67. }