Pull SERGEEV dependencies out of sst.c, fix docs.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 4 Feb 2005 13:57:04 +0000 (13:57 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 4 Feb 2005 13:57:04 +0000 (13:57 +0000)
io.c
sst-doc.xml
sst.c
sst.h

diff --git a/io.c b/io.c
index a436c3333b7b41a3826fdf2f05ed48d1d9cbe04b..bff7d46913fe55bedb7b824fb872f16febb60289 100644 (file)
--- a/io.c
+++ b/io.c
@@ -449,6 +449,16 @@ void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, i
 #endif /* SERGEEV */
 }
 
 #endif /* SERGEEV */
 }
 
+void makechart(void) {
+#ifdef SERGEEV
+    _setcursortype(_NOCURSOR);
+    setwnd(LOWER_WINDOW);
+    clrscr();
+    chart(0);
+    _setcursortype(_NORMALCURSOR);
+#endif /* SERGEEV */
+}
+
 void setpassword(void) {
 #ifndef SERGEEV
        while (TRUE) {
 void setpassword(void) {
 #ifndef SERGEEV
        while (TRUE) {
index e810746fa6f08a843a6d1ea889a00346fcb06a48..b068e7cab6d38467ecb8c0c4c3b5718e1201009a 100644 (file)
   <firstname>Tom</firstname>\r
   <surname>Almy</surname>\r
 </author>\r
   <firstname>Tom</firstname>\r
   <surname>Almy</surname>\r
 </author>\r
+<author>\r
+  <firstname>Stas</firstname>\r
+  <surname>Sergeev</surname>\r
+</author>\r
 <author>\r
   <firstname>Eric</firstname>\r
   <othername>Steven</othername>\r
 <author>\r
   <firstname>Eric</firstname>\r
   <othername>Steven</othername>\r
 \r
                             Resurrected By\r
                                Tom Almy\r
 \r
                             Resurrected By\r
                                Tom Almy\r
+\r
+                         Curses Interface By\r
+                              Stas Sergeev \r
+\r
+                         SST 2K polishing by\r
+                            Eric S. Raymond\r
 </literallayout>\r
 </dedication>\r
 \r
 </literallayout>\r
 </dedication>\r
 \r
@@ -284,7 +294,7 @@ abandon ship) must be written out in full.  Also, in a few cases two
 or more commands begin with the same letter, and in this case that\r
 letter refers to a particular one of the commands; to get the other,\r
 your abbreviation must be two or more characters long.  This sounds\r
 or more commands begin with the same letter, and in this case that\r
 letter refers to a particular one of the commands; to get the other,\r
 your abbreviation must be two or more characters long.  This sounds\r
-complicated, but you will learn the abbreviations quickly enough.</para>\r
+complicated, but you will learn the abbreviations qGuickly enough.</para>\r
 \r
 <para>What this all boils down to is:</para>\r
 \r
 \r
 <para>What this all boils down to is:</para>\r
 \r
@@ -314,6 +324,11 @@ Full commands:  SRSCAN
                 SRSCAN CHART\r
 </literallayout>\r
 \r
                 SRSCAN CHART\r
 </literallayout>\r
 \r
+<!-- This is new in SST 2K -->\r
+<para>If you are using the screen-oriented interface, it should never\r
+be necessary to call this command explicitly; a short-range scan will\r
+always be present on the screen.</para>\r
+\r
 <para>The short-range scan gives you a considerable amount of information\r
 about the quadrant your starship is in.  A short-range scan is best\r
 described by an example.</para>\r
 <para>The short-range scan gives you a considerable amount of information\r
 about the quadrant your starship is in.  A short-range scan is best\r
 described by an example.</para>\r
@@ -357,7 +372,6 @@ short-range scan anytime you like.</para>
 \r
 <para>If your short-range sensors are damaged, this command will only show\r
 the contents of adjacent sectors.</para>\r
 \r
 <para>If your short-range sensors are damaged, this command will only show\r
 the contents of adjacent sectors.</para>\r
-\r
 </sect1>\r
 <sect1><title>Status Report</title>\r
 \r
 </sect1>\r
 <sect1><title>Status Report</title>\r
 \r
@@ -475,6 +489,11 @@ Mnemonic:  LRSCAN
 Shortest abbreviation:  L\r
 </literallayout>\r
 \r
 Shortest abbreviation:  L\r
 </literallayout>\r
 \r
+<!-- This is new in SST 2K -->\r
+<para>If you are using the screen-oriented interface, it should never\r
+be necessary to call this command explicitly; a long-range scan will\r
+always be present on the screen.</para>\r
+\r
 <para>A long-range scan gives you general information about where you are\r
 and what is around you.  Here is an example output.</para>\r
 \r
 <para>A long-range scan gives you general information about where you are\r
 and what is around you.  Here is an example output.</para>\r
 \r
@@ -1605,6 +1624,67 @@ the algorithm.</para>
 <para>The DECUS version had a Deep Space Probe. Looked like a good idea\r
 so I implemented it based on its description.</para>\r
 \r
 <para>The DECUS version had a Deep Space Probe. Looked like a good idea\r
 so I implemented it based on its description.</para>\r
 \r
+</sect1>\r
+<sect1><title>Stas Sergeev's story</title>\r
+\r
+<para>I started from an older Tom Almy version and added features I had\r
+seen in mainframe variants of the game, I wrote a screen-oriented \r
+interface for it based on the curses library.</para>\r
+\r
+<itemizedlist>\r
+<listitem>\r
+<para>The Space Thingy can be shoved, if you ram it, and can fire back if \r
+fired upon.</para>\r
+</listitem>\r
+<listitem>\r
+<para>The Tholian can be hit with phasers.</para>\r
+</listitem>\r
+<listitem>\r
+<para>When you are docked, base covers you with an almost invincible shields \r
+      (a commander can still ram you, or a Romulan can destroy the base,\r
+      or a SCom can even succeed with direct attack IIRC, but this rarely \r
+      happens).</para>\r
+</listitem>\r
+<listitem>\r
+<para>SCom can't escape from you if no more enemies remain (without this, \r
+      chasing SCom can take an eternity).</para>\r
+</listitem>\r
+<listitem>\r
+<para>Probe target you enter is now the destination quadrant. Before I don't \r
+      remember what it was, but it was something I had difficulty using)</para>\r
+</listitem>\r
+<listitem>\r
+<para>Secret password is now autogenerated.</para>\r
+</listitem>\r
+<listitem>\r
+<para>Victory plaque is adjusted for A4 paper rather than 132-column greenbar\r
+:-)</para>\r
+</listitem>\r
+<listitem>\r
+<para>Phasers now tells you how much energy needed, but only if the computer \r
+is alive.</para>\r
+</listitem>\r
+<listitem>\r
+<para>Planets are auto-scanned when you enter the quadrant.</para>\r
+</listitem>\r
+<listitem>\r
+<para>Mining or using crystals in presense of enemy now yields an attack.\r
+There are other minor adjustments to what yields an attack\r
+and what does not.</para>\r
+</listitem>\r
+<listitem>\r
+<para>Ramming a black hole is no longer instant death.  There is a\r
+chance you might get timewarped instead.</para>\r
+</listitem>\r
+<listitem>\r
+<para>"freeze" command reverts to "save", most people will understand this\r
+better anyway.</para>\r
+</listitem>\r
+<listitem>\r
+<para>Screen-oriented interface, with sensor scans always up.</para>\r
+</listitem>\r
+</itemizedlist>\r
+\r
 </sect1>\r
 <sect1><title>Eric Raymond's story</title>\r
 \r
 </sect1>\r
 <sect1><title>Eric Raymond's story</title>\r
 \r
