From 2829feffadb1e4261ab71a69917f8c20a9b60451 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Tue, 12 May 2026 14:02:36 +0500 Subject: [PATCH 01/10] Enable mission retry --- src/core/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/config.h b/src/core/config.h index 9771ebe..10edd1b 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -394,9 +394,9 @@ enum Config { #define USE_MEASUREMENTS_IN_METERS // makes game use meters instead of feet in script #define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely #ifdef PC_MENU -//# define MISSION_REPLAY // mobile feature +# define MISSION_REPLAY // mobile feature #endif -//#define SIMPLIER_MISSIONS // apply simplifications from mobile +#define SIMPLIER_MISSIONS // apply simplifications from mobile #define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log From a3847a976882d052a27fe7493bcdba88c18bc262 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Tue, 12 May 2026 22:44:44 +0500 Subject: [PATCH 02/10] VC4 fixes Fixed lags on specific conditions, skinning --- TODO.md | 8 ++++---- src/core/main.cpp | 6 +++--- src/renderer/SpecialFX.cpp | 6 +++--- vendor/librw/src/gl/gl3immed.cpp | 20 ++++++++++++++++++++ vendor/librw/src/gl/gl3skin.cpp | 1 - vendor/librw/src/gl/shaders/skin.vert | 2 +- vendor/librw/src/gl/shaders/skin_gl.inc | 2 +- 7 files changed, 32 insertions(+), 13 deletions(-) diff --git a/TODO.md b/TODO.md index 32eb71c..3b2cf5f 100644 --- a/TODO.md +++ b/TODO.md @@ -16,13 +16,13 @@ Common: GLES 2.0 specific: - [x] Optimize to always run 10+ fps - [x] Fix skinning shader (cutscene heads require it) +- [x] Fix face animations in optimized builds +- [x] Disappearing background in cutscenes +- [x] Huge lag spikes on VC4 +- [x] Skinning shader is still broken on VC4 - [ ] Optimize to always run 20+ fps - [ ] Use etc1 compression -- [ ] Fix face animations in optimized builds -- [ ] Skinning shader is still broken on VC4 -- [ ] Disappearing background in cutscenes - [ ] HUD still disappearing sometimes -- [ ] Huge lag spikes on VC4 GLES 1.1 specific: - [x] Backport to STLport v4 diff --git a/src/core/main.cpp b/src/core/main.cpp index d44fe99..21643e0 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1403,10 +1403,10 @@ RenderScene(void) } #endif PUSH_RENDERGROUP("RenderScene"); -// CClouds::Render(); + CClouds::Render(); DoRWRenderHorizon(); CRenderer::RenderRoads(); -// CCoronas::RenderReflections(); + CCoronas::RenderReflections(); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); CRenderer::RenderEverythingBarRoads(); CRenderer::RenderBoats(); @@ -1416,7 +1416,7 @@ RenderScene(void) #ifndef SQUEEZE_PERFORMANCE CRenderer::RenderVehiclesButNotBoats(); #endif -// CWeather::RenderRainStreaks(); + CWeather::RenderRainStreaks(); POP_RENDERGROUP(); } diff --git a/src/renderer/SpecialFX.cpp b/src/renderer/SpecialFX.cpp index 4f4e4a0..6d96d21 100644 --- a/src/renderer/SpecialFX.cpp +++ b/src/renderer/SpecialFX.cpp @@ -137,10 +137,10 @@ void CSpecialFX::Render(void) { PUSH_RENDERGROUP("CSpecialFX::Render"); -// CMotionBlurStreaks::Render(); + CMotionBlurStreaks::Render(); CBulletTraces::Render(); -// CBrightLights::Render(); -// CShinyTexts::Render(); + CBrightLights::Render(); + CShinyTexts::Render(); CMoneyMessages::Render(); #ifdef NEW_RENDERER if(!(gbNewRenderer && FredIsInFirstPersonCam())) diff --git a/vendor/librw/src/gl/gl3immed.cpp b/vendor/librw/src/gl/gl3immed.cpp index 1619f23..8eaa827 100644 --- a/vendor/librw/src/gl/gl3immed.cpp +++ b/vendor/librw/src/gl/gl3immed.cpp @@ -118,6 +118,11 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices) glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u)); + glDisableVertexAttribArray(ATTRIB_NORMAL); + glDisableVertexAttribArray(ATTRIB_WEIGHTS); + glDisableVertexAttribArray(ATTRIB_INDICES); + glDisableVertexAttribArray(ATTRIB_TEXCOORDS1); + glDrawArrays(primTypeMap[primType], 0, numVertices); glDisableVertexAttribArray(ATTRIB_POS); @@ -151,6 +156,11 @@ im2DRenderIndexedPrimitive(PrimitiveType primType, glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u)); + glDisableVertexAttribArray(ATTRIB_NORMAL); + glDisableVertexAttribArray(ATTRIB_WEIGHTS); + glDisableVertexAttribArray(ATTRIB_INDICES); + glDisableVertexAttribArray(ATTRIB_TEXCOORDS1); + glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices); glDisableVertexAttribArray(ATTRIB_POS); @@ -221,6 +231,11 @@ im3DRenderPrimitive(PrimitiveType primType) glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u)); + glDisableVertexAttribArray(ATTRIB_NORMAL); + glDisableVertexAttribArray(ATTRIB_WEIGHTS); + glDisableVertexAttribArray(ATTRIB_INDICES); + glDisableVertexAttribArray(ATTRIB_TEXCOORDS1); + glDrawArrays(primTypeMap[primType], 0, num3DVertices); glDisableVertexAttribArray(ATTRIB_POS); @@ -245,6 +260,11 @@ im3DRenderIndexedPrimitive(PrimitiveType primType, void *indices, int32 numIndic glEnableVertexAttribArray(ATTRIB_TEXCOORDS0); glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u)); + glDisableVertexAttribArray(ATTRIB_NORMAL); + glDisableVertexAttribArray(ATTRIB_WEIGHTS); + glDisableVertexAttribArray(ATTRIB_INDICES); + glDisableVertexAttribArray(ATTRIB_TEXCOORDS1); + glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices); glDisableVertexAttribArray(ATTRIB_POS); diff --git a/vendor/librw/src/gl/gl3skin.cpp b/vendor/librw/src/gl/gl3skin.cpp index 8c626d7..a3dbeee 100644 --- a/vendor/librw/src/gl/gl3skin.cpp +++ b/vendor/librw/src/gl/gl3skin.cpp @@ -342,7 +342,6 @@ skinClose(void *o, int32, int32) void initSkin(void) { - if (moreVram) return; // TODO u_boneMatrices = registerUniform("u_boneMatrices", UNIFORM_MAT4, MAX_BONES); Driver::registerPlugin(PLATFORM_GL3, 0, ID_SKIN, diff --git a/vendor/librw/src/gl/shaders/skin.vert b/vendor/librw/src/gl/shaders/skin.vert index 1092d85..65e8595 100644 --- a/vendor/librw/src/gl/shaders/skin.vert +++ b/vendor/librw/src/gl/shaders/skin.vert @@ -13,7 +13,7 @@ main(void) SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x; SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y; SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z; - SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w; + //SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w; vec4 Vertex = u_world * vec4(SkinVertex, 1.0); gl_Position = u_proj * u_view * Vertex; diff --git a/vendor/librw/src/gl/shaders/skin_gl.inc b/vendor/librw/src/gl/shaders/skin_gl.inc index 21f13d7..ab7115a 100644 --- a/vendor/librw/src/gl/shaders/skin_gl.inc +++ b/vendor/librw/src/gl/shaders/skin_gl.inc @@ -14,7 +14,7 @@ const char *skin_vert_src = " SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x;\n" " SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y;\n" " SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z;\n" -" SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;\n" +" //SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;\n" " vec4 Vertex = u_world * vec4(SkinVertex, 1.0);\n" " gl_Position = u_proj * u_view * Vertex;\n" From 8cdae37d6e72f784a3dfbce94a4fbc6b25e504eb Mon Sep 17 00:00:00 2001 From: Shinovon Date: Tue, 12 May 2026 22:46:35 +0500 Subject: [PATCH 03/10] Bump pkg version --- sis/re3-gles1.pkg | 2 +- sis/re3.pkg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sis/re3-gles1.pkg b/sis/re3-gles1.pkg index 2f70b53..93aa794 100644 --- a/sis/re3-gles1.pkg +++ b/sis/re3-gles1.pkg @@ -1,4 +1,4 @@ -#{"GTA III"},(0xe0d67647),1,0,2 +#{"GTA III"},(0xe0d67647),1,0,3 [0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3 [0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1 diff --git a/sis/re3.pkg b/sis/re3.pkg index e570f2e..9374b6b 100644 --- a/sis/re3.pkg +++ b/sis/re3.pkg @@ -1,4 +1,4 @@ -#{"GTA III"},(0xe0d67647),1,0,2 +#{"GTA III"},(0xe0d67647),1,0,3 [0x101F7961], 0, 0, 0, {"S60ProductID"} ; S60v3 [0x1028315F], 0, 0, 0, {"S60ProductID"} ; ^1 From 4029e8ac5dafe2b74a0af5a0fdb3fe4ee3b6bcca Mon Sep 17 00:00:00 2001 From: Shinovon Date: Tue, 12 May 2026 22:49:50 +0500 Subject: [PATCH 04/10] Update todo --- TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 3b2cf5f..21e2dd3 100644 --- a/TODO.md +++ b/TODO.md @@ -35,6 +35,6 @@ GLES 1.1 specific: - [ ] Fix lighting Issues: -- [x] Fix crash in Texture::destroy on exit +- [ ] Fix crash in Texture::destroy on exit - [x] Save menu is too slow - [x] Crash when picking up a bat From 0f1389bb3ea2a884c3867ca79baaf4acd0441b38 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Wed, 13 May 2026 11:52:05 +0500 Subject: [PATCH 05/10] Update readme --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 83d7686..59786b0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # re3-symbian -Work-in-progress port of GTA III for Symbian devices.\ -Supports S60 3rd Edition FP1, S60 5th edition Symbian^3 and later. +Work-in-progress port of GTA III for Symbian devices. Based on re3, uses some code from [Dreamcast](https://gitlab.com/skmp/dca3-game) and [Vita](https://github.com/Rinnegatamante/librw-vita) ports. @@ -14,6 +13,13 @@ Tested devices: - Anna/Belle with BCM2727 (E7, N8, E6) - GLES 2.0 - S60v3.1 with PowerVR MBX (E90, N95) - GLES 1.1 +## Device requirements + +- S60 3rd Edition FP1, S60 5th Edition (non-Nokia), Symbian^3 or later +- GPU +- 128 MB RAM with at least 50 MB free +- Functional E: drive with 400 MB of free space + ## Building Import bld.inf in Carbide.c++ with Symbian^3 or newer SDK, add PKG file to SIS Builder and build the project. From 7e3f0685a3283cc0593ddc002b54a7a092c1450a Mon Sep 17 00:00:00 2001 From: Shinovon Date: Wed, 13 May 2026 11:56:03 +0500 Subject: [PATCH 06/10] Update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 59786b0..72c9ed8 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Tested devices: - S60 3rd Edition FP1, S60 5th Edition (non-Nokia), Symbian^3 or later - GPU -- 128 MB RAM with at least 50 MB free -- Functional E: drive with 400 MB of free space +- 128 MB RAM with at least 50 MB free (won't run on regular 64 MB N95 unless you disable all textures) +- Functional E: drive with 400 MB of free space (will be more as it'll start to support audio) ## Building From 3bec747ea69fc2a402e5efe2f9c9feba57bf72b7 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 14 May 2026 10:36:47 +0500 Subject: [PATCH 07/10] Check for stdcpp installation in pkg --- sis/re3.pkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sis/re3.pkg b/sis/re3.pkg index 9374b6b..4b38c53 100644 --- a/sis/re3.pkg +++ b/sis/re3.pkg @@ -7,7 +7,7 @@ %{"nnproject"} :"nnproject" -IF (NOT package(0x20009A80)) OR (NOT package(0x2002372A)) ; old or missing openc +IF (NOT package(0x20009A80)) OR (NOT package(0x2002372A)) OR (NOT package(0x10282872)) ; old or missing openc "incompatible_openc.txt"-"", FT, FORCEABORT ENDIF From 78e67407359b761edbefbe3d551a7c5b45bc23de Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 14 May 2026 13:52:53 +0500 Subject: [PATCH 08/10] Supress logging --- README.md | 10 +++++----- group/librw.mmh | 2 +- vendor/librw/src/gl/gl3shader.cpp | 5 +++++ vendor/librw/src/printf_stub.c | 11 +++++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 vendor/librw/src/printf_stub.c diff --git a/README.md b/README.md index 72c9ed8..6aa9517 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,6 @@ Based on re3, uses some code from [Dreamcast](https://gitlab.com/skmp/dca3-game) See [TODO.md](/TODO.md) for more details on project state. -Tested devices: -- Belle with BCM2763 (700) - GLES 2.0 -- Anna/Belle with BCM2727 (E7, N8, E6) - GLES 2.0 -- S60v3.1 with PowerVR MBX (E90, N95) - GLES 1.1 - ## Device requirements - S60 3rd Edition FP1, S60 5th Edition (non-Nokia), Symbian^3 or later @@ -20,6 +15,11 @@ Tested devices: - 128 MB RAM with at least 50 MB free (won't run on regular 64 MB N95 unless you disable all textures) - Functional E: drive with 400 MB of free space (will be more as it'll start to support audio) +Tested devices: +- Belle with BCM2763 (700) - GLES 2.0 +- Anna/Belle with BCM2727 (E7, N8, E6) - GLES 2.0 +- S60v3.1 with PowerVR MBX (E90, N95) - GLES 1.1 + ## Building Import bld.inf in Carbide.c++ with Symbian^3 or newer SDK, add PKG file to SIS Builder and build the project. diff --git a/group/librw.mmh b/group/librw.mmh index b38f518..2276d21 100644 --- a/group/librw.mmh +++ b/group/librw.mmh @@ -25,4 +25,4 @@ SOURCEPATH ../vendor/librw/src/ps2 SOURCE pds.cpp ps2.cpp ps2device.cpp ps2matfx.cpp ps2raster.cpp ps2skin.cpp SOURCEPATH ../vendor/librw/src SOURCE raster.cpp render.cpp skin.cpp texture.cpp tga.cpp tristrip.cpp userdata.cpp uvanim.cpp world.cpp -SOURCE assert.cpp +SOURCE assert.cpp printf_stub.c diff --git a/vendor/librw/src/gl/gl3shader.cpp b/vendor/librw/src/gl/gl3shader.cpp index 5e37304..c217a85 100644 --- a/vendor/librw/src/gl/gl3shader.cpp +++ b/vendor/librw/src/gl/gl3shader.cpp @@ -189,8 +189,13 @@ compileshader(GLenum type, const char **src, GLuint *shader) glShaderSource(shdr, n, src, nil); glCompileShader(shdr); glGetShaderiv(shdr, GL_COMPILE_STATUS, &success); +#ifdef _DEBUG printShaderSource(src); +#endif if(!success){ +#ifndef _DEBUG + printShaderSource(src); +#endif fprintf(stderr, "Error in %s shader\n", type == GL_VERTEX_SHADER ? "vertex" : "fragment"); glGetShaderiv(shdr, GL_INFO_LOG_LENGTH, &len); diff --git a/vendor/librw/src/printf_stub.c b/vendor/librw/src/printf_stub.c new file mode 100644 index 0000000..04df7e5 --- /dev/null +++ b/vendor/librw/src/printf_stub.c @@ -0,0 +1,11 @@ +#ifndef _DEBUG +#include + +int printf(const char * __restrict s, ...) { + return 0; +} + +int puts(const char *s) { + return 0; +} +#endif From ad5d8af63b1be9a8a85431f055fd81cb4136fd98 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Thu, 14 May 2026 13:53:24 +0500 Subject: [PATCH 09/10] Detect whether rendering on powervr or videocore --- src/skel/symbian/symbian.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/skel/symbian/symbian.cpp b/src/skel/symbian/symbian.cpp index b8f38ae..a07a202 100644 --- a/src/skel/symbian/symbian.cpp +++ b/src/skel/symbian/symbian.cpp @@ -96,6 +96,7 @@ static bool spinning; bool qwerty; bool touch; bool moreVram; +bool powervr; void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs) { } @@ -574,6 +575,17 @@ public: eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext); + const char* renderer = (const char *)glGetString(GL_RENDERER); + if (strstr(renderer, "MBX") || strstr(renderer, "SGX")) { + // use pvrtc + powervr = true; + } else if (strstr(renderer, "VideoCore")) { + // use etc1 + } else { + User::Leave(KErrNotSupported); + return; + } + setlocale(LC_ALL, ""); setlocale(LC_CTYPE, "C"); setlocale(LC_COLLATE, "C"); From 653d313413b9a299c2ebcf6701e7bf7b7eeb9f95 Mon Sep 17 00:00:00 2001 From: Shinovon Date: Fri, 15 May 2026 09:09:32 +0500 Subject: [PATCH 10/10] Update todo --- TODO.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 21e2dd3..c78f917 100644 --- a/TODO.md +++ b/TODO.md @@ -10,7 +10,7 @@ Common: - [x] Merge S60v3 and ^3 branches - [ ] Simplify geometry - [ ] Move map to top left corner -- [ ] Do something with sprites, they're still taking too much frame time +- [ ] Too many draw calls - [ ] Audio GLES 2.0 specific: @@ -22,7 +22,8 @@ GLES 2.0 specific: - [x] Skinning shader is still broken on VC4 - [ ] Optimize to always run 20+ fps - [ ] Use etc1 compression -- [ ] HUD still disappearing sometimes +- [ ] HUD still disappearing sometimes on VC3 +- [ ] Effects are slowing the render on VC4 GLES 1.1 specific: - [x] Backport to STLport v4