r12744 - in packages/trunk/invaders/debian: . patches

Fabian Greffrath fabian-guest at alioth.debian.org
Mon Oct 31 13:14:16 UTC 2011


Author: fabian-guest
Date: 2011-10-31 13:14:16 +0000 (Mon, 31 Oct 2011)
New Revision: 12744

Added:
   packages/trunk/invaders/debian/patches/04-change-colors.patch
Modified:
   packages/trunk/invaders/debian/changelog
   packages/trunk/invaders/debian/patches/series
Log:
04-change-colors.patch: Use PgUp and PgDown to toggle through the color
palette and use a secret key to toggle "psychedelic mode". ;)

Modified: packages/trunk/invaders/debian/changelog
===================================================================
--- packages/trunk/invaders/debian/changelog	2011-10-31 13:09:33 UTC (rev 12743)
+++ packages/trunk/invaders/debian/changelog	2011-10-31 13:14:16 UTC (rev 12744)
@@ -6,6 +6,8 @@
     and LDFLAGS a bit (we don't need -m32 twice) and replace -Werror with -W.
   * 02-static-inline.patch: Replace "extern inline" with "static inline" in
     io.h to allow for non-optimized builds.
+  * 04-change-colors.patch: Use PgUp and PgDown to toggle through the color
+    palette and use a secret key to toggle "psychedelic mode". ;)
 
  -- Fabian Greffrath <fabian+debian at greffrath.com>  Mon, 31 Oct 2011 13:10:20 +0100
 

Added: packages/trunk/invaders/debian/patches/04-change-colors.patch
===================================================================
--- packages/trunk/invaders/debian/patches/04-change-colors.patch	                        (rev 0)
+++ packages/trunk/invaders/debian/patches/04-change-colors.patch	2011-10-31 13:14:16 UTC (rev 12744)
@@ -0,0 +1,107 @@
+Author: Fabian Greffrath <fabian+debian at greffrath.com>
+Description: Use PgUp and PgDown to toggle through the color palette
+ and use a secret key to toggle "psychedelic mode". ;)
+
+--- invaders-1.0.0.orig/game.c
++++ invaders-1.0.0/game.c
+@@ -10,6 +10,8 @@ struct shot_t {
+ #define NUMSHOTS 5
+ static struct shot_t shots[NUMSHOTS];
+ static int8 ship,shipmove;
++static int8 shotcolor=4,shipcolor=5,aliencolor=3;
++static bool psychedelic=false;
+ 
+ struct alien_t {
+   int8 x,y; // x==-1 -> dead alien
+@@ -27,6 +29,19 @@ inline void reboot()
+   outb(0xfe,0x64);
+ };
+ 
++void changecolors(int c)
++{
++        shotcolor+=c;
++        if (shotcolor>15) shotcolor=1;
++        else if (shotcolor<1) shotcolor=15;
++        shipcolor+=c;
++        if (shipcolor>15) shipcolor=1;
++        else if (shipcolor<1) shipcolor=15;
++        aliencolor+=c;
++        if (aliencolor>15) aliencolor=1;
++        else if (aliencolor<1) aliencolor=15;
++}
++
+ void resetgame()
+ {
+   gameover=false;
+@@ -59,7 +74,7 @@ void display()
+   // display shots
+   {
+     uint8 i;
+-    video_usecolor(4,0);
++    video_usecolor(shotcolor,0);
+     for (i=0;i<NUMSHOTS;++i) {
+       if (shots[i].x!=-1) {
+ 	video_putchar(shots[i].x,shots[i].y,'|');
+@@ -69,7 +84,7 @@ void display()
+ 
+   // display ship
+   {
+-    video_usecolor(5,0);
++    video_usecolor(shipcolor,0);
+     video_putchar(ship-1,24,'/');
+     video_putchar(ship,23,'_');
+     video_putchar(ship+1,24,'\\');
+@@ -78,7 +93,7 @@ void display()
+   // display aliens
+   {
+     uint8 i;
+-    video_usecolor(3,0);
++    video_usecolor(aliencolor,0);
+     for (i=0;i<NUMALIENS;++i) {
+       if (aliens[i].x!=-1) {
+ 	video_putchar(aliens[i].x-1,aliens[i].y,'-');
+@@ -133,6 +148,25 @@ void keywork()
+         reboot();
+       }
+       break;
++    case 'u':
++      if (pressed) {
++        changecolors(+1);
++      }
++      break;
++    case 'd':
++      if (pressed) {
++        changecolors(-1);
++      }
++      break;
++    case '0':
++      if (pressed) {
++        if (psychedelic==false) psychedelic=true;
++        else {
++          psychedelic=false;
++          shotcolor=4,shipcolor=5,aliencolor=3;
++        }
++      }
++      break;
+     };
+   };
+ };
+@@ -233,6 +267,7 @@ void game()
+       sounder();
+       keywork();
+       calculate();
++      if (psychedelic==true) changecolors(+1);
+     };
+ 
+     displaygameover();
+--- invaders-1.0.0.orig/keyboard.c
++++ invaders-1.0.0/keyboard.c
+@@ -31,6 +31,8 @@ void key_decode(uint8 *key, bool *presse
+     if (c==0x4b) *key='<';
+     if (c==0x48) *key='^';
+     if (c==0x50) *key='v';
++    if (c==0x49) *key='u';
++    if (c==0x51) *key='d';
+   }else{
+     *pressed = ((c&0x80) == 0) ? true : false;
+     c &= ~0x80;

Modified: packages/trunk/invaders/debian/patches/series
===================================================================
--- packages/trunk/invaders/debian/patches/series	2011-10-31 13:09:33 UTC (rev 12743)
+++ packages/trunk/invaders/debian/patches/series	2011-10-31 13:14:16 UTC (rev 12744)
@@ -3,3 +3,4 @@
 02-build-flags.patch
 02-static-inline.patch
 03-reboot-on-esc.patch
+04-change-colors.patch




More information about the Pkg-games-commits mailing list