Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start work on hacky Xbox port #43

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open

Start work on hacky Xbox port #43

wants to merge 64 commits into from

Conversation

JayFoxRox
Copy link
Owner

@JayFoxRox JayFoxRox commented Nov 6, 2018

This is basically nothing yet, I was just curious how much work this might be.

I currently don't have any intentions of finishing this.

Requires JayFoxRox/nxdk#8 for compilation.

Based on #45

TODO:

  • Improve texture exporters; I'll be staring at them for a while
  • Make uc_native functional
    • Move host memory allocation into MapMemory (needs full control over memory layout)
    • Implement uc_native
  • Get rid of all headers
  • Reduce memory footprint
    • Don't align in Allocate, but align users which require it
    • Avoid relocation of exe sections, or avoid referring to them (as export->name currently does this), so they can be unloaded (fixed upstream using strup; not ideal.. but okay)
  • Port shaders to Xbox

xbox.c Outdated Show resolved Hide resolved
xbox.c Outdated Show resolved Hide resolved

#ifdef XBOX
__attribute__((constructor(101))) static void reserve_memory() {
// Reserve the space for the EXE
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Free LaunchDataPage?
  • Move saved AV data address?
  • Move framebuffer elsewhere?

#ifdef XBOX
__attribute__((constructor(102))) static void start_log() {
// Clear log
FILE* f = freopen("log.txt", "wb", stdout);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write this to some disk folder, so we can run from DVD

@JayFoxRox JayFoxRox force-pushed the hacky-xbox branch 2 times, most recently from 301757c to 8a2354a Compare May 21, 2019 14:05
emulation.c Show resolved Hide resolved
main.c Outdated
uint32_t* vtable = (uint32_t*)Memory(vtableAddress);
for(unsigned int i = 0; i < slotCount; i++) {
// Point addresses to themself
char* slotName = malloc(128);
char* slotName = &slotNames[i * 64];
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a stupid change; just calculate real length and stick to malloc

@JayFoxRox JayFoxRox force-pushed the hacky-xbox branch 8 times, most recently from 3d135f7 to 7efaa1d Compare June 6, 2019 16:44
.gitmodules Show resolved Hide resolved
Address code_address = buffer;
buffer += code_size;
buffer_size -= code_size;
#endif
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be moved into the allocator itself, so other code can also benefit (for small allocations).

It isn't necessary if the allocator has smaller pages.

emulation.c Outdated
@@ -655,7 +655,7 @@ unsigned int CreateEmulatedThread(uint32_t eip) {
stack = MapMemory(stackAddress, stackSize, true, true, false);
}
static int threadId = 0;
uint32_t esp = stackAddress + stackSize / 2 + 256 * 1024 * threadId++; // 256 kiB per late thread
uint32_t esp = stackAddress + stackSize;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to assert that threadId == 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant