The forum

Need For Speed Carbon

with Widescreen Universal Patch option

Author Replies
redevizer Wednesday 16 February 2011 at 12:13
redevizer

Wine version: 1.3.12
Distribution: Gentoo
Distribution version: 64 bit
Graphic Card: Nvidia Geforce 9600GT
Driver of the graphic card: 260.19.36
Comments: After installation, asks if you want play on widescreen. If yes, Universal Widescreen Patch is being downloaded, and the script is helping you to patch NFSC for widescreen.
Works great, I haven't noticed any bugs, excellent performance.

#!/bin/bash
# Date: (2011-16-02 08:37)
# Last version: (2011-16-02 08:37)
# Distribution used to test: Gentoo (x64)
# Author: redevizer
# License: Retail

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Need For Speed Carbon"
PREFIX="NFSCarbon"
WORKING_WINE_VERSION="1.3.12"

POL_SetupWindow_Init
POL_SetupWindow_presentation "$TITLE" "EA Games" "" "N/A" "$PREFIX"


select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

#downloading specific Wine
POL_SetupWindow_install_wine "$WORKING_WINE_VERSION"
Use_WineVersion "$WORKING_WINE_VERSION"
 
#fetching PROGRAMFILES environmental variable
POL_LoadVar_PROGRAMFILES
  
Choose between DVD and Digital Download version
POL_SetupWindow_menu "What version do you have?" "Actions" "DVD~Digital Download" "~"

if [ "$APP_ANSWER" == "DVD" ]; then
GAME_MEDIAVERSION="DVD"
else
GAME_MEDIAVERSION="DD"
fi

#Installing mandatory dependencies 
POL_Call POL_Install_vcrun2005
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_dotnet20
POL_Call POL_Install_d3dx9


if [ "$GAME_MEDIAVERSION" == "DVD" ]; then
#asking for CDROM and checking if its correct one
POL_SetupWindow_message "Please insert $TITLE media into your DVD drive\\nif not already done."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "AutoRun.exe"
wine start /unix "$CDROM/AutoRun.exe"
POL_SetupWindow_message "Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to redo the installation." "$TITLE"
else
#Asking then installing DDV of the game
cd $HOME
POL_SetupWindow_browse "Please select your $TITLE Digital Download executable" "$TITLE"
SETUP_EXE="$APP_ANSWER"
wine start /unix "$SETUP_EXE"
POL_SetupWindow_message "Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to redo the installation." "$TITLE"
fi

#asking about memory size of graphic card
POL_SetupWindow_menu_list "How much memory does your graphics board have?\\n(minimum for this game : 128)" "$TITLE" "128-256-320-384-512-640-768-896-1024-1792-2048" "-" "256"
VMS="$APP_ANSWER"
 
cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > vms.reg
echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> vms.reg
regedit vms.reg
if [ "$VMS" -lt "128" ]; then
POL_SetupWindow_message "This game will work correctly only with a graphic card with more than 128Mb of memory." "$TITLE"
fi


#widescreen question
POL_SetupWindow_question "Do you want to play with widescreen resoution?\\nIf yes Universal Widescreen Patcher will be downloaded\\n\\n\\nWidescreen How-To:\\n * unzip is required\\n * Select $TITLE location\\n * Enter desidered resolution\\n * In game select 640x480 resolution - it will be your desidered resolution" "Widescreen"
if [ $APP_ANSWER == "TRUE" ]; then
POL_SetupWindow_message "Please wait while Universal Widescreen Patcher is being downloaded (~300kb)." "$TITLE"
mkdir -p $WINEPREFIX/drive_c/windows/temp
cd $WINEPREFIX/drive_c/windows/temp
wget http://www.widescreengamingforum.com/downloads/uniws.zip
unzip uniws.zip
echo -e "THE INI IS BELOW \\n[Apps] \\nversion=1.03 \\n\\na0=Need For Speed Carbon\\n\\n\\n[Need For Speed Carbon] \\ndetails=Select the 640x480 resolution in game to use your custom resolution. \\ncheckfile=nfsc.exe \\nmodfile=nfsc.exe \\nsig=80020000C701E0010000 \\nsigwild=0000110000 \\nxoffset=0 \\nyoffset=6 \\noccur=1\\n" > patches.ini
wine start /unix uniws.exe
POL_SetupWindow_message "Widescreen How-To:\\n * unzip is required\\n * Select $TITLE location (DO NOT CHOOSE: FIND IT FOR ME\\n                         it might detect the nfsc.exe that is located on your DVD)\\n * Enter desidered resolution\\n * In game select 640x480 resolution - it will be your desidered resolution" "Widescreen"
fi

#delete temporary files
rm -rf $WINEPREFIX/drive_c/windows/temp/*


#making shortcut
POL_SetupWindow_auto_shortcut "$PREFIX" "nfsc.exe" "$TITLE" "" ""
Set_WineVersion_Assign "$WORKING_WINE_VERSION" "$TITLE"

POL_SetupWindow_message "$TITLE has been installed successfully.\\nHope it works...\\nGood luck with the game ;)\\n\\nIf the game does not work, try applying NO-CD patch" "$TITLE"

POL_SetupWindow_Close
exit

Edited by redevizer