@@ -1638,19 +1718,8 @@ quadrants introduced into many BASIC versions.</para>
 url='http://developer.berlios.de/projects/sst/'>project\r
 site</ulink>.</para>\r
 \r
 url='http://developer.berlios.de/projects/sst/'>project\r
 site</ulink>.</para>\r
 \r
-<para>Here are some good pages on the history of Star Trek games:</para>\r
-\r
-<itemizedlist>\r
-<listitem><para>\r
-<ulink url='http://www.dunnington.u-net.com/public/startrek/'>http://www.dunnington.u-net.com/public/startrek/</ulink>\r
-</para></listitem>\r
-<listitem><para>\r
-<ulink url='http://www3.sympatico.ca/maury/games/space/star_trek.html'>http://www3.sympatico.ca/maury/games/space/star_trek.html</ulink>\r
-</para></listitem>\r
-<listitem><para>\r
-<ulink url='http://www.cactus.org/%7Enystrom/startrek.html'>http://www.cactus.org/%7Enystrom/startrek.html</ulink>\r
-</para></listitem>\r
-</itemizedlist>\r
+<para>After I launched the Berlios project, Stas Sergeev contacted me\r
+me.  We worked together to merge in his changes.</para>\r
 \r
 <para>Modifications I've made:</para>\r
 \r
 \r
 <para>Modifications I've made:</para>\r
 \r
