diff options
Diffstat (limited to '03-reboot-on-esc.patch')
-rw-r--r-- | 03-reboot-on-esc.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/03-reboot-on-esc.patch b/03-reboot-on-esc.patch new file mode 100644 index 000000000000..ae612507acd9 --- /dev/null +++ b/03-reboot-on-esc.patch @@ -0,0 +1,40 @@ +Author: Fabian Greffrath <fabian+debian@greffrath.com> +Description: Reboot the machine when the ESC key is pressed, + reboot() taken from memtest86_3.5-2. + +--- invaders-1.0.0.orig/game.c ++++ invaders-1.0.0/game.c +@@ -2,6 +2,7 @@ + #include "keyboard.h" + #include "sound.h" + #include "delay.h" ++#include "io.h" + + struct shot_t { + int8 x,y; // x==-1 -> inactive shot +@@ -19,6 +20,13 @@ + + static bool gameover, winner; + ++static inline void reboot() ++{ ++ /* tell the BIOS to do a warm start */ ++ *((unsigned short *)0x472) = 0x1234; ++ outb(0xfe,0x64); ++}; ++ + void resetgame() + { + gameover=false; +@@ -120,6 +128,11 @@ + break; + case 'x': + return; ++ case '@': ++ if (pressed) { ++ reboot(); ++ } ++ break; + }; + }; + }; |