[runtime] pckernel implementation (#1032)

* toggle for ripping level models

* Create pckernel.gc

* builds and works

* fix defs

* resolution info works

* native letterboxing

* menu

* Fullscreen buttons

* Update glfw

* fix fullscreen taking over everything for some reason

* fix screenshots and add more menu options

* Cleanup DMA mess in load boundary render code (first try!!)

* Update default-menu.gc

* clang

* fix accidental macros in pairs

* refs

* fix null reference bugs

* add lavatube

* custom aspect ratios work (3D only)

* custom aspect ratios work (3D only)

* fix aspect ratio and non-4x3 debug text

* change `sceOpen`

* deadzone setting

* merge fixes

* check out `debug-pad-display`

* update readme imgs

* settings save works

* oops

* settings read/load (incomplete)

* add `:stop` to debugger and fix detach on Windows

* settings load works

* fullscreen and aspect ratio setting fixes

* swap menu options for convenience

* settings loads automatically properly

* fix panic and font hack edge case

* add rolling, ogre, snow, swamp, sunken b, jungle b

* Fixed borderless on windows please work

* Update fake_iso.txt

* remove error from opengl debug filter

* update refs

* minor tfrag tod palette lookup change

* accidentally nuked all opengl errors
This commit is contained in:
ManDude
2021-12-30 23:48:37 +00:00
committed by GitHub
parent 72fe06826f
commit 9ff71412e5
90 changed files with 3840 additions and 2447 deletions
+45 -1
View File
@@ -718,6 +718,42 @@ void c_memmove(u32 dst, u32 src, u32 size) {
memmove(Ptr<u8>(dst).c(), Ptr<u8>(src).c(), size);
}
/*!
* PC Port function to return the current OS as a symbol.
*/
u64 get_os() {
#ifdef _WIN32
return intern_from_c("windows").offset;
#elif __linux__
return intern_from_c("linux").offset;
#else
return s7.offset;
#endif
}
/*!
* PC Port function
*/
void get_window_size(u32 w_ptr, u32 h_ptr) {
if (w_ptr) {
auto w = Ptr<u32>(w_ptr).c();
*w = Gfx::get_window_width();
}
if (h_ptr) {
auto h = Ptr<u32>(h_ptr).c();
*h = Gfx::get_window_height();
}
}
/*!
* PC Port function
*/
void get_window_scale(u32 x_ptr, u32 y_ptr) {
float* x = x_ptr ? Ptr<float>(x_ptr).c() : NULL;
float* y = y_ptr ? Ptr<float>(y_ptr).c() : NULL;
Gfx::get_window_scale(x, y);
}
void InitMachine_PCPort() {
// PC Port added functions
make_function_symbol_from_c("__read-ee-timer", (void*)read_ee_timer);
@@ -736,6 +772,14 @@ void InitMachine_PCPort() {
make_function_symbol_from_c("pc-pad-input-key-get", (void*)Pad::input_mode_get_key);
make_function_symbol_from_c("pc-pad-input-index-get", (void*)Pad::input_mode_get_index);
// os stuff
make_function_symbol_from_c("pc-get-os", (void*)get_os);
make_function_symbol_from_c("pc-get-window-size", (void*)get_window_size);
make_function_symbol_from_c("pc-get-window-scale", (void*)get_window_scale);
make_function_symbol_from_c("pc-set-window-size", (void*)Gfx::set_window_size);
make_function_symbol_from_c("pc-set-letterbox", (void*)Gfx::set_letterbox);
make_function_symbol_from_c("pc-set-fullscreen", (void*)Gfx::set_fullscreen);
// init ps2 VM
if (VM::use) {
make_function_symbol_from_c("vm-ptr", (void*)VM::get_vm_ptr);
@@ -826,7 +870,7 @@ void InitMachineScheme() {
new_pair(s7.offset + FIX_SYM_GLOBAL_HEAP, *((s7 + FIX_SYM_PAIR_TYPE).cast<u32>()),
make_string_from_c("common"), kernel_packages->value);
lg::info("calling fake play~");
lg::info("calling fake play");
call_goal_function_by_name("play");
}
}