Skip to content

FhCall update - #237

Open
Andrewki44 wants to merge 22 commits into
mainfrom
FhCallUpdate
Open

FhCall update#237
Andrewki44 wants to merge 22 commits into
mainfrom
FhCallUpdate

Conversation

@Andrewki44

Copy link
Copy Markdown
Member

Resolves #236

Blocked By #225 & fahrenheit-crew/fahrenheit#161

@Andrewki44
Andrewki44 requested a review from a team June 10, 2026 03:21
@Andrewki44 Andrewki44 changed the title Fh call update FhCall update Jun 10, 2026

@EvelynTSMG EvelynTSMG left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes here and there. I expect many more changes here after you work on fahrenheit-crew/fahrenheit#160, so do not bother doing these first.

Comment thread src/modules/captures.cs
Comment thread src/modules/captures.cs Outdated
Comment thread src/modules/deathlink.cs Outdated
Comment thread src/modules/overdrives.cs Outdated
private FhModuleHandle<ArchipelagoFFXModule> _ffx_interop_handle;
private ArchipelagoFFXModule? _ffx_interop;

private FhMethodHandle<FhGCall.CT_RetInt> h_ret_doesChrKnowCommand => new(new FhMethodLocation("FFX.exe", 0x3A30C0));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a comment such as at line 32.
It should receive the same TODO as that line as well.

Comment thread src/modules/overdrives.cs Outdated
Comment thread src/customization.cs
Comment on lines +14 to +27
public enum CustomizationStatusEnum : byte {
NONE = 0x0,
AEON_AVAILABLE = 0x4,
AEON_ALREADY_LEARNED = 0x5,
AEON_CANNOT_LEARN_WITHOUT_KEY = 0x6,
AEON_NOT_ENOUGH_ITEMS = 0x7,

GEAR_AVAILABLE = 0xb,
GEAR_ALREADY_APPLIED = 0xc,
GEAR_NOT_ENOUGH_ITEMS = 0xe,
GEAR_CONFLICTING = 0xf, // (same group but lower level) or (same group, same level, different international bonus) or (international bonus is 0xfe AND gear has any ability with 0xff international bonus)
GEAR_NO_SLOTS = 0x10,
//NONE = 0x11
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've ported the CustomizationStatusEnum from the deleted overdrive_delegates.cs, but not the MenuListEnum which you use later?
As a sidenote, as MenuListEnum was renamed to MenuList, so too should CustomizationStatusEnum be renamed to CustomizationStatus.

Comment thread src/hooks.cs Outdated
// Drawing
public static TOMkpCrossExtMesFontLClutTypeRGBA _TOMkpCrossExtMesFontLClutTypeRGBA;
public static ToMakeBtlEasyFont _ToMakeBtlEasyFont;
public static void AtelSetUpCallFunc(int id, nint nameSpacePtr) => FhXCall.h_AtelSetUpCallFunc.fnptr!(id, nameSpacePtr);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is based on #225, I do not believe we should add a static property like this, which is functionally just shorthand for a longer line.

Comment thread src/hooks.cs Outdated
Comment on lines +26 to +27
public static char* get_event_name(uint event_id) => FhXCall.h_AtelGetEventName.fnptr!(event_id);
public static int atel_stack_pop(int* param_1, AtelStack* atelStack) => FhXCall.h_AtelStackPop.fnptr!(param_1, atelStack);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is based on #225, I do not believe we should add static properties like these, which are functionally just shorthand for a longer line.

Comment thread src/hooks.cs Outdated

return _FUN_007905a0.orig_fptr(item_id, amount);
FhXCall.h_MsSaveItemUse.chain_from(h_give_item).fnptr!(item_id, amount);
return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return is pointless.

Comment thread src/hooks.cs
Comment on lines +3306 to +3307
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public unsafe delegate nint FMOD_Bank_Post_Load(nint param_1, nint param_2, nint param_3, nint param_4);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used? Why isn't it Cdecl over StdCall?

@EvelynTSMG
EvelynTSMG requested a review from Rurusachi July 28, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updated FhCall Compatibility

2 participants