XNetStartup/WSAStartup stubs.

This commit is contained in:
Ben Vanik 2013-10-22 23:46:42 -07:00
parent 447ce90b7b
commit 60ef171ff2
5 changed files with 111 additions and 0 deletions

View File

@ -5,6 +5,8 @@
'xam_info.h',
'xam_module.cc',
'xam_module.h',
'xam_net.cc',
'xam_net.h',
'xam_ordinals.h',
'xam_private.h',
'xam_state.cc',

View File

@ -42,6 +42,7 @@ XamModule::XamModule(Runtime* runtime) :
// Register all exported functions.
RegisterInfoExports(export_resolver_.get(), xam_state.get());
RegisterNetExports(export_resolver_.get(), xam_state.get());
RegisterVideoExports(export_resolver_.get(), xam_state.get());
}

View File

@ -0,0 +1,76 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include <xenia/kernel/modules/xam/xam_net.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/modules/xam/xam_private.h>
#include <xenia/kernel/modules/xam/xam_state.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL NetDll_XNetStartup_shim(
xe_ppc_state_t* ppc_state, XamState* state) {
uint32_t one = SHIM_GET_ARG_32(0);
uint32_t params_ptr = SHIM_GET_ARG_32(1);
XELOGD(
"NetDll_XNetStartup(%d, %.8X)",
one,
params_ptr);
SHIM_SET_RETURN(0);
}
SHIM_CALL NetDll_WSAStartup_shim(
xe_ppc_state_t* ppc_state, XamState* state) {
uint32_t one = SHIM_GET_ARG_32(0);
uint32_t version = SHIM_GET_ARG_16(1);
uint32_t data_ptr = SHIM_GET_ARG_32(2);
XELOGD(
"NetDll_WSAStartup(%d, %.4X, %.8X)",
one,
version,
data_ptr);
if (data_ptr) {
SHIM_SET_MEM_16(data_ptr + 0x000, version);
SHIM_SET_MEM_16(data_ptr + 0x002, 0);
SHIM_SET_MEM_32(data_ptr + 0x004, 0);
SHIM_SET_MEM_32(data_ptr + 0x105, 0);
SHIM_SET_MEM_16(data_ptr + 0x186, 0);
SHIM_SET_MEM_16(data_ptr + 0x188, 0);
SHIM_SET_MEM_32(data_ptr + 0x190, 0);
}
SHIM_SET_RETURN(0);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterNetExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", NetDll_XNetStartup, state);
SHIM_SET_MAPPING("xam.xex", NetDll_WSAStartup, state);
}

View File

@ -0,0 +1,31 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_MODULES_XAM_NET_H_
#define XENIA_KERNEL_MODULES_XAM_NET_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_MODULES_XAM_NET_H_

View File

@ -31,6 +31,7 @@ extern XamState* shared_xam_state_;
// Registration functions, one per file.
void RegisterInfoExports(ExportResolver* export_resolver, XamState* state);
void RegisterNetExports(ExportResolver* export_resolver, XamState* state);
void RegisterVideoExports(ExportResolver* export_resolver, XamState* state);