[English] [Japanese]

Linux CD-ROM Game System

 
  YAMAMORI Takenori <yamamori@kt.rim.or.jp>

§ Installation of a base system

¶ With Vine Linux 2.0, which is a RedHat 6.x base Japanese distribution.

I have decided to use Vine 2.0 for a base system. At first we install Vine into a hard drive. Utilizing a free partition on a hard drive for a multiboot, you can operate carefully with a machine which is in use currently. However, I recommend to use another free machine if possible.

If you have only one machine, it is more safe that you remove the hard drive in use and attach another freely usable hard drive temporarily.

In installation of Vine, considering that it is to be put into CD-ROM finally, we have to pay attention to install only necessary packages.

I explain it sequentially and concretely.

Select "custom" on an "Installation type" screen which appears on the way of Vine's installer. Do not part a hard drive into small many partitions but two partitions which are root and swap. In fact, swap is needless because we cannot use swap in the CD-ROM game system which has no hard drive. However, because the installer of Vine does not let us go if we create no swap, we assign a swap partition by arbitrary size, which will be removed after installation.

In a selection screen of package groups, check the following four.

Do not install GNOME nor KDE.

Install "Development Tools" because a later installation of a game needs a C compiler and header files.

LAN is needless for the game system itself, but I install it in convenience of file transfer by LAN to construct the game system.

Emacs is not necessary because I don't use it but vi, however, I install it for the present because a certain package does not satisfy dependence relation if Emacs is not installed.

Afterwards, in a screen of X Window System setting, do not check "Use GUI login".

By this state, the total of the packages is displayed as 567MB on the installer. But just after installation, the "df /" command reports it as 648MB used.


¶ Removing unnecessary packages

It seems that the next installation of a game and others may increase a quantity of the hard drive more than a capacity of a CD-ROM so that it cannot be stored in a CD-ROM.

So we display the packages currently installed with a command "rpm -qa | less" and uninstall obviously unneeded packages among them. In addition, with a "rpm -qif filename" command, we can examine the package name that a certain file belongs to.

While uninstalling them with "rpm -e" command, if it makes an error with dependency of a package, uninstall the package that has a dependency too.

Eventually, the packages I uninstalled are the following.

  kinput2-v3release-7
  libwnn6-devel-3.0
  emacs-dl-wnn-0.3.6-7
  libwnn6-3.0
  wnn6-3.01
  wdm-1.20
  WMSoundSet-0.9.3
  wmakerconf-2.4
  WindowMaker-Icons-1.9
  WindowMaker-0.61.1_jp
  jman_pages-0.5-19991215.1
  CF-3.7Wpl2
  sendmail-8.9.3
  xxgdb-1.12
  gdb-4.18
  ImageMagick-4.2.9
  X11R6-contrib-3.3.2
  xscreensaver-3.17
  xlockmore-4.14
  xpaint-2.5.7
  tgif-4.1.27
  wget-1.5.3_jp

The quantity of the hard drive is now 585MB, which is an easy size to be put in a CD-ROM.

By the way, the packages of Canna (which is a Japanese KANJI input conversion server) are unneeded in fact. So I wished to uninstall Canna but couldn't do it as long as we use vi, because the installed vi is actually a Japanized patched version that dynamically linked with Canna library. I'd like to ask Vine for providing an original unpatched version of vi, which is a kind of system basic tool.


¶ Setting up a sound

Setting up the sound is easy by executing /usr/sbin/sndconfig as a root on the console, after launching kon(a KANJI terminal) if you prefer Japanese. My sound card is recognized as "Creative SB16 PnP" and is set automatically. If you choose to use the ALSA driver, you have to follow another method. (But I like the ALSA, too)


¶ Setting up a joystick

Kernel modules for a joystick exists as /lib/modules/2.2.14-1vl6/misc/joystick.o etc. in case of Vine 2.0 from the first. However, because a tool for identifying the joystick like jstest is not installed, we install it from the source.

I downloaded joystick-1.2.15.tar.gz from the following URI as a latest version at that time.

  http://atrey.karlin.mff.cuni.cz/~vojtech/joystick/

Because we don't need to install it entirely and we need only jstest, do as follows:

$ tar zxvf joystick-1.2.15.tar.gz
$ cd joystick-1.2.15
$ make jstest         # No need to compile kernel modules
$ su
# install -c jstest /usr/local/bin

In addition, /dev/js0 is necessary as a device file, and we can make it when we execute "# make devs" on the directory that joystick-1.2.15 has been extracted, however, in case of Vine 2.0, /dev/js0 - /dev/js3 have been created already by a dev-2.7.10-2vl3 package so that we have to do nothing.

We load kernel modules as follows after connecting joystick to a 15pin game port.

# /sbin/modprobe joy-analog

Here, by executing /sbin/lsmod, we may find two modules like joystick and joy-analog are loaded. Instead of modporbe, we can also use insmod individually as follows:

# insmod joystick
# insmod joy-analog

The command to remove them all at once is the following:

# /sbin/modprobe -r joy-analog

The module joystick is common to every joystick, but the module joy-analog will be different depending on each joystick. If you have a different type of joystick, you can select a proper module among the list that will be displayed by executing the following command:

/sbin/modprobe -l -t misc | less

Finally, add the following line to /etc/conf.modules.

