Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,38 @@ cmake --build --preset "${env:_RELEASE_CONFIGURATION}"
# Start the packaging
mkdir .dist\pkg\FF7_1998 | Out-Null
mkdir .dist\pkg\FF8_2000 | Out-Null
mkdir .dist\pkg\FF8_Remastered | Out-Null
mkdir .dist\pkg\FFNx_Steam | Out-Null
Copy-Item -R "$releasePath\bin\*" .dist\pkg\FF7_1998
Copy-Item -R "$releasePath\bin\*" .dist\pkg\FF8_2000
Copy-Item -R "$releasePath\bin\*" .dist\pkg\FF8_Remastered
Copy-Item -R "$releasePath\bin\*" .dist\pkg\FFNx_Steam
Remove-Item .dist\pkg\FF7_1998\FF8.reg
Remove-Item .dist\pkg\FF7_1998\ffnx_steam_api.dll
Remove-Item .dist\pkg\FF8_2000\FF7.reg
Remove-Item .dist\pkg\FF8_2000\ffnx_steam_api.dll
Remove-Item .dist\pkg\FF8_Remastered\FF7.reg
Remove-Item .dist\pkg\FFNx_Steam\FF7.reg
Remove-Item .dist\pkg\FFNx_Steam\FF8.reg
Remove-Item .dist\pkg\FFNx_Steam\FFVIII_EFIGS.dll
Remove-Item .dist\pkg\FFNx_Steam\FFVIII_JP.dll
Remove-Item .dist\pkg\FF7_1998\AF4DN.P
Remove-Item .dist\pkg\FF7_1998\FFVIII_EFIGS.dll
Remove-Item .dist\pkg\FF7_1998\FFVIII_JP.dll
Remove-Item .dist\pkg\FF8_2000\AF4DN.P
Remove-Item .dist\pkg\FF8_2000\FFVIII_EFIGS.dll
Remove-Item .dist\pkg\FF8_2000\FFVIII_JP.dll
Remove-Item .dist\pkg\FF8_Remastered\AF4DN.P
Move-Item .dist\pkg\FF7_1998\FF7.reg .dist\pkg\FF7_1998\FFNx.reg
Move-Item .dist\pkg\FF8_2000\FF8.reg .dist\pkg\FF8_2000\FFNx.reg
Move-Item .dist\pkg\FF8_Remastered\FF8.reg .dist\pkg\FF8_Remastered\FFNx.reg
Move-Item .dist\pkg\FF8_2000\FFNx.dll .dist\pkg\FF8_2000\eax.dll
Move-Item .dist\pkg\FF8_Remastered\FFNx.dll .dist\pkg\FF8_Remastered\eax.dll
Move-Item .dist\pkg\FFNx_Steam\FFNx.dll .dist\pkg\FFNx_Steam\AF3DN.P

7z a ".\.dist\${env:_RELEASE_NAME}-FF7_1998-${env:_RELEASE_VERSION}.zip" ".\.dist\pkg\FF7_1998\*"
7z a ".\.dist\${env:_RELEASE_NAME}-FF8_2000-${env:_RELEASE_VERSION}.zip" ".\.dist\pkg\FF8_2000\*"
7z a ".\.dist\${env:_RELEASE_NAME}-FF8_Remastered-${env:_RELEASE_VERSION}.zip" ".\.dist\pkg\FF8_Remastered\*"
7z a ".\.dist\${env:_RELEASE_NAME}-Steam-${env:_RELEASE_VERSION}.zip" ".\.dist\pkg\FFNx_Steam\*"

Remove-Item -Recurse -Force .dist\pkg
86 changes: 83 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,30 @@ target_compile_features(${CHOCO_RELEASE_NAME}
)
target_link_options(${CHOCO_RELEASE_NAME} PRIVATE /PDBALTPATH:${CHOCO_RELEASE_NAME}.pdb PRIVATE /DEF:${CMAKE_SOURCE_DIR}/misc/${CHOCO_RELEASE_NAME}.def)