@@ -1683,6 +1752,23 @@ an identifiable magic number and the thaw logic checks for same.
 I made the internal pager work, nd in the process got rid of a number\r
 of platform dependencies in the code.\r
 </para></listitem>\r
 I made the internal pager work, nd in the process got rid of a number\r
 of platform dependencies in the code.\r
 </para></listitem>\r
+<listitem><para>\r
+The HELP/CALL/SOS command is now MAYDAY.  SOS and CALL are still accepted.\r
+</para></listitem>\r
+</itemizedlist>\r
+\r
+<para>Here are some good pages on the history of Star Trek games:</para>\r
+\r
+<itemizedlist>\r
+<listitem><para>\r
+<ulink url='http://www.dunnington.u-net.com/public/startrek/'>http://www.dunnington.u-net.com/public/startrek/</ulink>\r
+</para></listitem>\r
+<listitem><para>\r
+<ulink url='http://www3.sympatico.ca/maury/games/space/star_trek.html'>http://www3.sympatico.ca/maury/games/space/star_trek.html</ulink>\r
+</para></listitem>\r
+<listitem><para>\r
+<ulink url='http://www.cactus.org/%7Enystrom/startrek.html'>http://www.cactus.org/%7Enystrom/startrek.html</ulink>\r
+</para></listitem>\r
 </itemizedlist>\r
 \r
 </sect1>\r
 </itemizedlist>\r
 \r
 </sect1>\r
diff --git a/sst.c b/sst.c
index 2e1038b0469d7b2a7a9a7f649d22e157daff8ab1..07b7da5cef805bca47a59a279237eee70611f9c1 100644 (file)
--- a/sst.c
+++ b/sst.c
@@ -49,47 +49,48 @@ Here are Tom Almy's changes:
 
    6. Perhaps cloaking to be added later? BSD version
 
 
    6. Perhaps cloaking to be added later? BSD version
 
-Here are Stas Sergeev's changes (controlled by the proprocessor symbol
-SERGEEV, not yet completely merged):
+Here are Stas Sergeev's changes:
 
    1. The Space Thingy can be shoved, if you it ram, and can fire back if 
       fired upon.
 
 
    1. The Space Thingy can be shoved, if you it ram, and can fire back if 
       fired upon.
 
-   1 The Tholian can be hit with phasers
+   2. The Tholian can be hit with phasers
 
 
-   2. When you are docked, base covers you with an almost invincible shields 
+   3. When you are docked, base covers you with an almost invincible shields 
       (a commander can still ram you, or a Romulan can destroy the base,
       or a SCom can even succeed with direct attack IIRC, but this rarely 
       happens).
 
       (a commander can still ram you, or a Romulan can destroy the base,
       or a SCom can even succeed with direct attack IIRC, but this rarely 
       happens).
 
-    3. SCom can't escape from you if no more enemies remain (without this, 
-       chasing SCom can take an eternity).
+   4. SCom can't escape from you if no more enemies remain (without this, 
+      chasing SCom can take an eternity).
 
 
-    4. Probe target you enter is now the destination quadrant. Before I don't 
-       remember what it was, but it was something I had difficulty using)
+   5. Probe target you enter is now the destination quadrant. Before I don't 
+      remember what it was, but it was something I had difficulty using)
 
 
-    5. Secret password is now autogenerated.
+   6. Secret password is now autogenerated.
 
 
-    6. "Plaque" is adjusted for A4 paper:)
+   7. "Plaque" is adjusted for A4 paper :-)
 
 
-    7. Phasers now tells you how much energy needed, but only if the computer 
+   8. Phasers now tells you how much energy needed, but only if the computer 
        is alive.
 
        is alive.
 
-    8. Planets are auto-scanned when you enter the quadrant.
+   9. Planets are auto-scanned when you enter the quadrant.
 
 
-    9. Mining or using crystals in presense of enemy now yields an attack.
+   10. Mining or using crystals in presense of enemy now yields an attack.
        There are other minor adjustments to what yields an attack
        and what does not.
 
        There are other minor adjustments to what yields an attack
        and what does not.
 
-    10. Ramming a black hole is no longer instant death.  There is a
-        chance you might get timewarped instead.
+   11. Ramming a black hole is no longer instant death.  There is a
+       chance you might get timewarped instead.
 
 
-    11. "freeze" command reverts to "save", most people will understand this
+   12. "freeze" command reverts to "save", most people will understand this
         better anyway.
 
         better anyway.
 
