diff --git a/src/xenia/kernel/xam/xam_module.cc b/src/xenia/kernel/xam/xam_module.cc index f3e05c56a..7689d3bf8 100644 --- a/src/xenia/kernel/xam/xam_module.cc +++ b/src/xenia/kernel/xam/xam_module.cc @@ -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 xam_exports(4096); diff --git a/src/xenia/kernel/xam/xam_module_export_groups.inc b/src/xenia/kernel/xam/xam_module_export_groups.inc new file mode 100644 index 000000000..3b22ab309 --- /dev/null +++ b/src/xenia/kernel/xam/xam_module_export_groups.inc @@ -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) diff --git a/src/xenia/kernel/xam/xam_private.h b/src/xenia/kernel/xam/xam_private.h index e9f256874..9122bc21c 100644 --- a/src/xenia/kernel/xam/xam_private.h +++ b/src/xenia/kernel/xam/xam_private.h @@ -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