invaders/0040750000175000017500000000000007302276751011347 5ustar erikerikinvaders/kernel.c0100640000175000017500000000025107277506736013001 0ustar erikerik#include "keyboard.h" #include "video.h" #include "game.h" void cmain (unsigned long magic, unsigned long addr) { key_initialize(); video_initialize(); game(); } invaders/boot.S0100640000175000017500000000333707272543546012447 0ustar erikerik/* boot.S - bootstrap the kernel */ /* Copyright (C) 1999 Free Software Foundation, Inc. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ASM 1 #include .text .code32 .globl start, _start /* This entry is not used actually. */ start: _start: jmp multiboot_entry /* Align 32 bits boundary. */ .align 4 /* Multiboot header. */ multiboot_header: /* magic */ .long MULTIBOOT_HEADER_MAGIC /* flags */ .long MULTIBOOT_HEADER_FLAGS /* checksum */ .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) /* header_addr */ .long multiboot_header /* load_addr */ .long _start /* load_end_addr */ .long _edata /* bss_end_addr */ .long _end /* entry_addr */ .long multiboot_entry multiboot_entry: /* Initialize the stack pointer. */ movl $(stack + STACK_SIZE), %esp /* Reset EFLAGS. */ pushl $0 popf /* Push the pointer to the Multiboot information structure. */ pushl %ebx /* Push the magic value. */ pushl %eax /* Now enter the C main function... */ call EXT_C(cmain) loop: hlt jmp loop /* Our stack area. */ .comm stack, STACK_SIZE invaders/multiboot.h0100640000175000017500000000570307272501213013527 0ustar erikerik/* multiboot.h - the header for Multiboot */ /* Copyright (C) 1999 Free Software Foundation, Inc. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Macros. */ /* The magic number for the Multiboot header. */ #define MULTIBOOT_HEADER_MAGIC 0x1BADB002 /* The flags for the Multiboot header. */ #define MULTIBOOT_HEADER_FLAGS 0x00010003 /* The magic number passed by a Multiboot-compliant boot loader. */ #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 /* The size of our stack (16KB). */ #define STACK_SIZE 0x4000 /* C symbol format. HAVE_ASM_USCORE is defined by configure. */ #ifdef HAVE_ASM_USCORE # define EXT_C(sym) _ ## sym #else # define EXT_C(sym) sym #endif #ifndef ASM /* Do not include here in boot.S. */ /* Types. */ /* The Multiboot header. */ typedef struct multiboot_header { unsigned long magic; unsigned long flags; unsigned long checksum; unsigned long header_addr; unsigned long load_addr; unsigned long load_end_addr; unsigned long bss_end_addr; unsigned long entry_addr; } multiboot_header_t; /* The symbol table for a.out. */ typedef struct aout_symbol_table { unsigned long tabsize; unsigned long strsize; unsigned long addr; unsigned long reserved; } aout_symbol_table_t; /* The section header table for ELF. */ typedef struct elf_section_header_table { unsigned long num; unsigned long size; unsigned long addr; unsigned long shndx; } elf_section_header_table_t; /* The Multiboot information. */ typedef struct multiboot_info { unsigned long flags; unsigned long mem_lower; unsigned long mem_upper; unsigned long boot_device; unsigned long cmdline; unsigned long mods_count; unsigned long mods_addr; union { aout_symbol_table_t aout_sym; elf_section_header_table_t elf_sec; } u; unsigned long mmap_length; unsigned long mmap_addr; } multiboot_info_t; /* The module structure. */ typedef struct module { unsigned long mod_start; unsigned long mod_end; unsigned long string; unsigned long reserved; } module_t; /* The memory map. Be careful that the offset 0 is base_addr_low but no size. */ typedef struct memory_map { unsigned long size; unsigned long base_addr_low; unsigned long base_addr_high; unsigned long length_low; unsigned long length_high; unsigned long type; } memory_map_t; #endif /* ! ASM */ invaders/clean.sh0100740000175000017500000000006607302276741012765 0ustar erikerik#!/bin/bash set -e set -v rm -f *.o *~ invaders.exec invaders/compile.sh0100740000175000017500000000075107302275006013325 0ustar erikerik#!/bin/bash set -e set -v CFLAGS="-fno-builtin -nostdinc -O2 -I. -Wall -Werror" LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000" gcc $CFLAGS -c keyboard.c gcc $CFLAGS -c delay.c gcc $CFLAGS -c common.c gcc $CFLAGS -c sound.c gcc $CFLAGS -c game.c 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 objcopy -O binary invaders.exec invaders invaders/io.h0100640000175000017500000001663407272531137012135 0ustar erikerik#ifndef _ASM_IO_H #define _ASM_IO_H /* * This file contains the definitions for the x86 IO instructions * inb/inw/inl/outb/outw/outl and the "string versions" of the same * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing" * versions of the single-IO instructions (inb_p/inw_p/..). * * This file is not meant to be obfuscating: it's just complicated * to (a) handle it all in a way that makes gcc able to optimize it * as well as possible and (b) trying to avoid writing the same thing * over and over again with slight variations and possibly making a * mistake somewhere. */ /* * Thanks to James van Artsdalen for a better timing-fix than * the two short jumps: using outb's to a nonexistent port seems * to guarantee better timings even on fast machines. * * On the other hand, I'd like to be sure of a non-existent port: * I feel a bit unsafe about using 0x80 (should be safe, though) * * Linus */ /* * Bit simplified and optimized by Jan Hubicka * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999. * * isa_memset_io, isa_memcpy_fromio, isa_memcpy_toio added, * isa_read[wl] and isa_write[wl] fixed * - Arnaldo Carvalho de Melo */ #ifdef SLOW_IO_BY_JUMPING #define __SLOW_DOWN_IO "\njmp 1f\n1:\tjmp 1f\n1:" #else #define __SLOW_DOWN_IO "\noutb %%al,$0x80" #endif #ifdef REALLY_SLOW_IO #define __FULL_SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO #else #define __FULL_SLOW_DOWN_IO __SLOW_DOWN_IO #endif /* * Talk about misusing macros.. */ #define __OUT1(s,x) \ extern inline void out##s(unsigned x value, unsigned short port) { #define __OUT2(s,s1,s2) \ __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1" #define __OUT(s,s1,x) \ __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \ __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; #define __IN2(s,s1,s2) \ __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0" #define __IN(s,s1,i...) \ __IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \ __IN1(s##_p) __IN2(s,s1,"w") __FULL_SLOW_DOWN_IO : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \ #define __INS(s) \ extern inline void ins##s(unsigned short port, void * addr, unsigned long count) \ { __asm__ __volatile__ ("rep ; ins" #s \ : "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); } #define __OUTS(s) \ extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \ { __asm__ __volatile__ ("rep ; outs" #s \ : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); } #define RETURN_TYPE unsigned char __IN(b,"") #undef RETURN_TYPE #define RETURN_TYPE unsigned short __IN(w,"") #undef RETURN_TYPE #define RETURN_TYPE unsigned int __IN(l,"") #undef RETURN_TYPE __OUT(b,"b",char) __OUT(w,"w",short) __OUT(l,,int) __INS(b) __INS(w) __INS(l) __OUTS(b) __OUTS(w) __OUTS(l) #define IO_SPACE_LIMIT 0xffff #ifdef __KERNEL__ #include /* * Temporary debugging check to catch old code using * unmapped ISA addresses. Will be removed in 2.4. */ #if 1 extern void *__io_virt_debug(unsigned long x, const char *file, int line); extern unsigned long __io_phys_debug(unsigned long x, const char *file, int line); #define __io_virt(x) __io_virt_debug((unsigned long)(x), __FILE__, __LINE__) //#define __io_phys(x) __io_phys_debug((unsigned long)(x), __FILE__, __LINE__) #else #define __io_virt(x) ((void *)(x)) //#define __io_phys(x) __pa(x) #endif /* * Change virtual addresses to physical addresses and vv. * These are pretty trivial */ extern inline unsigned long virt_to_phys(volatile void * address) { return __pa(address); } extern inline void * phys_to_virt(unsigned long address) { return __va(address); } extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); extern inline void * ioremap (unsigned long offset, unsigned long size) { return __ioremap(offset, size, 0); } /* * This one maps high address device memory and turns off caching for that area. * it's useful if some control registers are in such an area and write combining * or read caching is not desirable: */ extern inline void * ioremap_nocache (unsigned long offset, unsigned long size) { return __ioremap(offset, size, _PAGE_PCD); } extern void iounmap(void *addr); /* * IO bus memory addresses are also 1:1 with the physical address */ #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed * differently. On the x86 architecture, we just read/write the * memory location directly. */ #define readb(addr) (*(volatile unsigned char *) __io_virt(addr)) #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl #define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) #define __raw_writeb writeb #define __raw_writew writew #define __raw_writel writel #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) #define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c)) /* * ISA space is 'always mapped' on a typical x86 system, no need to * explicitly ioremap() it. The fact that the ISA IO space is mapped * to PAGE_OFFSET is pure coincidence - it does not mean ISA values * are physical addresses. The following constant pointer can be * used as the IO-area pointer (it can be iounmapped as well, so the * analogy with PCI is quite large): */ #define __ISA_IO_base ((char *)(PAGE_OFFSET)) #define isa_readb(a) readb(__ISA_IO_base + (a)) #define isa_readw(a) readw(__ISA_IO_base + (a)) #define isa_readl(a) readl(__ISA_IO_base + (a)) #define isa_writeb(b,a) writeb(b,__ISA_IO_base + (a)) #define isa_writew(w,a) writew(w,__ISA_IO_base + (a)) #define isa_writel(l,a) writel(l,__ISA_IO_base + (a)) #define isa_memset_io(a,b,c) memset_io(__ISA_IO_base + (a),(b),(c)) #define isa_memcpy_fromio(a,b,c) memcpy_fromio((a),__ISA_IO_base + (b),(c)) #define isa_memcpy_toio(a,b,c) memcpy_toio(__ISA_IO_base + (a),(b),(c)) /* * Again, i386 does not require mem IO specific function. */ #define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(b),(c),(d)) #define isa_eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(__ISA_IO_base + (b)),(c),(d)) static inline int check_signature(unsigned long io_addr, const unsigned char *signature, int length) { int retval = 0; do { if (readb(io_addr) != *signature) goto out; io_addr++; signature++; length--; } while (length); retval = 1; out: return retval; } static inline int isa_check_signature(unsigned long io_addr, const unsigned char *signature, int length) { int retval = 0; do { if (isa_readb(io_addr) != *signature) goto out; io_addr++; signature++; length--; } while (length); retval = 1; out: return retval; } /* Nothing to do */ #define dma_cache_inv(_start,_size) do { } while (0) #define dma_cache_wback(_start,_size) do { } while (0) #define dma_cache_wback_inv(_start,_size) do { } while (0) #endif /* __KERNEL__ */ #endif invaders/types.h0100640000175000017500000000054207272532443012662 0ustar erikerik#ifndef __TYPES_H #define __TYPES_H typedef signed char int8; typedef unsigned char uint8; typedef signed short int16; typedef unsigned short uint16; typedef signed int int32; typedef unsigned int uint32; typedef signed long long int64; typedef unsigned long long uint64; typedef uint8 bool; #define true ((uint8)1) #define false ((uint8)0) #endif invaders/keyboard.h0100640000175000017500000000052007277513753013322 0ustar erikerik#ifndef __KEYBOARD_H #define __KEYBOARD_H #include "types.h" /* ESC @ LEFT < RIGHT > UP ^ DOWN v LSHIFT l RSHIFT r ENTER e F1-F10 0123456789 SPACE ' ' NOTHING x only marks will be returned, releases ignored. */ void key_decode(uint8 *key, bool *pressed); void key_polling(); void key_initialize(); #endif invaders/sound.h0100640000175000017500000000016707272554105012650 0ustar erikerik#ifndef __SOUND_H #define __SOUND_H #include "types.h" void sound_freq (uint32 freq); void sound_nosound (); #endif invaders/delay.h0100640000175000017500000000027107277511221012607 0ustar erikerik#ifndef __DELAY_H #define __DELAY_H #include "types.h" // initialize the keyboard before using delay_wait !!! // t in seconds. // x = 1193180 / t void delay_wait (uint32 x); #endif invaders/keyboard.c0100640000175000017500000000221307277514405013311 0ustar erikerik#include "keyboard.h" #include "io.h" #include "memory.h" static uint8 *ringbuf=0; static uint32 ringstart=0, ringend=0, ringsize=1024; void key_decode(uint8 *key, bool *pressed) { uint8 c; uint32 ringoldstart = ringstart; *key='x'; *pressed=false; if (ringstart == ringend) return; c=ringbuf[ringstart++]; if (ringstart==ringsize) ringstart=0; if (c == 0xe0) { if (ringstart == ringend) { ringstart = ringoldstart; return; }; c = ringbuf[ringstart++]; if (ringstart == ringsize) ringstart=0; *pressed = ((c&0x80) == 0) ? true : false; c &= ~0x80; if (c==0x4d) *key='>'; if (c==0x4b) *key='<'; if (c==0x48) *key='^'; if (c==0x50) *key='v'; }else{ *pressed = ((c&0x80) == 0) ? true : false; c &= ~0x80; if ((c>=0x3b) && (c<=0x44)) *key=c-0x3b+'0'; if (c==0x2a) *key='l'; if (c==0x36) *key='r'; if (c==1) *key='@'; if (c==0x1c) *key='e'; if (c==0x39) *key=' '; }; }; void key_polling() { if (inb(0x64)&1) { ringbuf[ringend++] = inb(0x60); if (ringend==ringsize) ringend=0; }; }; void key_initialize() { ringbuf = malloc (ringsize); }; invaders/video.c0100640000175000017500000000405107277511221012612 0ustar erikerik#include "video.h" #include "io.h" #include "common.h" #include "memory.h" static uint8 video_attr=7; static uint8 *videohidden = 0; static const uint8 hextab[16] = {'0','1','2','3','4','5','6','7', '8','9','A','B','C','D','E','F'}; void video_usecolor(uint8 fg, uint8 bg) { video_attr = (fg & 15) | (bg << 4); }; void video_putchar(int32 x, int32 y, uint8 code) { if ((x<0) || (y<0) || (x>=80) || (y>=25)) return; videohidden [ (y*80+x)*2 ] = code; videohidden [ (y*80+x)*2 +1 ] = video_attr; }; void video_fill(int32 x, int32 y, int32 width, int32 height, uint8 code) { int32 a, b; for (a = x; a < x+width; ++a) for (b = y; b < y+height; ++b) video_putchar (a, b, code); }; void video_puthex8(int32 x, int32 y, uint8 hex) { video_putchar(x,y,hextab[hex>>4]); video_putchar(x+1,y,hextab[hex&15]); }; void video_putstring(int32 x, int32 y, uint8 *str) { while (*str) video_putchar(x++,y,*(str++)); }; void video_update() { memcpy ((uint8*)0xb8000, videohidden, 80*25*2); }; void video_setcolor(uint8 colnum, uint8 red, uint8 green, uint8 blue) { const uint8 tab[16]={0,1,2,3,4,5,0x14,7,0x38,0x39,0x3a, 0x3b,0x3c,0x3d,0x3e,0x3f}; if (colnum>=16) return; outb(tab[colnum],0x3c8); outb(red,0x3c9); outb(green,0x3c9); outb(blue,0x3c9); }; void video_blinkchars(bool onoff) { // FIXME I BUGGY ON SOME VIDEO CARDS uint8 a; inb(0x3da); outb(0x10,0x3c0); a=inb(0x3c1); if (onoff) a |= 8; else a &= ~8; outb(a,0x3c1); outb(32,0x3c0); }; static void video_visiblecursor (bool onoff) { uint8 a; outb(0xa, 0x3d4); a = inb(0x3d5); if (onoff) a &= ~32; else a |= 32; outb(0xa, 0x3d4); outb(a, 0x3d5); }; void video_hidecursor() { video_visiblecursor (false); }; void video_poscursor(int32 x, int32 y) { if ((x<0) || (y<0) || (x>=80) || (y>=25)) { video_hidecursor (); }else{ uint16 c; c = y*80+x; outb(0xe,0x3d4); outb(c>>8,0x3d5); outb(0xf,0x3d4); outb(c&255,0x3d5); video_visiblecursor(true); }; }; void video_initialize() { videohidden = malloc (80*25*2); }; invaders/sound.c0100640000175000017500000000042107272554075012642 0ustar erikerik#include "sound.h" #include "io.h" void sound_freq (uint32 freq) { uint16 z = (uint16) ( ((uint32)(1193180)) / freq ); outb(182,0x43); outb(z&255, 0x42); outb(z>>8, 0x42); outb(inb(0x61) | 3, 0x61); }; void sound_nosound () { outb(inb(0x61) & ~3, 0x61); }; invaders/video.h0100640000175000017500000000117707277511221012625 0ustar erikerik#ifndef __VIDEO_H #define __VIDEO_H #include "types.h" // effect on virtual buffer only 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); // immediate effect void video_update(); void video_setcolor(uint8 colnum, uint8 red, uint8 green, uint8 blue); void video_blinkchars(bool onoff); void video_hidecursor(); void video_poscursor(int32 x, int32 y); // out of screen -> video_hidecursor void video_initialize(); #endif invaders/delay.c0100640000175000017500000000107007277506676012622 0ustar erikerik#include "delay.h" #include "io.h" #include "video.h" #include "keyboard.h" static void delay_wait_short (uint32 x) { uint16 val; uint8 lo, hi; val=x+20000; outb(32+16,0x43); outb(val&255,0x40); outb(val>>8,0x40); do outb(0xe2,0x43); while (inb(0x40)&64); for (;;) { outb(0,0x43); lo=inb(0x40); hi=inb(0x40); val=((uint16)lo) | (((uint16)hi) << 8); if (val<20000) break; key_polling(); }; }; void delay_wait (uint32 x) { while (x>30000) { x-=30000; delay_wait_short(30000); }; delay_wait_short(x); }; invaders/game.h0100640000175000017500000000007107272543546012432 0ustar erikerik#ifndef __GAME_H #define __GAME_H void game (); #endif invaders/game.c0100640000175000017500000000731607277516322012433 0ustar erikerik#include "video.h" #include "keyboard.h" #include "sound.h" #include "delay.h" struct shot_t { int8 x,y; // x==-1 -> inactive shot }; #define NUMSHOTS 5 static struct shot_t shots[NUMSHOTS]; static int8 ship,shipmove; struct alien_t { int8 x,y; // x==-1 -> dead alien int8 xadd; }; #define NUMALIENS 40 static struct alien_t aliens[NUMALIENS]; static bool gameover, winner; void resetgame() { gameover=false; winner=false; { uint8 i; for (i=0;ix=x*7+12; a->y=y*2; a->xadd = ( (x%2) ^ (y%2) ) ? -1 : 1; }; }; }; }; void display() { // clear screen video_usecolor(0,0); video_fill(0,0,80,25,0); // display shots { uint8 i; video_usecolor(4,0); for (i=0;i': if (pressed) { shipmove=1; }else{ if (shipmove==1) shipmove=0; }; break; case ' ': { uint8 i; if (!pressed) break; for (i=0;i78) ship=78; for (i=0;i=aliens[i].x-1) ) { shots[k].x=-1; aliens[i].x=-1; goto nextalien; }; }; }; }; aliens[i].x += aliens[i].xadd; if (aliens[i].x<1) { aliens[i].x=1; aliens[i].xadd=1; aliens[i].y++; }else if (aliens[i].x>78) { aliens[i].x=78; aliens[i].xadd=-1; aliens[i].y++; }; if (aliens[i].y>=20) gameover=true; }; nextalien:; }; if (!foundalien) gameover = winner = true; }; void sounder() { { uint8 i; for (i=0;i Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. invaders/README0100640000175000017500000000075107302275160012221 0ustar erikerikhi. this is invaders, a multi boot compliant game for i386. boot it with grub (http://www.gnu.org/software/grub/) like this: root (YOUR ROOT DEVICE) kernel (YOUR PATH)/invaders boot run the compile.sh script to compile the game, or just use the precompiled image. (do not try to boot "invaders.exec", that's the wrong file. use "invaders" instead) the license of the whole project is the GNU General Public License, see the LICENSE file for details. have fun, Erik erikyyy@erikyyy.de invaders/memory.h0100640000175000017500000000014107277501372013023 0ustar erikerik#ifndef __MEMORY_H #define __MEMORY_H #include "types.h" void *malloc (uint32 amount); #endif invaders/memory.c0100640000175000017500000000025007277501434013016 0ustar erikerik#include "memory.h" static uint8 *nextfree = (uint8*) 0x200000; void *malloc (uint32 amount) { void *retval = nextfree; nextfree += amount; return retval; }; invaders/invaders0100750000175000017500000000571407302276745013117 0ustar erikerik"OQ L$LjSPUQ0 ÐU WVSM Ex]  = 95 0  9 u  ud 9u E 0 9 u  4] Mu>KuE?<w%D(BE[ÐUS]Bt  &$ [ÐUVS] BƄt$ Ʊ B[^ÉUjÉUUE || O~/ fBBj`ÉUh Í&'UVSx y  vA€v ( BE) EUÍƍRM  $8Et Ƃ  t&Ƃ ÀvŠUv[^ÉU WVSjjOjjjPjj0jj.  Í<2tj| P2PÀvӃjjj/j HP j_j Pj\j @P jjE E@<;tDj-3P;HPj*3P;Pp j-3P;@PXE}'v{e[^_ÍvUSEPEPE>t? tY