X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=sst.c;h=dc26b35442556fcf1b04a2747ec573f8d1f8c2f7;hp=0f8aed65523ed7d25e1ce48ce5af7c18f8578eed;hb=89e52d61fcf689e15a8f831dea084a33ceaa8217;hpb=458c7ff54123a67012af3d60d1c83e7a43b8eb74 diff --git a/sst.c b/sst.c index 0f8aed6..dc26b35 100644 --- a/sst.c +++ b/sst.c @@ -2,7 +2,6 @@ #include #include #include -#include "conio.h" #include "sstlinux.h" #include "sst.h" @@ -103,74 +102,77 @@ static struct commands[] = { #define SRSCAN 1 {"SRSCAN", SRSCAN}, - {"STATUS", SRSCAN}, -#define LRSCAN 2 +#define STATUS 2 + {"STATUS", STATUS}, +#define REQUEST 3 + {"REQUEST", REQUEST}, +#define LRSCAN 4 {"LRSCAN", LRSCAN}, -#define PHASERS 3 +#define PHASERS 5 {"PHASERS", PHASERS}, -#define TORPEDO 4 +#define TORPEDO 6 {"TORPEDO", TORPEDO}, {"PHOTONS", TORPEDO}, -#define MOVE 5 +#define MOVE 7 {"MOVE", MOVE}, -#define SHIELDS 6 +#define SHIELDS 8 {"SHIELDS", SHIELDS}, -#define DOCK 7 +#define DOCK 9 {"DOCK", DOCK}, -#define DAMAGES 8 +#define DAMAGES 10 {"DAMAGES", DAMAGES}, -#define CHART 9 +#define CHART 11 {"CHART", CHART}, -#define IMPULSE 10 +#define IMPULSE 12 {"IMPULSE", IMPULSE}, -#define REST 11 +#define REST 13 {"REST", REST}, -#define WARP 12 +#define WARP 14 {"WARP", WARP}, -#define SCORE 13 +#define SCORE 15 {"SCORE", SCORE}, -#define SENSORS 14 +#define SENSORS 16 {"SENSORS", SENSORS}, -#define ORBIT 15 +#define ORBIT 17 {"ORBIT", ORBIT}, -#define TRANSPORT 16 +#define TRANSPORT 18 {"TRANSPORT", TRANSPORT}, -#define MINE 17 +#define MINE 19 {"MINE", MINE}, -#define CRYSTALS 18 +#define CRYSTALS 20 {"CRYSTALS", CRYSTALS}, -#define SHUTTLE 19 +#define SHUTTLE 21 {"SHUTTLE", SHUTTLE}, -#define PLANETS 20 +#define PLANETS 22 {"PLANETS", PLANETS}, -#define REPORT 21 +#define REPORT 23 {"REPORT", REPORT}, -#define COMPUTER 23 +#define COMPUTER 24 {"COMPUTER", COMPUTER}, -#define COMMANDS 24 +#define COMMANDS 25 {"COMMANDS", COMMANDS}, -#define EMEXIT 25 +#define EMEXIT 26 {"EMEXIT", EMEXIT}, -#define PROBE 26 +#define PROBE 27 {"PROBE", PROBE}, -#define SAVE 27 +#define SAVE 28 {"SAVE", SAVE}, {"FREEZE", SAVE}, -#define ABANDON 28 +#define ABANDON 29 {"ABANDON", ABANDON}, -#define DESTRUCT 29 +#define DESTRUCT 30 {"DESTRUCT", DESTRUCT}, -#define DEATHRAY 30 +#define DEATHRAY 31 {"DEATHRAY", DEATHRAY}, -#define DEBUGCMD 31 +#define DEBUGCMD 32 {"DEBUG", DEBUGCMD}, -#define MAYDAY 32 +#define MAYDAY 33 {"MAYDAY", MAYDAY}, {"SOS", MAYDAY}, {"CALL", MAYDAY}, -#define QUIT 33 +#define QUIT 34 {"QUIT", QUIT}, -#define HELP 34 +#define HELP 35 {"HELP", HELP}, }; @@ -257,7 +259,7 @@ static void helpme(void) { while (fgets(linebuf, sizeof(linebuf),fp)) { if (strstr(linebuf, "******")) break; - proutc(linebuf); + proutn(linebuf); } fclose(fp); } @@ -307,8 +309,14 @@ static void makemoves(void) { commandhook(commands[i].name, TRUE); switch (i) { /* command switch */ case SRSCAN: // srscan - srscan(SRSCAN); + srscan(SCAN_FULL); break; + case STATUS: // status + srscan(SCAN_STATUS); + break; + case REQUEST: // status request + srscan(SCAN_REQUEST); + break; case LRSCAN: // lrscan lrscan(); break; @@ -484,6 +492,8 @@ int main(int argc, char **argv) { strcat(line, " "); } while (TRUE) { /* Play a game */ + setwnd(FULLSCREEN_WINDOW); + clrscr(); prelim(); setup(line[0] == '\0'); if (alldone) { @@ -504,11 +514,8 @@ int main(int argc, char **argv) { } proutn("Do you want to play again? "); if (!ja()) break; - setwnd(FULLSCREEN_WINDOW); - clrscr(); } skip(1); - ioend(); prout("May the Great Bird of the Galaxy roost upon your home planet."); return 0; }