ColinPitrat / caprice32

An emulator of the Amstrad CPC 8bit home computer range.
GNU General Public License v2.0
148 stars 32 forks source link

Can't find ROM after install from code (raspbian) #164

Closed cpcbegin closed 4 years ago

cpcbegin commented 4 years ago

I install the latest versión of caprice32 v4.6.0 with these commands:

sudo apt install git build-essential libsdl1.2-dev libfreetype6-dev libpng-dev zlib1g-dev
git clone https://github.com/ColinPitrat/caprice32 caprice32cp
cd caprice32cp
git pull
make
sudo make install

Previous versions runs OK but the new one only works in path where I compile it, in any other path show this error:

ERROR src/cap32.cpp:951 - Couldn't open ROM file '/home/pi/opt/rom//cpc6128.rom' ERROR src/cap32.cpp:1092 - Failed patching the ROM

ColinPitrat commented 4 years ago

Do you have a message in output saying which configuration file is used?

ColinPitrat commented 4 years ago

Indeed, the install make target is broken. The problem is that it puts the config in /etc/cap32.cfg with the default values for all the paths (./) and the resources under /usr/local/share/caprice32. We'd need to patch the cap32.cfg when we install it.

ColinPitrat commented 4 years ago

To properly support this we need to:

I think I prefer the patching for the config. The simplest is to have a config template that is used both to generate installed config (by replacing a pattern by the resources dir) and the local cap32.cfg (by removing the paths that have the pattern)

ColinPitrat commented 4 years ago

This should be fixed with the following changes:

Can you please confirm this works well?

cpcbegin commented 4 years ago

Perfect, now I can run again cap32 in any directory. Thanks a lot, now you can close this issue.

2play commented 4 years ago

As a workaround I have resolved this in the past by adding the actual path of where my binary will be, instead the APP_PATH="**$PWD**"

With above if the compile folder exists then even if moved still works (but we dont want the extra files) :-)