[XAM] Rework how export groups are registered.

This commit is contained in:
gibbed 2020-11-23 05:49:03 -06:00 committed by Rick Gibbed
parent 42b1427087
commit 1481735d36
3 changed files with 34 additions and 32 deletions

View File

@ -27,21 +27,10 @@ XamModule::XamModule(Emulator* emulator, KernelState* kernel_state)
: KernelModule(kernel_state, "xe:\\xam.xex"), loader_data_() {
RegisterExportTable(export_resolver_);
// Register all exported functions.
RegisterAvatarExports(export_resolver_, kernel_state_);
RegisterContentExports(export_resolver_, kernel_state_);
RegisterEnumExports(export_resolver_, kernel_state_);
RegisterInfoExports(export_resolver_, kernel_state_);
RegisterInputExports(export_resolver_, kernel_state_);
RegisterLocaleExports(export_resolver_, kernel_state_);
RegisterMsgExports(export_resolver_, kernel_state_);
RegisterNetExports(export_resolver_, kernel_state_);
RegisterNotifyExports(export_resolver_, kernel_state_);
RegisterNuiExports(export_resolver_, kernel_state_);
RegisterUIExports(export_resolver_, kernel_state_);
RegisterUserExports(export_resolver_, kernel_state_);
RegisterVideoExports(export_resolver_, kernel_state_);
RegisterVoiceExports(export_resolver_, kernel_state_);
#define XE_MODULE_EXPORT_GROUP(m, n) \
Register##n##Exports(export_resolver_, kernel_state_);
#include "xam_module_export_groups.inc"
#undef XE_MODULE_EXPORT_GROUP
}
std::vector<xe::cpu::Export*> xam_exports(4096);

View File

@ -0,0 +1,26 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2020 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
// This is a partial file designed to be included by other files when
// constructing various tables.
XE_MODULE_EXPORT_GROUP(xam, Avatar)
XE_MODULE_EXPORT_GROUP(xam, Content)
XE_MODULE_EXPORT_GROUP(xam, Enum)
XE_MODULE_EXPORT_GROUP(xam, Info)
XE_MODULE_EXPORT_GROUP(xam, Input)
XE_MODULE_EXPORT_GROUP(xam, Locale)
XE_MODULE_EXPORT_GROUP(xam, Msg)
XE_MODULE_EXPORT_GROUP(xam, Net)
XE_MODULE_EXPORT_GROUP(xam, Notify)
XE_MODULE_EXPORT_GROUP(xam, Nui)
XE_MODULE_EXPORT_GROUP(xam, UI)
XE_MODULE_EXPORT_GROUP(xam, User)
XE_MODULE_EXPORT_GROUP(xam, Video)
XE_MODULE_EXPORT_GROUP(xam, Voice)

View File

@ -23,24 +23,11 @@ bool xeXamIsUIActive();
xe::cpu::Export* RegisterExport_xam(xe::cpu::Export* export_entry);
// Registration functions, one per file.
#define DECLARE_REGISTER_EXPORTS(n) \
#define XE_MODULE_EXPORT_GROUP(m, n) \
void Register##n##Exports(xe::cpu::ExportResolver* export_resolver, \
KernelState* kernel_state)
DECLARE_REGISTER_EXPORTS(Avatar);
DECLARE_REGISTER_EXPORTS(Content);
DECLARE_REGISTER_EXPORTS(Enum);
DECLARE_REGISTER_EXPORTS(Info);
DECLARE_REGISTER_EXPORTS(Input);
DECLARE_REGISTER_EXPORTS(Locale);
DECLARE_REGISTER_EXPORTS(Msg);
DECLARE_REGISTER_EXPORTS(Net);
DECLARE_REGISTER_EXPORTS(Notify);
DECLARE_REGISTER_EXPORTS(Nui);
DECLARE_REGISTER_EXPORTS(UI);
DECLARE_REGISTER_EXPORTS(User);
DECLARE_REGISTER_EXPORTS(Video);
DECLARE_REGISTER_EXPORTS(Voice);
#undef DECLARE_REGISTER_EXPORTS
KernelState* kernel_state);
#include "xam_module_export_groups.inc"
#undef XE_MODULE_EXPORT_GROUP
} // namespace xam
} // namespace kernel