diff --git a/include/logglobals.h b/include/logglobals.h index 3ae7ddfeff981d1acb588f20c09b992cc9c0bdf6..00a5dc361285639435f72e809c279722fea89de9 100644 --- a/include/logglobals.h +++ b/include/logglobals.h @@ -36,9 +36,6 @@ extern log_action_t gg; /* External global variables */ -extern int rabbits, rabflag; /* Rabbit mode */ -extern int avoidrabbits; - extern short txacross, txdown, across, down, baseline, line1, line2, kindgroupbase, kindgroupleft, kindgroupright, kindgroupstart, kindgroupsize, histdown; @@ -128,7 +125,7 @@ extern short messageright; /* Maximum width of messages */ extern long fastsavetime; -extern long watchdog, rabtime; /* Miscellaneous timers */ +extern long watchdog; /* Miscellaneous timers */ extern log_tool *simtype_ignore; /* Non-simulated type */ extern log_tool *simtype_common; /* Common-pin type */ diff --git a/include/logstructs.h b/include/logstructs.h index 700d2c44374a8f7fd87b295e1e4faf3e32007829..af24349f240de2c0d90b14a167bbfc05466adda9 100644 --- a/include/logstructs.h +++ b/include/logstructs.h @@ -37,18 +37,6 @@ typedef struct filerecfilerec { FILEBUFNC(f,filerec); } filerecfilerec; -typedef struct rablistrec { - short x, y, next; -} rablistrec; /* Rabbit mode state descriptor */ - -typedef rablistrec rablisttype[rablistsize + 1]; - -typedef struct rabmusrec { - short note, time; -} rabmusrec; /* Rabbit music descriptor */ - -typedef rabmusrec rabmustype[rabmussize]; - typedef short kindgrouptype[kindgroupmaxsize]; typedef log_gattrrec *kindattrtype[kindgroupmaxsize]; diff --git a/include/logstuff.h b/include/logstuff.h index 855e10878438ea03a1b6274b99f463f2b10558ac..f1542cc8d3fc142082d3edd8ead061d40b016246 100644 --- a/include/logstuff.h +++ b/include/logstuff.h @@ -5,7 +5,6 @@ void setup_log_cursors(); void recolor_log_cursors(int color, int force); void choose_log_cursor(int curs); void m_saveclip (); -void m_bunny(int x, int y); int findprocedure(char *name, void (**proc)()); diff --git a/include/settings.h b/include/settings.h index f414c33a8fbd513f1b1b2a29a031993c3c7e9604..56d77eda5f69de60114d479e7875d2bfbaaf1e50 100644 --- a/include/settings.h +++ b/include/settings.h @@ -103,11 +103,6 @@ #define histsweep_trig 2 #define histsweep_manual 3 -#define rablistsize 23 /* Size of Rabbit State Machine */ -#define rabtabsize 10 /* Maximum number of rabbits on screen */ -#define rabmussize 32 /* Length of rabbit theme music */ -#define rabdelay 30000 /* Time to wait for rabbit: 5 Minutes */ - #define NAMEGAP (3 * gg.scale) /* signallabel horizontal offset */ #define maxeditmodes 4 diff --git a/include/window.h b/include/window.h index 7f0e07cd0cca531160f1c874ee60b42c16913252..1655290e5eb0b5566d824f662ca99d2121de4796 100644 --- a/include/window.h +++ b/include/window.h @@ -71,10 +71,6 @@ void uerase(short x1, short y1, short x2, short y2); void erase(short x1, short y1, short x2, short y2); -void norabbits(); - -void addrabbit(); - void centerstr2(int x, int y, char *s); void rightstr2(int x, int y, char *s); diff --git a/src/keyboard.c b/src/keyboard.c index b9288be4f64c0b36bac8c2ffd0ba6d53e2049934..fda303f0ed06f3e7a4590736b162c9d505155a4f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -113,8 +113,6 @@ void trykbd() } if (!pollkbd2()) return; - norabbits(); - rabtime = timers_sysclock(); ch = inkey4(); switch (ch) { diff --git a/src/log.c b/src/log.c index 13a48c3be60434a7f369a11390539f5d41036d39..535bfb5d6d6e388bd705c11d002c85ceaf975d8f 100644 --- a/src/log.c +++ b/src/log.c @@ -90,10 +90,6 @@ enum cursors oldcursortype; log_action_t gg; ///< External global variables -int rabbits; ///< A plushy animal -int rabflag; ///< If Rabbit mode -int avoidrabbits; ///< Should repel rabbits - short txacross; short txdown; short across; @@ -205,7 +201,6 @@ short messageright; ///< Maximum width of messages long fastsavetime; long watchdog; ///< Miscellaneous timers -long rabtime; ///< Miscellaneous timers log_tool *simtype_ignore; ///< Non-simulated type log_tool *simtype_common; ///< Common-pin type @@ -2091,11 +2086,6 @@ void doimmedcnffunction() return; if (gg.initdone) remcursor(); - getbool(gg.funcarg, &avoidrabbits); - if (avoidrabbits) - vmessage("Avoiding rabbits"); - else - vmessage("Not avoiding rabbits"); clearfunc(); } @@ -11319,7 +11309,6 @@ static void initialize() gg.quiet = false; gg.dotsvisible = true; gg.showconflicts = false; - avoidrabbits = true; pushedbackkey = '\0'; conflictenbl = true; conflictstop = false; @@ -11715,8 +11704,6 @@ static void initialize() gg.probekind = NULL; probeflag = false; briefprobe = false; - rabbits = false; - rabflag = false; firsttraining = true; training = false; cureditmode = 1; @@ -11879,7 +11866,6 @@ int main(int argc, char * argv[]) else nocrosshair(); gg.stillnear = true; - rabtime = timers_sysclock(); if (displaynews) shownews(); if (*gg.func == '\0') @@ -11908,15 +11894,6 @@ int main(int argc, char * argv[]) nocrosshair(); } - if (gg.t.near_) - { - if (rabflag) - norabbits(); - rabtime = timers_sysclock(); - } - - if (timers_sysclock() - rabtime > rabdelay && !avoidrabbits) - addrabbit(); } while (!(gg.t.dn || *gg.func != '\0')); } if (displaynews) @@ -11924,8 +11901,6 @@ int main(int argc, char * argv[]) clearalpha(); displaynews = false; } - if (rabflag) - norabbits(); nocrosshair(); clipoff(); if (*gg.func != '\0') diff --git a/src/logstuff.c b/src/logstuff.c index e333cd94527593268907b7a51f538d208df11e48..b499f16a7428f92b23fc6c996ebc938068b4180d 100644 --- a/src/logstuff.c +++ b/src/logstuff.c @@ -124,14 +124,6 @@ void choose_log_cursor(int curs) } } -void m_bunny(int x, int y) -{ - m_colormode(m_xor); - m_color(m_white); - m_drawstr(x, y, NULL, "Boink"); -} - - int save_clip_x1, save_clip_y1, save_clip_x2, save_clip_y2; extern int m_clip_x1, m_clip_y1, m_clip_x2, m_clip_y2; diff --git a/src/pen.c b/src/pen.c index dea02bccfcee065c1f9f59f657dcc726858d85f0..71302589b7182f326284c8910da610c5c0ab7e83 100644 --- a/src/pen.c +++ b/src/pen.c @@ -8,72 +8,8 @@ #include "log.h" #include "window.h" -short rabstate = 0; ///< Rabbit recognizer state - -const rablisttype rablist = { - { 0, 0, 1 }, - { 0, 4, 2 }, - { 0, 3, 3 }, - { 0, 2, 4 }, - { 0, 1, 5 }, - { 0, 0, 6 }, - { 1, 0, 7 }, - { 2, 0, 8 }, - { 3, 0, 9 }, - { 4, 0, 10 }, - { 4, 1, 11 }, - { 4, 2, -12 }, - { 3, 2, 13 }, - { 2, 2, 14 }, - { 1, 2, 15 }, - { 2, 2, -18 }, - { 0, 2, 17 }, - { 1, 2, 15 }, - { 3, 2, -20 }, - { 2, 3, -20 }, - { 3, 3, 21 }, - { 4, 3, -23 }, - { 3, 4, -23 }, - { 4, 4, 42 } -}; - -const rabmustype discomadness = { - { 3, 46 }, - { 0, 8 }, - { 4, 10 }, - { 0, 15 }, - { 4, 12 }, - { 0, 2 }, - { 5, 35 }, - { 0, 6 }, - { 4, 35 }, - { 0, 6 }, - { 5, 8 }, - { 0, 17 }, - { 5, 12 }, - { 0, 2 }, - { 6, 35 }, - { 0, 6 }, - { 5, 35 }, - { 0, 6 }, - { 6, 8 }, - { 0, 17 }, - { 6, 12 }, - { 0, 2 }, - { 8, 35 }, - { 0, 6 }, - { 3, 35 }, - { 0, 6 }, - { 4, 8 }, - { 0, 16 }, - { 4, 12 }, - { 0, 3 }, - { 5, 50 }, - { 0, 0 } -}; - /** @brief Find the position of the pen. - Also draws the cursor, runs logic probe and handles Rabbit mode. + Also draws the cursor, runs logic probe. Returns: - D, D0 if the pen is/was down; @@ -149,45 +85,6 @@ void pen() { rx = gg.t.x * 5 / across; ry = gg.t.y * 5 / down; - if (rx != rablist[rabstate].x || ry != rablist[rabstate].y) - { - i = abs(rablist[rabstate].next) - 1; - do - { - i++; - } while ((rablist[i].x != rx || rablist[i].y != ry) && - rablist[i].next < 0); - if (rablist[i].x == rx && rablist[i].y == ry) - { - if (i == rablistsize) - { - remcursor(); - rabbits = !rabbits; - if (rabbits && !gg.quiet) - { - i = 1; - x = timers_sysclock(); - do - { - y = discomadness[i - 1].time; - do - { - } while (timers_sysclock() <= x + y); - /* nothing */ - i++; - x = timers_sysclock(); - } while (y != 0); - } - rabstate = 0; - } else - rabstate = i; - } else - rabstate = 0; - } - } - else - { - rabstate = 0; } if (gg.probemode) diff --git a/src/window.c b/src/window.c index 6be723d3bb1c0d413f3aa73692c7a4c024187dcf..10092eee11a91835f6d3a023d9bf3ec22269bd00 100644 --- a/src/window.c +++ b/src/window.c @@ -59,8 +59,6 @@ int chairflag; ///< If crosshair is on window int chairflag2; ///< If crosshair will be on window int rbandflag; ///< If Rubber-band wire is on window -static rablistrec rabtable[rabtabsize]; ///< Positions of rabbits - void initcolormap() { m_setcolor((long)log_gray, 4L, 4L, 4L); @@ -358,69 +356,6 @@ void erase(short x1, short y1, short x2, short y2) box(x1, y1, x2, y2); } - -/// Make sure there are no rabbits on the window. -void norabbits() -{ - short i; - - clipoff(); - for (i = 0; i < rabtabsize; i++) - { - if (rabtable[i].next == 1) - { - m_bunny((long)rabtable[i].x, (long)rabtable[i].y); - rabtable[i].next = 0; - } - } - rabflag = false; -} - - -/// Draw a rabbit on the window. -void addrabbit() -{ - short i, j, rx, ry; - int nogood; - rablistrec *WITH; - - clipoff(); - j = -1; - for (i = 1; i <= rabtabsize; i++) - { - if (rabtable[i - 1].next == 0) - j = i; - } - if (j == -1) - { - j = (rand() % (long) rabtabsize) + 1; - m_bunny((long)rabtable[j - 1].x, (long)rabtable[j - 1].y); - rabtable[j - 1].next = 0; - } - do - { - rx = rand() % (across - 24L); - ry = (rand() % (baseline - 40L)) + down - baseline + 30; - nogood = false; - for (i = 0; i < rabtabsize; i++) - { - WITH = &rabtable[i]; - if (WITH->next == 1) - { - if (WITH->x + 24 >= rx && WITH->x <= rx + 24 && WITH->y + 26 >= ry && - WITH->y <= ry + 26) - nogood = true; - } - } - } while (nogood); - rabtable[j - 1].next = 1; - rabtable[j - 1].x = rx; - rabtable[j - 1].y = ry; - m_bunny((long)rx, (long)ry); - rabflag = true; - rabtime = sysclock(); -} - /** @brief Attempt to force a line to be horizontal or vertical. If possible, second pair of coordinates is changed appropriately. @@ -483,7 +418,6 @@ void crosshair(short x, short y) - Scissors (if Delete command). - Rectangle (if Paste command). - Green line (if drawing a wire). - - Rabbit (if Rabbit mode). */ void xorcursor() { @@ -548,15 +482,7 @@ void xorcursor() } else { - if (rabbits && !avoidrabbits && cursy < baseline) - { - choose_log_cursor(0); - if (cursx < 45) - m_bunny(0L, cursy - 17L); - else - m_bunny(cursx - 45L, cursy - 17L); - } - else if (gg.probemode) + if (gg.probemode) { choose_log_cursor(3); }