Skip to content
Alan Tse edited this page Dec 7, 2023 · 49 revisions

Welcome to the CommonLibVR wiki!

ESL scratchpad

ESLs are not supported in VR. This is a page to aggregate data for VR for any attempts to add it.

AFKMods discussion

1.5.97 address for .esl: 141632ac8

TESFile->smallFileCompileIndex looks to be just padding in VR. We can treat TESFile as the SE version and we likely won't overwrite any actual data

Address:

Name SSE VR Notes
bool TESFile::IsESL_14017E160 (TESFile * param_1) 14017E160
void TESFile::AdjustFormIDFileIndex(TESFile *a_this,uint *a_formid) 14017e180 Used to set formids for ESL files; need in VR
bool TESFile::SetCompileIndex_14017C63 (TESFile * a_file, int a_index) 14017C63 14018C480
PluginLoader? 14050eea0 14051dc00
LoadPluginBSA 140173BD0 140184360
TESDataHandler::ctor 140166D80 1401774C0 functions relevant for forms/formIDs/etc.
TESDataHandler::CompileFiles_14017EFF0 14016E660 14017EFF0 DataHandler->LoadingFiles set to true AND false here. offset 0x14A seems to be where masters are set above regular files. loadedModCount reset if a_unk is true, maybe this is where the plugins are parsed/loaded?
iFormsLoaded 141EC3B60 141F889C0 Named from FO4
TESDataHandler::ConstructObjectList_140180870 1401700E0 140180870 Named from FO4

Functions we should modify:

Name SSE VR Modification treatment
TESDataHandler::sub_14017EFF0 14016E660 14017EFF0 ASM hook 5 spots where loadedmods is used, replace with TESFileCollection
TESDataHandler::AddFile 14017EFF0 Replace entire function with SSE or near SSE equivalent; uses TESFile::IsESL
sub_1401831F0 1401831F0 ASM replace 0x807-852. Jmp to function to add TESFile the way SSE does (ESP/ESL split)
TESFile::GetCompileIndex_14018C470 14018C470 Seems used for File checking/form ID setting. Fixes uses of this!
TESFile * TESNPC::GetFaceTint (TESNPC * a_this, undefined8 param_2, undefined8 param_3) 1403602b0 14036fb70 Uses TESFile::IsESL, but SSE test looks unused?

Specific function discussion

TESNPC::GetFaceTint

Compare SSE vs VR

  if (a_this_00 != (TESFile *)0x0) {
    TESFile::IsESL_14017E160((TESFile *)a_this_00); // SSE function doesn't appear used?
    iVar4 = f_snprintf_1401423D0
                      (param_2,(char *)(param_3 & 0xffffffff),
                       "data\\Textures\\Actors\\Character\\FaceGenData\\FaceTint\\%s\\%08X.dds",
                       a_this_00->Name_58);
    a_this_00 = (TESFile *)CONCAT71((int7)(CONCAT44(extraout_var,iVar4) >> 8),1);
  }
  return a_this_00;

Assembly does a test but doesn't branch based on it?

       14036031d 8b 5b 14        MOV        EBX,dword ptr [RBX + 0x14]
       140360320 48 8b c8        MOV        a_this,RAX
       140360323 e8 38 de        CALL       TESFile::IsESL_14017E160                         bool IsESL_14017E160(TESFile * a
                 e1 ff
       140360328 84 c0           TEST       isESL,isESL
       14036032a 4c 8d 4f 58     LEA        R9,[RDI + 0x58]
       14036032e b9 ff ff        MOV        a_this,0xffffff
                 ff 00

VR:

  if (pTVar4 != (TESFile *)0x0) {
    iVar3 = f_snprintf_1401423D0
                      (param_2,(char *)(param_3 & 0xffffffff),
                       "data\\Textures\\Actors\\Character\\FaceGenData\\FaceTint\\%s\\%08X.dds",
                       pTVar4->Name_58);
    return (TESFile *)CONCAT71((int7)(CONCAT44(extraout_var,iVar3) >> 8),1);
  }
  return (TESFile *)0x0;
}

Clone this wiki locally