Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
blueminder committed Feb 23, 2023
2 parents dbc740b + a970a12 commit ceb5e16
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Expand Up @@ -78,7 +78,7 @@ jobs:
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}

- name: Setup Sentry CLI
uses: mathieu-bour/setup-sentry-cli@1.2.0
uses: mathieu-bour/setup-sentry-cli@v1
env:
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/c-cpp.yml
Expand Up @@ -208,7 +208,7 @@ jobs:
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' && (matrix.config.os == 'windows-2019' || matrix.config.os == 'ubuntu-22.04' || matrix.config.name == 'apple-darwin') }}

- name: Setup Sentry CLI
uses: mathieu-bour/setup-sentry-cli@1.2.0
uses: mathieu-bour/setup-sentry-cli@v1
env:
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -73,7 +73,7 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(WINDOWS_STORE)
string(REPLACE "v" "" MS_VERSION ${GIT_VERSION})
string(REGEX REPLACE "[Vv]" "" MS_VERSION ${GIT_VERSION})
string(REPLACE "-" "." MS_VERSION ${MS_VERSION})
string(REGEX REPLACE "\.g[0-9a-f]+" "" MS_VERSION ${MS_VERSION})
string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+" VERSION_3PARTS ${MS_VERSION})
Expand Down
15 changes: 15 additions & 0 deletions core/cheats.cpp
Expand Up @@ -446,6 +446,21 @@ void CheatManager::reset(const std::string& gameId)
cheats.emplace_back(Cheat::Type::setValue, "Skip DIMM version check", true, 16, 0x0007f486, 0xe001); // mov #1, r0
cheats.back().builtIn = true;
}
else if (gameId == "Fixed BOOT strapper") // Extreme Hunting 2
{
setActive(true);
cheats.emplace_back(Cheat::Type::runNextIfEq, "skip netbd check ifeq", true, 32, 0x00067b04, 0);
cheats.back().builtIn = true;
cheats.emplace_back(Cheat::Type::setValue, "skip netbd check", true, 32, 0x00067b04, 1); // 1 skips initNetwork()
cheats.back().builtIn = true;
cheats.emplace_back(Cheat::Type::setValue, "skip netbd check 2", true, 16, 0x0009acc8, 0x0009); // not acceptable by main board
cheats.back().builtIn = true;
// ac010000 should be d202 9302, but is changed to 78c0 8c93
cheats.emplace_back(Cheat::Type::runNextIfEq, "fix boot ifeq", true, 32, 0x00010000, 0x8c9378c0);
cheats.back().builtIn = true;
cheats.emplace_back(Cheat::Type::setValue, "fix boot", true, 32, 0x00010000, 0x9302d202);
cheats.back().builtIn = true;
}

if (config::WidescreenGameHacks)
{
Expand Down
5 changes: 3 additions & 2 deletions core/emulator.cpp
Expand Up @@ -328,8 +328,9 @@ static void loadSpecialSettings()
else if (prod_id == "NINJA ASSAULT"
|| prod_id == "Sports Shooting USA" // AW
|| prod_id == "SEGA CLAY CHALLENGE" // AW
|| prod_id == "RANGER MISSION" // AW
|| prod_id == "EXTREME HUNTING") // AW
|| prod_id == "RANGER MISSION" // AW
|| prod_id == "EXTREME HUNTING" // AW
|| prod_id == "Fixed BOOT strapper")// Extreme hunting 2 (AW)
{
INFO_LOG(BOOT, "Enabling lightgun setup for game %s", prod_id.c_str());
settings.input.JammaSetup = JVS::LightGun;
Expand Down
3 changes: 2 additions & 1 deletion core/hw/pvr/pvr.cpp
Expand Up @@ -46,7 +46,8 @@ void reset(bool hard)
rend_reset();
tactx_Term();
elan::reset(hard);
ta_parse_reset();
if (hard)
ta_parse_reset();
}

