Files
jak-project/game/kernel/common/kscheme.h
T
Parker de25f39439 arm64: Apple Silicon support (#4390)
Got OpenGOAL building and running natively on Apple Silicon.

This is the rest of the port after the smaller arm64 emitter PRs. I was
told pushing one big PR was okay. This covers goalc, the runtime,
linker, kernel and the GOAL asm.

The new paths have native tests. I also found four more emitter bugs
while running it. They're in scalar sqrt, 128-bit stores, scalar max and
indexed stores above 4 GB.

Spent a while cleaning it up so it's easier to read. 4am gotta sleep lol

Closes #3841

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2026-08-24 23:22:47 -04:00

58 lines
1.4 KiB
C++

#pragma once
#include "common/common_types.h"
#include "game/kernel/common/Ptr.h"
extern s32 NumSymbols;
extern Ptr<u32> s7;
extern Ptr<u32> SymbolTable2;
extern Ptr<u32> LastSymbol;
extern u32 FastLink;
extern Ptr<u32> EnableMethodSet;
void kscheme_init_globals_common();
constexpr u32 CRC_POLY = 0x04c11db7;
constexpr u32 EMPTY_HASH = 0x8454B6E6;
constexpr u32 OFFSET_MASK = 7;
constexpr uint32_t UNKNOWN_PP = UINT32_MAX;
struct String {
u32 len;
char* data() { return ((char*)this) + sizeof(String); }
};
struct Function {};
void init_crc();
u32 crc32(const u8* data, s32 size);
u64 delete_illegal(u32 obj);
u64 goal_malloc(u32 heap, u32 size, u32 flags, u32 name);
u64 call_goal(Ptr<Function> f, u64 a, u64 b, u64 c, u64 st, void* offset);
u64 call_goal_on_stack(Ptr<Function> f, u64 rsp, u64 st, void* offset);
// align the host stack for each ABI
#ifdef __aarch64__
constexpr u64 GOAL_STACK_TOP_OFFSET = 16;
#else
constexpr u64 GOAL_STACK_TOP_OFFSET = 8;
#endif
u64 call_goal_function(Ptr<Function> func);
u64 print_structure(u32 s);
u64 print_integer(u64 obj);
u64 print_binteger(u64 obj);
u64 print_float(u32 f);
u64 print_vu_function(u32 obj);
u64 copy_fixed(u32 it);
u64 copy_structure(u32 it, u32 unknown);
u64 inspect_integer(u64 obj);
u64 inspect_binteger(u64 obj);
u64 inspect_float(u32 f);
u64 inspect_structure(u32 obj);
u64 inspect_vu_function(u32 obj);
u64 inspect_kheap(u32 obj);