Initial Alloy implementation.
This is a regression in functionality and performance, but a much better foundation for the future of the project (I think). It can run basic apps under an SSA interpreter but doesn't support some of the features required to do real 360 apps yet.
This commit is contained in:
61
tools/alloy-sandbox/alloy-sandbox.cc
Normal file
61
tools/alloy-sandbox/alloy-sandbox.cc
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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/xenia.h>
|
||||
#include <alloy/alloy.h>
|
||||
|
||||
#include <alloy/runtime/raw_module.h>
|
||||
#include <xenia/cpu/xenon_memory.h>
|
||||
#include <xenia/cpu/xenon_runtime.h>
|
||||
|
||||
#include <gflags/gflags.h>
|
||||
|
||||
using namespace alloy;
|
||||
using namespace alloy::backend;
|
||||
using namespace alloy::runtime;
|
||||
using namespace xe;
|
||||
using namespace xe::cpu;
|
||||
|
||||
|
||||
int alloy_sandbox(int argc, xechar_t** argv) {
|
||||
int result_code = 1;
|
||||
|
||||
XenonMemory* memory = new XenonMemory();
|
||||
|
||||
ExportResolver* export_resolver = new ExportResolver();
|
||||
XenonRuntime* runtime = new XenonRuntime(memory, export_resolver);
|
||||
|
||||
Backend* backend = 0;
|
||||
// Backend* backend = new alloy::backend::interpreter::InterpreterBackend(
|
||||
// runtime);
|
||||
// Backend* backend = new alloy::backend::x64::X64Backend(
|
||||
// runtime);
|
||||
runtime->Initialize(backend);
|
||||
|
||||
RawModule* module = new RawModule(runtime->memory());
|
||||
module->LoadFile(0x82000000, "test\\codegen\\instr_add.bin");
|
||||
runtime->AddModule(module);
|
||||
|
||||
XenonThreadState* thread_state = new XenonThreadState(
|
||||
runtime, 100, 64 * 1024, 0);
|
||||
|
||||
Function* fn;
|
||||
runtime->ResolveFunction(0x82000000, &fn);
|
||||
fn->Call(thread_state);
|
||||
|
||||
delete thread_state;
|
||||
|
||||
delete runtime;
|
||||
delete memory;
|
||||
|
||||
return result_code;
|
||||
}
|
||||
// ehhh
|
||||
#include <xenia/platform.cc>
|
||||
XE_MAIN_THUNK(alloy_sandbox, "alloy-sandbox");
|
||||
22
tools/alloy-sandbox/alloy-sandbox.gypi
Normal file
22
tools/alloy-sandbox/alloy-sandbox.gypi
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||
{
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'alloy-sandbox',
|
||||
'type': 'executable',
|
||||
|
||||
'dependencies': [
|
||||
'alloy',
|
||||
'xenia',
|
||||
],
|
||||
|
||||
'include_dirs': [
|
||||
'.',
|
||||
],
|
||||
|
||||
'sources': [
|
||||
'alloy-sandbox.cc',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||
{
|
||||
'includes': [
|
||||
'alloy-sandbox/alloy-sandbox.gypi',
|
||||
'xenia-run/xenia-run.gypi',
|
||||
#'xenia-test/xenia-test.gypi',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user