void init()
Expand Down
6 changes: 4 additions & 2 deletions core/reios/reios.cpp
Expand Up @@ -121,8 +121,10 @@ static bool reios_locate_bootfile(const char* bootfile)
// system settings
flash_syscfg_block syscfg{};
int rc = static_cast<DCFlashChip*>(flashrom)->ReadBlock(FLASH_PT_USER, FLASH_USER_SYSCFG, &syscfg);
verify(rc != 0);
memcpy(&data[16], &syscfg.time_lo, 8);
if (rc == 0)
WARN_LOG(REIOS, "Can't read system settings from flash");
else
memcpy(&data[16], &syscfg.time_lo, 8);

memcpy(GetMemPtr(0x8c000068, sizeof(data)), data, sizeof(data));

Expand Down
5 changes: 3 additions & 2 deletions core/rend/TexCache.cpp
Expand Up @@ -453,11 +453,11 @@ void BaseTextureCacheData::unprotectVRam()

bool BaseTextureCacheData::Delete()
{
unprotectVRam();

if (custom_load_in_progress > 0)
return false;

unprotectVRam();

free(custom_image_data);
custom_image_data = nullptr;

Expand Down Expand Up @@ -625,6 +625,7 @@ void BaseTextureCacheData::Update()
else
{
WARN_LOG(RENDERER, "Warning: invalid texture. Address %08X %08X size %d", sa_tex, sa, size);
unprotectVRam();
return;
}
}
Expand Down
60 changes: 40 additions & 20 deletions core/rend/gl4/gles.cpp
Expand Up @@ -72,17 +72,21 @@ in vec4 in_pos;
in vec4 in_base;
in vec4 in_offs;
in vec2 in_uv;
#if pp_TwoVolumes == 1
in vec4 in_base1;
in vec4 in_offs1;
in vec2 in_uv1;
#endif
// Output
INTERPOLATION out vec4 vtx_base;
INTERPOLATION out vec4 vtx_offs;
out vec3 vtx_uv;
#if pp_TwoVolumes == 1
INTERPOLATION out vec4 vtx_base1;
INTERPOLATION out vec4 vtx_offs1;
out vec2 vtx_uv1;
#endif
flat out uint vtx_index;
void main()
Expand All @@ -95,20 +99,26 @@ void main()
vtx_base = in_base;
vtx_offs = in_offs;
vtx_uv = vec3(in_uv, vpos.z);
vtx_base1 = in_base1;
vtx_offs1 = in_offs1;
vtx_uv1 = in_uv1;
#if pp_TwoVolumes == 1
vtx_base1 = in_base1;
vtx_offs1 = in_offs1;
vtx_uv1 = in_uv1;
#endif
vtx_index = uint(pp_Number) + uint(gl_VertexID);
#if pp_Gouraud == 1 && DIV_POS_Z != 1
vtx_base *= vpos.z;
vtx_offs *= vpos.z;
vtx_base1 *= vpos.z;
vtx_offs1 *= vpos.z;
#if pp_TwoVolumes == 1
vtx_base1 *= vpos.z;
vtx_offs1 *= vpos.z;
#endif
#endif
#if DIV_POS_Z != 1
vtx_uv.xy *= vpos.z;
vtx_uv1 *= vpos.z;
#if pp_TwoVolumes == 1
vtx_uv1 *= vpos.z;
#endif
vpos.w = 1.0;
vpos.z = 0.0;
#endif
Expand Down Expand Up @@ -169,9 +179,11 @@ uniform int fog_control[2];
INTERPOLATION in vec4 vtx_base;
INTERPOLATION in vec4 vtx_offs;
in vec3 vtx_uv;
#if pp_TwoVolumes == 1
INTERPOLATION in vec4 vtx_base1;
INTERPOLATION in vec4 vtx_offs1;
in vec2 vtx_uv1;
#endif
flat in uint vtx_index;
float fog_mode2(float w)
Expand Down Expand Up @@ -275,21 +287,27 @@ void main()
vec4 texcol;
#if pp_Palette == 0
#if DIV_POS_Z == 1
if (area1)
texcol = texture(tex1, vtx_uv1);
else
texcol = texture(tex0, vtx_uv.xy);
#if pp_TwoVolumes == 1
if (area1)
texcol = texture(tex1, vtx_uv1);
else
#endif
texcol = texture(tex0, vtx_uv.xy);
#else
#if pp_TwoVolumes == 1
if (area1)
texcol = textureProj(tex1, vec3(vtx_uv1.xy, vtx_uv.z));
else
#endif
texcol = textureProj(tex0, vtx_uv);
#endif
#else
#if pp_TwoVolumes == 1
if (area1)
texcol = textureProj(tex1, vec3(vtx_uv1.xy, vtx_uv.z));
texcol = palettePixel(tex1, vec3(vtx_uv1.xy, vtx_uv.z));
else
texcol = textureProj(tex0, vtx_uv);
#endif
#else
if (area1)
texcol = palettePixel(tex1, vec3(vtx_uv1.xy, vtx_uv.z));
else
texcol = palettePixel(tex0, vtx_uv);
texcol = palettePixel(tex0, vtx_uv);
#endif
#if pp_BumpMap == 1
Expand Down Expand Up @@ -457,7 +475,9 @@ void main()
class Vertex4Source : public OpenGl4Source
{
public:
Vertex4Source(bool gouraud, bool divPosZ) : OpenGl4Source() {
Vertex4Source(bool gouraud, bool divPosZ, bool twoVolumes) : OpenGl4Source()
{
addConstant("pp_TwoVolumes", twoVolumes);
addConstant("pp_Gouraud", gouraud);
addConstant("DIV_POS_Z", divPosZ);

Expand Down Expand Up @@ -505,7 +525,7 @@ bool gl4CompilePipelineShader(gl4PipelineShader* s, const char *fragment_source
if (s->naomi2)
vertexSource = N2Vertex4Source(s).generate();
else
vertexSource = Vertex4Source(s->pp_Gouraud, s->divPosZ).generate();
vertexSource = Vertex4Source(s->pp_Gouraud, s->divPosZ, s->pp_TwoVolumes).generate();
Fragment4ShaderSource fragmentSource(s);

s->program = gl_CompileAndLink(vertex_source != nullptr ? vertex_source : vertexSource.c_str(),
Expand Down Expand Up @@ -621,7 +641,7 @@ static void create_modvol_shader()
{
if (gl4.modvol_shader.program != 0)
return;
Vertex4Source vertexShader(false, config::NativeDepthInterpolation);
Vertex4Source vertexShader(false, config::NativeDepthInterpolation, false);
OpenGl4Source fragmentShader;
fragmentShader.addConstant("DIV_POS_Z", config::NativeDepthInterpolation)
.addSource(ShaderHeader)
Expand Down
4 changes: 1 addition & 3 deletions core/rend/gles/gles.cpp
Expand Up @@ -651,8 +651,6 @@ GLuint gl_CompileAndLink(const char *vertexShader, const char *fragmentShader)

glcache.UseProgram(program);

verify(glIsProgram(program));

return program;
}

Expand Down Expand Up @@ -809,7 +807,7 @@ bool CompilePipelineShader(PipelineShader* s)

ShaderUniforms.Set(s);

return glIsProgram(s->program)==GL_TRUE;
return true;
}

#ifdef __ANDROID__
Expand Down
4 changes: 2 additions & 2 deletions core/rend/gles/opengl_driver.cpp
Expand Up @@ -50,13 +50,13 @@ OpenGLDriver::OpenGLDriver()
for (auto& tex : vmu_lcd_tex_ids)
tex = ImTextureID();
ImGui_ImplOpenGL3_Init();
EventManager::listen(Event::Start, emuEventCallback, this);
EventManager::listen(Event::Resume, emuEventCallback, this);
EventManager::listen(Event::Terminate, emuEventCallback, this);
}

OpenGLDriver::~OpenGLDriver()
{
EventManager::unlisten(Event::Start, emuEventCallback, this);
EventManager::unlisten(Event::Resume, emuEventCallback, this);
EventManager::unlisten(Event::Terminate, emuEventCallback, this);

std::vector<GLuint> texIds;
Expand Down
2 changes: 1 addition & 1 deletion core/rend/gles/opengl_driver.h
Expand Up @@ -53,7 +53,7 @@ class OpenGLDriver final : public ImGuiDriver
{
switch (event)
{
case Event::Start:
case Event::Resume:
gameStarted = true;
break;
case Event::Terminate:
Expand Down

0 comments on commit ceb5e16

Please sign in to comment.