Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve .exe matching accuracy #303

Merged
merged 8 commits into from
Nov 4, 2024
Merged
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
3 changes: 2 additions & 1 deletion config/ghidra_ns_to_obj.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
AnmManager,th06::AnmManager
AnmVm,th06::AnmVm
AsciiManager,th06::AsciiManager,th06::StageMenu
BombData,th06::BombData
BulletManager,th06::BulletManager
Chain,th06::Chain,th06::ChainElem
EclManager,th06::EclManager
Expand All @@ -25,7 +26,7 @@ Player,th06::Player
Rng,th06::Rng
ScreenEffect,th06::ScreenEffect
SoundPlayer,th06::SoundPlayer
Stage,th06::Stage
Stage,th06::Stage,th06::AnmManager::ExecuteAnmIdx
Supervisor,th06::Supervisor,th06::Controller
TextHelper,th06::TextHelper
utils,th06::utils
Expand Down
1 change: 1 addition & 0 deletions config/implemented.csv
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ th06::TextHelper::GetFormatInfo
th06::TextHelper::InvertAlpha
th06::TextHelper::CopyTextToSurface
th06::Supervisor::AddedCallback
th06::Supervisor::DeletedCallback
th06::Supervisor::ReleasePbg3
th06::Supervisor::LoadPbg3
th06::Supervisor::RegisterChain
Expand Down
4 changes: 2 additions & 2 deletions config/stubbed.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ th06::ResultScreen::ParseClrd
th06::ResultScreen::ParsePscr
th06::ResultScreen::ParseCatk
th06::ResultScreen::GetHighScore
th06::Supervisor::DeletedCallback
th06::MusicRoom::RegisterChain
th06::ResultScreen::RegisterChain
th06::ResultScreen::ReleaseScoreDat
Expand All @@ -18,4 +17,5 @@ th06::ReplayManager::StopRecording
th06::ReplayManager::SaveReplay
th06::ReplayManager::ValidateReplayData
th06::ScreenEffect::DrawSquare
th06::Pbg3Archive::Pbg3Archive
th06::TextHelper::ReleaseTextBuffer
th06::Pbg3Archive::Pbg3Archive
8 changes: 8 additions & 0 deletions objdiff.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@

"reverse_fn_order": false
},
{
"name": "BombData",

"target_path": "build/objdiff/orig/BombData.obj",
"base_path": "build/objdiff/reimpl/BombData.obj",

"reverse_fn_order": false
},
{
"name": "BulletManager",

Expand Down
43 changes: 24 additions & 19 deletions scripts/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def configure(build_type):
writer.variable("link", "link.exe")
writer.variable(
"th06_link_flags",
"/subsystem:windows /machine:X86 /filealign:4096 /incremental:no",
"/subsystem:windows /machine:X86 /filealign:4096 /incremental:no /opt:ref",
)

writer.variable("msvc_deps_prefix", "Note: including file:")
Expand Down Expand Up @@ -92,36 +92,41 @@ def configure(build_type):

cxx_sources = [
"AsciiManager",
"BulletData",
"BulletManager",
"Chain",
"AnmVm",
"Stage",
"BombData",
"EclManager",
"Enemy", # ECL instructions.
"EffectManager",
"Ending",
"EnemyManager",
"Enemy",
"BulletManager",
"Gui",
"GuiImpl",
"GameManager",
"Chain",
# Controller
"FileSystem",
"Supervisor",
"GameErrorContext",
"Rng",
"utils",
"TextHelper",
"GameWindow",
"MainMenu",
"ItemManager",
"main",
"GameWindow",
"MidiOutput",
"EffectManager",
"Supervisor",
# MusicRoom
"Player",
# ReplayManager
# ResultScreen
"ScreenEffect",
"SoundPlayer",
"Player",
"Stage",
"AnmVm",
"AnmManager",
"GameManager",
"Gui",
"GuiImpl",
"Rng",
"utils",
"ZunTimer",
"MainMenu",
"zwave",
"main",
"BulletData",
"ZunTimer",
]

pbg3_sources = [
Expand Down
11 changes: 0 additions & 11 deletions src/AnmManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,17 +619,6 @@ ZunResult AnmManager::LoadAnm(i32 anmIdx, char *path, i32 spriteIdxOffset)
return ZUN_SUCCESS;
}

void AnmManager::ExecuteAnmIdx(AnmVm *vm, i32 anmFileIdx)
{
vm->anmFileIndex = anmFileIdx;
vm->pos = D3DXVECTOR3(0, 0, 0);
vm->posOffset = D3DXVECTOR3(0, 0, 0);
vm->fontHeight = 15;
vm->fontWidth = 15;

SetAndExecuteScript(vm, this->scripts[anmFileIdx]);
}

#pragma var_order(curInstr, local_c, local_10, local_14, local_18, local_1c, local_20, nextInstr, local_28, local_2c, \
local_30, local_34, local_38, local_3c, local_48, local_54, local_60, local_68, local_6a, local_6c, \
local_70, curTime, scaleInterpCurTime, local_b4, local_b8, local_c0, local_c4, local_c8, local_cc, \
Expand Down
10 changes: 5 additions & 5 deletions src/AnmVm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

namespace th06
{
AnmVm::AnmVm()
{
this->activeSpriteIndex = -1;
}

void AnmVm::Initialize()
{
this->uvScrollPos.y = 0.0;
Expand All @@ -31,4 +26,9 @@ void AnmVm::Initialize()
this->posInterpEndTime = 0;
this->currentTimeInScript.Initialize();
}

AnmVm::AnmVm()
{
this->activeSpriteIndex = -1;
}
}; // namespace th06
2 changes: 1 addition & 1 deletion src/AnmVm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ enum AnmVmAnchor
};

union AnmVmFlags {
u32 flags;
u16 flags;
struct
{
u32 isVisible : 1;
Expand Down
Loading
Loading