diff --git a/games/colem/ColEm.html b/games/colem/ColEm.html
new file mode 100644
index 0000000000..3a641ea82f
--- /dev/null
+++ b/games/colem/ColEm.html
@@ -0,0 +1,361 @@
+
+
+ColEm Documentation
+
+
+
+
+
+ColEm
version 2.5
+
+>
+
+Contents
+
+
+
+New in This Version
+
+
+- Yet again ported ColEm to Unix using the new EMULib
+ framework. The new ColEm-Unix has been tested to compile
+ and run on Ubuntu Linux but should work on any other Unix.
+ ColEm-Unix source code is included with the core source code
+ distribution.
+
- Ported ColEm to Maemo OS2008 used in N800 and N810 internet tablets
+ from Nokia. ColEm-Maemo has been specifically optimized for
+ the tablets using ARM assembler. It will simulate joypad with the
+ touch screen and automatically open
*.cv/*.cv.gz
files
+ from the file manager. ColEm-Maemo source code is included with the
+ core source code distribution.
+ - Renamed
-zoom/-nozoom
to -soft/-nosoft
.
+ - Added
-scale
option to scale window on Unix.
+ - Added
-home
to set home directory with system ROMs.
+ - Options
-tv/-notv
, -soft/-nosoft
, and the
+ [F8]
key now work for both MSDOS and Unix.
+ - ColEm-Symbian display routines rewritten in ARM assembler for speed.
+
- Split ColEm-Symbian configuration menu into four tabs, making
+ "Video" and "Audio" settings separate.
+
- Added "Audio Latency", "Skip Frames", and "Sync Updates" settings
+ to ColEm-Symbian.
+
- Documentation and built-in help changed, many inconsistencies removed.
+
+
+
+Introduction
+
+
+ ColEm is a portable emulator of the old ColecoVision videogame console.
+It should run most ColecoVision games and supports Coleco's SuperAction
+controllers with spin wheels. You can always get the latest ColEm binaries,
+source code, and support files from
+
+
+http://fms.komkon.org/ColEm/
+
+
+There are versions of ColEm for many platforms, with Windows, MSDOS, Unix,
+and Symbian ports being maintained by myself. All these ports are available
+for free from the above website.
+
+
+The ColEm-Symbian port works on the 3rd Edition Series60 phones from
+Nokia and its licensees. You can download it, as well as my other
+Symbian products, at
+
+
+http://fms.komkon.org/EmuSymbian/
+
+
+ColEm is written in portable C and thus can be ported to any sufficiently
+fast computing platform. The current ColEm source code distribution includes
+portable core sources and platform-specific sources for Windows and MSDOS.
+The ColEm-Unix sources are also available, for a slightly older version
+of ColEm.
+
+
+If you would like to port ColEm to another system or make changes in
+ColEm's code, please, contact me by email or some other means. Be
+aware that ColEm source code is freely distributable, but it is not
+public domain and it is not released under GPL. You can not use it
+for commercial purposes, distribute, or change it on your own, unless you
+contact me to arrange the conditions of such use and get my permission.
+Feel free to look at it though.
+
+
+
+Buttons
+
+
+
+All versions:
+ [ALT] - Hold to switch to the second controller
+ [SPACE] - FIRE-R button (also: [SHIFT],A,S,D,F,G,H,J,K,L)
+ [CONTROL] - FIRE-L button (also: Z,X,C,V,B,N,M)
+ [Q] - SuperAction PURPLE button (also: E,T,U,O)
+ [W] - SuperAction BLUE button (also: R,Y,I,P)
+ [0]-[9] - Digit buttons
+ [-] - [*] button
+ [=] - [#] button
+ [PGUP] - Fast-forward emulation (also: [F9])
+ [ESC] - Quit emulation (also: [F12])
+ [F2] - Turn soundtrack log on/off
+ [F3] - Toggle FIRE-R autofire on/off
+ [F4] - Toggle FIRE-L autofire on/off
+ [F5] - Invoke configuration menu
+ [F6] - Load emulation state
+ [F7] - Save emulation state
+ [F9] - Fast-forward emulation (also: [PGUP])
+ [F11] - Reset hardware
+ [F12] - Quit emulation (also: [ESC])
+ [ALT]+[PGUP] - Increase audio volume
+ [ALT]+[PGDOWN] - Decrease audio volume
+
+With #define DEBUG:
+ [F1] - Go into the built-in debugger
+
+With #define GIFLIB:
+ [F10] - Make a screen snapshot (SNAPxxxx.GIF)
+
+With #define WINDOWS:
+ [ALT]+[ENTER] - Switch between full screen and window modes
+
+With #define MSDOS or UNIX:
+ [F8] - Turn scanline simulation on/off
+ [CTRL]+[F8] - Toggle screen softening on/off
+
+
+
+
+Command Line Options
+
+
+
+Usage: colem [-option1 [-option2...]] [filename]
+
+[filename] = Name of the file to load as a cartridge [CART.ROM]
+ This program will transparently uncompress singular GZIPped
+ and PKZIPped files.
+
+[-option] =
+ -verbose <level> - Select debugging messages [5]
+ 0 - Silent 1 - Startup messages
+ 2 - VDP 4 - Illegal Z80 ops
+ 16 - Sound
+ -skip <percent> - Percentage of frames to skip [25]
+ -help - Print this help page
+ -home <dirname> - Set directory with system ROM files [off]
+ -pal/-ntsc - Video system to use [-ntsc]
+ -adam/-cv - Run in Adam/ColecoVision mode [-cv]
+ -allspr - Show all sprites [off]
+ -autoa/-noautoa - Autofire/No autofire for FIRE-R button [-noautoa]
+ -autob/-noautob - Autofire/No autofire for FIRE-L button [-noautob]
+ -spin1x/-spin1y - Mouse X/Y position as SuperAction spinner 1 [off]
+ -spin2x/-spin2y - Mouse X/Y position as SuperAction spinner 2 [off]
+ -drums/-nodrums - Hit/Don't hit MIDI drums on noise [-nodrums]
+ -logsnd <filename> - Write soundtrack to a MIDI file [LOG.MID]
+ -palette <number> - Use given color palette [0]
+ 0 - Scaled VDP colors 1 - Original VDP colors
+ 2 - Faded NTSC colors
+ -sound [<quality>] - Sound emulation quality [22050]
+ -nosound - Don't emulate sound [-nosound]
+
+With #define DEBUG:
+ -trap <address> - Trap execution when PC reaches address [FFFFh]
+
+With #define UNIX or MSDOS:
+ -sync <frequency> - Sync screen updates to <frequency> [-nosync]
+ -nosync - Do not sync screen updates [-nosync]
+ -tv/-notv - Simulate/Don't simulate scanlines [-notv]
+ -soft/-nosoft - Scale screen up with softening [-nosoft]
+
+With #define MSDOS:
+ -vsync - Sync screen updates to VGA VBlanks [-vsync]
+
+With #define UNIX:
+ -saver/-nosaver - Save/don't save CPU when inactive [-saver]
+ -scale <factor> - Scale window by <factor> [2]
+
+With #define MITSHM:
+ -shm/-noshm - Use/don't use MIT SHM extensions for X [-shm]
+
+
+
+
+Frequently Asked Questions
+
+
+- Why is the emulator so slow on my PC?
+
+Your computer may be too slow to run the emulator. On slow machines, try
+speeding things up by skipping more frames (-skip
command
+line option or "Draw XX% frames" menu option). In ColEm-Windows, make
+window smaller or switch to the full screen mode with
+[Alt]+[Enter]
.
+
+ - Emulator is too fast on my PC!
+
+If ColEm is too fast on your computer, you can slow it down by syncing it
+to a timer (-sync
in ColEm-Unix), VBlanks (-vsync
+in ColEm-MSDOS), or by choosing "PAL Video"/"NTSC Video" menu option in
+ColEm-Windows.
+
+ - I can't get some ROM images to work with the emulator.
+
+If you can't get ROM image to work, send it to me for analysis.
+
+ - Is it legal to spread cartridge ROMs?
+
+NO. Nobody seems to care though, mainly because there is no
+profit to be made from ColecoVision software any longer. Nevertheless, be
+aware of the fact that by using commercial software you haven't bought you
+are commencing an act of piracy.
+
+ - When compiling ColEm-Unix, I get "undefined name" errors.
+
+This usually means that your linker cannot find the necessary libraries
+(namely, libX11 and libXext) or some additional libraries (like libsocket
+and libnsl) are required. Find these libraries in your system and modify
+the Makefile so that the final invocation of the C compiler has
+-L<path_to_libs>
options. If you have no libXext
+library and the same functionality isn't provided in libX11, try
+#undefining the MITSHM
option.
+
+ - When starting ColEm-Unix, I get X_ShmAttach error.
+
+You are probably trying to run the emulator on a remote Xterminal while
+it attempts to use shared memory for interfacing with X. Another reason
+for this error may be the lack of MITSHM extension support in your
+Xserver. Use -noshm
option to disable the usage of shared
+memory.
+
+ - When starting ColEm-Unix, I get X_PutImage error.
+
+Unix/X version of ColEm can currently be compiled for 8bit, 16bit, or
+32bit Xterminals. Neither 1bit nor 4bit Xterminals will work with the
+drivers included into official ColEm distribution.
+
+
+
+
+History
+
+New in ColEm 2.4
+
+- Ported ColEm to smartphones running Symbian/UIQ3 software!
+
- Added new, much better, scanline simulation and video softening
+ effects to ColEm-Windows.
+
- ColEm-Windows full-screen mode now runs in 640x480 resolution.
+
- Added
-sync/-nosync
option to ColEm-MSDOS to sync screen
+ updates to the timer (use -vsync
for VBlanks).
+ - Added
-zoom/-nozoom
option to ColEm-MSDOS that will
+ zoom ColEm display to fill the whole screen, using image
+ softening algorithm.
+ - ColEm-MSDOS now runs in 640x480x15bpp VESA screen mode when
+
-zoom
or -tv
options used, otherwise
+ it runs in 320x200x15bpp screen mode.
+ - Added [CONTROL]+[F8] key combination to ColEm-MSDOS to toggle
+ display zoom on/off.
+
- Added new "Fill & Soften" zoom mode to ColEm-Symbian. It is
+ rather slow though.
+
- Fixed possible source of instabilities in the S60 open file dialog
+ in ColEm-Symbian.
+
+New in ColEm 2.3
+
+- Added network play option to ColEm-Windows and ColEm-Symbian!
+
- Now resetting R register on ResetZ80() to keep states of both NetPlay
+ players consistent.
+
- Now clearing all RAM on ResetColeco() to keep states of both NetPlay
+ players consistent.
+
- Added new, much better, scanline simulation and video softening
+ effects to ColEm-Windows.
+
- ColEm-Windows full-screen mode now runs in 640x480 resolution.
+
- Added zoom settings to ColEm-Symbian ("None", "Keep Aspect", and
+ "Fill Screen").
+
- Added display orientation settings to ColEm-Symbian ("Landscape",
+ "Portrait", and "Auto").
+
- Finally fixed opendir() problem in EMULib-Symbian. All built-in
+ menu file dialogs work now!
+
- Further extended and optimized Symbian screen rendering routines.
+
- Fixed and optimized TV scanline simulation in ColEm-Symbian, made
+ scanline effect stronger.
+
- Fixed system warnings in when flipping Nokia E70 open/closed.
+
- Fixed possible crash when selecting an initial file in ColEm-Symbian.
+
+New in ColEm 2.2
+
+- Changed Z80 NMI handling to comply with the standard.
+
- Added "show all sprites" option (-allspr).
+
- Added error messages to ColEm-Windows and ColEm-Symbian.
+
- Added button and key remapping configuration to ColEm-Symbian.
+
- ColEm-Symbian application menu is now split into three pages.
+
- ColEm-MSDOS is now prebound with DOS32A extender, instead of
+ outdated DOS4GW.
+
+New in ColEm 2.1
+
+- Added builtin configuration menu ([F5]).
+
- Added palette selection (-palette) between scaled VDP palette, original
+ VDP palette, and the faded NTSC palette suggested by Richard Drushel.
+
- Now defaulting to the palette from TMS9918 datasheet scaled by 255/224
+ to get true white color.
+
- Fixed console keyboard input in Windows.
+
- Updated and extended documentation.
+
+New in ColEm 2.0
+
+- MSDOS and Windows versions are now based on the new framework.
+
- Started adding Coleco Adam emulation (not finished yet).
+
- Added state saving and loading via .STA files.
+
- Added SuperAction spinner emulation with the mouse.
+
- Added zoomed sprites support in VDP.
+
- Standardized TMS9918 emulation.
+
- Fixed VDP VBlank interrupt bug.
+
- Replaced "updates per VBlank" (-uperiod) with "percentage of
+ skipped frames" parameter (-skip).
+
- Removed -vperiod/-hperiod parameters as deprecated.
+
- Added -pal/-ntsc parameters to switch between TMS9918/TMS9928
+ and TMS9929 VDPs.
+
- Soundtrack saved into MIDI files.
+
- Documentation rewritten in HTML.
+
- Added speed throttling to ColEm-MSDOS (-vsync).
+
- Keyboard assignments have changed.
+
+New in ColEm 1.0
+
+- Standardized Z80 emulation.
+
- Standardized PSG emulation.
+
- Soundtrack saved into .SND files.
+
- Screen refresh done line-by-line.
+
- Sprites are refreshed line-by-line.
+
- Limit on sprites per line introduced.
+
- General cleanup of the source code.
+
- Rewritten documentation.
+
+
+
+Thanks to...
+
+
+Finally, I would like to thank Hans Guijt, Marcel de Kogel, John Stiles,
+Neal Danner, Alan Steremberg, and all other people who helped me with
+advice, information, ROM images, and encouragment.
+
+
+
+
+© Copyright by
+Marat Fayzullin
+(marat [AT] komkon /DOT/ org)
+
+
+
diff --git a/games/colem/README b/games/colem/README
new file mode 100644
index 0000000000..47668260fc
--- /dev/null
+++ b/games/colem/README
@@ -0,0 +1,33 @@
+ColEm is a portable emulator of the old ColecoVision videogame console.
+It should run most ColecoVision games and supports Coleco's SuperAction
+controllers with spin wheels.
+
+In order to run ColecoVision games, you will need a copy of the system
+ROM image, but for copyright reasons, no ROM image is included. The
+file is generally called "coleco.rom" or "coleco.zip" (which contains
+"coleco.rom"). If you own a ColecoVision console, depending on the laws
+where you live, it may or may not be legal for you to use a copy of the
+ROM. If it's legal, you can either crack open your console, remove the
+ROM chip, and read the data from it... or use google-fu to find an
+already-dumped image file. Legal issues aside, you have 2 ways to
+provide the ROM image for the emulator to use:
+
+1. Place either "coleco.rom" or "coleco.zip" (containing "coleco.rom") in
+the directory with the SlackBuild script. The resulting package will
+include the ROM image in "usr/share/colem/coleco.rom". If you do this,
+DO NOT give anyone a copy of the package! Using the ROM might possibly
+be legal, but bundling it with ColEm is against the ColEm license.
+
+2. Build the package without the ROM image. After installing the
+package, manually place a copy of "coleco.rom" in "/usr/share/colem/"
+or "~/.colem/".
+
+Note about the sources: It appears that every time upstream releases a
+new version, the download link for the previous version is removed. If
+you are unable to download the source, try visiting the home page and
+look for a new version of ColEm. If this is the case, please contact
+the maintainer of this script (see the .info file)
+
+By default, ColEm is built for 24- and 32-bit color depth X11 displays.
+If you intend to run ColEm on an 8- or 16-bpp display, set either
+DISPLAY_BPP=8 or DISPLAY_BPP=16 in the script's environment.
diff --git a/games/colem/colem.1 b/games/colem/colem.1
new file mode 100644
index 0000000000..e8d3c76029
--- /dev/null
+++ b/games/colem/colem.1
@@ -0,0 +1,215 @@
+.TH COLEM "1" "January 2011" "SlackBuilds.org" "User Commands"
+.SH NAME
+colem \- Emulator for ColecoVision and Coleco Adam consoles
+.SH SYNOPSIS
+.B colem
+[\fI-option1 \fR[\fI-option2\fR...]] [\fIfilename\fR]
+.SH DESCRIPTION
+ColEm is a portable emulator of the old ColecoVision videogame console. It should run most ColecoVision games and supports Coleco's SuperAction controllers with spin wheels.
+.PP
+You can always get the latest ColEm binaries, source code, and support files from
+.B http://fms.komkon.org/ColEm/
+.SH OPTIONS
+.TP
+\fB[filename]\fR
+Name of the file to load as a cartridge [default: CART.ROM]
+.PP
+This program will transparently uncompress singular GZIPped
+and PKZIPped files.
+.TP
+\fB\-verbose\fR
+Select debugging messages [bitmask, default: 5]
+.br
+0 \- Silent
+.br
+1 \- Startup messages
+.br
+2 \- VDP
+.br
+4 \- Illegal Z80 ops
+.br
+16 \- Sound
+.TP
+\fB\-pal\fR, \fB\-ntsc\fR
+Video system to use [default: \-ntsc]
+.TP
+\fB\-skip\fR
+Percentage of frames to skip [default: 25]
+.TP
+\fB\-help\fR
+Print this help page
+.TP
+\fB\-home\fR
+Set directory with system ROM files [default: see FILES, below]
+.TP
+\fB\-adam\fR, \fB\-cv\fR
+Run in Adam/ColecoVision mode [default: \-cv]
+.TP
+\fB\-allspr\fR
+Show all sprites [off]
+.TP
+\fB\-autoa\fR, \fB\-noautoa\fR
+Autofire/No autofire for FIRE\-R button [default: \-noautoa]
+.TP
+\fB\-autob\fR, \fB\-noautob\fR
+Autofire/No autofire for FIRE\-L button [default: \-noautob]
+.TP
+\fB\-spin1x\fR, \fB\-spin1y\fR
+Mouse X/Y position as SuperAction spinner 1 [default: off]
+.TP
+\fB\-spin2x\fR, \fB\-spin2y\fR
+Mouse X/Y position as SuperAction spinner 2 [default: off]
+.TP
+\fB\-drums\fR, \fB\-nodrums\fR
+Hit/Don't hit MIDI drums on noise [default: \-nodrums]
+.TP
+\fB\-logsnd\fR
+Write soundtrack to a MIDI file [default: LOG.MID]
+.TP
+\fB\-palette\fR
+Use given color palette [default: 0]
+.br
+0 \- Scaled VDP colors
+.br
+1 \- Original VDP colors
+.br
+2 \- Faded NTSC colors
+.TP
+\fB\-sound\fR []
+Sound emulation quality [default: 22050]
+.TP
+\fB\-nosound\fR
+Don't emulate sound [default: emulate sound]
+.TP
+\fB\-trap\fR
+Trap execution when PC reaches address [default: FFFFh]
+.TP
+\fB\-sync\fR
+Sync screen updates to [default: 60]
+.TP
+\fB\-nosync\fR
+Do not sync screen updates [default: \-nosync]
+.TP
+\fB\-tv\fR, \fB\-notv\fR
+Simulate/Don't simulate scanlines [default: \-notv]
+.TP
+\fB\-soft\fR, \fB\-nosoft\fR
+Scale screen up with softening [default: \-nosoft]
+.TP
+\fB\-saver\fR, \fB\-nosaver\fR
+Save/don't save CPU when inactive [default: \-saver]
+.TP
+\fB\-shm\fR, \fB\-noshm\fR
+Use/don't use MIT SHM extensions for X [default: \-shm]
+.TP
+\fB\-scale\fR
+Scale window by [default: 2]
+.SH "KEYBOARD BINDINGS"
+.TP
+\fB[ALT]\fR
+Hold to switch to the second controller
+.TP
+\fB[SPACE]\fR
+FIRE\-R button (also: [SHIFT],A,S,D,F,G,H,J,K,L)
+.TP
+\fB[CONTROL]\fR
+FIRE\-L button (also: Z,X,C,V,B,N,M)
+.TP
+\fB[Q]\fR
+SuperAction PURPLE button (also: E,T,U,O)
+.TP
+\fB[W]\fR
+SuperAction BLUE button (also: R,Y,I,P)
+.TP
+\fB[0]\-[9]\fR
+Digit buttons
+.TP
+\fB[\-]\fR
+[*] button
+.TP
+\fB[=]\fR
+[#] button
+.TP
+\fB[PGUP]\fR
+Fast\-forward emulation (also: [F9])
+.TP
+\fB[ESC]\fR
+Quit emulation (also: [F12])
+.TP
+\fB[F1]\fR
+Go into the built\-in debugger
+.TP
+\fB[F2]\fR
+Turn soundtrack log on/off
+.TP
+\fB[F3]\fR
+Toggle FIRE\-R autofire on/off
+.TP
+\fB[F4]\fR
+Toggle FIRE\-L autofire on/off
+.TP
+\fB[F5]\fR
+Invoke configuration menu
+.TP
+\fB[F6]\fR
+Load emulation state
+.TP
+\fB[F7]\fR
+Save emulation state
+.TP
+\fB[F8]\fR
+Turn scanline simulation on/off
+.TP
+\fB[ALT]+[F8]\fR
+Toggle screen softening on/off
+.TP
+\fB[F9]\fR
+Fast\-forward emulation (also: [PGUP])
+.TP
+\fB[F11]\fR
+Reset hardware
+.TP
+\fB[F12]\fR
+Quit emulation (also: [ESC])
+.TP
+\fB[ALT]+[PGUP]\fR
+Increase audio volume
+.TP
+\fB[ALT]+[PGDOWN]\fR
+Decrease audio volume
+.SH FILES
+.TP
+\fBcoleco.rom\fR
+ColecoVision BIOS ROM image (8192 bytes). This is the only ROM required
+for playing ColecoVision games.
+.TP
+\fBwriter.rom\fR
+SmartWriter ROM (32768 bytes), only required for emulating the Coleco ADAM system.
+.TP
+\fBeos.rom\fR
+Extended OS ROM (8192 bytes), only required for emulating the Coleco ADAM system.
+.PP
+The above ROM images may be named in all\-lowercase or all\-uppercase,
+and are searched for in:
+.PP
+1. The directory specified by \fB\-home\fR, or the current directory if \fB\-home\fR not given.
+.br
+2. \fI/usr/share/colem\fR
+.br
+3. \fI~/.colem\fR
+.PP
+The coleco.rom file will occasionally be found on websites with the names "os7.rom"
+or "ColecoVision\ BIOS\ (1982).col". Its md5sum is one of:
+.PP
+2c66f5911e5b42b8ebe113403548eee7 (original version)
+.br
+00fd13b66d39c69706aa48eb84a78411 (hacked version, different font)
+.br
+47f7180592a00b9631c97a12ff0fdd3c (hacked version, no title screen delay)
+.PP
+ColEm works with any of the above ROM images.
+.SH AUTHOR
+ColEm is by Marat Fayzullin, (C)FMS 1994\-2010
+.PP
+This man page is by B. Watson, for the SlackBuilds.org project (but may
+be used by anyone for any purpose).
diff --git a/games/colem/colem.SlackBuild b/games/colem/colem.SlackBuild
new file mode 100644
index 0000000000..46ca0ab45b
--- /dev/null
+++ b/games/colem/colem.SlackBuild
@@ -0,0 +1,130 @@
+#!/bin/sh
+
+# Slackware build script for colem
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+PRGNAM=colem
+VERSION=${VERSION:-2.6}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+# Since we have to set endianness at compile-time, included a few
+# extra ARCHes here (only i486 and x86_64 are actually tested, you're
+# on your own with the others)
+# alphaslack and armedslack are little-endian, caught by the default case.
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ BIGENDIAN=yes
+elif [ "$ARCH" = "sparc" ]; then
+ SLKCFLAGS="-O2"
+ BIGENDIAN=yes
+elif [ "$ARCH" = "powerpc" ]; then
+ SLKCFLAGS="-O2"
+ BIGENDIAN=yes
+else
+ SLKCFLAGS="-O2"
+fi
+
+set -e
+
+ZIPNAME="ColEm"
+ZIPVER=$( echo $VERSION | sed 's/\.//g' )
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+mkdir $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+unzip $CWD/$ZIPNAME$ZIPVER-Source.zip
+chown -R root:root .
+chmod -R a-s,u+w,go+r-w .
+
+sed -i 's/-O3/$(SLKCFLAGS)/' EMULib/Rules.gcc
+
+# Make the emulator look in /usr/share/colem and ~/.colem for the
+# system ROMs, as well as the current directory. Without this, it's
+# quite annoying to use colem from either the command line or KDE.
+patch -p1 < $CWD/rom_path.diff
+
+cd $ZIPNAME/Unix
+
+# Allow building for 8bpp or 16bpp X11 displays (the default is 32,
+# which works on either 24bpp or 32bpp, which 99% of everyone is
+# using now).
+if [ "${DISPLAY_BPP:-32}" != "32" ]; then
+ sed -i "/^DEFINES/s/-DBPP32/-DBPP$DISPLAY_BPP/" Makefile
+fi
+
+# Allow building on big-endian platforms (such as s390)
+if [ "${BIGENDIAN:-no}" != "no" ]; then
+ sed -i "/^DEFINES/s/-DLSB_FIRST/-DMSB_FIRST/" Makefile
+fi
+
+make SLKCFLAGS="$SLKCFLAGS"
+mkdir -p $PKG/usr/bin
+install -s -m0755 -oroot -groot $PRGNAM $PKG/usr/bin
+
+# Man page written by script author.
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README
+
+# HTML doc downloaded from http://fms.komkon.org/ColEm/ColEm.html
+cat $CWD/$ZIPNAME.html > $PKG/usr/doc/$PRGNAM-$VERSION/$ZIPNAME.html
+
+mkdir -p $PKG/usr/share/pixmaps
+cat ../Maemo/Package/colem-64x64.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+
+# .desktop file and mime .xml file originally taken from ColEm-Maemo
+# sources and modified to get rid of the Maemo-specific stuff.
+mkdir -p $PKG/usr/share/applications
+cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
+
+mkdir -p $PKG/usr/share/mime/packages
+cat $CWD/$PRGNAM.xml > $PKG/usr/share/mime/packages/$PRGNAM.xml
+
+# The ROM directory
+mkdir -p $PKG/usr/share/$PRGNAM
+
+# If there's a ROM image in $CWD, include it in the package
+if [ -e $CWD/coleco.zip ]; then
+ ( cd $CWD ; unzip -o coleco.zip )
+elif [ -e $CWD/COLECO.ZIP ]; then
+ ( cd $CWD ; unzip -o COLECO.ZIP )
+fi
+if [ -e $CWD/coleco.rom ]; then
+ cat $CWD/coleco.rom > $PKG/usr/share/$PRGNAM/coleco.rom
+elif [ -e $CWD/COLECO.ROM ]; then
+ cat $CWD/COLECO.ROM > $PKG/usr/share/$PRGNAM/coleco.rom
+fi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/games/colem/colem.desktop b/games/colem/colem.desktop
new file mode 100644
index 0000000000..33754341ed
--- /dev/null
+++ b/games/colem/colem.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Application
+Name=ColEm
+GenericName=ColecoVision Emulator
+Exec=colem
+Icon=colem
+Terminal=false
+Categories=Game;Emulator;
diff --git a/games/colem/colem.info b/games/colem/colem.info
new file mode 100644
index 0000000000..68b263f8f4
--- /dev/null
+++ b/games/colem/colem.info
@@ -0,0 +1,10 @@
+PRGNAM="colem"
+VERSION="2.6"
+HOMEPAGE="http://fms.komkon.org/ColEm/"
+DOWNLOAD="http://fms.komkon.org/ColEm/ColEm26-Source.zip"
+MD5SUM="dbafc021fc71ae5baae3602369f5a6f5"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
+APPROVED="rworkman"
diff --git a/games/colem/colem.xml b/games/colem/colem.xml
new file mode 100644
index 0000000000..816a514c54
--- /dev/null
+++ b/games/colem/colem.xml
@@ -0,0 +1,10 @@
+
+
+
+ ColecoVision Cartridge ROM
+
+
+
+
+
+
diff --git a/games/colem/doinst.sh b/games/colem/doinst.sh
new file mode 100644
index 0000000000..9a8ded3c60
--- /dev/null
+++ b/games/colem/doinst.sh
@@ -0,0 +1,7 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -x /usr/bin/update-mime-database ]; then
+ /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
+fi
diff --git a/games/colem/rom_path.diff b/games/colem/rom_path.diff
new file mode 100644
index 0000000000..b2353f2190
--- /dev/null
+++ b/games/colem/rom_path.diff
@@ -0,0 +1,87 @@
+diff -Naur a/ColEm/Coleco.c b/ColEm/Coleco.c
+--- a/ColEm/Coleco.c 2008-03-30 12:53:24.000000000 -0400
++++ b/ColEm/Coleco.c 2009-09-29 17:49:32.000000000 -0400
+@@ -19,6 +19,9 @@
+ #include
+ #include
+ #include
++#include
++#include
++#include
+
+ #ifdef __WATCOMC__
+ #include
+@@ -69,6 +72,46 @@
+ #define fwrite(B,N,L,F) gzwrite(F,B,(L)*(N))
+ #endif
+
++/* 20090929 bkw: smart_fopen() searches for ROMs in various places
++ you might expect them to live, on a UNIXey system. Also searches
++ for both upper- and lower-case filenames. */
++static FILE *smart_fopen(const char *path, const char *mode) {
++ FILE *fp;
++ char lowercase_path[20], filename[PATH_MAX + 1];
++ const char *p = path;
++ char *lp = lowercase_path;
++ struct passwd *ent;
++
++ while(*p) *lp++ = tolower(*p++);
++ *lp = '\0';
++
++ if( (fp = fopen(path, mode)) )
++ return fp;
++
++ if( (fp = fopen(lowercase_path, mode)) )
++ return fp;
++
++ sprintf(filename, "/usr/share/colem/%s", path);
++ if( (fp = fopen(filename, mode)) )
++ return fp;
++
++ sprintf(filename, "/usr/share/colem/%s", lowercase_path);
++ if( (fp = fopen(filename, mode)) )
++ return fp;
++
++ if( (ent = getpwuid(getuid())) && (ent->pw_dir) ) {
++ sprintf(filename, "%s/.colem/%s", ent->pw_dir, path);
++ if( (fp = fopen(filename, mode)) )
++ return fp;
++
++ sprintf(filename, "%s/.colem/%s", ent->pw_dir, lowercase_path);
++ if( (fp = fopen(filename, mode)) )
++ return fp;
++ }
++
++ return NULL;
++}
++
+ /** StartColeco() ********************************************/
+ /** Allocate memory, load ROM image, initialize hardware, **/
+ /** CPU and start the emulation. This function returns 0 in **/
+@@ -134,7 +177,7 @@
+
+ /* COLECO.ROM: OS7 (ColecoVision BIOS) */
+ if(Verbose) printf(" Opening COLECO.ROM...");
+- if(!(F=fopen("COLECO.ROM","rb"))) P="NOT FOUND";
++ if(!(F=smart_fopen("COLECO.ROM","rb"))) P="NOT FOUND";
+ else
+ {
+ if(fread(ROM_BIOS,1,0x2000,F)!=0x2000) P="SHORT FILE";
+@@ -145,7 +188,7 @@
+ if(!P)
+ {
+ if(Verbose) printf("OK\n Opening WRITER.ROM...");
+- if(F=fopen("WRITER.ROM","rb"))
++ if(F=smart_fopen("WRITER.ROM","rb"))
+ {
+ if(fread(ROM_WRITER,1,0x8000,F)==0x8000) ++AdamROMs;
+ fclose(F);
+@@ -157,7 +200,7 @@
+ if(!P&&AdamROMs)
+ {
+ if(Verbose) printf(" Opening EOS.ROM...");
+- if(F=fopen("EOS.ROM","rb"))
++ if(F=smart_fopen("EOS.ROM","rb"))
+ {
+ if(fread(ROM_EOS,1,0x2000,F)==0x2000) ++AdamROMs;
+ fclose(F);
diff --git a/games/colem/slack-desc b/games/colem/slack-desc
new file mode 100644
index 0000000000..d32b9d3899
--- /dev/null
+++ b/games/colem/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+colem: colem (ColecoVision emulator)
+colem:
+colem: ColEm is a portable emulator of the old ColecoVision videogame
+colem: console. It should run most ColecoVision games and supports Coleco's
+colem: SuperAction controllers with spin wheels.
+colem:
+colem:
+colem:
+colem:
+colem:
+colem: