Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b1c585f
implement core functionalities for PS2 to Windows port
caprado Nov 12, 2025
6142fc0
Implement utility functions for managing a global pointer array and e…
caprado Nov 13, 2025
fe342cf
Implement Windows timing functionality to replace PS2 timing logic
caprado Jan 3, 2026
8497767
Update upload-artifact action to version 4 in track-progress workflow
caprado Jan 3, 2026
2b5ab63
Update progress data commit to push to progress-data branch instead o…
caprado Jan 3, 2026
8fbbdf5
Add CMakeLists.txt and Windows build script for project setup
caprado Jan 3, 2026
6ac15aa
Merge remote-tracking branch 'origin/main' into categorize/system
caprado Jan 3, 2026
ef2c78f
Update track-progress workflow to push progress data directly to main…
caprado Jan 3, 2026
d8f4d05
Add git pull --rebase before pushing updated progress data
caprado Jan 3, 2026
9ae4bec
Merge branch 'main' into categorize/system
caprado Jan 3, 2026
bb27891
Update progress data commit condition to allow manual workflow dispatch
caprado Jan 3, 2026
7cc87f5
Merge branch 'categorize/system' of https://github.com/caprado/REOF2 …
caprado Jan 3, 2026
0e1e590
Merge remote-tracking branch 'origin/main' into categorize/system
caprado Jan 3, 2026
90a759d
Fix image link in README to use absolute URL for decompilation progre…
caprado Jan 3, 2026
9bee234
Add function integrity verification workflow and script
caprado Jan 3, 2026
0de9443
update extracted functions & tools
caprado Jan 3, 2026
87bb0e3
Refactor: Remove obsolete rendering, resource entry, and graphics buf…
caprado Jan 3, 2026
baa0ece
Classify/Refactor src files
caprado Jan 4, 2026
cdce772
Merge branch 'main' into categorize/system
caprado Jan 4, 2026
e04fc85
Refactor: Remove obsolete documentation comments and enhance function…
caprado Jan 4, 2026
002454b
Merge branch 'categorize/system' of https://github.com/caprado/REOF2 …
caprado Jan 4, 2026
0966481
Add new functions and update documentation
caprado Jan 4, 2026
32a01f0
Add new function hashes and clean up obsolete entries in function_has…
caprado Jan 4, 2026
821e727
Enhance function definition pattern matching to exclude C keywords in…
caprado Jan 4, 2026
2ccc724
Refactor updateGameStateManager
caprado Jan 5, 2026
03f7ffe
Enhance TAG_PATTERN to support category, status, and author formats w…
caprado Jan 5, 2026
96884cf
Add camera input and update systems
caprado May 24, 2026
f9997ca
Refactor game state management and finalize frame processing; add new…
caprado May 24, 2026
8eb4770
Refactor game state management and rendering system
caprado May 24, 2026
beda653
feat: Implement video playback system using ffmpeg
caprado May 24, 2026
a21078b
feat: Enhance demo overlay with attract mode functionality and audio …
caprado May 25, 2026
13d58c8
feat: Update .gitignore to include additional project files and direc…
caprado May 25, 2026
6f03021
Merge remote-tracking branch 'origin/main' into categorize/system
caprado May 25, 2026
88187a1
feat: Add scene initialization function and enhance demo overlay with…
caprado May 25, 2026
93c729c
style: Format documentation comments for better readability
caprado May 25, 2026
6fa09ae
refactor: Update menu item count and improve input handling logic
caprado May 25, 2026
8a4147a
Refactor PS2-specific functions and implement Windows options screen
caprado May 26, 2026
6e6742d
feat: Add documentation comments for game state functions and update …
caprado May 26, 2026
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ badge.svg
Thumbs.db
assets/
.local_docs/
.claude/settings.local.json
docs/ARCHITECTURE.md
docs/FONT_FORMAT.md
tools/build_call_graph.py
tools/check_function_refs.py
tools/extract_iecs_vag.py
tools/fix_function_names.py
tools/fix_src_refs.py
asm.asm
CLAUDE.md
176 changes: 39 additions & 137 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,155 +1,57 @@
cmake_minimum_required(VERSION 3.15)
project(REOF2_Decompilation VERSION 0.1.0 LANGUAGES C CXX)
project(REOF2 VERSION 0.1.0 LANGUAGES C)

# Set C standard
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Build options
option(BUILD_ORIGINAL_EXTRACTED "Include original extracted functions" OFF)
option(BUILD_TESTS "Build test suite" OFF)
add_definitions(-DPLATFORM_WINDOWS)

# Platform detection
if(WIN32)
add_definitions(-DPLATFORM_WINDOWS)
message(STATUS "Building for Windows")
elseif(UNIX)
add_definitions(-DPLATFORM_LINUX)
message(STATUS "Building for Linux")
endif()

# Include directories
include_directories(
${CMAKE_SOURCE_DIR}/src/include
${CMAKE_SOURCE_DIR}/src
)

# Source files - Core System
set(CORE_SOURCES
src/core/entry.c
src/core/hardware.c
src/core/thread.c
)
include_directories(${CMAKE_SOURCE_DIR}/src)

# Source files - Memory Management
set(MEMORY_SOURCES
src/core/memory/allocation.c
src/core/memory/pool.c
)
# Find ffmpeg
find_path(AVCODEC_INCLUDE_DIR libavcodec/avcodec.h)
find_path(AVFORMAT_INCLUDE_DIR libavformat/avformat.h)
find_path(SWSCALE_INCLUDE_DIR libswscale/swscale.h)
find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h)

