-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
6f8e1f0
to
b4f86a4
Compare
b15d6c4
to
8d38c86
Compare
d6b7e70
to
f4c47c5
Compare
|
||
#ifdef XBOX | ||
__attribute__((constructor(101))) static void reserve_memory() { | ||
// Reserve the space for the EXE |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
301757c
to
8a2354a
Compare
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]; |
There was a problem hiding this comment.
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
3d135f7
to
7efaa1d
Compare
24a579a
to
ff56e2a
Compare
Address code_address = buffer; | ||
buffer += code_size; | ||
buffer_size -= code_size; | ||
#endif |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
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:
Make uc_native functionalMove host memory allocation intoMapMemory
(needs full control over memory layout)Implement uc_nativeAllocate
, but align users which require itAvoid relocation of exe sections, or avoid referring to them (as(fixed upstream using strup; not ideal.. but okay)export->name
currently does this), so they can be unloaded