+   13. Screen-oriented interface, with sensor scans always up.
+
 Eric Raymond's changes:
 
 Eric Raymond's changes:
 
-     1. "sos" and "call" becomes "mayday", "freeze" and "save" are both good.
+   1. "sos" and "call" becomes "mayday", "freeze" and "save" are both good.
 
    */
 
 
    */
 
@@ -99,13 +100,11 @@ static struct
     int value;
 }
 commands[] = {
     int value;
 }
 commands[] = {
-#ifndef SERGEEV
 #define SRSCAN 1
        {"SRSCAN",      SRSCAN},
        {"STATUS",      SRSCAN},
 #define LRSCAN 2
        {"LRSCAN",      LRSCAN},
 #define SRSCAN 1
        {"SRSCAN",      SRSCAN},
        {"STATUS",      SRSCAN},
 #define LRSCAN 2
        {"LRSCAN",      LRSCAN},
-#endif /* SERGEEV */
 #define PHASERS        3
        {"PHASERS",     PHASERS},
 #define TORPEDO        4
 #define PHASERS        3
        {"PHASERS",     PHASERS},
 #define TORPEDO        4
@@ -129,10 +128,8 @@ commands[] = {
        {"WARP",        WARP},
 #define SCORE  13
        {"SCORE",       SCORE},
        {"WARP",        WARP},
 #define SCORE  13
        {"SCORE",       SCORE},
-#ifndef SERGEEV
 #define SENSORS        14
        {"SENSORS",     SENSORS},
 #define SENSORS        14
        {"SENSORS",     SENSORS},
-#endif /* SERGEEV */
 #define ORBIT  15
        {"ORBIT",       ORBIT},
 #define TRANSPORT      16
 #define ORBIT  15
        {"ORBIT",       ORBIT},
 #define TRANSPORT      16
@@ -280,13 +277,7 @@ static void makemoves(void) {
                         clrscr();
                        proutn("COMMAND> ");
                         if (scan() == IHEOL) {
                         clrscr();
                        proutn("COMMAND> ");
                         if (scan() == IHEOL) {
-#ifdef SERGEEV
-                            _setcursortype(_NOCURSOR);
-                            setwnd(LOWER_WINDOW);
-                            clrscr();
-                            chart(0);
-                            _setcursortype(_NORMALCURSOR);
-#endif /* SERGEEV */
+                           makechart();
                             continue;
                         }
                         ididit=0;
                             continue;
                         }
                         ididit=0;
@@ -310,14 +301,12 @@ static void makemoves(void) {
                }
                commandhook(commands[i].name, TRUE);
                switch (i) { /* command switch */
                }
                commandhook(commands[i].name, TRUE);
                switch (i) { /* command switch */
-#ifndef SERGEEV
                         case SRSCAN:                 // srscan
                                srscan(1);
                                break;
                        case LRSCAN:                    // lrscan
                                lrscan();
                                 break;
                         case SRSCAN:                 // srscan
                                srscan(1);
                                break;
                        case LRSCAN:                    // lrscan
                                lrscan();
                                 break;
-#endif /* SERGEEV */
                        case PHASERS:                   // phasers
                                phasers();
                                if (ididit) hitme = TRUE;
                        case PHASERS:                   // phasers
                                phasers();
                                if (ididit) hitme = TRUE;
@@ -359,11 +348,9 @@ static void makemoves(void) {
                         case SCORE:                // score
                                 score();
                                break;
                         case SCORE:                // score
                                 score();
                                break;
-#ifndef SERGEEV
                        case SENSORS:                   // sensors
                                sensor();
                                break;
                        case SENSORS:                   // sensors
                                sensor();
                                break;
-#endif /* SERGEEV */
                        case ORBIT:                     // orbit
                                orbit();
                                if (ididit) hitme = TRUE;
                        case ORBIT:                     // orbit
                                orbit();
                                if (ididit) hitme = TRUE;
diff --git a/sst.h b/sst.h
index 0e3e52419e4fcf22b69cc4a9c728269811c238c3..aef476b76f19db679d01b2063088feaf992e8bd0 100644 (file)
--- a/sst.h
+++ b/sst.h
@@ -444,6 +444,7 @@ void waitfor(void);
 void setpassword(void);
 void commandhook(char *, int);
 void c_printf (char *format, ... );
 void setpassword(void);
 void commandhook(char *, int);
 void c_printf (char *format, ... );
+void makechart(void);
 
 typedef struct {
         int wndleft,wndtop,wndright,wndbottom;
 
 typedef struct {
         int wndleft,wndtop,wndright,wndbottom;