# Source files - Utilities
set(UTILITY_SOURCES
src/core/utility/array.c
src/core/utility/lookup.c
)
find_library(AVCODEC_LIBRARY avcodec)
find_library(AVFORMAT_LIBRARY avformat)
find_library(SWSCALE_LIBRARY swscale)
find_library(AVUTIL_LIBRARY avutil)
find_library(SWRESAMPLE_LIBRARY swresample)
find_library(OPENAL_LIBRARY openal)

# Source files - Synchronization
set(SYNC_SOURCES
src/core/sync/semaphore.c
)

# Source files - Game Logic
set(GAME_SOURCES
src/game/init.c
src/game/loop.c
src/game/state.c
src/game/rendering.c
src/game/resource.c
src/game/texture_manager.c
)
# Collect all .c files under src/
file(GLOB_RECURSE ALL_SOURCES "src/*.c")

# Source files - I/O
set(IO_SOURCES
src/io/cdrom.c
src/io/filesystem.c
)
add_executable(reof2 ${ALL_SOURCES})

# Combine all sources
set(ALL_SOURCES
${CORE_SOURCES}
${MEMORY_SOURCES}
${UTILITY_SOURCES}
${SYNC_SOURCES}
${GAME_SOURCES}
${IO_SOURCES}
${BOOTSTRAP_SOURCES}
target_include_directories(reof2 PRIVATE
${AVCODEC_INCLUDE_DIR}
${AVFORMAT_INCLUDE_DIR}
${SWSCALE_INCLUDE_DIR}
${AVUTIL_INCLUDE_DIR}
)

# Filter out files that don't exist yet
set(EXISTING_SOURCES)
foreach(source ${ALL_SOURCES})
if(EXISTS ${CMAKE_SOURCE_DIR}/${source})
list(APPEND EXISTING_SOURCES ${source})
else()
message(WARNING "Source file not found: ${source}")
endif()
endforeach()

# Platform abstraction layer
if(WIN32)
set(PLATFORM_SOURCES
src/platform/windows/windows_platform.c
)
# Filter platform sources too
foreach(source ${PLATFORM_SOURCES})
if(EXISTS ${CMAKE_SOURCE_DIR}/${source})
list(APPEND EXISTING_SOURCES ${source})
else()
message(WARNING "Platform source file not found: ${source}")
endif()
endforeach()
endif()

# Game bootstrap
set(BOOTSTRAP_SOURCES
src/game/bootstrap.c
target_link_libraries(reof2
opengl32
gdi32
user32
kernel32
${AVCODEC_LIBRARY}
${AVFORMAT_LIBRARY}
${SWSCALE_LIBRARY}
${AVUTIL_LIBRARY}
${SWRESAMPLE_LIBRARY}
${OPENAL_LIBRARY}
)

# Main executable
if(EXISTING_SOURCES)
add_executable(reof2
src/main.c # Windows entry point wrapper
${EXISTING_SOURCES}
)

# Windows-specific libraries
if(WIN32)
target_link_libraries(reof2
kernel32 # Windows API
user32
)
endif()

# Compiler warnings
if(MSVC)
target_compile_options(reof2 PRIVATE /W4)
else()
target_compile_options(reof2 PRIVATE -Wall -Wextra -Wpedantic)
endif()

# Output directories
set_target_properties(reof2 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
if(MSVC)
target_compile_options(reof2 PRIVATE /W3)
else()
message(FATAL_ERROR "No source files found to compile!")
target_compile_options(reof2 PRIVATE -Wall -Wextra)
endif()

# Optional: Build original extracted functions for reference
if(BUILD_ORIGINAL_EXTRACTED)
file(GLOB EXTRACTED_SOURCES "extracted/*.c")
add_library(extracted_functions STATIC ${EXTRACTED_SOURCES})
target_include_directories(extracted_functions PRIVATE ${CMAKE_SOURCE_DIR}/src/include)
endif()

# Print build configuration
message(STATUS "==============================================")
message(STATUS "REOF2 Decompilation Build Configuration")
message(STATUS "==============================================")
message(STATUS "C Standard: ${CMAKE_C_STANDARD}")
message(STATUS "CXX Standard: ${CMAKE_CXX_STANDARD}")
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Source Files Found: ${CMAKE_CURRENT_LIST_LENGTH}")
message(STATUS "==============================================")
set_target_properties(reof2 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
This project is dedicated to the decompilation and preservation of the PlayStation 2 game "Resident Evil Outbreak File #2". The game binary has been extracted into C code using custom automated decompilation tools. The project is now focused on analyzing, categorizing, and refactoring this raw code into readable, maintainable source code with proper function names, data structures, and documentation. The ultimate goal is to create a documented, buildable version that runs on modern platforms (Windows and Linux) while preserving the original game's behavior.


## Demo

![REOF2 Boot to Menu](docs/media/demo.gif)

## Current Status
The game binary has been extracted into raw C code using decompilation tools. Current focus:
- Analyzing and categorizing 4073 extracted functions by purpose
- Identifying function roles (entry points, memory management, I/O, game logic, etc.)
- Refactoring raw decompiler output into readable, maintainable code
- Replacing generic names (`func_00100230`) with meaningful identifiers
- Documenting data structures and system architecture
- Creating a platform abstraction layer for Windows and Linux support

**Progress:** 4073 functions extracted and ready for analysis. String and data sections included.

The Windows port boots to the main menu with full video, audio, and input.

**Progress:** 4073 functions extracted. Boot-to-menu flow fully ported.

## Project Structure

Expand Down
Loading
Loading