mirror of
https://github.com/open-goal/jak-project
synced 2026-07-08 22:45:00 -04:00
move GOAL stack to GOAL memory (#114)
* move GOAL code stack to GOAL memory * fix win arg reg and check rsp in debugger * fix windows maybe and fix some incorrect logging formatters
This commit is contained in:
+8
-11
@@ -136,6 +136,8 @@ s32 goal_main(int argc, const char* const* argv) {
|
||||
* Main loop to dispatch the GOAL kernel.
|
||||
*/
|
||||
void KernelCheckAndDispatch() {
|
||||
u64 goal_stack = u64(g_ee_main_mem) + EE_MAIN_MEM_SIZE - 8;
|
||||
|
||||
while (!MasterExit) {
|
||||
// try to get a message from the listener, and process it if needed
|
||||
Ptr<char> new_message = WaitForMessageAndAck();
|
||||
@@ -148,20 +150,15 @@ void KernelCheckAndDispatch() {
|
||||
// dispatch the kernel
|
||||
//(**kernel_dispatcher)();
|
||||
|
||||
// todo remove. this is added while KERNEL.CGO is broken.
|
||||
if (MasterUseKernel) {
|
||||
call_goal(Ptr<Function>(kernel_dispatcher->value), 0, 0, 0, s7.offset, g_ee_main_mem);
|
||||
// use the GOAL kernel.
|
||||
call_goal_on_stack(Ptr<Function>(kernel_dispatcher->value), goal_stack, s7.offset,
|
||||
g_ee_main_mem);
|
||||
} else {
|
||||
// use a hack to just run the listener function if there's no GOAL kernel.
|
||||
if (ListenerFunction->value != s7.offset) {
|
||||
// fprintf(stderr, "Running Listener Function:\n");
|
||||
// auto cptr = Ptr<u8>(ListenerFunction->value).c();
|
||||
// for (int i = 0; i < 40; i++) {
|
||||
// fprintf(stderr, "%x ", cptr[i]);
|
||||
// }
|
||||
// fprintf(stderr, "\n");
|
||||
auto result =
|
||||
call_goal(Ptr<Function>(ListenerFunction->value), 0, 0, 0, s7.offset, g_ee_main_mem);
|
||||
// fprintf(stderr, "result of listener function: %lld\n", result);
|
||||
auto result = call_goal_on_stack(Ptr<Function>(ListenerFunction->value), goal_stack,
|
||||
s7.offset, g_ee_main_mem);
|
||||
#ifdef __linux__
|
||||
cprintf("%ld\n", result);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user