Skip to content

Commit

Permalink
Merge pull request #127 from Cebion/nfs2se
Browse files Browse the repository at this point in the history
New Port: Need for Speed II Special Edition
  • Loading branch information
Cebion authored Feb 26, 2024
2 parents 5f4fdf2 + fc80f5d commit 87efa50
Show file tree
Hide file tree
Showing 19 changed files with 366 additions and 0 deletions.
61 changes: 61 additions & 0 deletions ports/nfs2se/Need For Speed II SE.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
if [ -d "/opt/system/Tools/PortMaster/" ]; then
controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
controlfolder="/opt/tools/PortMaster"
else
controlfolder="/roms/ports/PortMaster"
fi

source $controlfolder/control.txt
source $controlfolder/device_info.txt
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"

get_controls

GAMEDIR=/$directory/ports/nfs2se
CONFDIR="$GAMEDIR/conf/"

CUR_TTY=/dev/tty0
$ESUDO chmod 666 $CUR_TTY

> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1

cd $GAMEDIR

export LD_LIBRARY_PATH="/usr/lib/arm-linux-gnueabihf/":"/usr/lib32":"$GAMEDIR/libs/":"$LD_LIBRARY_PATH"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"

$ESUDO rm -rf ~/.nfs2se
ln -sfv /$directory/ports/nfs2se/conf/.nfs2se ~/


# Process directories
find . -depth -type d | grep -e "[A-Z]" | while read -r dir; do
newdir=$(echo "$dir" | tr '[A-Z]' '[a-z]' | sed 's/-1$//')

# Simple progress message
echo "Renaming $dir" > "$CUR_TTY"

mv "$dir" "$dir-1" > "$CUR_TTY"
mv "$dir-1" "$newdir" > "$CUR_TTY"
done

# Process files
find . -type f | grep -e "[A-Z]" | while read -r file; do
newfile=$(echo "$file" | tr '[A-Z]' '[a-z]' | sed 's/-1$//')

# Simple progress message
echo "Renaming $file" > "$CUR_TTY"

mv "$file" "$file-1" > "$CUR_TTY"
mv "$file-1" "$newfile" > "$CUR_TTY"
done

#export TEXTINPUTINTERACTIVE="Y"

