debian/0000755000000000000000000000000011653770371007200 5ustar debian/grub-invaders.install0000644000000000000000000000007111653612001013317 0ustar invaders.exec boot debian/scripts/22_invaders etc/grub.d debian/grub-invaders.postinst0000644000000000000000000000021511653612001013534 0ustar #!/bin/sh set -e if [ "$1" = "configure" ] && [ -x "`which update-grub2 2>/dev/null`" ]; then update-grub2 fi #DEBHELPER# exit 0 debian/patches/0000755000000000000000000000000011653770251010624 5ustar debian/patches/02-build-flags.patch0000644000000000000000000000266311653612000014247 0ustar Author: Robert Millan Author: Stefan Potyra Author: Kees Cook Author: Carl-Daniel Hailfinger Author: Fabian Greffrath Origin: http://www.coreboot.org/pipermail/coreboot/2009-April/046558.html Description: Support for building on amd64 and others, move -nostdlib to CFLAGS, as it's a compiler flag, use CFLAGS for linking as well (since gcc is used), replace -fno-builtin with -ffreestanding, replace -Werror with -W, and fix an incompatibility with newer gcc and binutils. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422364 --- invaders-1.0.0.orig/compile.sh +++ invaders-1.0.0/compile.sh @@ -3,8 +3,8 @@ set -e set -v -CFLAGS="-fno-builtin -nostdinc -O2 -I. -Wall -Werror" -LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000" +CFLAGS="-ffreestanding -m32 -nostdinc -nostdlib -I. -O2 -W -Wall" +LDFLAGS="-Wl,-N -Wl,-Ttext -Wl,100000 -Wl,--build-id=none" gcc $CFLAGS -c keyboard.c gcc $CFLAGS -c delay.c gcc $CFLAGS -c common.c @@ -14,5 +14,5 @@ gcc $CFLAGS -c kernel.c gcc $CFLAGS -c video.c gcc $CFLAGS -c memory.c gcc $CFLAGS -c boot.S -gcc $LDFLAGS -o invaders.exec boot.o kernel.o keyboard.o video.o game.o sound.o delay.o common.o memory.o +gcc $CFLAGS $LDFLAGS -o invaders.exec boot.o kernel.o keyboard.o video.o game.o sound.o delay.o common.o memory.o objcopy -O binary invaders.exec invaders debian/patches/01-misspelling-loose.patch0000644000000000000000000000107411653612000015515 0ustar Author: Daniel Kahn Gillmor Description: Fix misspelling: "YOU LOOSE" should be "YOU LOSE". Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=478928 --- invaders-1.0.0.orig/game.c +++ invaders-1.0.0/game.c @@ -198,7 +198,7 @@ void displaygameover() video_usecolor(6,1); video_putstring(30,10," GAME OVER "); - video_putstring(30,11,winner ? " YOU WIN " : " YOU LOOSE "); + video_putstring(30,11,winner ? " YOU WIN " : " YOU LOSE "); video_putstring(30,12," PRESS ESC "); video_update(); do{ debian/patches/04-change-colors.patch0000644000000000000000000000515311653612000014601 0ustar Author: Fabian Greffrath 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 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; +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; }; }; }; debian/patches/01-uint8-char.patch0000644000000000000000000000202211653612000014024 0ustar Author: Carl-Daniel Hailfinger Origin: http://www.coreboot.org/pipermail/coreboot/2009-April/046558.html Description: Use (char *) instead of (uint8 *) to avoid "pointer targets [...] differ in signedness" warnings when passing a string. --- invaders-1.0.0.orig/video.c +++ invaders-1.0.0/video.c @@ -36,7 +36,7 @@ void video_puthex8(int32 x, int32 y, uin video_putchar(x+1,y,hextab[hex&15]); }; -void video_putstring(int32 x, int32 y, uint8 *str) +void video_putstring(int32 x, int32 y, char *str) { while (*str) video_putchar(x++,y,*(str++)); }; --- invaders-1.0.0.orig/video.h +++ invaders-1.0.0/video.h @@ -8,7 +8,7 @@ void video_usecolor(uint8 fg, uint8 bg); void video_putchar(int32 x, int32 y, uint8 code); void video_fill(int32 x, int32 y, int32 width, int32 height, uint8 code); void video_puthex8(int32 x, int32 y, uint8 hex); -void video_putstring(int32 x, int32 y, uint8 *str); +void video_putstring(int32 x, int32 y, char *str); // immediate effect void video_update(); debian/patches/02-static-inline.patch0000644000000000000000000000160511653612000014614 0ustar Author: Fabian Greffrath Description: Replace "extern inline" with "static inline" in io.h to allow for non-optimized builds. --- invaders-1.0.0.orig/io.h +++ invaders-1.0.0/io.h @@ -50,7 +50,7 @@ * Talk about misusing macros.. */ #define __OUT1(s,x) \ -extern inline void out##s(unsigned x value, unsigned short port) { +static inline void out##s(unsigned x value, unsigned short port) { #define __OUT2(s,s1,s2) \ __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1" @@ -60,7 +60,7 @@ __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (va __OUT1(s##_p,x) __OUT2(s,s1,"w") __FULL_SLOW_DOWN_IO : : "a" (value), "Nd" (port));} \ #define __IN1(s) \ -extern inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v; +static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v; #define __IN2(s,s1,s2) \ __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0" debian/patches/05-pause.patch0000644000000000000000000000174711653612000013200 0ustar Author: Fabian Greffrath Description: Use "P" to pause and resume. --- invaders-1.0.0.orig/game.c +++ invaders-1.0.0/game.c @@ -42,6 +42,21 @@ void changecolors(int c) else if (aliencolor<1) aliencolor=15; } +void displaypause() +{ + uint8 key; + bool pressed; + + video_usecolor(6,1); + video_putstring(30,10," PAUSE "); + video_putstring(30,11," PRESS \'P\' "); + video_update(); + do{ + key_decode(&key,&pressed); + key_polling(); + } while (!(pressed&&(key=='p'))); +}; + void resetgame() { gameover=false; @@ -167,6 +182,11 @@ void keywork() } } break; + case 'p': + if (pressed) { + displaypause(); + } + break; }; }; }; --- invaders-1.0.0.orig/keyboard.c +++ invaders-1.0.0/keyboard.c @@ -42,6 +42,7 @@ void key_decode(uint8 *key, bool *presse if (c==1) *key='@'; if (c==0x1c) *key='e'; if (c==0x39) *key=' '; + if (c==0x19) *key='p'; }; }; debian/clean0000644000000000000000000000001111653612001010156 0ustar invaders debian/grub-invaders.postrm0000644000000000000000000000015511653612001013200 0ustar #!/bin/sh set -e if [ -x "`which update-grub2 2>/dev/null`" ]; then update-grub2 ; fi #DEBHELPER# exit 0 debian/copyright0000644000000000000000000000405211653612001011115 0ustar Format: http://dep.debian.net/deps/dep5 Upstream-Name: Invaders Upstream-Contact: Erik Thiele Source: http://www.erikyyy.de/invaders/ Files: * Copyright: © 2001, Erik Thiele License: GPL-2+ Files: io.h Copyright: © 1991-2009, Linus Torvalds and many others License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. Files: multiboot.h Copyright: © 1999, Free Software Foundation, Inc. License: GPL-2+ Files: debian/* Copyright: © 2007-2011, Fabian Greffrath License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. debian/source/0000755000000000000000000000000011653770251010475 5ustar debian/source/format0000644000000000000000000000001411653612000011666 0ustar 3.0 (quilt) debian/scripts/0000755000000000000000000000000011653770251010664 5ustar debian/scripts/22_invaders0000644000000000000000000000062111653612000012707 0ustar #!/bin/bash -e if test -e /boot/invaders.exec ; then source /usr/lib/grub/grub-mkconfig_lib INVADERSPATH=$( make_system_path_relative_to_its_root "/boot/invaders.exec" ) echo "Found GRUB Invaders image: /boot/invaders.exec" >&2 cat << EOF menuentry "GRUB Invaders" { EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/g" cat << EOF multiboot ${INVADERSPATH} } EOF fi debian/grub-invaders.docs0000644000000000000000000000000711653612001012600 0ustar README debian/compat0000644000000000000000000000000211653612001010357 0ustar 7 debian/grub-invaders.examples0000644000000000000000000000002211653612001013463 0ustar debian/examples/* debian/rules0000755000000000000000000000067211653612001010246 0ustar #!/usr/bin/make -f %: dh $@ override_dh_auto_build: sh ./compile.sh override_dh_auto_clean: sh ./clean.sh override_dh_fixperms: dh_fixperms chmod 0644 debian/grub-invaders/boot/invaders.exec chmod 0755 debian/grub-invaders/etc/grub.d/22_invaders override_dh_strip: dh_strip ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) strip --remove-section=.comment --remove-section=.note \ debian/grub-invaders/boot/invaders.exec endif debian/watch0000644000000000000000000000010011653612001010201 0ustar version=3 http://www.erikyyy.de/invaders/invaders-(.*)\.tar\.gz debian/control0000644000000000000000000000141211653612001010562 0ustar Source: invaders Section: kernel Priority: optional Maintainer: Debian Games Team Uploaders: Fabian Greffrath , Stefan Potyra DM-Upload-Allowed: yes Build-Depends: debhelper (>= 7.0.50~) Standards-Version: 3.9.2 Homepage: http://www.erikyyy.de/invaders/ Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/invaders/ Vcs-Browser: http://svn.debian.org/wsvn/pkg-games/packages/trunk/invaders/ Package: grub-invaders Architecture: any-i386 any-amd64 Depends: ${misc:Depends} Description: multiboot compliant kernel game GRUB Invaders is a game that runs directly on a computer, without an operating system. It is meant to be started with the GRUB bootloader for PCs. debian/examples/0000755000000000000000000000000011653770251011013 5ustar debian/examples/grub-menu.lst0000644000000000000000000000041111653612001013420 0ustar # sample /boot/grub/menu.lst entry for grub-invaders # # This example assumes the contents of /boot is on the root partition. # If your /boot is on its own partition, remove /boot from the 'kernel' line. title GRUB Invaders root (hd0,0) kernel /boot/invaders.exec debian/changelog0000644000000000000000000001623211653770123011051 0ustar invaders (1.0.0-12) unstable; urgency=low [ Fabian Greffrath ] * Split 01-pointer-targets-differ-in-signedness.patch into two separate patches: 01-misspelling-loose.patch and 01-uint8-char.patch. * Rename 02-gcc-ldflags.patch to 02-build-flags.patch, clean up CFLAGS 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". ;) * 05-pause.patch: Use "P" to pause and resume. * Add DEP-3 compliant headers to all patches. * Make debian/copyright DEP-5 compliant and update Debian packaging license. * Update Standards-Version to 3.9.2. * Set Architecture to "any-i386 any-amd64" instead of a hard-coded list. -- Stefan Potyra Tue, 01 Nov 2011 14:12:46 +0100 invaders (1.0.0-11) unstable; urgency=low [ Fabian Greffrath ] * Refreshed all patches. * debian/patches/03-reboot-on-esc.patch: Only reboot when the ESC key is pressed in-game, not during the GAME OVER screen. * Relaxed debhelper build-dependency a bit. * Updated my email address. * Removed spurious removal of an obsoleted config file. * Converted packaging to source format "3.0 (quilt)". [ Stefan Potyra ] * Add myself to uploaders. [ Fabian Greffrath ] * Set DM-Upload-Allowed: yes. -- Fabian Greffrath Tue, 22 Dec 2009 08:52:16 +0100 invaders (1.0.0-10) unstable; urgency=low [ Stefan Potyra ] * Fix build failures if stack-protector is enabled by default, thanks to Kees Cook for the patches: + rename debian/patches/02-amd64.patch to 02-gcc-ldflags.patch + move -nostdlib to CFLAGS, as it's a compiler flag + use CFLAGS for linking as well (since gcc is used) [ Fabian Greffrath ] * debian/patches/02-gcc-ldflags.patch: Replace -fno-builtin with -ffreestanding, the latter implies the former and is even stricter. * debian/patches/03-reboot-on-esc.patch: New patch, perform a reboot when the ESC key is pressed. Relies on the keyboard controller available at port 0x64 (just as the whole game does anyway). -- Fabian Greffrath Fri, 13 Nov 2009 13:44:59 +0100 invaders (1.0.0-9) unstable; urgency=low [ Fabian Greffrath ] * debian/clean, debian/grub-invaders.{docs,examples,install}: + Added. * debian/compat: + Raised debhelper compatibility to 7. * debian/control: + Changed Section from misc to kernel. + Raised Build-Depends to debhelper (>= 7.2) and quilt (>= 0.46-7). + Bumped Standards-Version to 3.8.3. + Removed spurious Suggests on grub2. * debian/copyright: + Converted into a machine-readable format. + Adjusted license for io.h to GPL-2 (not GPL-2+). + Relicensed the Debian packaging under the GNU All-Permissive License. * debian/examples/grub-menu.lst, debian/scripts/22_invaders: + Use the original filename "invaders.exec" instead of "invaders". * debian/grub-invaders.post{inst,rm}: + Renamed from post{inst,rm}. * debian/patches/: + Switched from dpatch to quilt for patch management. + Applied fixes from Carl-Daniel Hailfinger found at : * debian/patches/01-pointer-targets-differ-in-signedness.dpatch: + Use (char *) instead of (uint8 *). * debian/patches/02-amd64.dpatch: + Fix incompatibility with newer gcc and binutils. * debian/rules: + Converted to debhelper 7.2. + Improved stripping. * debian/scripts/22_invaders: + Renamed from debian/scripts/grub. + Use grub-mkconfig_lib instead of the deprecated update-grub_lib (Closes: #539947). Thanks Didier 'OdyX' Raboud. [ Evgeni Golov ] * debian/README.source: + Added a short note on where to get info about quilt. -- Fabian Greffrath Thu, 20 Aug 2009 20:31:38 +0200 invaders (1.0.0-8) unstable; urgency=low * debian/control: + Set Maintainer to Debian Games Team and added myself to Uploaders. + Added Vcs-Svn and Vcs-Browser fields. + Bumped Suggests to 'grub2 (>= 1.96+20080531-1)'. * debian/patches/01-pointer-targets-differ-in-signedness.dpatch: + Fixed misspelling: "YOU LOOSE" should be "YOU LOSE" (Closes: #478928). Thanks Daniel Kahn Gillmor . * debian/scripts/grub: + Fixed to use functions out of /usr/lib/grub/update-grub_lib instead of ${GRUB_DRIVE_BOOT} (Closes: #492267). Thanks Justin B Rye . + Added a missing "prepare_grub_to_access_device ${GRUB_DEVICE_BOOT}" call. Without it, it could break if /boot/ is in a different device than whatever came before invaders. Thanks Robert Millan . -- Fabian Greffrath Fri, 1 Aug 2008 14:44:00 +0100 invaders (1.0.0-7) unstable; urgency=low * debian/postinst: + Remove forgotten config file `/etc/grub.d/20_invaders' before running update-grub2. -- Fabian Greffrath Sun, 10 Feb 2008 15:30:00 +0100 invaders (1.0.0-6) unstable; urgency=low * debian/control: + Changed Suggests to 'grub2 (>= 1.95+20080116-1)'. -- Fabian Greffrath Sun, 27 Jan 2008 20:15:00 +0100 invaders (1.0.0-5) unstable; urgency=low * debian/control: + Bumped Standards-Version to 3.7.3. + Added Homepage: field. + Added 'Depends: ${misc:Depends}'. + Added 'Suggests: grub2 (>= 1.95+20081116-1)'. + Removed Recommends. * debian/postinst, debian/postrm: + Use update-grub2 instead of update-grub (Closes: #460078). * debian/rules: + Install debian/scripts/grub to '/etc/grub.d/22_invaders'. * debian/scripts/grub: + Synced with memtest86 (3.4-1) packaging. -- Fabian Greffrath Wed, 23 Jan 2008 10:00:00 +0100 invaders (1.0.0-4) unstable; urgency=low * Support /boot on separate partition (Closes: #424928). Thanks, Paul Martin ! * Support stripping of the binary file /boot/invaders. * Recommends: grub2 (>= 1.95+20070515-1) | grub. -- Fabian Greffrath Fri, 18 May 2007 14:55:00 +0100 invaders (1.0.0-3) unstable; urgency=low * Fix bogus postrm. -- Fabian Greffrath Sun, 13 May 2007 15:08:00 +0100 invaders (1.0.0-2) unstable; urgency=low * Install ELF image, not a.out (Closes: #422366). Thanks, Robert Millan ! * Add support for building on amd64 (Closes: #422364). Thanks again, Robert Millan ! * Provide /etc/grub.d/20_invaders and run update-grub in postinst/-rm (Closes: #417030). Thanks again, Robert Millan ! * Recommends: grub2 (>= 1.95+20070505-1) | grub. -- Fabian Greffrath Sat, 5 May 2007 15:22:00 +0100 invaders (1.0.0-1) unstable; urgency=low * Initial release (Closes: #415955). -- Fabian Greffrath Fri, 23 Mar 2007 09:46:00 +0100