alias char-major-15 joy-analog

Here, char-major-15 is meaning of a character special device with a major number 15, which we can see by the "ls -l /dev/js0" command.

The user who logged in to a console owns /dev/js0 and can execute jstest as follows:

$ jstest /dev/js0

When we execute above, the modules are loaded automatically according to a description of /etc/conf.modules, and the joystick should work.

Here, if we can see numerical values and on/off responding to the input of joystick are displayed on a screen, it is okay.


¶ Installation of an SDL game

circuslinux We install a game of the leading role here. I looked for a reasonable game for SDL that supported both sound and joystick, and ran into a game called circuslinux. We can download circuslinux-1.0.1.tar.gz as a source file from the following:

http://www.newbreedsoftware.com/circus-linux/

Some SDL libraries like SDL-1.1.x, SDL_image, SDL_mixer that exist on the following URI are needed for an installation of circuslinux:

http://www.libsdl.org/

I intended to install them with binaries at first in order to easily finish work if possible, but because a downloadable binary SDL_image-1.0.4 was dynamically linked with SDL-1.0.x instead of SDL-1.1.x, it was not usable. So I have decided to install them by rebuilding from *.src.rpm entirely.

By the way, we can see a downloadable binary SDL-1.1.2 is dynamically linked with libesd.so and libaudiofile.so.

In addition, a binary SDL_mixer is dynamically linked with smpeg library. We can build SDL libraries by rebuilding from the sources, even without the library mentioned above, and I confirmed that the circuslinux works on this environment at least.

However, we had better build SDL libraries so as to be linked with libesd/libaudiofile/smpeg for the later. We can download the smpeg library by following a link on the SDL Web page.

Eventually, the necessary source packages are the following:

  SDL-1.1.2-1.src.rpm
  SDL_image-1.0.4-1.src.rpm
  smpeg-0.3.5-1.src.rpm
  SDL_mixer-1.0.5-1.src.rpm

Put them under /usr/src/redhat/SRPMS directory.

When we installed Vine 2.0 along this article, the development environment of esound and audiofile may not be installed though the execution environment of them are installed. So, from a CD-ROM of Vine 2.0, we install the following packages first.

(Installation of audiofile-devel and esound-devel)
----
# mount /mnt/cdrom
# cd /mnt/cdrom/Vine/RPMS
# rpm -ivh audiofile-devel-0.1.9-1vl2.i386.rpm
# rpm -ivh esound-devel-0.2.17-1.i386.rpm
# cd /
# umount /mnt/cdrom
----

Here, we install the SDL base library as follows:

----
# cd /usr/src/redhat/SRPMS
# rpm --rebuild SDL-1.1.2-1.src.rpm
# cd /usr/src/redhat/RPMS/i386
# rpm -ivh SDL-1.1.2-1.i386.rpm SDL-devel-1.1.2-1.i386.rpm
----

Next, install SDL_image

----
# cd /usr/src/redhat/SRPMS
# rpm --rebuild SDL_image-1.0.4-1.src.rpm
# cd /usr/src/redhat/RPMS/i386
# rpm -ivh SDL_image-1.0.4-1.i386.rpm SDL_image-devel-1.0.4-1.i386.rpm
----

Install smpeg before SDL_mixer

----
# cd /usr/src/redhat/SRPMS
# rpm --rebuild smpeg-0.3.5-1.src.rpm
# cd /usr/src/redhat/RPMS/i386
# rpm -ivh smpeg-0.3.5-1.i386.rpm smpeg-devel-0.3.5-1.i386.rpm
----

The last is SDL_mixer

----
# cd /usr/src/redhat/SRPMS
# rpm --rebuild SDL_mixer-1.0.5-1.src.rpm
# cd /usr/src/redhat/RPMS/i386
# rpm -ivh SDL_mixer-1.0.5-1.i386.rpm SDL_mixer-devel-1.0.5-1.i386.rpm
----

Now, the SDL environment is ready, so we install the circuslinux right now. Most of the files that the source archive of the circuslinux contains are graphic and sound data, which are to be installed manually in case of earlier version of circuslinux, but now it gets more easy to install with GNU configure system.

A concrete procedure is the following. Don't forget to add a "--enable-joystick" option to the "./configure" script in order to use joystick.

(Installing circuslinux)
----
$ ./configure --enable-joystick
$ make
$ su
# make install
----
Here, the circuslinux command is installed in /usr/local/bin, while graphic and sound data are installed under /usr/local/share/circuslinux.

Now, we can simply start the circuslinux on the X Window System. If you have a digital joypad, add the following option:

$ circuslinux --digital

Because circuslinux is size of 640×480 dots, it is good to change the screen size of the X server to 640×480 dots by using Xconfigurator. Then the game can run as a full screen mode, and it is effective. Or if the X server has a 640×480 dots mode already, adding "--fullscreen" option with circuslinux command is another way. The X server will be switched to a full screen mode automatically.

Here, we have completed installing the base-system which can start the Linux game.


To "Linux CD-ROM Game System" index


This page has been rewritten for the web from a manuscript of TECH Linux Vol. 2 "CD-ROM Game System" ASCII Corporation.
To "SunOS 4.1.4 the mystery" Home
© 2000 YAMAMORI Takenori
yamamori@kt.rim.or.jp