$GPTOKEYB "nfs2se" -c "./nfs2se.gptk" &
$GAMEDIR/nfs2se
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" > /dev/tty0
22 changes: 22 additions & 0 deletions ports/nfs2se/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Notes
Thanks to [Błażej Szczygieł](https://github.com/zaps166/NFSIISE) for creating this wrapper and making it available for free!

## Controls

| Button | Action |
|--|--|
|A| Accelerate|
|B| Brake|
|Y| Hand Brake|
|L1| Shift Down |
|R1| Shift Up |
|L2| Camera View |
|R2| Horn |

## Compile

```shell
git clone https://github.com/zaps166/NFSIISE.git
modify src/Wrapper.c to if (SDL_Init(SDL_INIT_EVERYTHING & ~(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER)) < 0)
./compile_nfs cpp gles2
```
Binary file added ports/nfs2se/nfs2se/conf/.nfs2se/config/config.dat
Binary file not shown.
94 changes: 94 additions & 0 deletions ports/nfs2se/nfs2se/conf/.nfs2se/nfs2se.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#This is the "Need For Speed II SE" wrapper configuration file.
#Don't modify the "nfs2se.conf.template" file, be sure that you are editing configuration inside home directory (created during the first run):
# Linux: "~/.nfs2se/nfs2se.conf",
# Windows: "%AppData%\.nfs2se\nfs2se.conf".
#Leave empty line at the end of the file!
#Remove "#" from the beginning of the line to apply the configuration!

#UseOnlyOneCPU:
# 0 - The game can use more than one CPU (can be unstable)
# 1 - The game can use only the first CPU (can be more stable, default)
#StartInFullScreen:
# 0 - The game runs in window
# 1 - The game runs in full screen (default)
#VSync:
# -1 - Don't change
# 0 - VSync disabled
# 1 - VSync enabled (default)
# >1 - VSync enabled, limit the framerate
#MSAA (Multisample antialiasing):
# 0 - Don't change (default)
# 1 - Disable MSAA
# 2, 4, 8, 16 - Enable MSAA. If not supported, the game probably won't run.
#UseWindowSizeForFullScreen:
# 0 - Don't change screen size (default)
# 1 - Use screen size from "WindowSize"
#WindowSize:
# Type your own window size (default: 640x480)
#KeepAspectRatio:
# 0 - Fills the entire window
# 1 - Keeps the original aspect ratio (4:3, default)
#Joystick0AxisValueShift:
# Specify the number to shift value for the first axis in first joystick (simple deadzone compensation)
#Joystick1AxisValueShift:
# Specify the number to shift value for the first axis in second joystick (simple deadzone compensation)
#Joystick0Axes:
# Specify which axes will be used in game for first joystick. NFS2SE supports only 4 axes (e.g. 0,12,13,14:0,1,1,1 or 0,1,4,5:0,0,0,0 or 0,1,2,5:0,0,0,0)
# The numbers after colon chooses axis type (0 - normal axis, 1 - half axis, -1 - inverted half axis)
#Joystick1Axes:
# Specify which axes will be used in game for second joystick. NFS2SE supports only 4 axes.
# The numbers after colon chooses axis type (0 - normal axis, 1 - half axis, -1 - inverted half axis)
#Joystick0Buttons:
# Specify which buttons will be used in game for first joystick. Value less than 0 - disabled. NFS2SE supports 15 buttons
#Joystick1Buttons:
# Specify which buttons will be used in game for second joystick. Value less than 0 - disabled. NFS2SE supports 15 buttons
#Joystick0EscButton:
# Specify which button will be used as Escape key
#UseHapticPolar:
# 0 - Use SDL_HAPTIC_STEERING_AXIS
# 1 - Use SDL_HAPTIC_POLAR
#UseSpringForceFeedbackEffect:
# 0 - Don't use Spring Force Feedback Effect (default)
# 1 - Use Spring Force Feedback Effect (experimental)
#ForceFeedbackDevice:
# Specify the Force Feedback device (-1 - auto, default)
#LinearSoundInterpolation:
# 0 - Original samplerate - 22050Hz (default)
# 1 - Linear interpolated sound to 44100Hz (artificial highs)
#UseGlBleginGlEnd:
# Use glBegin(), glEnd() instead of glDrawArrays() - can be slower, disabled by default
#Port1:
# TCP and UDP port (default: 1030)
#Port2:
# Second UDP port for host (default: 1029)
#Bcast:
# Broadcast address for UDP connection (default: 255.255.255.255)
#LinuxCOM1, LinuxCOM2, LinuxCOM3, LinuxCOM4:
# Full path to serial port device (e.g. /dev/ttyS0)

UseOnlyOneCPU=1
#StartInFullScreen=1
VSync=-1
#MSAA=4
#UseWindowSizeForFullScreen=0
#WindowSize=640x480
#KeepAspectRatio=1
#Joystick0AxisValueShift=8448
#Joystick1AxisValueShift=8448
#Joystick0Axes=0,1,2,3:0,0,0,0
#Joystick1Axes=0,1,2,3:0,0,0,0
#Joystick0Buttons=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
#Joystick1Buttons=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
#Joystick0EscButton=-1
#UseHapticPolar=0
#UseSpringForceFeedbackEffect=0
#ForceFeedbackDevice=-1
#LinearSoundInterpolation=1
#UseGlBleginGlEnd=0
#Port1=1030
#Port2=1029
#Bcast=255.255.255.255
LinuxCOM1=/dev/ttyS0
LinuxCOM2=/dev/ttyS1
LinuxCOM3=/dev/ttyUSB0
LinuxCOM4=/dev/ttyUSB1
Binary file added ports/nfs2se/nfs2se/conf/.nfs2se/stats/oval.stf
Binary file not shown.
Binary file added ports/nfs2se/nfs2se/conf/.nfs2se/tmptrk/main.trk
Binary file not shown.
Binary file added ports/nfs2se/nfs2se/conf/.nfs2se/tmptrk/temp.mus
Binary file not shown.
33 changes: 33 additions & 0 deletions ports/nfs2se/nfs2se/install.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
4nnenglish
4nnlocal
0rn.\gamedata\sim\ai\
1rn.\gamedata\sim\cardata\
0rn.\gamedata\sim\aicardt\
3rn
3rn
3rn.\gamedata\tracks\se\
0rn.\gamedata\tmptrk\
0rn.\gamedata\tracks\data\pc\
0rn.\gamedata\tracks\speeds\
3nn
1rn.\gamedata\carmodel\pc\
1rn.\gamedata\render\pc\
1rn.\gamedata\dashhud\pc\
3nn.\gamedata\audio\pc\
2rn.\gamedata\audio\sfx\pc\
0rn.\gamedata\prefs\pc\
0rn.\gamedata\force\
0rn.\gamedata\pause\
1rn.\fedata\pc\art\
1rn.\fedata\pc\text\
1rn.\fedata\pc\text\
0rn.\fedata\pc\save\
0rn.\fedata\pc\stats\
0rn.\fedata\pc\config\
3nl.\fedata\pc\audio\
2nn.\fedata\pc\art\slides\
2nn.\fedata\pc\art\track\
3nn.\fedata\pc\movies\
0rn.\fedata\pc\stats\prh\


Binary file added ports/nfs2se/nfs2se/nfs2se
Binary file not shown.
94 changes: 94 additions & 0 deletions ports/nfs2se/nfs2se/nfs2se.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#This is the "Need For Speed II SE" wrapper configuration file.
#Don't modify the "nfs2se.conf.template" file, be sure that you are editing configuration inside home directory (created during the first run):
# Linux: "~/.nfs2se/nfs2se.conf",
# Windows: "%AppData%\.nfs2se\nfs2se.conf".
#Leave empty line at the end of the file!
#Remove "#" from the beginning of the line to apply the configuration!

#UseOnlyOneCPU:
# 0 - The game can use more than one CPU (can be unstable)
# 1 - The game can use only the first CPU (can be more stable, default)
#StartInFullScreen:
# 0 - The game runs in window
# 1 - The game runs in full screen (default)
#VSync:
# -1 - Don't change
# 0 - VSync disabled
# 1 - VSync enabled (default)
# >1 - VSync enabled, limit the framerate
#MSAA (Multisample antialiasing):
# 0 - Don't change (default)
# 1 - Disable MSAA
# 2, 4, 8, 16 - Enable MSAA. If not supported, the game probably won't run.
#UseWindowSizeForFullScreen:
# 0 - Don't change screen size (default)
# 1 - Use screen size from "WindowSize"
#WindowSize:
# Type your own window size (default: 640x480)
#KeepAspectRatio:
# 0 - Fills the entire window
# 1 - Keeps the original aspect ratio (4:3, default)
#Joystick0AxisValueShift:
# Specify the number to shift value for the first axis in first joystick (simple deadzone compensation)
#Joystick1AxisValueShift:
# Specify the number to shift value for the first axis in second joystick (simple deadzone compensation)
#Joystick0Axes:
# Specify which axes will be used in game for first joystick. NFS2SE supports only 4 axes (e.g. 0,12,13,14:0,1,1,1 or 0,1,4,5:0,0,0,0 or 0,1,2,5:0,0,0,0)
# The numbers after colon chooses axis type (0 - normal axis, 1 - half axis, -1 - inverted half axis)
#Joystick1Axes:
# Specify which axes will be used in game for second joystick. NFS2SE supports only 4 axes.
# The numbers after colon chooses axis type (0 - normal axis, 1 - half axis, -1 - inverted half axis)
#Joystick0Buttons:
# Specify which buttons will be used in game for first joystick. Value less than 0 - disabled. NFS2SE supports 15 buttons
#Joystick1Buttons:
# Specify which buttons will be used in game for second joystick. Value less than 0 - disabled. NFS2SE supports 15 buttons
#Joystick0EscButton:
# Specify which button will be used as Escape key
#UseHapticPolar:
# 0 - Use SDL_HAPTIC_STEERING_AXIS
# 1 - Use SDL_HAPTIC_POLAR
#UseSpringForceFeedbackEffect:
# 0 - Don't use Spring Force Feedback Effect (default)
# 1 - Use Spring Force Feedback Effect (experimental)
#ForceFeedbackDevice:
# Specify the Force Feedback device (-1 - auto, default)
#LinearSoundInterpolation:
# 0 - Original samplerate - 22050Hz (default)
# 1 - Linear interpolated sound to 44100Hz (artificial highs)
#UseGlBleginGlEnd:
# Use glBegin(), glEnd() instead of glDrawArrays() - can be slower, disabled by default
#Port1:
# TCP and UDP port (default: 1030)
#Port2:
# Second UDP port for host (default: 1029)
#Bcast:
# Broadcast address for UDP connection (default: 255.255.255.255)
#LinuxCOM1, LinuxCOM2, LinuxCOM3, LinuxCOM4:
# Full path to serial port device (e.g. /dev/ttyS0)

#UseOnlyOneCPU=1
#StartInFullScreen=1
#VSync=-1
#MSAA=4
#UseWindowSizeForFullScreen=0
#WindowSize=640x480
#KeepAspectRatio=1
#Joystick0AxisValueShift=8448
#Joystick1AxisValueShift=8448
#Joystick0Axes=0,1,2,3:0,0,0,0
#Joystick1Axes=0,1,2,3:0,0,0,0
#Joystick0Buttons=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
#Joystick1Buttons=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
#Joystick0EscButton=-1
#UseHapticPolar=0
#UseSpringForceFeedbackEffect=0
#ForceFeedbackDevice=-1
#LinearSoundInterpolation=1
#UseGlBleginGlEnd=0
#Port1=1030
#Port2=1029
#Bcast=255.255.255.255
LinuxCOM1=/dev/ttyS0
LinuxCOM2=/dev/ttyS1
LinuxCOM3=/dev/ttyUSB0
LinuxCOM4=/dev/ttyUSB1
34 changes: 34 additions & 0 deletions ports/nfs2se/nfs2se/nfs2se.gptk
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
back = esc
start = enter

a = up
b = down
x = b
y = space

l1 = z
l2 = c
r1 = a
r2 = h

up = up
down = down
left = left
right = right

left_analog_up = up
left_analog_down = down
left_analog_left = left
left_analog_right = right

right_analog_up = \"
right_analog_down = \"
right_analog_left = \"
right_analog_right = \"

deadzone_mode = scaled_radial
deadzone = 2000
deadzone_scale = 8
deadzone_delay = 16
mouse_scale = 512
mouse_delay = 16
Binary file added ports/nfs2se/nfs2se/text.eng
Binary file not shown.
Binary file added ports/nfs2se/nfs2se/text.fre
Binary file not shown.
Binary file added ports/nfs2se/nfs2se/text.ger
Binary file not shown.
Binary file added ports/nfs2se/nfs2se/text.ita
Binary file not shown.
Binary file added ports/nfs2se/nfs2se/text.spa
Binary file not shown.
Binary file added ports/nfs2se/nfs2se/text.swe
Binary file not shown.
28 changes: 28 additions & 0 deletions ports/nfs2se/port.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"version": 2,
"name": "nfs2se.zip",
"items": [
"Need For Speed II SE.sh",
"nfs2se"
],
"items_opt": [],
"attr": {
"title": "Need For Speed II SE",
"porter": [
"Cebion"
],
"desc": "\"Need for Speed II\" is a racing video game released in the late 1990s, featuring a variety of exotic cars and tracks from around the world, allowing players to race against computer-controlled opponents or human players in various modes, including single race and tournament.",
"inst": "Copy FEDATA and GAMEDATA directories from the Need For Speed™ II SE original CD-ROM into nfs2se directory. Folder needs to be +500 Mb.",
"genres": [
"racing"
],
"image": null,
"rtr": false,
"exp": false,
"runtime": null,
"reqs": []
"arch": [
"armhf"
]
}
}
Binary file added ports/nfs2se/screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 87efa50

Please sign in to comment.