# Remastered proxy
set(REMASTERED_RELEASE_NAME "FFNx-Remastered-Proxy")
file(GLOB_RECURSE remastered_source_files "${CMAKE_SOURCE_DIR}/remastered-proxy/*.cpp")
add_library(${REMASTERED_RELEASE_NAME} SHARED ${remastered_source_files} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
target_include_directories(
${REMASTERED_RELEASE_NAME}
PRIVATE "${CMAKE_SOURCE_DIR}/remastered-proxy"
)
target_compile_options(
${REMASTERED_RELEASE_NAME}
PRIVATE /DVERSION="${_DLL_VERSION}"
PRIVATE /D_CRT_SECURE_NO_WARNINGS
PRIVATE /DNOMINMAX
PRIVATE /Zc:strictStrings-
PRIVATE /Zc:__cplusplus
PRIVATE /Zc:preprocessor
PRIVATE /Qpar
PRIVATE /MP
)
target_compile_features(${REMASTERED_RELEASE_NAME}
PRIVATE cxx_std_20
)
target_link_options(${REMASTERED_RELEASE_NAME} PRIVATE /PDBALTPATH:${REMASTERED_RELEASE_NAME}.pdb PRIVATE /DEF:${CMAKE_SOURCE_DIR}/misc/${REMASTERED_RELEASE_NAME}.def)

# Include all the source code files
file(GLOB_RECURSE source_files "${CMAKE_SOURCE_DIR}/src/*.cpp")

Expand All @@ -148,7 +172,7 @@ cmrc_add_resource_library(
)

add_library(${RELEASE_NAME} SHARED ${source_files} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
add_dependencies(${RELEASE_NAME} ${CHOCO_RELEASE_NAME})
add_dependencies(${RELEASE_NAME} ${CHOCO_RELEASE_NAME} ${REMASTERED_RELEASE_NAME})
target_include_directories(
${RELEASE_NAME}
PRIVATE "${CMAKE_SOURCE_DIR}/src"
Expand Down Expand Up @@ -186,7 +210,6 @@ target_link_libraries(
imgui::imgui
pugixml::pugixml
tomlplusplus::tomlplusplus
STEAMWORKSSDK::STEAMWORKSSDK
xxHash::xxhash
lz4::lz4
Vorbis::vorbisfile
Expand Down Expand Up @@ -307,10 +330,21 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E rename
${CMAKE_BINARY_DIR}/bin/${CHOCO_RELEASE_NAME}.dll
${CMAKE_BINARY_DIR}/bin/AF4DN.P
# remastered proxy .dll
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${REMASTERED_RELEASE_NAME}.dll
${CMAKE_BINARY_DIR}/bin
# rename remastered .dll to FFVIII_EFIGS.dll
COMMAND ${CMAKE_COMMAND} -E rename
${CMAKE_BINARY_DIR}/bin/${REMASTERED_RELEASE_NAME}.dll
${CMAKE_BINARY_DIR}/bin/FFVIII_EFIGS.dll
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_BINARY_DIR}/bin/FFVIII_EFIGS.dll
${CMAKE_BINARY_DIR}/bin/FFVIII_JP.dll
# steam_api.dll
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/tools/steamworkssdk/steam_api.dll
${CMAKE_BINARY_DIR}/bin
${CMAKE_BINARY_DIR}/bin/ffnx_steam_api.dll
# .pdb
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${RELEASE_NAME}.pdb
Expand Down Expand Up @@ -610,3 +644,49 @@ if(NOT "${FF7_STEAM_RERELEASE_GAME_PATH}" STREQUAL "")
${FF7_STEAM_RERELEASE_GAME_PATH}/FFNx.toml
)
endif()

# Copy FFNx release to FF8 Remastered Steam game path if installed
execute_process(
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/utils/FindSteamGamePath 1026680
OUTPUT_VARIABLE FF8_REMASTERED_GAME_PATH
ERROR_VARIABLE FF8_REMASTERED_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT "${FF8_REMASTERED_GAME_PATH}" STREQUAL "")
cmake_path(CONVERT "${FF8_REMASTERED_GAME_PATH}" TO_CMAKE_PATH_LIST FF8_REMASTERED_GAME_PATH)
# Ensure FFNx.toml exists so the copy on build does not error on fresh installs
if(NOT EXISTS "${FF8_REMASTERED_GAME_PATH}/FFNx.toml")
# Copy file if it doesn't exist
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/misc/FFNx.toml" DESTINATION "${FF8_REMASTERED_GAME_PATH}/")
endif()
add_custom_command(
TARGET ${RELEASE_NAME}
POST_BUILD
COMMAND echo Copying ${RELEASE_NAME} ${_DLL_VERSION} release to ${FF8_REMASTERED_GAME_PATH}...
# Preserve the current FFNx.toml
COMMAND ${CMAKE_COMMAND} -E rename
${FF8_REMASTERED_GAME_PATH}/FFNx.toml
${FF8_REMASTERED_GAME_PATH}/FFNx.toml.bak
# Prevent steam_api.dll to be deployed
COMMAND ${CMAKE_COMMAND} -E remove
${CMAKE_BINARY_DIR}/bin/steam_api.dll
# Copy all dist files
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_BINARY_DIR}/bin
${FF8_REMASTERED_GAME_PATH}
# Delete previous eax.dll
COMMAND ${CMAKE_COMMAND} -E remove
${FF8_REMASTERED_GAME_PATH}/eax.dll
# Rename FFNx.dll to eax.dll
COMMAND ${CMAKE_COMMAND} -E rename
${FF8_REMASTERED_GAME_PATH}/FFNx.dll
${FF8_REMASTERED_GAME_PATH}/eax.dll
# Delete the new copied FFNx.toml
COMMAND ${CMAKE_COMMAND} -E remove
${FF8_REMASTERED_GAME_PATH}/FFNx.toml
# Bring back the existing FFNx.toml
COMMAND ${CMAKE_COMMAND} -E rename
${FF8_REMASTERED_GAME_PATH}/FFNx.toml.bak
${FF8_REMASTERED_GAME_PATH}/FFNx.toml
)
endif()
17 changes: 16 additions & 1 deletion docs/how_to_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ external_music_ext = "akb"
#### [2000 Squaresoft Release](https://www.mobygames.com/game/windows/final-fantasy-viii)

0. Install the game on this path: `C:\Games\Final Fantasy VIII`
1. Update your game to v1.2 ( you can find a collection here: https://www.ff8.fr/telechargements/programmes )
1. Update your game to v1.2 ( you can find a collection here: [FF8.fr download page](https://www-ff8-fr.translate.goog/telechargements/programmes?_x_tr_sl=fr&_x_tr_tl=en&_x_tr_hl=fr&_x_tr_pto=wapp#archives_conserve_pour_la_posterite) )
2. Download the latest `FFNx-FF8_2000` release here: https://github.com/julianxhokaxhiu/FFNx/releases
3. Extract the ZIP content next to `ff8.exe` file
4. Double click on [`FFNx.reg`](https://github.com/julianxhokaxhiu/FFNx/blob/master/misc/FF8.reg)
Expand All @@ -102,6 +102,21 @@ external_music_ext = "akb"
5. Replace all files when asked.
6. Enjoy!

#### Early alpha [Remastered Release](https://store.steampowered.com/app/1026680/FINAL_FANTASY_VIII__REMASTERED/)

**Warning:** The compatibilty with the Remastered version is currently uncomplete. You will most likely encounters crashes
in battle and model rendering issues.

0. Install the game using Steam
1. Open the installation directory of the game ( see [How to access game files](https://steamcommunity.com/sharedfiles/filedetails/?id=760447682) )
2. Download the FF8 patch v1.2 ( you can find a collection here: [FF8.fr download page](https://www-ff8-fr.translate.goog/telechargements/programmes?_x_tr_sl=fr&_x_tr_tl=en&_x_tr_hl=fr&_x_tr_pto=wapp#archives_conserve_pour_la_posterite) )
3. Extract the patch ZIP content next to `FFVIII_LAUNCHER.exe` file
4. Rename `FF8.exe` to `FF8.ffnx`
5. Download the latest `FFNx-FF8_Remastered` release here: https://github.com/julianxhokaxhiu/FFNx/releases
6. Extract the FFNx ZIP content next to `FFVIII_LAUNCHER.exe` file
7. Replace all files when asked.
8. Enjoy!

## Mod Launchers

### 7thHeaven 2.4.0+
Expand Down
25 changes: 25 additions & 0 deletions misc/FFNx-Remastered-Proxy.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
;*****************************************************************************;
; Copyright (C) 2009 Aali132 ;
; Copyright (C) 2018 quantumpencil ;
; Copyright (C) 2018 Maxime Bacoux ;
; Copyright (C) 2020 myst6re ;
; Copyright (C) 2020 Chris Rizzitello ;
; Copyright (C) 2020 John Pritchard ;
; Copyright (C) 2025 Julian Xhokaxhiu ;
; ;
; This file is part of FFNx ;
; ;
; FFNx 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 3 of the License ;
; ;
; FFNx is distributed in the hope that it will be useful, ;
; but WITHOUT ANY WARRANTY; without even the implied warranty of ;
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;
; GNU General Public License for more details. ;
;*****************************************************************************;

LIBRARY FFVIII_EFIGS.dll
EXPORTS
; Required for the Remastered driver injection
runGame
19 changes: 16 additions & 3 deletions misc/FFNx.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ borderless = false
#[RESOLUTION]
# Resolution of the game.
# Default (value = 0):
# - Window mode will use 640x480
# - Window mode will use 640x480 (1024x768 on FF8:Remastered)
# - Fullscreen mode will use your desktop resolution
#~~~~~~~~~~~~~~~~~~~~~~~~~~~
window_size_x = 0
Expand Down Expand Up @@ -262,7 +262,7 @@ external_music_sync = false
# - FF7 1998: music/vgmstream ( 7h-era compatibility )
# - FF7 eStore: data/music_ogg
# - FF7 Steam: data/music_ogg
# - FF8 2000/Steam: data/music/dmusic/ogg
# - FF8: data/music/dmusic/ogg
#~~~~~~~~~~~~~~~~~~~~~~~~~~~
external_music_path = ""

Expand Down Expand Up @@ -773,12 +773,25 @@ data_drive = ""
#[HIGH RES FONT]
# Overrides the high res font option if set.
# Available choices are:
# - -1: Default game behavior (High-res on FF8 Steam, honor FF8Config option on FF8 2000)
# - -1: Default game behavior (HD font on remastered, High-res on FF8 Steam, honor FF8Config option on FF8 2000)
# - 0: Low-res font
# - 1: High-res font
# - 2: HD font (remastered only)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~
ff8_high_res_font = -1

#[HD TEXTURES]
# Prevent the game from loading remastered HD PNG textures, this is a list of modules to disable.
# Available choices are:
# - field
# - battle
# - menu
# - cardgame
# - intro
# - world
#~~~~~~~~~~~~~~~~~~~~~~~~~~~
ff8_disable_remastered_hd_textures = []

## DEBUGGING OPTIONS - These options are mostly useful for developers or people reporting crashes. Please do enable them only when required.

# Show the PSX SSIGPU VRAM window
Expand Down
76 changes: 76 additions & 0 deletions remastered-proxy/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/****************************************************************************/
// Copyright (C) 2009 Aali132 //
// Copyright (C) 2018 quantumpencil //
// Copyright (C) 2018 Maxime Bacoux //
// Copyright (C) 2026 myst6re //
// Copyright (C) 2020 Chris Rizzitello //
// Copyright (C) 2020 John Pritchard //
// Copyright (C) 2020 Marcin Gomulak //
// Copyright (C) 2026 Julian Xhokaxhiu //
// Copyright (C) 2023 Cosmos //
// //
// This file is part of FFNx //
// //
// FFNx 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 3 of the License //
// //
// FFNx is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
/****************************************************************************/

#include <filesystem>
#include <windows.h>
#include <winuser.h>

const char processes[][32]{
"FF8.ffnx",
"FF8.exe"
};
const int numProcesses = sizeof(processes) / sizeof(processes[0]);

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
return TRUE;
}

__declspec(dllexport) void __stdcall runGame()
{
int process_to_start = -1;

for (int i = 0; i < numProcesses; i++)
{
if (std::filesystem::exists(processes[i]))
{
process_to_start = i;
}
}

if (process_to_start < 0)
{
MessageBoxA(NULL, "FF8.ffnx/FF8.exe not found", "Error", MB_ICONERROR | MB_OK);
}

// Initialize the process start information
STARTUPINFOA si = STARTUPINFOA();
PROCESS_INFORMATION pi = PROCESS_INFORMATION();
si.cb = sizeof(si);

// Start the process
if (!CreateProcessA(processes[process_to_start], NULL, NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi))
{
MessageBoxA(NULL, "Something went wrong while launching the game.", "Error", MB_ICONERROR | MB_OK);
return;
}

// Wait for the process to finish
WaitForSingleObject(pi.hProcess, INFINITE);

// Close process and thread handles
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);

return;
}
8 changes: 2 additions & 6 deletions src/achievement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
// GNU General Public License for more details. //
/****************************************************************************/

#include <steamworkssdk/isteamutils.h>
#include <steamworkssdk/isteamuserstats.h>
#include <steamworkssdk/isteamuser.h>

#include <numeric>
#include <algorithm>
#include <unordered_set>
Expand Down Expand Up @@ -151,7 +147,7 @@ void SteamManager::OnUserStatsReceived(UserStatsReceived_t *pCallback)
{
ach_trace("%s - received stats and achievements from Steam\n", __func__);
this->isInitialized = true;

// load stats (assume all stats to be integers)
for (auto statName: this->stats) {
int statValue;
Expand Down Expand Up @@ -980,7 +976,7 @@ void SteamAchievementsFF8::unlockMagazineAddictAchievement(const savemap_ff8_ite
}
}
ach_trace("%s - trying to unlock magazine addict achivement (magazines found: %d)\n", __func__, magazines_found.size());

if (magazines_found.size() >= MAGAZINES_TO_COLLECT) {
this->steamManager->setAchievement(MAGAZINES_ADDICT);
}
Expand Down
2 changes: 1 addition & 1 deletion src/achievement.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <memory>
#include <optional>
#include <steamworkssdk/steam_api.h>
#include <array>
#include <unordered_map>
#include <vector>
Expand All @@ -33,6 +32,7 @@

#include "ff7.h"
#include "ff8/save_data.h"
#include "steam.h"

#define _ACH_ID(id) \
{ \
Expand Down
Loading