Wednesday, 13 June 2007

Running Vice 1.21 Commodore Emulator under Ubuntu 7.04

Last weekend I installed Vice 1.21 - Commodore Emulator on my Ubuntu 7.04 - Festy Fawn.
First I downloaded the tarball (source code) from the site
vice-1.21.tar.gz
The official site of Vice is :
Vice Team
VICE 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.
So don't be afraid to download it!

Then I opened a terminal and ran the commands In order to obtain the gcc compiler :
sudo apt-get install build-essential

Then I decompressed the file with the command :
tar xvfz vice-1.21.tar.gz
Then I changed the current directory to the /vice-1.21 and ran the command :
sudo ./configure
Then I ran :
sudo make

Then I got the following errors :
../../src/arch/unix/x11/xaw/uiarch.h:33:27: error: X11/Intrinsic.h: No such file or directory
../../src/arch/unix/x11/xaw/uiarch.h:34:28: error: X11/StringDefs.h: No such file or directory
In file included from ../../src/arch/unix/x11/xaw/videoarch.h:5,
from ../../src/arch/unix/videoarch.h:9,
from video-canvas.c:39:

So I Installed the libxt-dev package to fix the problem :
sudo apt-get install libxt-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libice-dev libsm-dev
The following NEW packages will be installed:
libice-dev libsm-dev libxt-dev
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 563kB of archives.
After unpacking 1675kB of additional disk space will be used.
Do you want to continue [Y/n]?

Then I ran again :

sudo make

And another error was reported :
FileSel.c:47:29: error: X11/Xaw/SimpleP.h: No such file or directory
FileSel.c:48:28: error: X11/Xaw/Simple.h: No such file or directory
FileSel.c:49:28: error: X11/Xaw/LabelP.h: No such file or directory
FileSel.c:50:27: error: X11/Xaw/Label.h: No such file or directory
FileSel.c:51:30: error: X11/Xaw/CommandP.h: No such file or directory
FileSel.c:52:29: error: X11/Xaw/Command.h: No such file or directory
FileSel.c:53:27: error: X11/Xaw/FormP.h: No such file or directory
FileSel.c:54:26: error: X11/Xaw/Form.h: No such file or directory
In file included from FileSelP.h:25,
from FileSel.c:71:
DirMgr.h:86: warning: function declaration isn't a prototype
In file included from FileSel.c:71:
FileSelP.h:27:31: error: X11/Xaw/Cardinals.h: No such file or directory
FileSel.c: In function ChildrenCreate:
FileSel.c:767: error: labelWidgetClass undeclared (first use in this function)
FileSel.c:767: error: (Each undeclared identifier is reported only once
FileSel.c:767: error: for each function it appears in.)
FileSel.c:805: error: commandWidgetClass undeclared (first use in this function)
make[7]: *** [FileSel.o] Error 1
make[7]: Leaving directory `/home/ubuntu/vice-1.21/src/arch/unix/x11/xaw/widgets'
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory `/home/ubuntu/vice-1.21/src/arch/unix/x11/xaw'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/home/ubuntu/vice-1.21/src/arch/unix/x11'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/ubuntu/vice-1.21/src/arch/unix'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/ubuntu/vice-1.21/src/arch'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/ubuntu/vice-1.21/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ubuntu/vice-1.21/src'
make: *** [all-recursive] Error 1

So I Installed libxaw7-dev and libxaw-headers packages :

sudo apt-get install libxaw7-dev libxaw-headers

ubuntu@horus:~/vice-1.21$ sudo apt-get install libxaw7-dev libxaw-headers
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libxmu-dev libxmu-headers libxpm-dev
The following NEW packages will be installed:
libxaw-headers libxaw7-dev libxmu-dev libxmu-headers libxpm-dev
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 389kB of archives.
After unpacking 1577kB of additional disk space will be used.
Do you want to continue [Y/n]?

Then I ran again :

sudo make

that finished without errors. So I ran :

sudo make install

I started the emulator via the x64 command to my surprise the screen was always black, If i pressed the left mouse button or the right button a menu appeared but the screeen was always black.
After googling a little I found the solution :
Just a simple change (a 0 for a 1) in the file :
vice-1.21/src/arch/unix/x11/xaw/uicolor.c

So I changed the line :
im = XCreateImage(display, visual, x11ui_get_display_depth(),
ZPixmap, 0, (char *)data, 1, 1, 8, 1);

for :

im = XCreateImage(display, visual, x11ui_get_display_depth(),
ZPixmap, 0, (char *)data, 1, 1, 8, 0);


Then I recompiled again with :
sudo make
then
sudo make install

Then the program worked!!!
Thanks to the open source it was posible to fix the game and play ASYLUM!!!
This is one of the benefits of having the code!!!

Here the screen with the compiling console, gedit with the source, and Asylum (a C64 Adventure Game) !!!



For those who don't know the Asylum game here is a link with the D64 disk image :

http://www.retrosite.de/adventure/asylum/asylum.html

Please, remember don't look up in Asylum!!! ;-)

6 comments:

Daryn said...

Thanks! You made my day.

I was getting the black screen from the version of VICE in the Ubuntu repositories, and didn't know how to go about compiling my own copy, finding dependencies, etc...

This worked perfect for me!

Carl said...

Well, it almost worked for me. Compiled with no errors however the audio isn't working. Also have no joystick and have not done the keyboard mapping yet. Well, at least I got this far. Tried every other emulator out there and this is the first success I have had.

Thanks,

Carl



http://www.gaihosa.com

Shalz said...

Thanks a ton! ur blog helped me solve a majority of my installation prob. I however hav a question! have you encountered an error like:

when i try the "make" command on the software i installed, i get the following error:

make -f scripts/Makefile.build obj=/home/shalini/nistnet-3.0a/kernel
scripts/Makefile.build:46: *** CFLAGS was changed in "/home/shalini/nistnet-3.0a/kernel/Makefile". Fix it to use EXTRA_CFLAGS. Stop.
make[2]: *** [_module_/home/shalini/nistnet-3.0a/kernel] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.24-17-generic'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/shalini/nistnet-3.0a/kernel'
make: *** [sub_dirs] Error 2


I am assuming that a small glitch is standing in way of completing this installation.

-Shalini

Bush said...

Thanks a whole bunch! I was going nuts trying to find a C64 emulator that actually worked in Linux. I even tried vice initially but, like you, I got nothing but that black screen. Your article enabled me to fix that. Thanks again!

reyt said...

One night,wow gold a Delta twin-engine puddle final fantasy gil jumper was flying somewhere world of warcraft power leveling above New Jersey.maplestory mesos There were five people on board:flyff power leveling the pilot, Michael Jordan,Bill Gates, the Dali Lama,2moons power leveling and a hippie. Suddenly,Maple Story mesos an illegal oxygen generator exploded loudly 2moons gold in the luggage compartment, age of conan power leveling and the passenger cabin began Atlantica gold to fill with smoke. The cockpit doorflyff gold opened, and the pilot burst into the compartment. Atlantica power leveling"Gentlemen,knight online power leveling he began, "I have good news knight online power leveling and bad news. World of warcraft Power Leveling The bad news is SilkRoad Power leveling that we're about to crash in New Jersey. The good news archlord power leveling is that there are archlord gold four parachutes,buy last chaos gold and I have flyff power leveling one of them

Gary said...

I have been trying for months to install Ubuntu in my laptop, But I do not get why this has turned into a pretty complex shore. I would better get some Generic Viagra in order to forget about all my troubles