maybe for console enable check? see xref to MainWndProc sometimes also string passed: 600976
pops 1 arg
not an exact copy
not an exact copy
Called by CreateAnim_CNFSAnimBankPool
Called by CreateAnim_CNFSAnimBankPool
Called by CreateAnim_CNFSAnimBankPool
TODO but most likely: this is struct of link (prev, next), for each, call their destructor (vtable entry 0)
Nop handler that returns 1
if binsection->header
is 0
.
int magic, index; magic = handler.magic; index = 0x3F & ((magic >> 0x6) + (magic + (magic >> 0xC))); this->value = handler; this->nextEntry = binSectionMagicMap[index]; binSectionMagicMap[index] = this; numBinSectionLoadFunctionsInMagicMapBucket++;
Used in LoadBinSection and UnloadBinSection.
struct BinSectionMagicMapEntry *entry; int index; index = 0x3F & ((magic >> 0x6) + (magic + (magic >> 0xC))); entry = binSectionMagicMap[index]; while (entry) { if (entry->value.magic == magic) { return entry; } entry = entry->nextEntry; } return NULL;
Called once, from AllocateAndInitPool.
struct Pool *pool; struct PoolEntry *entry; struct PoolEntry *next; int idx; pool = this; do { pool->firstAvailableElement = NULL; if (pool->elementAmount) { next = (void*) ((char*) pool + sizeof(struct Pool)); pool->firstAvailableElement = (void*) next; for (idx = pool->elementAmount - 1; idx >= 0; idx--) { entry = next; next += pool->elementSize; entry->nextEntry = next; } next->nextEntry = 0; } pool = pool->nextLinkedPool; } while (pool);
returns -1
when not in this pool (or any linked pools).
Mark the entry as free again. Returns the amount of used entries in the pool. Same as UngetPoolEntry, but a thiscall.
generic IsPointInRangeOfPoint, but this function is only used by marker func PathsData::FindMarkerAtPosWithTypeAfterIndex, hence its name
radius is always a radius, so it's usually 4-14
Case sensitive hash function. see also cshashWithStartValue and cihash
Like cshash, but starts with given startValue
instead of -1
.
TODO where used? and why
Functionally equivalent to strcpy(dest, src1); strcpy(dest + strlen(src1), src2);
.
Uses sign extension. See also LanguageConversionTable::StrcpyCharToWchar and LanguageAwareStrcpyCharToWchar.
always returns 0, makes no sense
goes through all previous entries from this and sort based on return result of given function
like Pool::GetNextFreeItem except doesn't check if pool needs to be extended if no entries are left, and doesn't check if entry needs to be zero inited?
Same as Pool::UngetEntry, but a cdecl.
Calls bPrintf but does some stuff with QueryPerformanceCounter
before and after,
I'm assuming it times. Seems to add the time spent to _TimeSpentInFormatWithSinglePlaceholder, and increments _FormatWithSinglePlaceholderCallCount
every time this func is called.
does more parameters, but unsure how that works
TODO, seems to check the string to determine how to alloc? somestring arg compared with RCMP::chunkbuff?
Called by init_function_77B670.
this->link.prev = &this->link; this->link.next = &this->link; this->inited = 1;
Uses SomeAlloc? to allocate memory, calls Pool::Init. TODO, has one more XREF
Only called by Pool::GetNextFreeItem?
Implementation nfsu2-re-hooks/replace-440BB0-Pool__Extend.c
see also PoolGetNextFreeItemRaw
Frees pool and all its linked pools, remove the pool from the link in struct PoolControl.
Calls AllocateAndInitPool.
Implementation nfsu2-re-hooks/replace-440DF0-CreatePool.c
pools->PoolControl::DeletePool(pool);
Pool::GetNextFreeItem but wrapped in an cdecl.
doesn't actually print; formats it into audioDebugString (as long as arg0 is non-zero)
empties and frees all entries, entries where their link is at +10h
Does a function call on soundEffectSystem?.
returns d at requested index
loads a texture maybe or checks if a texture is loaded somewhere maybe, return hash to use for struct UIElement.textureHashOrMovieName
return this->field_8704 ? this->field_8710 : 0;
return this->field_8704 ? this->field_8714 : 0;
Hashes str
and delegates to FindUILabelByHash.
Uses cihash.
Uses cihash.
Uses cihash.
0 if not found but 0 is also a possible slot!
hashOfCareerSlot like CAREER_SLOT_2 stockCarHash like STOCK_PEUGEOT (it's not really _buying_ since cars are always free)
TODO check where this is called, it will be the carreer game state's keyhandler.
TODO has some references to unknown fields
When SmsMessageList::GetNumUnreadMessages returns 1
, immediately open that message. Show mailbox otherwise.
Gets the subject from SmsMessage::GetSubject and prepends Subject:
to it (based on language).
Used by SmsListEntry::ctor and EngageMessageDialogFNGObject::ctor.
See nfsu2-re-hooks/replace-497760-GetSmsMessageSubjectHeader.c
to use for CarCollectionWithPointers::CountAvailableCars and/or IsCarUnlocked
ui element "RaceMode_data", sets "ranked mode" label to "circuit" etc based on selected online car
cmd is format string aCmdHttpTimeDMe, result stored in buffer downloadingHttpCommandString
requests scene name from career data and loads IG_PlayMovie.fng
sets reputation/bank value strings, type of race text (sponsor/some OL thing), pchelpbar
and put it in loadingTipsFNGObject
return IsFNGLoaded("PC_Loading.fng") ? "PC_Loading.fng" : 0;
return B/C/D/E/F/10
and put it in struct836498.chyronIGFNGObject
ie go left or go right (switch between keyboard/gamepad/...) message should only be UIMSG_GO_LEFT or UIMSG_GO_RIGHT
columnName should be OPTION_NAME_
or OPTION_DATA_
or OPTION_DATA2_
rowidx is read from this->currentOptionIndex
related to struct OptionsPCControllerFNGObject, updates the text of a row in the controls list
updates scroller, car logo/badge texture, accel/spd/handl progress bars
availableStockCarList is sentinel node of list with entries struct Tmp4DF9C0ListEntry
called when selected car changes, when filter changes, ..
passed text is used, or when zero, "connecting to lobby"
called with param "UI_OLISPConnect.fng"
on init (altho variable)
called from OptionsPCControllerFNGObject::OnMouseActivity
finds the index where the given struct ControllerOptionsRelated is in either the primary or secondary link. If it's found in the primary controls link: return its index, if it's found in the secondary controls link: return its index, otherwise 0
for example: " Total Spent On Car: " entry
namePrefix: always " "
for total reputation and average reputation
for example, the "Overall Status" header
these create 54(36h) instances of something with UI object stuff. There are 18 controls *3(name,primary,secondary columns) = 54
flag should be IS_STOCK_CAR (when choosing car to buy) or IS_CAREER_CAR (when choosing career car to replace if no slots free)
relies on carSelectCategory to know what cars to display, resets it to IS_STOCK_CAR | IS_TUNED_CAR
if the result would be empty
message: 5073EF13 prev, D9FEEC59 next
see replace-4EED10-CarSelectFNGObject__ChangeCategory.c
used for both QR and OL car select AND customize car select
Sums this
and rect
into this
.
Initializes memory that was allocated to be a dialog.
will delegate to procUpdateUIVertical or procUpdateUIHorizontal based on isVertical
does not update ui elements, need to do that separately. value [0,1]
TODO
Returns a string ptr or NULL
for given hash (which is passed through edx
).
Does a binary search over the hashes in loadedLanguage.ptrTable
key is passed thru edx
Same as GetLanguageString but copy it into a buffer.
Calls GetLanguageStringOrNull and when it returns NULL
, call it again but with
0xC01A6F63
as fallback (which is the key DEFAULT_STRING_ERROR
and results in FENG: Default string error.
)
Returns, based on passed index, one of: th, st, nd, rd, th, th, th, th, th, th th
,
uses default string as fallback.
TODO: xref this for fun and profit (only 2 usages?)
if (section->header.magic == 0x39000) { loadedLanguage.ptrConversionTable = 0; loadedLanguage.numStrings = 0; loadedLanguage.ptrStrings = 0; loadedLanguage.ptrTable = 0; }
finds any marker of type MARKER_TYPE_D/MARKER_TYPE_E/MARKER_TYPE_F with matching hash
return numBin34A15;
internal name which can be used to create eg SPONSOR_INFO_%S
language key
searches in careerStageSettingsEntries
param stageIndex: 0-7
basically __stdcall wrapper around FindCareerRaceByHash because 'this' is not used
field_8869 is char[8][2]
, this counts how many of those 16 fields are set to 0
sponsors' availability depends on average reputation per race in previous stage, and something else (struct CareerStageSettings.field_1C)
param stageIndex: 0-7
from stage0 to stage7, add 1 if their signedSponsor is nonnull
profileData.career.currentStage is usually passed as arg0
writes to struct Career.carPosition and struct Career.carAngle
this->field_8704 = this->field_8700; this->field_8708 = this->field_871C; this->someCareerShop870C = this->someCareerShop8724; this->field_8710 = this->field_8728; this->field_8714 = this->field_8720;
this->field_8704 = 0; this->field_8708 = 0; this->someCareerShop870C = 0; this->field_8710 = 0;
'this' is unused; can be treated as __stdcall (__cdecl even since 0 params)
is doing pure freeroam stuff in career I guess
checks if something is collected (struct Career7B00.field_6)
also sets this->field_873D = 1
return this->stage0[arg0].stageFinished?
crash if arg0 < 0 or > 7
stakes: amount to win or lose stageIndex 0-7
this->floatField_1AE4 = 0; this->field_1AE8 = 0;
return this->field_1AE0
index 0-2
return this->field_1AE8 == 2
Only used in the career money cheats.
Only used in career money cheats, and to show bank label in career freeroam? not for pchelpbar, other transactions etc...
Called from LoadBinSection80034A10. Data is a bin section with magic 0x34A17
(which is inside bin section
80034A10
).
smsDatas = (void*) data; numSmsDatas = size / 20;
Goes through all smsDatas and returns the one that has a matching
cshash(careerStringPool + careerTextLanguageTableOffset)
.
TODO may be able to find out some gameprogress things here
Returns the hash for the language string that is the sms sender. Used once in EngageMessageDialogFNGObject::ctor.
return this->data.senderLanguageLabel;
TODO: check xrefs
if (!sms->deleted && !sms->read) { this->numUnreadMessages--; } sms->deleted = 1; sms->read = 1;
arg is struct Car.carIndex, checks carsToHideForRegionUS and carsToHideForRegionNotUS
stockCarHash like STOCK_PEUGOT
may not modify ecx! see 52A736
NOTE: THIS IS SHARED FOR struct TunedCar struct CareerCar struct OnlineCar
NOTE: THIS IS SHARED FOR struct TunedCar struct CareerCar struct OnlineCar
just nulls everything
Starts at container->rootElement
,
iterates through all children by traversing nextSibling
,
calls visitor->vtable->acceptElement
for every child,
calls FNGInfo::VisitContainerRecursively (itself) for every child that is of type 5 (struct UIContainer
).
returns 0
when either calls return 0.
does nothing with this
Starts at this->rootUIElement
,
iterates through all children by traversing nextSibling
,
calls visitor->vtable->acceptElement
for every child,
calls FNGInfo::VisitContainerRecursively for every child that is of type 5 (struct UIContainer
),
returns 0 when either calls return 0
.
If element->hash == this->searchingHash
,
set this->foundUIElement
to element
and return 0.
same as the other stricmp, just implemented slightly differently (removes one redundant condition and does the 'case insensitive' calculation differently but equally correct)
Case insensitive hash function. see also cshash
See nfsu2-re-hooks/replace-50B790-CreateFNGObject.c
for a reimplementation.
Goes through all entries in fngdata and returns the one with matching hash.
Goes through all the fng data above and set the handler for stricmp matching fng names.
exact same code can be found inlined at 51BBBF
works with data with binsection header 30203 & 30210
Delegates hashing to cshash.
Does its own hashing.
It's a guess
it's a guess
Frees all struct UIElement::FERenderObject
objects by calling FNGInfo::VisitUIRecursively
using a visitor that has UIElementVisitor_ClearFNGCache::acceptElement as its acceptElement
.
'this' is unused; can be called as an __stdcall
*((short*) arg_0 + 0) = mouseData.cursorX - canvasWidth2; *((short*) arg_0 + 1) = mouseData.cursorY - canvasHeight2; *((short*) arg_0 + 2) = mouseData.button0State << 1 | mouseData.button1State; (or swapped)
may have more parameters
only if it's not already that value; then also add NEED_UPDATE_0 to its flags
Only seen this being called when there's a list on screen so far.
*cursorX = mouseData.cursorX - canvasWidth2; *cursorY = mouseData.cursorY - canvasHeight2;
*mouseWheelData = mouseData.mousestate.lZ;
Gets called in one location, but still haven't actually seen it being called. Not in Main/Career/QR menus... TODO
Checks if any of the given hashes conform with struct FNGInfo.hash of entries in pUIData->field_8->fngPackagesDC.__parent.first
and return its fngName
.
return "UI_PC_Help_Bar.fng";
and put it in pcHelpBarFNGObject
If a char could not be converted, it will be _
and the func will return 1
.
A nop function. It seems like many calls to different functions that got nopped all redirect here. Some of the calls are used as a debug print, see Debug print.
arrow: 1 (left) or 2 (right)
sets two labels' text by language string
allocates memory into ptrAllocatedBytes50DB80
Doesn't actually use this
, so can be treated as a __stdcall
.
Returns a ptr to the first occurrence of ^
or \n
, nullptr otherwise.
Doesn't actually use this
, so can be treated as a __stdcall
.
Returns a ptr to the zero terminator.
this->field_B = 0
Checks if dest
is NULL first.
this is pretty much memcpy(this, from, sizeof(struct CareerD24_54_30_0)
but instead all fields are copied separately
return hashf("BRAND_NAME_%s", cars[car_index].manufacturerName);
return hashf("CAR_NAME_%s%s", cars[car_index].manufacturerName, "");
return GetLanguageStringOrNull(hashf("CAR_NAME_%s%s", cars[car_index].manufacturerName, ""));
does the DEFAULT_STRING_ERROR
dance if no such language string exists
return hashf("CS_CAR_LOGO_%s%s", cars[car_index].manufacturerName, "");
calls GetGameRegion for no good reason? (result unused)
TODO
Uses LanguageConversionTable::StrcpyCharToWchar when loadedLanguage.ptrConversionTable
is set, otherwise NaiveStrcpyCharToWchar.
struct BinDataLanguage39000 *data; struct LanguageTableEntry *tableEntry; int i; if (section->header.magic == 0x39000) { data = (void*) section->data; loadedLanguage.ptrConversionTable = (void*) (data + (int) data->field_0); loadedLanguage.numStrings = data->numStrings; loadedLanguage.ptrStrings = (void*) (data + (int) data->stringsOffset); loadedLanguage.ptrTable = (void*) (data + (int) data->tableOffset); tableEntry = loadedLanguage.ptrTable; for (i = 0; i < loadedLanguage.numStrings; i++) { tableEntry->string += loadedLanguage.ptrTable; tableEntry++; } }
searches in careerSponsors with use of careerStringPool
returns hashed SPONSOR_%S
data comes from bin section 34A18 in GLOBALB.BUN also sets sponsors to the ptr to sponsor instead of the name hash
This gets loaded once (enforced by profileData.binSection80034A10loaded), data resides in GLOBAL/GLOBALB.BUN
.
Career/Sponsor/DVD/Magazines related.
The data in this section is more sections, with magic 0x34A11-0x34A1F
(excluding 0x34A13
)
does nothing if the race is DDAY_EVENT_A or DDAY_EVENT_B
check if something is collected
return CarCollection::GetCareerCarForSlotHash(this->activeCarSlotHash);
allocates struct Tmp4DF9C0ListEntry for every available car and puts it into the passed link
could be a reputation thing
TODO: what does this actually do (RecalculateUncollectedMoneyMarkers?)
returns ptr to save data positioned after reading this
Used once in EngageMessageDialogFNGObject::ctor.
See nfsu2-re-hooks/replace-514B00-GetSmsMessageBody.c
When useCachedFlag
, just return profileData.career.smsMessageList.numUnreadMessages
, otherwise count all
profileData.career.smsMessageList.smsMessages
that have both read
and
deleted
on 0
.
TODO check other xref, probably for displaying icon ingame
For every message, set flag movedToCorrectInbox
when flag read
is set.
marker is of type MARKER_TYPE_ENGAGE_TIP
returns ptr to save data positioned after reading this
searches all cars (stock/tuned/career/online/sponsor)
may not modify ecx! see 52A7A5
called (sometimes more than once) on profile load
may not modify ecx! see 52A736 and 52A7A5
"FromStockCar" is an assumption, is this always true?
slotHash is like TUNED_CAR_%d car is only used to invoke struct InventoryCar$vtable.procGetCarIndex
NOTE: THIS IS SHARED FOR struct TunedCar struct CareerCar struct OnlineCar just calls TunedCar18::ApplyTuningToInstance
struct UIElementVisitor_FindByHash visitor; visitor.__parent.vtable = &vtable_UIElementVisitor_FindByHash; visitor.searchingHash = hash; visitor.foundUIElement = 0; FNGInfo::VisitUIRecursively(this, visitor); return visitor.foundUIElement;
frees struct NamedLinkNode.name if not empty, then allocate just enough memory to fit name into it, copy it, cihash it and put it into struct NamedLinkNode.cihashOfName
Goes through __parent.next
until the next one is null or its
fngName
and hash
matches.
this
is unused.
and zero field 38
calls Init for fngs in DC, nulls data in field8, zeros other fields
data is binsection 30203 or 30210
calls dtor of this->fngObject
and nulls it (if set),
nulls this->fngInfo->somethingUIImpl
and then nulls it (if set),
frees this->data30203
and then nulls it (if set)
SomethingUI::NukeAllScreens has this inlined
cdecl for SomethingUI::SumCSHashOfFNGNamesInEntries with profileData.somethingUI
in struct SomethingUI.link, move the entry with matching (hash of) name to the front of the link and return it (or return null if not found)
just called from LoadBinSection30203_30210
param oneOrZero is !!something_864F7C
creates a new struct SomethingUIImpl to hold the data and adds it as last in profileData.somethingUI.link
used in UIData::InitFNGPackage at 54E571
used in UIData::UnloadFNGPackage
Searches through field_8.
TODO
TODO
some ui element get size maybe?
out will be ([-cw/2,cw/2]
,[-ch/2,ch/2]
)
Returns 1
on success.
Discovered when looking at cheats. 8 is some choose sound, 9 too, .. TODO other IDs.
If it's already allocated and long enough, NOP.
Otherwise allocate new memory, copy existing string, free previous memory.
Does not actually check the allocatedWcharLength
field, but does a strlen to check if
the existing string length is less than required.
these are for the OPTION_DATA_ elements, aka the primary/secondary control elements (complements the Name element)
this is for the OPTION_NAME_ element (the name of an option), complements the Data elements
nop if uielement is not null otherwise writes floatField_8C, floatField_90, floatField_94, floatField_98
this is pretty much memcpy(this, from, sizeof(struct CareerD24_54_30)
but instead all fields are copied separately
Returns the name of what FNG to display for the dialog that was passed.
See nfsu2-re-hooks/replace-526C40-GetFNGForDialog.c
"valid" because it checks if the race hash is also present in struct Career.field_7148.raceHash
doesn't use this; something with cars
param marker may be null
this func only plays some sound!?
'this' is unused; can be treated as a normal __stdcall (__cdecl even)
finds first career car in profileData.player1.carCollection.__parent.careerCars with nonzero isLocked and puts it on zero
something with "THE_UNIQUES_SHOP"
zeros collectedEngageMarkers, finds all MARKER_TYPE_ENGAGE_TIP and put them in collectedEngageMarkers if they're not collected (checked with SmsMessageList::IsEngageTipUncollected)
changes struct Career.bank
and struct CareerCar434.moneySpentOnCar
Checks with SmsMessageList::IsMessageAlreadyReceived first.
Checks with SmsMessageList::IsMessageAlreadyReceived first.
Goes through all smsDatas and send all unreceived messages with type
8 (My game files do not have any messages
with that type)? Also checks for type SMS_TYPE_OUTRUN_INFO
, then does more checks with arg0
before sending.
arg0 is also put in {struct Career+field_8734} before calling this
Goes through all smsDatas and send every one that hasn't been received yet and has type ==
SMS_TYPE_DVD_COVER
and data == index
by using SmsMessageList::SendMessage
(which already has a check for if it was already received...).
Goes through all smsDatas and send every one that hasn't been received yet and has type ==
SMS_TYPE_OUTRUN_INFO
by using SmsMessageList::SendMessage when it wasn't received yet.
(which already has a check for if it was already received...).
This only matches the single SMS_OUTRUN_INTRO
SMS.
TODO check xref to explore outrun code
Goes through all smsDatas. When didWin
is 1, send all with type == SMS_TYPE_OUTRUN_VICTORY
, else send
all with type == SMS_TYPE_OUTRUN_DEFEAT
. Uses SmsMessageList::SendMessage.
TODO xref to explore outrun code
Returns null when it was already received.
fastcall? ecx is playerIndex, eax is slotHash
also does profileData.field_156B0 and controllerStruct874C40
has CarCollection::ctor inlined (at least it looks like that from a distance, I haven't looked very closely but seems reasonable to think)
slotNameHash like STOCK_PEUGOT or CAREER_SLOT_%d or TUNED_CAR_%d it supports creating from existing tuned/career car, but that is never actually possible to invoke with UI?
When fngName
is null, searches every FNG in this->fngPackagesDC.__parent.first
for the given hash.
Otherwise, limit the search to the FNG that is in the hierarchy of this->fngPackagesDC.__parent.first
(by using FNGInfoList::GetFNGInfoByNameByHierarchy).
fngName is nullable
Something with font, section is in languagefiles
searches either both hierarchies (struct UIData_field8.fngPackagesDC and struct UIData_field8.fngPackagesEC) or, if that's not initialized yet[citation needed], searches profileData.somethingUI
Checks if the primary mouse button is held down. Delegates to IsPointInUIElement
Checks is the primary mouse button is just down (pressed, not holding down). Delegates to IsPointInUIElement
Used when a button is pressed, to send the appropriate message.
See PCHelpBarFNGObject::SyncByMask for mask. BUTTON_PC_NAV_CONTINUE
is returned if it's not any of the other BUTTON_
masks.
mask is just (1 << x)
Called from PCHelpBarFNGObject::MessageHandler.
sets frameTimeWhenArrowClicked and currentScrollAmountToPerform and plays sounds when indeed clicked
called from Career::InitOnProfileLoad
Converts language aware, like LanguageAwareStrcpyCharToWchar does. Calls WideCharString::EnsureAllocatedSize. Returns itself.
what's the difference with Career::SignRandomSponsorForSomeReason?
Implementation:
struct SmsData *smsdata; smsdata = this->smsMessageList->SmsMessageList::SendEngageTipSmsMessage(engageMarker); if (smsdata) { this->bank += smsdata->moneyReward; this->Career::RecalculateCollectedEngageMarkers(); }
calculates in possible sponsor bonus money TODO: this returns 0 on some conditions. what are they?
Combines GetSmsDataForHash, SmsMessageList::IsMessageAlreadyReceived and SmsMessageList::SendMessage.
Uses SmsMessageList::SendMessageFormatted. TODO
typeToCheck: - if & 0x1FF, check if unlocked by career progress or if sponsor car, check cheat - if & 0x1F9, check if unlocked from the start
typeToCheck: - if & 0x1FF, check if unlocked by career progress or if sponsor car, check cheat - if & 0x1F9, check if unlocked from the start
checks all cars (stock, tuned, career, online, sponsor), depending on flagsToCheck
stockCarHash like STOCK_PEUGEOT
Only seems to be used for dynamic things such as: money, player name, sms messages, track length...
also creates FERenderObjectPool and FERenderEPolyPool
Called from ??SetupPools.
Frees struct UIElement::FERenderObject
and its EPoly objects with FERenderObject::FreeAllRenderEPolys_0 and FERenderObject::FreeAllRenderEPolys.
'this' unused, can be called as __stdcall
it just passes args to IsPointInUIElement
goes through levelSorterPoolEntry and assigns indexInLevelSorterLink and indexInLevelSorterLink
Called from ??SetupPools.
calls UIData::DrawMagazineBackIfNeeded if drawHud
simple wrapper for UIData::ShowFNG
paramsPtr points to array of parameters Delegates to UILabel::SetString.
Only used for a few things, such as: sms 'from', sms 'subject', part name in customize. Delegates to SetUILabelFormattedString
varargs
only dismisses when idToDismiss==shownDialog.dialogId
, nop otherwise
magazine/dvd showcase (picture) done
magazine/dvd showcase (picture) done
gives race reward money, sends sms messages if needed, increases current stage idx if needed, more things...
changes activeCarSlotHash
also sets this->field_873D = 1
what's the difference with Career::SignSponsor? this one does a lot more...
has SomethingUIImpl::ReleaseFngAndFngInfoAndPtrFieldC inlined
name is kinda dramatic but it seems like it clears all references to linked fngs?
called when the binsection is being unloaded
Unloads FNG packages?
Uses FindUILabelByName, then SetUILabelFormattedString.
send command to UI element?
basename can be: SideScroller: vertical scrollbar (to place at the left/right side) SideScrollBar: TBD ScrollBar/scrollbar: TBD Chat_ScrollBar: TBD empty string: TBD? H_ScrollBar: TBD Scroll_Bar: TBD basename will be used to get ui elements with hash %s_Backing, %s_Handle, ...
may not be ctor, but sure looks like it
returns uiElement10
returns 1 if there is a movie to play (which will be filled in in the given argument buffer)
calls FNGInfo::54CE60 for every UI element in this fng, possibly some init stuff
Sets buttons and background of the help bar, updates profile name display. See enum PCHELPBARFLAGS Mask gets adjusted based on profileData.menuState and _??gameStateSomething:
if ((profileData.menuState == MENU_STATE_ONLINE_MAIN_MENU || profileData.menuState == MENU_STATE_CUSTOMIZE_FROM_ONLINE_MAIN_MENU) && _??gameStateSomething == 3 && (mask & BUTTON_PC_NAV_QUIT)) { mask = (mask & ~PC_NAV_QUIT) | BUTTON_PC_NAV_LOGOFF; } if (profileData.menuState == MENU_STATE_LAN_MAIN_MENU && (mask & BUTTON_PC_NAV_EA_MESSENGER)) { mask &= ~BUTTON_PC_NAV_EA_MESSENGER; }
this smells like a memory leak elaborate way to determine which parts browser UI to show
return 1 if handled
returns slotNameHash of same or newly allocated tunedcar
can customize existing tunedcar, careercar, onlinecar, or if it's a stockcar then it will allocate a new tunedcar slot and initialize it will show fng for customizing the car
parentFngName
may be null.
Does more stuff.
Wraps UIData::AddFNGToUIObject.
parentFngName
may be null.
Returns the new dialog id for it (value in shownDialog.dialogId) or zero when it didn't show because of some override.
Calls ShowDialog.
Delegates to ShowButtonlessFormattedDialogPtr.
Delegates to ShowButtonlessFormattedDialogPtr.
Calls ShowDialog.
Uses 0x639(OK)
for middleButtonLanguageString, 0x34DC1BEC
for middleButtonMessage,
0xB4EDEB6D
for escMessage, 0
for field_31C,
1
for numButtons and field_32C.
Delegates to ShowStandardFormattedErrorDialog.
Calls ShowDialog.
Uses 0
for field_31C and 1
for numButtons.
Delegates to ShowSingleButtonEscapableFormattedDialog32C.
Uses 1
for field_32C.
Delegates to ShowSingleButtonEscapableFormattedDialog32C.
Uses 1
for field_32C.
Delegates to ShowSingleButtonEscapableFormattedDialog32C.
Uses 0
for escMessage and field_32C.
Delegates to ShowSingleButtonEscapableFormattedDialog32C.
Uses 0
for escMessage and field_32C.
Calls ShowDialog.
Delegates to ShowTwoButtonEscapableFormattedDialog31C_32C with 1
for field_32C.
Delegates to ShowTwoButtonEscapableFormattedDialog31C_32C with 1
for field_32C.
Delegates to ShowTwoButtonEscapableFormattedDialog31C_32C with 0
for escMessage and field_32C.
Delegates to ShowTwoButtonEscapableFormattedDialog31C_32C with 0
for escMessage and field_32C.
Calls ShowDialog with 3
for numButtons, 1
for field_32C.
Delegates to ShowThreeButtonEscapableFormattedDialogPtr31C.
Delegates to ShowThreeButtonEscapableFormattedDialogPtr31C.
Calls ShowDialog with 1
for numButtons, field_32C, isHelpDialog.
Uses 0x639(OK)
for middleButtonLanguageString, 0x34DC1BEC
for middleButtonMessage,
0xB4EDEB6D
for escMessage, 0
for field_31C.
this
is unused
also called MenuScreen::BaseNotify
Called from WM_CHAR
messages in MainWndProc,
only used to type/press enter in a textbox and Q to quit.
Navigating menus seems unaffected
Called when menus change.
Called from PCHelpBarFNGObject::MessageHandler.
used in UIData::InitFNGPackage at 54E558
only does things with ui elements type 7 (movie)
TODO document this and go in the last unresolved func.
DecalsOverlay.fng and DecalsOverlayInvis.fng
return _gameRegion;
0-5, affects name of cars
return _gameRegion == 1 || (4 < _gameRegion && _gameRegion < 10);
Unsure about this name.
returns 0 64bit edx:eax
returns 0 64bit edx:eax
return driveNameLetterPathThing;
Only called from unnamed_577AB0.
struct BinSectionMagicMapEntry *entry; int i; entry = FindBinSectionHandler(binsection->header.magic); if (entry) { return entry->value.loadfunc(binsection); } for (i = 0; i < 36; i++) { if (binSectionLoadFuncs[i](binsection)) { return 1; } } return 0;
Returns 1
when something managed to load it.
Some loaders that are in the map are also in the array.
memset(this->filename_again, 0, 4*12); strncpy(this->filename_again, filename, 0x2F); this->field_C4 = arg0;
return AmountOfQueuedFileSlotPoolEntries != 0;
uses joyKeyData
uppercase and / to \
Initializes cheatScreenData and cheatData.
Weird one, is called on each cheat entry and all cheats with a matching
field_28
has zero written to its hasBeenTriggered
field.
Basically return cheatExtraCareerMoney200 + cheatExtraCareerMoney1000;
Does things and calls the bin section unload handler, similar to LoadBinSection.
what type of pool entry is this? also seems to move the entry in the list?
Called from CheatScreenData::CheatCheck when a cheat matched.
true for car 27 (skyline) and 21 (rx8) if "regmebaby" cheat was triggered does not apply to career car lot
visual: just a number
performance: just a number
returns the handle of the new struct QueuedFileSlotPoolEntry
Called from UIHandleKey when cheatScreenData.doCheatCheck
is non-zero.
this MIGHT be a more generic constructor.. right
might do more than getting file size, todo RETURN TYPE IS PROBABLY _NOT_ FILESYSTEMPOOLENTRY
lots of depth, many critical sections etc mostly called bin files, some speech files, something E:\bin.dat
returns this
Creates a struct bFileSystemPoolEntry but no way to get it? although that is done by AllocateFileSystemPoolEntryForFileAndReadFileSize and that func's docs say it may not be true that it allocates an instance
Called by ??SetupPools
return &this->network44->keyValueString636F6E66;
calls a function ptr that may change, delegates to 440820 with extra param 8 or B
this MIGHT be a more generic constructor.. right
Called once during boot, from LoadPaths?
TODO
return languageIndex == -1 ? 0 : languageIndex
Guessing this is used when trying to go online, in case this game client has the wrong version, TODO
int OpenPatchesWebsite() { char *url; switch (GetGameRegion()) { case 0: url = "http://patches.ea.com/nfs_underground2/EN-US/home.html"; break; case 2: url = "http://patches.ea.com/nfs_underground2/KO/home.html"; break; case 3: url = "http://patches.ea.com/nfs_underground2/JP/home.html"; break; case 4: url = "http://patches.ea.com/nfs_underground2/TW/home.html"; break; case 5: switch (GetCurrentLoadedLanguage()) { case 0: url = "http://patches.ea.com/nfs_underground2/EN-UK/home.html"; break; case 5: url = "http://patches.ea.com/nfs_underground2/NL/home.html"; break; case 6: url = "http://patches.ea.com/nfs_underground2/SV/home.html"; break; case 7: url = "http://patches.ea.com/nfs_underground2/DA/home.html"; break; default: goto def; } break; case 6: url = "http://patches.ea.com/nfs_underground2/FR/home.html"; break; case 7: url = "http://patches.ea.com/nfs_underground2/DE/home.html"; break; case 8: url = "http://patches.ea.com/nfs_underground2/IT/home.html"; break; case 9: url = "http://patches.ea.com/nfs_underground2/ES/home.html"; break; case 11: url = "http://patches.ea.com/nfs_underground2/ZH/home.html"; break; case 12: url = "http://patches.ea.com/nfs_underground2/TH/home.html"; break; def: default: /*eax??*/ break; } return ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL); }
returns multibyte string
returns multibyte string
related to size needed to write save data
tempStoredOptLightGlow = _optLightGlow; _optLightGlow = 0;
TODO: why?
_optLightGlow = tempStoredOptLightGlow;
TODO: why?
return clamp(_optWorldDetail, 0, 2);
Sets maximum values of various options based on the adapter info in _d3d9AdapterIdentifier.
See all _optMax*
fields.
Also seems to do stuff with shaders maybe? TODO
Called twice. TODO: where and why
Returns _optTextureFiltering+1
(0-2 -> 1-3
), but maxed to 2
if the device doesn't have D3DDEVCAPS_RTPATCHES
support.
Based on the device, for every resolution index,
put 1
in isSupportedResolutionIdx at that index if available.
For each option that has a maximum value field, set it to the maximum value if it was exceeded.
Calls SetPresetDisplayLevelFromLevelOfDetail,
sets _optFSAALevel to 0
for some specific windows version or if the device is from vendor
Advanced Micro Devices, Inc, then calls EnsureDisplayOptionsDontExceedMaxSettings
Loads display settings from windows registry into their variables. Only called once, at boot.
Stores display settings into windows registry. Called multiple times, TODO.
unsigned char values[55] = { ' ', '.', ',', '_', '@', '-', '`', '=', '[', ']', '\\', ';', '\'', '/', '<', '>', '?', ':', '"', '{', '}', '|', '+', '(', ')', '*', '&', '%', '#', '!', '~', 0xE5, 0xE4, 0xE0, 0xE2, 0xEB, 0xE8, 0xE9, 0xEA, 0xEF, 0xEE, 0xF6, 0xF4, 0xFC, 0xF9, 0xFB, 0xE7, 0x9C, 0xF2, 0xEC, 0xC5, 0xC4, 0xD6, 0xDC, 0xA7 }; int i; for (i = 0; i < 55; i++) { if (values[i] == value) { return 1; } } return 0;
Creates and sets mouseData.dinputdevice
Calls MouseData::QueryAndUpdateCursorPosition and then updates button states.
called once, from DoUI. returns 1
if position deltas or scrollwheel or
any of the JustPressed/JustReleased fields are not zero. Always returning 0 here has the
effect that ui hover does not work, left click acts as right click (go back) except when
clicking on the active ui element (like main menu bar). Dialog box buttons still work
somehow. The car showroom can still be rotated with mmb. Mouse still moves.
returns multibyte string
delegates to ControllerStruct874C40::GetKeyboardKeyName or ControllerStruct874C40::GetControllerKeyName depending on this->type
Doesn't do anything unless (debug?) flag consoleEnabledFlag is nonzero.
Seems like a proc that handles typing text, maybe for a console?
Seems almost completely removed though
See nfsu2-re-hooks/faux-enable-console.c
for how it can be 'enabled', although nothing happens with the string
Called once, from init_function_77E580_MouseData_ctor.
On first call (checked with neighbourhoodHashesCalculatedAlready), calculate all the hashes in neighbourhoodData.
called from PathsData::ReadFromBinData
inits stuff and markers
atPosition
can be null, then it'll just return the first marker.
When after
is not null, the search starts after that specific marker
markerTypesToCheck: set bit 0 to check marker types 0, set bit 1 to check marker types 1, and so on if after is set, only markers of that type or higher will be checked
loads pathsData
Called when exiting to main menu after being in race/freeroam.
return profileData.player1.p24.useMetricSystem == 1
technically it looks like this is an instance method of struct C, but this
is unused and no params so __cdecl it is
when nopped, LAN lobby doesn't work
find entry in ptrCarData by struct Car.carNamehash
playerId 1/2
preset cars of my game:
DDAY_PLAYER_CAR model: 350Z DDAY_PLAYER_CAR_OLD_RX8 model: RX8 DDAY_PLAYER_CAR_OLD model: LANCEREVO8 DEMO_AI_IMPREZAWRX_WHITE model: IMPREZAWRX DEMO_AI_IMPREZAWRX_BLUE model: IMPREZAWRX DEMO_AI_300GT_ORANGE model: 3000GT DEMO_AI_300GT_BLUE model: 3000GT DEMO_AI_350Z_SILVER model: 350Z DEMO_AI_350Z_BROWN model: 350Z TT_AI_PRESET_1 model: TT G35_AI_PRESET_1 model: G35 LANCEREVO8_AI_PRESET_1 model: LANCEREVO8 350Z_AI_PRESET_1 model: 350Z CALEB_GTO model: GTO NIKKI_MUSTANGGT model: MUSTANGGT NIGEL_3000GT model: 3000GT TOM_G35 model: G35 AL_RX8 model: RX8 MARCUS_CELICA model: CELICA SCOTT_TT model: TT DEMO_PRESET_1 model: 350Z DEMO_PRESET_2 model: 350Z DEMO_PRESET_3 model: 350Z DEMO_PRESET_4 model: 350Z CHINGY model: NAVIGATOR CAPONE model: HUMMER D3 model: ECLIPSE SHINESTREET model: IS300 DAVIDCHOE model: COROLLA JAPANTUNING model: G35 SNOOP_DOGG model: ESCALADE THE_DOORS model: GTO
Sets ptrCarData data.
carPresetHash: struct CarPreset.name
jumptable 006E23E3 default case
most likely 1000
*((int*)arg+8/4)==current_thread_id
index of array in struct_8AD610
pops and set node valuemaybe? to -1
esi = struct struct8AD610LinkedListNode*
file might get read in here, see criticalSectionWrapper_fileReadLock in passed struct this function has been seen running on non-main thread (not seen on main thread) seems to loop forever until stopLoadingFileLoop? is not 0 this might be resposible for reading files?
thread with threadfuncfilerelated as runnable
return 1 on success
return amount of bytes actually read
returns number of bytes written
moveMethod is either 0 for start or 1 for current 64bit edx:eax
64bit edx:eax assumed __thiscall
1 on success(1), zero otherwise assumed __thiscall
directoryname is at this+4? returns free bytes available to user 64bit edx:eax
for data("A=1 B=2 C:3 D=4") key("C") ret("3 D=4")
Returns amount of chars written?
writes to ptr in ESI, returns 1-4
some wchar expand/set string like func
arg0
is the key=value\n
etc string
Calls Winsock's socket
, set it nonblocking (with ioctlsocket
).
In case of type == SOCK_RAW
, call setsockopt(s, SOL_SOCKET, SO_BROADCAST, (ptr to 1), 4)
.
Returned value is stored in socketWrapper and the previous value is put in its previousSocketWrapper
(this seems to be an atomic operation).
Calls Winsock's shutdown
and closesocket
.
Some critical section stuff. Removes it from the socket wrapper links
Calls Winsock's bind
.
returns 0 on success or WSAEWOULDBLOCK
/WSAECONNRESET
,
-2 on WSAENOTCONN
,
-5 on WSAENETUNREACH
/WSAEHOSTDOWN
,
-6 on WSAECONNREFUSED
,
-7 on other err.
arg should be at least 20h
criticalSectionWrapper8B7CB8 is used when nullptr is passed
criticalSectionWrapper8B7CB8 is used when nullptr is passed
8B7CB8
is used when nullptr is passed
ret 0 on failure
criticalSectionWrapper8B7CB8 is used when nullptr is passed
criticalSectionWrapper8B7CB8 is used when nullptr is passed
so it can be put in struct Network44.network0
expects one in FPU, removes it returns 64bit edx:eax?
mostly used as pure virtual function
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/atexit?view=msvc-160
We sure arg1 is a __thiscall func ptr?
varargs for params maybe does a lot more shit
Invoked once at boot, does things (todo) and calls all functions in someInitFunctions.
according to ghidra
index should be <= 18(012h)
or variable criticalSectionVars is wrong
Calls WorldAnimStuff::ctor.
Registers binSectionHandlerMagicMapEntry0 (without using BinSectionMagicMapEntry::RegisterBinSectionHandler).
inits controllerStruct874C40
Calls MouseData::ctor to initialize mouse data.
registered with atexit