Skip to content

Commit e5e66f3

Browse files
committed
Initial commit
0 parents  commit e5e66f3

25 files changed

+3006
-0
lines changed

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Compiled Static libraries
20+
*.lai
21+
*.la
22+
*.a
23+
*.lib
24+
25+
# Executables
26+
*.exe
27+
*.out
28+
*.app
29+
30+
build/*
31+
build_x86/*
32+
.vscode/*
33+
out/*
34+
.vs/*
35+
rel/*

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "external/spdlog"]
2+
path = external/spdlog
3+
url = https://github.com/gabime/spdlog
4+
[submodule "external/ModUtils"]
5+
path = external/ModUtils
6+
url = https://github.com/CookiePLMonster/ModUtils
7+
[submodule "external/ini-cpp"]
8+
path = external/ini-cpp
9+
url = https://github.com/SSARCandy/ini-cpp

CMakeLists.txt

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# This file is automatically generated from cmake.toml - DO NOT EDIT
2+
# See https://github.com/build-cpp/cmkr for more information
3+
4+
cmake_minimum_required(VERSION 3.15)
5+
6+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
7+
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
8+
endif()
9+
10+
set(CMKR_ROOT_PROJECT OFF)
11+
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
12+
set(CMKR_ROOT_PROJECT ON)
13+
14+
# Bootstrap cmkr and automatically regenerate CMakeLists.txt
15+
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
16+
if(CMKR_INCLUDE_RESULT)
17+
cmkr()
18+
endif()
19+
20+
# Enable folder support
21+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
22+
23+
# Create a configure-time dependency on cmake.toml to improve IDE support
24+
configure_file(cmake.toml cmake.toml COPYONLY)
25+
endif()
26+
27+
project(outrun2006tweaks-proj)
28+
29+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
30+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
31+
32+
set(ASMJIT_STATIC ON CACHE BOOL "" FORCE)
33+
34+
option(ZYDIS_BUILD_TOOLS "" OFF)
35+
option(ZYDIS_BUILD_EXAMPLES "" OFF)
36+
37+
if ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
38+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT")
39+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
40+
41+
# Statically compile runtime
42+
string(REGEX REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
43+
string(REGEX REPLACE "/MD" "/MT" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
44+
string(REGEX REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
45+
string(REGEX REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
46+
47+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
48+
message(NOTICE "Building in Release mode")
49+
endif()
50+
51+
include(FetchContent)
52+
53+
message(STATUS "Fetching zydis (v4.0.0)...")
54+
FetchContent_Declare(zydis
55+
GIT_REPOSITORY
56+
"https://github.com/zyantific/zydis"
57+
GIT_TAG
58+
v4.0.0
59+
)
60+
FetchContent_MakeAvailable(zydis)
61+
62+
message(STATUS "Fetching safetyhook (629558c64009a7291ba6ed5cfb49187086a27a47)...")
63+
FetchContent_Declare(safetyhook
64+
GIT_REPOSITORY
65+
"https://github.com/cursey/safetyhook"
66+
GIT_TAG
67+
629558c64009a7291ba6ed5cfb49187086a27a47
68+
)
69+
FetchContent_MakeAvailable(safetyhook)
70+
71+
# Target: spdlog
72+
set(spdlog_SOURCES
73+
"external/spdlog/src/async.cpp"
74+
"external/spdlog/src/bundled_fmtlib_format.cpp"
75+
"external/spdlog/src/cfg.cpp"
76+
"external/spdlog/src/color_sinks.cpp"
77+
"external/spdlog/src/file_sinks.cpp"
78+
"external/spdlog/src/spdlog.cpp"
79+
"external/spdlog/src/stdout_sinks.cpp"
80+
cmake.toml
81+
)
82+
83+
add_library(spdlog STATIC)
84+
85+
target_sources(spdlog PRIVATE ${spdlog_SOURCES})
86+
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${spdlog_SOURCES})
87+
88+
target_compile_definitions(spdlog PUBLIC
89+
SPDLOG_COMPILED_LIB
90+
)
91+
92+
target_include_directories(spdlog PUBLIC
93+
"external/spdlog/include"
94+
)
95+
96+
# Target: outrun2006tweaks
97+
set(outrun2006tweaks_SOURCES
98+
"src/Proxy.cpp"
99+
"src/dllmain.cpp"
100+
"src/hook_mgr.cpp"
101+
"src/hooks_framerate.cpp"
102+
"src/hooks_graphics.cpp"
103+
"src/Proxy.def"
104+
"src/Resource.rc"
105+
"external/ModUtils/Patterns.cpp"
106+
"src/Proxy.hpp"
107+
"src/game.hpp"
108+
"src/hook_mgr.hpp"
109+
"src/plugin.hpp"
110+
"src/resource.h"
111+
"external/ModUtils/Patterns.h"
112+
"external/ModUtils/MemoryMgr.h"
113+
cmake.toml
114+
)
115+
116+
add_library(outrun2006tweaks SHARED)
117+
118+
target_sources(outrun2006tweaks PRIVATE ${outrun2006tweaks_SOURCES})
119+
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${outrun2006tweaks_SOURCES})
120+
121+
target_compile_definitions(outrun2006tweaks PUBLIC
122+
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
123+
)
124+
125+
target_compile_features(outrun2006tweaks PUBLIC
126+
cxx_std_20
127+
)
128+
129+
target_compile_options(outrun2006tweaks PUBLIC
130+
"/GR-"
131+
"/GS-"
132+
"/bigobj"
133+
"/EHa"
134+
"/MP"
135+
)
136+
137+
target_include_directories(outrun2006tweaks PUBLIC
138+
"shared/"
139+
"src/"
140+
"include/"
141+
"external/ModUtils/"
142+
"external/ini-cpp/ini/"
143+
)
144+
145+
target_link_libraries(outrun2006tweaks PUBLIC
146+
spdlog
147+
safetyhook
148+
version.lib
149+
)
150+
151+
target_link_options(outrun2006tweaks PUBLIC
152+
"/DEBUG"
153+
"/OPT:REF"
154+
"/OPT:ICF"
155+
)
156+
157+
set_target_properties(outrun2006tweaks PROPERTIES
158+
OUTPUT_NAME
159+
dinput8
160+
SUFFIX
161+
.dll
162+
RUNTIME_OUTPUT_DIRECTORY_RELEASE
163+
"${CMAKE_BINARY_DIR}/bin/${CMKR_TARGET}"
164+
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO
165+
"${CMAKE_BINARY_DIR}/bin/${CMKR_TARGET}"
166+
LIBRARY_OUTPUT_DIRECTORY_RELEASE
167+
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
168+
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO
169+
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
170+
ARCHIVE_OUTPUT_DIRECTORY_RELEASE
171+
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
172+
ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO
173+
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
174+
)
175+

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 emoose
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Outrun2006Tweaks.ini

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[Performance]
2+
# Framelimit: The max framerate for the game to use, this will also override the fullscreen refresh rate that the game requests.
3+
# Set to 0 to disable this framelimiter, in case you want to use an external one instead.
4+
FramerateLimit = 60
5+
6+
# FramerateFastLoad: Unlimits the framerate during load screens to help reduce load times.
7+
# (disabling vsync may improve this even more)
8+
FramerateFastLoad = true
9+
10+
# FramerateUnlockExperimental: forces game to update at 60Hz, while rendering can run at a higher rate (experimental!)
11+
# Prevents game from speeding up when playing with FramerateLimit above 60FPS.
12+
# Though since game is still running at 60Hz internally, so this isn't as good as a true framerate unlock, but might still be useful for some.
13+
# (currently higher FPS has issues with certain animated textures / UI elements being drawn too quickly, not too noticeable at 120/144, but can be disorientating at 3000+FPS)
14+
# Should be fine to leave this enabled in most cases, but if you have issues feel free to disable this here.
15+
FramerateUnlockExperimental = true
16+
17+
[Window]
18+
# WindowedBorderless: Forces windowed mode to become borderless, also fixes positioning of it to 0,0.
19+
# Make sure to edit outrun2006.ini and change "DX/WINDOWED = 0" to "DX/WINDOWED = 1" for borderless to become active.
20+
WindowedBorderless = true
21+
22+
# WindowedHideMouseCursor: Hides mouse cursor while game window is active.
23+
WindowedHideMouseCursor = true
24+
25+
# DisableDPIScaling: Disables DPI scaling on game window, can help fix issues when screen DPI is set above 100%
26+
DisableDPIScaling = true
27+
28+
[Graphics]
29+
# AnisotropicFiltering: Level of AF for game to use, 1 - 16, 0 to leave it at games default.
30+
AnisotropicFiltering = 16
31+
32+
# TransparencySupersampling: Allows game to enable transparency supersampling, heavily reducing aliasing on things like barriers or the cloth around the track edge.
33+
# May only work on NVIDIA cards.
34+
TransparencySupersampling = true
35+
36+
# ScreenEdgeCullFix: Fixes issues with certain stage objects being culled out before they reach edge of screen when playing at non-4:3 aspect ratio.
37+
ScreenEdgeCullFix = true
38+
39+
# DisableVehicleLODs: Disables LODs on vehicles, reducing the ugly pop-in they have.
40+
# Likely has a tiny performance hit, probably not noticeable on modern machines.
41+
DisableVehicleLODs = true
42+
43+
# DisableStageCulling: Disables culling of certain stage objects, so most distant objects won't obviously pop in to view.
44+
DisableStageCulling = true

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Outrun2006Tweaks
2+
A wrapper DLL that can patch in some minor fixes & tweaks into Outrun 2006: Coast 2 Coast.
3+
4+
### Features
5+
- Game can now run in borderless windowed mode; mouse cursor will now be hidden while game is active
6+
- Adds a built-in framelimiter to prevent game from speeding up
7+
- (experimentally adds a fix to allow game to run at higher FPS without speedup too, more info below)
8+
- Fixes objects being culled out before reaching edge of screen
9+
- Allows disabling vehicle LODs to reduce the ugly pop-in of them
10+
- Disables culling of certain stage objects
11+
- Can force anisotropic filtering level & enable transparency supersampling, greatly reducing aliasing around the edges of track.
12+
- Automatically disables DPI scaling on the game window, fixing scaling issues with certain setups
13+
- Allows game to load in lens flare data from correct path if necessary, fixing lens flare issues.
14+
15+
All of the above can be toggled/customized via the Outrun2006Tweaks.ini file.
16+
17+
There's also a semi-experimental fix to allow running above 60FPS without speedup, by locking the games tickrate to 60FPS while draw-rate is unlimited.
18+
Since the game will still internally update at 60FPS this won't give as much benefit as a true framerate-unlock though.
19+
(some things like animated textures & UI text also unfortunately have speed issues with it...)
20+
21+
### Setup
22+
As the Steam release is packed with an ancient steamstub - which doesn't seem to work with DLL wrappers - an unpacked version of the game EXE is included with this tweaks pack.
23+
24+
This replacement EXE should be compatible with both the Steam release and the original DVD.
25+
26+
To set it up just extract the files from the release ZIP into your `Outrun2006 Coast 2 Coast` folder, where `OR2006C2C.EXE` is located, replacing the original EXE.
27+
28+
After that you can edit the `Outrun2006Tweaks.ini` to customize the tweaks to your liking.
29+
30+
### TODO
31+
- even with LODs & culling disabled some distant cars still pop into view, can distance of them loading in be increased?
32+
- likewise certain parts of the stage have pop-in, usually happens when some part is obscured by some other geometry, occlusion culling maybe?
33+
- car shadow improvements? seems player car uses different shadowing to other cars, could that be added to those too?
34+
- (the existing car shadows also seem to disappear after some distance, could it be increased?)
35+
- input improvements: deadzone, rumble?
36+
- fix broken car horn (haven't seen any code for it yet though...)
37+
- game retiming? probably a pipe dream - seems game is meant for 60.2Hz tickrate, lots of things coded for that & using 0.0166112... frametimes
38+
- a way to change music mid-race would be sweet
39+
- intro/splash skip
40+
41+
### Thanks
42+
Thanks to [debugging.games](http://debugging.games) for hosting debug symbols for Outrun 2 SP (Lindburgh), very useful for looking into Outrun2006.

build_vs2022.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
git pull --recurse-submodules
2+
git submodule update --init --recursive
3+
mkdir build
4+
cd build
5+
cmake .. -G "Visual Studio 17 2022" -A Win32
6+
cmake --build . --config Release

0 commit comments

Comments
 (0)