From eebba003ea19716261c4132b6d1c83fa46745e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20R=2E=20Miguel?= <36349314+vrmiguel@users.noreply.github.com> Date: Fri, 8 May 2020 03:26:21 -0300 Subject: [PATCH 1/3] Add features and enhancements. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 5c77892..32cd8b6 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,13 @@ OpenGL adaptation of [n64decomp/sm64](https://github.com/n64decomp/sm64). Feel free to report bugs and contribute, but remember, there must be **no upload of any copyrighted asset**. Run `./extract-assets.py --clean && make clean` or `make distclean` to remove ROM-originated content. +## Features + + * Native rendering. You can now play SM64 without the need of an emulator. + * Variable aspect ratio and resolution. The game can now correctly render at basically any window size. + * Native xinput controller support. On Linux, DualShock 4 has been confirmed to work plug-and-play. + * True analog camera control is now available on our [testing branch](https://github.com/sm64pc/sm64pc/tree/testing). + ## Building ### On Linux @@ -64,6 +71,19 @@ A full guide is to be written. You can use [mxe](https://mxe.cc/) and MinGW. The game can be compiled for web browsers that support WebGL using [Emscripten](https://github.com/emscripten-core). To do so, install [emsdk](https://github.com/emscripten-core/emsdk) and run `make TARGET_WEB=1`. +## Optional enhancements + +On the `./enhancements` folder, you'll find several .patch files, which can be applied in the following manner: + +``` + git apply fps.patch --ignore-whitespace --reject +``` +If any rejections occur, you can search for them with `find | grep .rej`. +Try to solve rejections through [wiggle](https://github.com/neilbrown/wiggle). +``` +wiggle rejection.rej --replace +``` + ### Current issues * Support for the EU version is still experimental. From 7e97699076892c6bca7d83f6d61164881220a423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20R=2E=20Miguel?= <36349314+vrmiguel@users.noreply.github.com> Date: Fri, 8 May 2020 04:14:56 -0300 Subject: [PATCH 2/3] Add RPi-related optimizations. --- src/pc/gfx/gfx_sdl2.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index c1bd9fc..2d8a1e7 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -80,16 +80,28 @@ const SDL_Scancode scancode_rmapping_nonextended[][2] = { static void gfx_sdl_init(void) { SDL_Init(SDL_INIT_VIDEO); - + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + + #ifdef TARGET_RPI + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); // These attributes allow for hardware acceleration on RPis. + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); + #endif //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); + #ifndef TARGET_RPI wnd = SDL_CreateWindow("Super Mario 64 PC-Port", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, DESIRED_SCREEN_WIDTH, DESIRED_SCREEN_HEIGHT, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); - + #else + wnd = SDL_CreateWindow("Super Mario 64 RPi (GLES2)", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + DESIRED_SCREEN_WIDTH, DESIRED_SCREEN_HEIGHT, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); + #endif + + if (configFullscreen) { SDL_SetWindowFullscreen(wnd, SDL_WINDOW_FULLSCREEN_DESKTOP); @@ -204,4 +216,4 @@ struct GfxWindowManagerAPI gfx_sdl = { gfx_sdl_swap_buffers_begin, gfx_sdl_swap_buffers_end, gfx_sdl_get_time -}; \ No newline at end of file +}; From 0c10f9eacc7c143d2b335228dfff2052de7b65ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20R=2E=20Miguel?= <36349314+vrmiguel@users.noreply.github.com> Date: Fri, 8 May 2020 04:36:17 -0300 Subject: [PATCH 3/3] Removes the cursor from view when on the game's window. --- src/pc/gfx/gfx_sdl2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index 2d8a1e7..5d7419c 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -80,6 +80,7 @@ const SDL_Scancode scancode_rmapping_nonextended[][2] = { static void gfx_sdl_init(void) { SDL_Init(SDL_INIT_VIDEO); + SDL_ShowCursor(SDL_DISABLE); // Removes the cursor from view when upon the game's window. SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);