mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65a92470d3 | ||
|
|
10dc1a2da2 | ||
|
|
aad2128c32 | ||
|
|
2640678cac | ||
|
|
8b90e2d53d | ||
|
|
f87175dc7f | ||
|
|
b30444c0d0 | ||
|
|
c1da0caf15 | ||
|
|
c4a8fc5b71 | ||
|
|
8eb46b5a4c | ||
|
|
8be16d1039 | ||
|
|
76e6208d1b | ||
|
|
bc09080ba5 | ||
|
|
a6eb257a3a | ||
|
|
e62450d255 | ||
|
|
1aa922f700 | ||
|
|
4c9d2f99b1 | ||
|
|
f6e899b570 | ||
|
|
695c39fba2 | ||
|
|
e5616cff98 | ||
|
|
76d5994c1e | ||
|
|
cbb40832a1 | ||
|
|
e4bdcde1ca | ||
|
|
863e119ff4 | ||
|
|
2ccf6dc872 | ||
|
|
24ebf1b4f1 | ||
|
|
ed2832434c | ||
|
|
5e160fca8f | ||
|
|
a0ef82e221 | ||
|
|
3e7ac3d66c | ||
|
|
730e6fa737 | ||
|
|
cdfcd9fddd |
55
.github/workflows/cron_publish_flatpak.yml
vendored
55
.github/workflows/cron_publish_flatpak.yml
vendored
@@ -6,36 +6,43 @@ on:
|
||||
workflow_dispatch: # As well as manually.
|
||||
|
||||
jobs:
|
||||
check:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
name: "Check if release is needed"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 180
|
||||
outputs:
|
||||
PCSX2_RELEASE: ${{ steps.getinfo.outputs.PCSX2_RELEASE }}
|
||||
FLATHUB_RELEASE: ${{ steps.getinfo.outputs.FLATHUB_RELEASE }}
|
||||
steps:
|
||||
- name: Get latest tag and Flathub release
|
||||
id: getinfo
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
PCSX2_RELEASE=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/PCSX2/pcsx2/releases | jq -r '.[0].tag_name')
|
||||
FLATHUB_RELEASE=$(curl -L -s https://flathub.org/api/v2/appstream/net.pcsx2.PCSX2 | jq -r '.releases | max_by(.version) | .version')
|
||||
echo "Latest PCSX2 release is: '${PCSX2_RELEASE}'"
|
||||
echo "Latest Flathub release is: '${FLATHUB_RELEASE}'"
|
||||
PCSX2_RELEASE=$(echo $PCSX2_RELEASE | sed 's/[^0-9]*//g')
|
||||
FLATHUB_RELEASE=$(echo $FLATHUB_RELEASE | sed 's/[^0-9]*//g')
|
||||
echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||
echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# check is disabled as the flathub api does not give us beta repository information
|
||||
# Alternatively we can "flatpak remote-info or parse the appstream directly for the beta repo"
|
||||
# Maybe in the future if we don't want to publish the same version twice if we get no commits
|
||||
# for 24 hours.
|
||||
|
||||
# check:
|
||||
# if: github.repository == 'PCSX2/pcsx2'
|
||||
# name: "Check if release is needed"
|
||||
# runs-on: ubuntu-latest
|
||||
# timeout-minutes: 180
|
||||
# outputs:
|
||||
# PCSX2_RELEASE: ${{ steps.getinfo.outputs.PCSX2_RELEASE }}
|
||||
# FLATHUB_RELEASE: ${{ steps.getinfo.outputs.FLATHUB_RELEASE }}
|
||||
# steps:
|
||||
# - name: Get latest tag and Flathub release
|
||||
# id: getinfo
|
||||
# env:
|
||||
# GH_TOKEN: ${{ github.token }}
|
||||
# run: |
|
||||
# PCSX2_RELEASE=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/PCSX2/pcsx2/releases | jq -r '.[0].tag_name')
|
||||
# FLATHUB_RELEASE=$(curl -L -s https://flathub.org/api/v2/appstream/net.pcsx2.PCSX2 | jq -r '.releases | max_by(.version) | .version')
|
||||
# echo "Latest PCSX2 release is: '${PCSX2_RELEASE}'"
|
||||
# echo "Latest Flathub release is: '${FLATHUB_RELEASE}'"
|
||||
# PCSX2_RELEASE=$(echo $PCSX2_RELEASE | sed 's/[^0-9]*//g')
|
||||
# FLATHUB_RELEASE=$(echo $FLATHUB_RELEASE | sed 's/[^0-9]*//g')
|
||||
# echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||
# echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
needs: check
|
||||
# needs: check
|
||||
# outputs are automatically compared as strings. This doesn't work in our favour
|
||||
# Use fromJson() to convert them to proper integers...
|
||||
# see: https://github.com/github/docs/pull/25870
|
||||
# and: https://github.com/orgs/community/discussions/57480
|
||||
#if: fromJson(needs.check.outputs.FLATHUB_RELEASE) < fromJson(needs.check.outputs.PCSX2_RELEASE)
|
||||
|
||||
# if: fromJson(needs.check.outputs.FLATHUB_RELEASE) < fromJson(needs.check.outputs.PCSX2_RELEASE)
|
||||
name: "Build and publish Flatpak"
|
||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||
with:
|
||||
|
||||
13
.github/workflows/linux_build_flatpak.yml
vendored
13
.github/workflows/linux_build_flatpak.yml
vendored
@@ -54,19 +54,16 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
set-safe-directory: ${{ env.GITHUB_WORKSPACE }}
|
||||
# 10 here, since the odds of having 10 untagged commits in a row should be slim to none
|
||||
# This is required for the tagging logic in generate-metainfo.sh
|
||||
fetch-depth: 10
|
||||
fetch-tags: true
|
||||
|
||||
# Work around container ownership issue
|
||||
- name: Set Safe Directory
|
||||
shell: bash
|
||||
run: git config --global --add safe.directory "*"
|
||||
|
||||
# Hackity hack. When running the workflow on a schedule, we don't have the tag,
|
||||
# it doesn't fetch tags, therefore we don't get a version. So grab them manually.
|
||||
# actions/checkout elides tags, fetch them primarily for releases
|
||||
- name: Fetch tags
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Add stable release identifier file
|
||||
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||
shell: bash
|
||||
@@ -125,7 +122,7 @@ jobs:
|
||||
cache: true
|
||||
restore-cache: true
|
||||
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}
|
||||
|
||||
|
||||
#- name: Validate build
|
||||
# run: |
|
||||
# flatpak-builder-lint repo repo
|
||||
|
||||
@@ -12,12 +12,24 @@ GIT_DATE=$(git log -1 --pretty=%cd --date=iso8601)
|
||||
GIT_VERSION=$(git tag --points-at HEAD)
|
||||
GIT_HASH=$(git rev-parse HEAD)
|
||||
|
||||
if [[ "${GIT_VERSION}" == "" ]]; then
|
||||
# In the odd event that we run this script before the release gets tagged.
|
||||
GIT_VERSION=$(git describe --tags)
|
||||
if [[ "${GIT_VERSION}" == "" ]]; then
|
||||
GIT_VERSION=$(git rev-parse HEAD)
|
||||
fi
|
||||
if [[ -z "${GIT_VERSION}" ]]; then
|
||||
if git branch -r --contains HEAD | grep -q 'origin/master'; then
|
||||
# Our master doesn't have a tagged commit
|
||||
# This happens when the commit is "ci skip"
|
||||
# abbrev so we have just the latest tag
|
||||
# ie v2.3.420 (Yes, that's the current master at the time of writing)
|
||||
GIT_VERSION=$(git describe --tags --abbrev=0)
|
||||
else
|
||||
# We are probably building a PR
|
||||
# Keep the short SHA in the version
|
||||
# ie v2.3.420-1-g10dc1a2da
|
||||
GIT_VERSION=$(git describe --tags)
|
||||
fi
|
||||
|
||||
if [[ -z "${GIT_VERSION}" ]]; then
|
||||
# Fallback to raw commit hash
|
||||
GIT_VERSION=$(git rev-parse HEAD)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "GIT_DATE: ${GIT_DATE}"
|
||||
|
||||
@@ -2557,8 +2557,6 @@ SCAJ-25012:
|
||||
SCAJ-25026:
|
||||
name: "Kunoichi Shinobi"
|
||||
region: "NTSC-Unk"
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SCAJ-25034:
|
||||
name: "Sakura Taisen Monogatari"
|
||||
region: "NTSC-Unk"
|
||||
@@ -12878,8 +12876,6 @@ SLAJ-25023:
|
||||
SLAJ-25026:
|
||||
name: "Kunoichi Shinobi"
|
||||
region: "NTSC-Unk"
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SLAJ-25027:
|
||||
name: "Sonic Heroes"
|
||||
region: "NTSC-Unk"
|
||||
@@ -12894,8 +12890,6 @@ SLAJ-25030:
|
||||
SLAJ-25031:
|
||||
name: "Kunoichi - Shinobu"
|
||||
region: "NTSC-C-J"
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SLAJ-25033:
|
||||
name: "Puyo Puyo Fever"
|
||||
region: "NTSC-Unk"
|
||||
@@ -19388,8 +19382,6 @@ SLES-52238:
|
||||
name: "Nightshade"
|
||||
region: "PAL-M5"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SLES-52240:
|
||||
name: "International Pool Championship"
|
||||
region: "PAL-M5"
|
||||
@@ -22086,6 +22078,8 @@ SLES-53099:
|
||||
SLES-53100:
|
||||
name: "Scooby-Doo! Unmasked"
|
||||
region: "PAL-M4"
|
||||
gsHWFixes:
|
||||
nativeScaling: 2 # Fixes post processing position.
|
||||
SLES-53104:
|
||||
name: "Tom Clancy's Rainbow Six - Lockdown"
|
||||
region: "PAL-M5"
|
||||
@@ -30956,8 +30950,6 @@ SLKA-25135:
|
||||
name: "Kunoichi"
|
||||
region: "NTSC-K"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SLKA-25136:
|
||||
name: "Need for Speed - Underground"
|
||||
region: "NTSC-K"
|
||||
@@ -32522,8 +32514,6 @@ SLKA-35004:
|
||||
name: "Sakura Wars 5 So Long My Love"
|
||||
region: "NTSC-K"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_SakuraWarsSoLongMyLove"
|
||||
SLKA-35005:
|
||||
name: "Jin Samguk Mussang 5 - Special"
|
||||
region: "NTSC-K"
|
||||
@@ -35217,8 +35207,6 @@ SLPM-61059:
|
||||
name-sort: "くのいち -しのび- [たいけんばん]"
|
||||
name-en: "Kunoichi -Shinobi- [Trial]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SLPM-61060:
|
||||
name: "BUSIN 0 ~Wizardry Alternative NEO~ [体験版]"
|
||||
name-sort: "ぶしん ぜろ ~うぃざーどりぃ おるたなてぃぶ ねお~ [たいけんばん]"
|
||||
@@ -42473,8 +42461,6 @@ SLPM-65447:
|
||||
name-en: "Kunoichi -Shinobi-"
|
||||
region: "NTSC-J"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SLPM-65448:
|
||||
name: "カンブリアンQTS ~化石になっても~"
|
||||
name-sort: "かんぶりあんQTS ~かせきになっても~"
|
||||
@@ -59136,6 +59122,8 @@ SLPS-25581:
|
||||
name-sort: "しんぷる2000しりーず Vol. 92 THE のろいのげーむ"
|
||||
name-en: "Simple 2000 Series Vol. 92 - The Game of a Curse"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
cpuCLUTRender: 1 # Fixes corrupted and missing graphics.
|
||||
SLPS-25582:
|
||||
name: "アストロ球団 決戦!!ビクトリー球団編"
|
||||
name-sort: "あすとろきゅうだん けっせん!!びくとりーきゅうだんへん"
|
||||
@@ -66538,8 +66526,6 @@ SLUS-20810:
|
||||
name: "Nightshade"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_Kunoichi"
|
||||
SLUS-20811:
|
||||
name: "Need for Speed - Underground"
|
||||
region: "NTSC-U"
|
||||
@@ -68231,6 +68217,8 @@ SLUS-21091:
|
||||
name: "Scooby-Doo! Unmasked"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
nativeScaling: 2 # Fixes post processing position.
|
||||
SLUS-21093:
|
||||
name: "Worms Forts - Under Siege"
|
||||
region: "NTSC-U"
|
||||
@@ -73133,8 +73121,6 @@ SLUS-21927:
|
||||
name: "Sakura Wars - So Long, My Love [English - Disc 1]"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_SakuraWarsSoLongMyLove"
|
||||
SLUS-21928:
|
||||
name: "Scooby-Doo! and the Spooky Swamp"
|
||||
region: "NTSC-U"
|
||||
@@ -73151,8 +73137,6 @@ SLUS-21930:
|
||||
name: "Sakura Wars - So Long, My Love [Japanese - Disc 2]"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
getSkipCount: "GSC_SakuraWarsSoLongMyLove"
|
||||
SLUS-21931:
|
||||
name: "Disney/Pixar Toy Story 3"
|
||||
region: "NTSC-U"
|
||||
|
||||
@@ -1000,6 +1000,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
03000000d62000007162000001000000,Moga Pro 2,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X,
|
||||
03000000c62400002a89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||
03000000c62400002b89000000010000,MOGA XP5A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||
03000000853200008906000000010000,Nacon Revolution X Unlimited,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
|
||||
03000000632500007505000000020000,NeoGeo mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||
03000000921200004b46000003020000,NES 2-port Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b11,platform:Mac OS X,
|
||||
030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Mac OS X,
|
||||
@@ -1607,6 +1608,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
030000009b2800003200000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
||||
030000009b2800006000000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
|
||||
030000009b2800006100000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux,
|
||||
030000009b2800006400000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux,
|
||||
030000009b2800008000000020020000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux,
|
||||
030000009b2800008000000001010000,Raphnet Wii Classic Adapter V3,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux,
|
||||
03000000f8270000bf0b000011010000,Razer Kishi,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||
|
||||
@@ -419,6 +419,16 @@ void Host::OnCreateMemoryCardOpenRequested()
|
||||
// noop
|
||||
}
|
||||
|
||||
bool Host::InBatchMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Host::InNoGUIMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Host::ShouldPreferHostFileSelector()
|
||||
{
|
||||
return false;
|
||||
@@ -534,7 +544,7 @@ bool GSRunner::ParseCommandLineArgs(int argc, char* argv[], VMBootParameters& pa
|
||||
{
|
||||
std::string str(argv[++i]);
|
||||
|
||||
s_settings_interface.SetBoolValue("EmuCore/GS", "dump", true);
|
||||
s_settings_interface.SetBoolValue("EmuCore/GS", "DumpGSData", true);
|
||||
|
||||
if (str.find("rt") != std::string::npos)
|
||||
s_settings_interface.SetBoolValue("EmuCore/GS", "SaveRT", true);
|
||||
@@ -766,7 +776,7 @@ bool GSRunner::ParseCommandLineArgs(int argc, char* argv[], VMBootParameters& pa
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s_settings_interface.GetBoolValue("EmuCore/GS", "dump") && !dumpdir.empty())
|
||||
if (s_settings_interface.GetBoolValue("EmuCore/GS", "DumpGSData") && !dumpdir.empty())
|
||||
{
|
||||
if (s_settings_interface.GetStringValue("EmuCore/GS", "HWDumpDirectory").empty())
|
||||
s_settings_interface.SetStringValue("EmuCore/GS", "HWDumpDirectory", dumpdir.c_str());
|
||||
|
||||
@@ -311,7 +311,7 @@ void searchWorker(DebugInterface* cpu, std::vector<SearchResult>& searchResults,
|
||||
const auto readValue = readValueAtAddress<T>(cpu, addr);
|
||||
|
||||
const bool doesMatch = handleSearchComparison(searchComparison, addr, &searchResult, searchValue, readValue);
|
||||
if (!doesMatch)
|
||||
if (doesMatch)
|
||||
searchResult = MemorySearchView::SearchResult(addr, QVariant::fromValue(readValue), searchType);
|
||||
|
||||
return !doesMatch;
|
||||
|
||||
@@ -92,7 +92,7 @@ public Q_SLOTS:
|
||||
void refreshGridCovers();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
bool event(QEvent* event) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -43,7 +43,7 @@ void LogWindow::updateSettings()
|
||||
{
|
||||
std::unique_lock lock(s_log_mutex);
|
||||
|
||||
const bool new_enabled = Host::GetBaseBoolSettingValue("Logging", "EnableLogWindow", false) && !QtHost::InNoGUIMode();
|
||||
const bool new_enabled = Host::GetBaseBoolSettingValue("Logging", "EnableLogWindow", false) && !Host::InNoGUIMode();
|
||||
const bool attach_to_main = Host::GetBaseBoolSettingValue("Logging", "AttachLogWindowToMainWindow", true);
|
||||
const bool curr_enabled = Log::IsHostOutputEnabled();
|
||||
|
||||
|
||||
@@ -1130,7 +1130,7 @@ bool MainWindow::shouldHideMainWindow() const
|
||||
// NOTE: We can't use isRenderingToMain() here, because this happens post-fullscreen-switch.
|
||||
return (Host::GetBoolSettingValue("UI", "HideMainWindowWhenRunning", false) && !g_emu_thread->shouldRenderToMain()) ||
|
||||
(g_emu_thread->shouldRenderToMain() && (isRenderingFullscreen() || m_is_temporarily_windowed)) ||
|
||||
QtHost::InNoGUIMode();
|
||||
Host::InNoGUIMode();
|
||||
}
|
||||
|
||||
bool MainWindow::shouldMouseLock() const
|
||||
@@ -1306,7 +1306,7 @@ bool MainWindow::requestShutdown(bool allow_confirm, bool allow_save_to_state, b
|
||||
// reshow the main window during display updates, because otherwise fullscreen transitions and renderer switches
|
||||
// would briefly show and then hide the main window. So instead, we do it on shutdown, here. Except if we're in
|
||||
// batch mode, when we're going to exit anyway.
|
||||
if (!isRenderingToMain() && isHidden() && !QtHost::InBatchMode() && !g_emu_thread->isRunningFullscreenUI())
|
||||
if (!isRenderingToMain() && isHidden() && !Host::InBatchMode() && !g_emu_thread->isRunningFullscreenUI())
|
||||
updateWindowState(true);
|
||||
|
||||
// Clear the VM valid state early. That way we can't do anything in the UI if we take a while to shut down.
|
||||
@@ -2060,7 +2060,7 @@ void MainWindow::onVMStopped()
|
||||
updateInputRecordingActions(false);
|
||||
|
||||
// If we're closing or in batch mode, quit the whole application now.
|
||||
if (m_is_closing || QtHost::InBatchMode())
|
||||
if (m_is_closing || Host::InBatchMode())
|
||||
{
|
||||
quit();
|
||||
return;
|
||||
|
||||
@@ -602,7 +602,7 @@ void Host::CheckForSettingsChanges(const Pcsx2Config& old_config)
|
||||
|
||||
bool EmuThread::shouldRenderToMain() const
|
||||
{
|
||||
return !Host::GetBoolSettingValue("UI", "RenderToSeparateWindow", false) && !QtHost::InNoGUIMode();
|
||||
return !Host::GetBoolSettingValue("UI", "RenderToSeparateWindow", false) && !Host::InNoGUIMode();
|
||||
}
|
||||
|
||||
void EmuThread::toggleSoftwareRendering()
|
||||
@@ -1268,7 +1268,7 @@ void Host::RequestVMShutdown(bool allow_confirm, bool allow_save_state, bool def
|
||||
|
||||
// This will probably call shutdownVM() again, but by the time it runs, we'll have already shut down
|
||||
// and it'll be a noop.
|
||||
if (QtHost::InBatchMode())
|
||||
if (Host::InBatchMode())
|
||||
QMetaObject::invokeMethod(g_main_window, "requestExit", Qt::QueuedConnection, Q_ARG(bool, false));
|
||||
}
|
||||
}
|
||||
@@ -1437,12 +1437,12 @@ void Host::CommitBaseSettingChanges()
|
||||
}
|
||||
}
|
||||
|
||||
bool QtHost::InBatchMode()
|
||||
bool Host::InBatchMode()
|
||||
{
|
||||
return s_batch_mode;
|
||||
}
|
||||
|
||||
bool QtHost::InNoGUIMode()
|
||||
bool Host::InNoGUIMode()
|
||||
{
|
||||
return s_nogui_mode;
|
||||
}
|
||||
|
||||
@@ -245,12 +245,6 @@ namespace QtHost
|
||||
/// Sets the icon theme, based on the current style (light/dark).
|
||||
void SetIconThemeFromStyle();
|
||||
|
||||
/// Sets batch mode (exit after game shutdown).
|
||||
bool InBatchMode();
|
||||
|
||||
/// Sets NoGUI mode (implys batch mode, does not display main window, exits on shutdown).
|
||||
bool InNoGUIMode();
|
||||
|
||||
/// Returns true if the calling thread is the UI thread.
|
||||
bool IsOnUIThread();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -446,6 +446,13 @@ std::vector<GSVector2i>* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0)
|
||||
return p2t;
|
||||
}
|
||||
|
||||
u32 GSLocalMemory::IsPageAlignedMasked(u32 psm, const GSVector4i& rc)
|
||||
{
|
||||
const psm_t& psm_s = m_psm[psm];
|
||||
const GSVector4i pgmsk = GSVector4i(psm_s.pgs).xyxy() - GSVector4i(1);
|
||||
return ((rc & pgmsk) == GSVector4i::zero()).mask();
|
||||
}
|
||||
|
||||
bool GSLocalMemory::IsPageAligned(u32 psm, const GSVector4i& rc)
|
||||
{
|
||||
const psm_t& psm_s = m_psm[psm];
|
||||
|
||||
@@ -524,6 +524,7 @@ public:
|
||||
GSPixelOffset4* GetPixelOffset4(const GIFRegFRAME& FRAME, const GIFRegZBUF& ZBUF);
|
||||
std::vector<GSVector2i>* GetPage2TileMap(const GIFRegTEX0& TEX0);
|
||||
static bool HasOverlap(u32 src_bp, u32 src_bw, u32 src_psm, GSVector4i src_rect, u32 dst_bp, u32 dst_bw, u32 dst_psm, GSVector4i dst_rect);
|
||||
static u32 IsPageAlignedMasked(u32 psm, const GSVector4i& rc);
|
||||
static bool IsPageAligned(u32 psm, const GSVector4i& rc);
|
||||
static u32 GetStartBlockAddress(u32 bp, u32 bw, u32 psm, GSVector4i rect);
|
||||
static u32 GetEndBlockAddress(u32 bp, u32 bw, u32 psm, GSVector4i rect);
|
||||
|
||||
@@ -184,40 +184,6 @@ bool GSHwHack::GSC_NamcoGames(GSRendererHW& r, int& skip)
|
||||
{
|
||||
if (skip == 0)
|
||||
{
|
||||
if (r.IsPossibleChannelShuffle() && !(RTBP0 & 31))
|
||||
{
|
||||
GSVertex* v = &r.m_vertex.buff[0];
|
||||
|
||||
// Make sure we're detecting the right effect.
|
||||
if (((v[1].XYZ.X - v[0].XYZ.X) >> 4) != 8 || ((v[1].XYZ.Y - v[0].XYZ.Y) >> 4) != 14)
|
||||
return false;
|
||||
|
||||
GSTextureCache::Target* rt = g_texture_cache->LookupTarget(GIFRegTEX0::Create(RTBP0, RFBW, RFPSM),
|
||||
GSVector2i(1, 1), r.GetTextureScaleFactor(), GSTextureCache::RenderTarget);
|
||||
if (!rt)
|
||||
return false;
|
||||
|
||||
GL_INS("GSC_NamcoGames(): HLE channel shuffle");
|
||||
|
||||
// have to set up the palette ourselves too, since GSC executes before it does
|
||||
r.m_mem.m_clut.Read32(RTEX0, r.m_draw_env->TEXA);
|
||||
std::shared_ptr<GSTextureCache::Palette> palette =
|
||||
g_texture_cache->LookupPaletteObject(r.m_mem.m_clut, GSLocalMemory::m_psm[RTEX0.PSM].pal, true);
|
||||
if (!palette)
|
||||
return false;
|
||||
|
||||
GSHWDrawConfig& conf = r.BeginHLEHardwareDraw(
|
||||
rt->GetTexture(), nullptr, rt->GetScale(), rt->GetTexture(), rt->GetScale(), rt->GetUnscaledRect());
|
||||
conf.pal = palette->GetPaletteGSTexture();
|
||||
conf.ps.channel = ChannelFetch_RGB;
|
||||
conf.colormask.wa = false;
|
||||
r.EndHLEHardwareDraw(false);
|
||||
|
||||
// 12 pages: 2 calls by channel, 3 channels, 1 blit
|
||||
skip = 12 * (3 + 3 + 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!s_nativeres && r.PRIM->PRIM == GS_SPRITE && RTME && RTEX0.TFX == 1 && RFPSM == RTPSM && RTPSM == PSMCT32 && RFBMSK == 0xFF000000 && r.m_index.tail > 2)
|
||||
{
|
||||
GSVertex* v = &r.m_vertex.buff[0];
|
||||
@@ -431,31 +397,6 @@ bool GSHwHack::GSC_TalesOfLegendia(GSRendererHW& r, int& skip)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GSHwHack::GSC_Kunoichi(GSRendererHW& r, int& skip)
|
||||
{
|
||||
if (skip == 0)
|
||||
{
|
||||
if (!RTME && (RFBP == 0x0 || RFBP == 0x00700 || RFBP == 0x00800) && RFPSM == PSMCT32 && RFBMSK == 0x00FFFFFF)
|
||||
{
|
||||
// Removes depth effects(shadows) not rendered correctly on all renders.
|
||||
skip = 3;
|
||||
}
|
||||
if (RTME && (RFBP == 0x0700 || RFBP == 0) && RTBP0 == 0x0e00 && RTPSM == 0 && RFBMSK == 0)
|
||||
{
|
||||
skip = 1; // Removes black screen (not needed anymore maybe)?
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RTME && (RFBP == 0x0e00) && RFPSM == PSMCT32 && RFBMSK == 0xFF000000)
|
||||
{
|
||||
skip = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GSHwHack::GSC_ZettaiZetsumeiToshi2(GSRendererHW& r, int& skip)
|
||||
{
|
||||
if (skip == 0)
|
||||
@@ -505,27 +446,6 @@ bool GSHwHack::GSC_ZettaiZetsumeiToshi2(GSRendererHW& r, int& skip)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GSHwHack::GSC_SakuraWarsSoLongMyLove(GSRendererHW& r, int& skip)
|
||||
{
|
||||
if (skip == 0)
|
||||
{
|
||||
if (RTME == 0 && RFBP != RTBP0 && RTBP0 && RFBMSK == 0x00FFFFFF)
|
||||
{
|
||||
skip = 3; // Remove darkness
|
||||
}
|
||||
else if (RTME == 0 && RFBP == RTBP0 && (RTBP0 == 0x1200 || RTBP0 == 0x1180 || RTBP0 == 0) && RFBMSK == 0x00FFFFFF)
|
||||
{
|
||||
skip = 3; // Remove darkness
|
||||
}
|
||||
else if (RTME && (RFBP == 0 || RFBP == 0x1180) && RFPSM == PSMCT32 && RTBP0 == 0x3F3F && RTPSM == PSMT8)
|
||||
{
|
||||
skip = 1; // Floodlight
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GSHwHack::GSC_UltramanFightingEvolution(GSRendererHW& r, int& skip)
|
||||
{
|
||||
if (skip == 0)
|
||||
@@ -1393,12 +1313,10 @@ bool GSHwHack::MV_Ico(GSRendererHW& r)
|
||||
#define CRC_F(name) { #name, &GSHwHack::name }
|
||||
|
||||
const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_functions[] = {
|
||||
CRC_F(GSC_Kunoichi),
|
||||
CRC_F(GSC_Manhunt2),
|
||||
CRC_F(GSC_MidnightClub3),
|
||||
CRC_F(GSC_SacredBlaze),
|
||||
CRC_F(GSC_GuitarHero),
|
||||
CRC_F(GSC_SakuraWarsSoLongMyLove),
|
||||
CRC_F(GSC_SFEX3),
|
||||
CRC_F(GSC_DTGames),
|
||||
CRC_F(GSC_TalesOfLegendia),
|
||||
|
||||
@@ -16,9 +16,7 @@ public:
|
||||
static bool GSC_BlackAndBurnoutSky(GSRendererHW& r, int& skip);
|
||||
static bool GSC_MidnightClub3(GSRendererHW& r, int& skip);
|
||||
static bool GSC_TalesOfLegendia(GSRendererHW& r, int& skip);
|
||||
static bool GSC_Kunoichi(GSRendererHW& r, int& skip);
|
||||
static bool GSC_ZettaiZetsumeiToshi2(GSRendererHW& r, int& skip);
|
||||
static bool GSC_SakuraWarsSoLongMyLove(GSRendererHW& r, int& skip);
|
||||
static bool GSC_UltramanFightingEvolution(GSRendererHW& r, int& skip);
|
||||
static bool GSC_TalesofSymphonia(GSRendererHW& r, int& skip);
|
||||
static bool GSC_UrbanReign(GSRendererHW& r, int& skip);
|
||||
|
||||
@@ -2862,7 +2862,9 @@ void GSRendererHW::Draw()
|
||||
|
||||
GIFRegTEX0 FRAME_TEX0;
|
||||
bool shuffle_target = false;
|
||||
if (!no_rt && GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].bpp == 16 && GSLocalMemory::m_psm[m_cached_ctx.TEX0.PSM].bpp >= 16 &&
|
||||
const u32 page_alignment = GSLocalMemory::IsPageAlignedMasked(m_cached_ctx.TEX0.PSM, m_r);
|
||||
const bool page_aligned = (page_alignment & 0xF0F0) != 0; // Make sure Y is page aligned.
|
||||
if (!no_rt && page_aligned && m_cached_ctx.ZBUF.ZMSK && GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].bpp == 16 && GSLocalMemory::m_psm[m_cached_ctx.TEX0.PSM].bpp >= 16 &&
|
||||
(m_vt.m_primclass == GS_SPRITE_CLASS || (m_vt.m_primclass == GS_TRIANGLE_CLASS && (m_index.tail % 6) == 0 && TrianglesAreQuads(true) && m_index.tail > 6)))
|
||||
{
|
||||
// Tail check is to make sure we have enough strips to go all the way across the page, or if it's using a region clamp could be used to draw strips.
|
||||
@@ -3164,6 +3166,144 @@ void GSRendererHW::Draw()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (no_rt && ds && ds->m_TEX0.TBP0 != m_cached_ctx.ZBUF.Block())
|
||||
{
|
||||
const GSLocalMemory::psm_t& zbuf_psm = GSLocalMemory::m_psm[m_cached_ctx.ZBUF.PSM];
|
||||
int vertical_offset = ((static_cast<int>(m_cached_ctx.ZBUF.Block() - ds->m_TEX0.TBP0) / 32) / std::max(static_cast<int>(ds->m_TEX0.TBW), 1)) * zbuf_psm.pgs.y; // I know I could just not shift it..
|
||||
int texture_offset = 0;
|
||||
int horizontal_offset = ((static_cast<int>((m_cached_ctx.ZBUF.Block() - ds->m_TEX0.TBP0)) / 32) % static_cast<int>(std::max(ds->m_TEX0.TBW, 1U))) * zbuf_psm.pgs.x;
|
||||
// Used to reduce the offset made later in channel shuffles
|
||||
m_target_offset = std::abs(static_cast<int>((m_cached_ctx.ZBUF.Block() - ds->m_TEX0.TBP0)) >> 5);
|
||||
|
||||
if (vertical_offset < 0)
|
||||
{
|
||||
ds->m_TEX0.TBP0 = m_cached_ctx.ZBUF.Block();
|
||||
GSVector2i new_size = ds->m_unscaled_size;
|
||||
// Make sure to use the original format for the offset.
|
||||
const int new_offset = std::abs((vertical_offset / zbuf_psm.pgs.y) * GSLocalMemory::m_psm[ds->m_TEX0.PSM].pgs.y);
|
||||
texture_offset = new_offset;
|
||||
|
||||
new_size.y += new_offset;
|
||||
|
||||
const GSVector4i new_drect = GSVector4i(0, new_offset * ds->m_scale, new_size.x * ds->m_scale, new_size.y * ds->m_scale);
|
||||
ds->ResizeTexture(new_size.x, new_size.y, true, true, new_drect);
|
||||
|
||||
if (src && src->m_from_target && src->m_from_target == ds && src->m_target_direct)
|
||||
{
|
||||
src->m_texture = ds->m_texture;
|
||||
|
||||
// If we've moved it and the source is expecting to be inside this target, we need to update the region to point to it.
|
||||
int max_region_y = src->m_region.GetMaxY() + new_offset;
|
||||
if (max_region_y == new_offset)
|
||||
max_region_y = new_size.y;
|
||||
|
||||
src->m_region.SetY(src->m_region.GetMinY() + new_offset, max_region_y);
|
||||
}
|
||||
|
||||
ds->m_valid.y += new_offset;
|
||||
ds->m_valid.w += new_offset;
|
||||
ds->m_drawn_since_read.y += new_offset;
|
||||
ds->m_drawn_since_read.w += new_offset;
|
||||
|
||||
g_texture_cache->CombineAlignedInsideTargets(ds, src);
|
||||
|
||||
if (ds->m_dirty.size())
|
||||
{
|
||||
for (int i = 0; i < static_cast<int>(ds->m_dirty.size()); i++)
|
||||
{
|
||||
ds->m_dirty[i].r.y += new_offset;
|
||||
ds->m_dirty[i].r.w += new_offset;
|
||||
}
|
||||
}
|
||||
|
||||
t_size.y += std::abs(vertical_offset);
|
||||
vertical_offset = 0;
|
||||
}
|
||||
|
||||
if (horizontal_offset < 0)
|
||||
{
|
||||
// Thankfully this doesn't really happen, but catwoman moves the framebuffer backwards 1 page with a channel shuffle, which is really messy and not easy to deal with.
|
||||
// Hopefully the quick channel shuffle will just guess this and run with it.
|
||||
ds->m_TEX0.TBP0 += horizontal_offset;
|
||||
horizontal_offset = 0;
|
||||
}
|
||||
|
||||
if (vertical_offset || horizontal_offset)
|
||||
{
|
||||
GSVertex* v = &m_vertex.buff[0];
|
||||
|
||||
for (u32 i = 0; i < m_vertex.tail; i++)
|
||||
{
|
||||
v[i].XYZ.X += horizontal_offset << 4;
|
||||
v[i].XYZ.Y += vertical_offset << 4;
|
||||
}
|
||||
|
||||
if (texture_offset && src && src->m_from_target && src->m_target_direct && src->m_from_target == ds)
|
||||
{
|
||||
GSVector4i src_region = src->GetRegionRect();
|
||||
|
||||
if (src_region.rempty())
|
||||
{
|
||||
src_region = GSVector4i::loadh(ds->m_unscaled_size);
|
||||
src_region.y += texture_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
src_region.y += texture_offset;
|
||||
src_region.w += texture_offset;
|
||||
}
|
||||
src->m_region.SetX(src_region.x, src_region.z);
|
||||
src->m_region.SetY(src_region.y, src_region.w);
|
||||
}
|
||||
|
||||
m_context->scissor.in.x += horizontal_offset;
|
||||
m_context->scissor.in.z += horizontal_offset;
|
||||
m_context->scissor.in.y += vertical_offset;
|
||||
m_context->scissor.in.w += vertical_offset;
|
||||
m_r.y += vertical_offset;
|
||||
m_r.w += vertical_offset;
|
||||
m_r.x += horizontal_offset;
|
||||
m_r.z += horizontal_offset;
|
||||
m_in_target_draw = ds->m_TEX0.TBP0 != m_cached_ctx.ZBUF.Block();
|
||||
m_vt.m_min.p.x += horizontal_offset;
|
||||
m_vt.m_max.p.x += horizontal_offset;
|
||||
m_vt.m_min.p.y += vertical_offset;
|
||||
m_vt.m_max.p.y += vertical_offset;
|
||||
|
||||
t_size.y = ds->m_unscaled_size.y - vertical_offset;
|
||||
t_size.x = ds->m_unscaled_size.x - horizontal_offset;
|
||||
}
|
||||
|
||||
// Don't resize if the BPP don't match.
|
||||
GSVector2i new_size = GetValidSize(src, possible_shuffle);
|
||||
if (new_size.x > ds->m_unscaled_size.x || new_size.y > ds->m_unscaled_size.y)
|
||||
{
|
||||
const u32 new_width = std::max(new_size.x, ds->m_unscaled_size.x);
|
||||
const u32 new_height = std::max(new_size.y, ds->m_unscaled_size.y);
|
||||
|
||||
//DevCon.Warning("HW: Resizing texture %d x %d draw %d", ds->m_unscaled_size.x, new_height, s_n);
|
||||
ds->ResizeTexture(new_width, new_height);
|
||||
}
|
||||
else if ((IsPageCopy() || is_possible_mem_clear) && m_r.width() <= zbuf_psm.pgs.x && m_r.height() <= zbuf_psm.pgs.y)
|
||||
{
|
||||
const int get_next_ctx = m_env.PRIM.CTXT;
|
||||
const GSDrawingContext& next_ctx = m_env.CTXT[get_next_ctx];
|
||||
GSVector4i update_valid = GSVector4i::loadh(GSVector2i(horizontal_offset + GSLocalMemory::m_psm[m_cached_ctx.ZBUF.PSM].pgs.x, GSLocalMemory::m_psm[m_cached_ctx.ZBUF.PSM].pgs.y + vertical_offset));
|
||||
ds->UpdateValidity(update_valid, true);
|
||||
if (is_possible_mem_clear)
|
||||
{
|
||||
if ((horizontal_offset + GSLocalMemory::m_psm[m_cached_ctx.ZBUF.PSM].pgs.x) >= static_cast<int>(ds->m_TEX0.TBW * 64) && next_ctx.ZBUF.Block() == (m_cached_ctx.ZBUF.Block() + 0x20))
|
||||
{
|
||||
update_valid.x = 0;
|
||||
update_valid.z = GSLocalMemory::m_psm[m_cached_ctx.ZBUF.PSM].pgs.x;
|
||||
update_valid.y += GSLocalMemory::m_psm[m_cached_ctx.ZBUF.PSM].pgs.y;
|
||||
update_valid.w += GSLocalMemory::m_psm[m_cached_ctx.ZBUF.PSM].pgs.y;
|
||||
ds->UpdateValidity(update_valid, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!no_rt)
|
||||
|
||||
@@ -228,8 +228,8 @@ bool GSTextureCache::CanTranslate(u32 bp, u32 bw, u32 spsm, GSVector4i r, u32 db
|
||||
{
|
||||
const GSVector2i src_page_size = GSLocalMemory::m_psm[spsm].pgs;
|
||||
const GSVector2i dst_page_size = GSLocalMemory::m_psm[dpsm].pgs;
|
||||
const bool bp_page_aligned_bp = ((bp & ~((1 << 5) - 1)) == bp) || bp == dbp;
|
||||
const bool block_layout_match = GSLocalMemory::m_psm[spsm].bpp == GSLocalMemory::m_psm[dpsm].bpp;
|
||||
const bool bp_page_aligned_bp = ((bp & ~((1 << 5) - 1)) == bp) || bp == dbp || (block_layout_match && bw == dbw);
|
||||
const GSVector4i page_mask(GSVector4i((src_page_size.x - 1), (src_page_size.y - 1)).xyxy());
|
||||
const GSVector4i masked_rect(r & ~page_mask);
|
||||
const int src_pixel_width = static_cast<int>(bw * 64);
|
||||
@@ -276,7 +276,7 @@ GSVector4i GSTextureCache::TranslateAlignedRectByPage(u32 tbp, u32 tebp, u32 tbw
|
||||
int page_offset = (static_cast<int>(sbp) - static_cast<int>(tbp)) >> 5;
|
||||
int block_offset = (static_cast<int>(sbp) - static_cast<int>(tbp)) & 0x1F;
|
||||
|
||||
if (!(s_psm.bpp == t_psm.bpp))
|
||||
if (!(s_psm.bpp == t_psm.bpp) || block_offset)
|
||||
{
|
||||
if (block_offset)
|
||||
in_rect = in_rect.ralign<Align_Outside>(s_psm.bs);
|
||||
@@ -299,6 +299,33 @@ GSVector4i GSTextureCache::TranslateAlignedRectByPage(u32 tbp, u32 tebp, u32 tbw
|
||||
DevCon.Warning("Error translating rect");
|
||||
return GSVector4i::zero();
|
||||
}
|
||||
|
||||
const bool block_matched_format = s_psm.bpp == t_psm.bpp && (sbw == tbw || sbw == 1);
|
||||
// If there is block offset left over, try to adjust to that.
|
||||
if (block_matched_format)
|
||||
{
|
||||
GSVector4i b2a_offset = GSVector4i::zero();
|
||||
const GSVector4i target_rect = GSVector4i(0, 0, src_bw, 2048);
|
||||
bool offset_found = false;
|
||||
|
||||
for (b2a_offset.x = target_rect.x; b2a_offset.x < target_rect.z; b2a_offset.x += s_psm.bs.x)
|
||||
{
|
||||
for (b2a_offset.y = target_rect.y; b2a_offset.y < target_rect.w; b2a_offset.y += s_psm.bs.y)
|
||||
{
|
||||
const u32 a_candidate_bp = s_psm.info.bn(b2a_offset.x, b2a_offset.y, tbp, sbw);
|
||||
if (sbp == a_candidate_bp)
|
||||
{
|
||||
offset_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (offset_found)
|
||||
break;
|
||||
}
|
||||
|
||||
if (offset_found)
|
||||
in_rect = (in_rect + b2a_offset.xyxy()).max_i32(GSVector4i(0));
|
||||
}
|
||||
}
|
||||
|
||||
GSVector4i new_rect = GSVector4i::zero();
|
||||
@@ -602,6 +629,8 @@ void GSTextureCache::DirtyRectByPage(u32 sbp, u32 spsm, u32 sbw, Target* t, GSVe
|
||||
{
|
||||
RGBAMask rgba;
|
||||
rgba._u32 = GSUtil::GetChannelMask(spsm);
|
||||
// FIXME: This could be a problem if used when the valid area is smaller than dirty area and it needs the data during expansion on a later draw.
|
||||
// This happens on Kamen Rider - Seigi no Keifu if the invalidatevideomem function was to use this function for depth clearing.
|
||||
AddDirtyRectTarget(t, t->m_valid, t->m_TEX0.PSM, t->m_TEX0.TBW, rgba);
|
||||
return;
|
||||
}
|
||||
@@ -618,7 +647,7 @@ void GSTextureCache::DirtyRectByPage(u32 sbp, u32 spsm, u32 sbw, Target* t, GSVe
|
||||
int block_offset = static_cast<int>(sbp) - static_cast<int>(target_bp);
|
||||
// Different format needs to be page aligned, unless the block layout matches, then we can block align
|
||||
// Might be able to translate the original rect.
|
||||
if (!(src_info->bpp == dst_info->bpp))
|
||||
if (!(src_info->bpp == dst_info->bpp) || block_offset)
|
||||
{
|
||||
const int src_bpp = src_info->bpp;
|
||||
const bool column_align = !block_offset && src_r.z <= src_info->cs.x && src_r.w <= src_info->cs.y && src_info->depth == dst_info->depth;
|
||||
@@ -741,7 +770,7 @@ void GSTextureCache::DirtyRectByPage(u32 sbp, u32 spsm, u32 sbw, Target* t, GSVe
|
||||
const int yblocks = in_rect.height() / src_info->bs.y;
|
||||
// if !(block_offset & 0x7) is false, this is technically incorrect, but FFX hates it and starts making a mess, so it's better this way without adding complexity.
|
||||
// TODO maybe: Add per block invalidation? ugh, would have to keep that to small blocks. 2 blocks in the case of FFX.
|
||||
if ((xblocks <= 4 && yblocks <= 2) || req_depth_offset)
|
||||
if ((xblocks <= (src_info->pgs.x / src_info->bs.x) && yblocks <= (src_info->pgs.y / src_info->bs.y)) || req_depth_offset)
|
||||
{
|
||||
GSVector4i b2a_offset = GSVector4i::zero();
|
||||
const GSVector4i target_rect = GSVector4i(0, 0, src_width, 2048);
|
||||
@@ -1165,8 +1194,8 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const bool is_depth, c
|
||||
if (inside_target)
|
||||
{
|
||||
// Need to set it up as a region target.
|
||||
src->m_region.SetX(block_boundary_rect.x, src->m_from_target->m_valid.z);
|
||||
src->m_region.SetY(block_boundary_rect.y, src->m_from_target->m_valid.w);
|
||||
src->m_region.SetX(block_boundary_rect.x, std::max(src->m_from_target->m_valid.z, block_boundary_rect.z));
|
||||
src->m_region.SetY(block_boundary_rect.y, std::max(src->m_from_target->m_valid.w, block_boundary_rect.w));
|
||||
}
|
||||
|
||||
if (GSRendererHW::GetInstance()->IsTBPFrameOrZ(dst->m_TEX0.TBP0))
|
||||
@@ -1279,11 +1308,6 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const
|
||||
// Make sure it is page aligned, otherwise things get messy with the pixel order (Tomb Raider Legend).
|
||||
if (t->m_used)
|
||||
{
|
||||
// If the BP is block offset it's unlikely to be a target, but a target can be made by a HW move, so we need to check for a match.
|
||||
// Good for Baldurs Gate Dark Alliance (HW Move), bad for Tomb Raider Legends (just offset).
|
||||
if (((bp & (BLOCKS_PER_PAGE - 1)) != (t->m_TEX0.TBP0 & (BLOCKS_PER_PAGE - 1))) && (bp & (BLOCKS_PER_PAGE - 1)))
|
||||
continue;
|
||||
|
||||
//const bool overlaps = t->Inside(bp, bw, psm, block_boundary_rect);
|
||||
const bool overlaps = t->Overlaps(bp, bw, psm, block_boundary_rect);
|
||||
// Try to make sure the target has available what we need, be careful of self referencing frames with font in the alpha.
|
||||
@@ -1293,6 +1317,12 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const
|
||||
if (!overlaps || (found_t && (GSState::s_n - dst->m_last_draw) < (GSState::s_n - t->m_last_draw)))
|
||||
continue;
|
||||
|
||||
// If the BP is offset in to a page and the format does not match, trying to match up the correct position is very difficult since we don't swizzle.
|
||||
// Tomb Raider Legends does a block level BP in PSMT8 over a C16 target, which is just a nightmare to get right.
|
||||
// Baldurs Gate used to have this too, but now we can translate HW moves inside targets when the format matches.
|
||||
if (((bp & (BLOCKS_PER_PAGE - 1)) != (t->m_TEX0.TBP0 & (BLOCKS_PER_PAGE - 1))) && (bp & (BLOCKS_PER_PAGE - 1)) && !CanTranslate(bp, bw, psm, block_boundary_rect, t->m_TEX0.TBP0, t->m_TEX0.PSM, t->m_TEX0.TBW))
|
||||
continue;
|
||||
|
||||
const bool width_match = (std::max(64U, bw * 64U) >> GSLocalMemory::m_psm[psm].info.pageShiftX()) ==
|
||||
(std::max(64U, t->m_TEX0.TBW * 64U) >> GSLocalMemory::m_psm[t->m_TEX0.PSM].info.pageShiftX());
|
||||
|
||||
@@ -1772,10 +1802,6 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const
|
||||
if (!t->HasValidBitsForFormat(psm, req_color, req_alpha, rt_tbw == TEX0.TBW) && !(possible_shuffle && GSLocalMemory::m_psm[psm].bpp == 16 && GSLocalMemory::m_psm[t->m_TEX0.PSM].bpp == 32))
|
||||
continue;
|
||||
|
||||
// Be careful of shuffles where it can shuffle the width of the target, even though it may not have all been drawn to.
|
||||
if (!possible_shuffle && frame.Block() != TEX0.TBP0 && !t->Inside(bp, bw, psm, block_boundary_rect))
|
||||
continue;
|
||||
|
||||
x_offset = rect.x;
|
||||
y_offset = rect.y;
|
||||
dst = t;
|
||||
@@ -3543,11 +3569,11 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons
|
||||
continue;
|
||||
}
|
||||
|
||||
const int height_adjust = (((dst_end_block - t->m_TEX0.TBP0) >> 5) / std::max(t->m_TEX0.TBW, 1U)) * GSLocalMemory::m_psm[t->m_TEX0.PSM].pgs.y;
|
||||
const int height_adjust = ((((dst_end_block + 31) - t->m_TEX0.TBP0) >> 5) / std::max(t->m_TEX0.TBW, 1U)) * GSLocalMemory::m_psm[t->m_TEX0.PSM].pgs.y;
|
||||
|
||||
if (height_adjust < t->m_unscaled_size.y)
|
||||
{
|
||||
t->m_TEX0.TBP0 = dst_end_block;
|
||||
t->m_TEX0.TBP0 = GSLocalMemory::GetStartBlockAddress(t->m_TEX0.TBP0, t->m_TEX0.TBW, t->m_TEX0.PSM, GSVector4i(0, height_adjust, t->m_valid.z, t->m_valid.w));
|
||||
t->m_valid.w -= height_adjust;
|
||||
t->ResizeValidity(t->m_valid);
|
||||
|
||||
@@ -4339,7 +4365,9 @@ void GSTextureCache::InvalidateVideoMem(const GSOffset& off, const GSVector4i& r
|
||||
InvalidateTemporaryZ();
|
||||
}
|
||||
|
||||
if (GSLocalMemory::m_psm[psm].depth)
|
||||
// If we're dealing with quadrant draws, we need to position them correctly (Final Fantasy X).
|
||||
if (GSLocalMemory::m_psm[psm].depth &&
|
||||
r.width() <= (GSLocalMemory::m_psm[psm].pgs.x >> 1) && r.height() <= (GSLocalMemory::m_psm[psm].pgs.y >> 1))
|
||||
DirtyRectByPage(bp, psm, bw, t, r);
|
||||
else
|
||||
AddDirtyRectTarget(t, r, psm, bw, rgba);
|
||||
@@ -4733,7 +4761,7 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
// Not even going to go down the rabbit hole of palette formats on the GPU.. We shouldn't have any targets with P4/P8 anyway.
|
||||
const GSLocalMemory::psm_t& spsm_s = GSLocalMemory::m_psm[SPSM];
|
||||
const GSLocalMemory::psm_t& dpsm_s = GSLocalMemory::m_psm[DPSM];
|
||||
if (SPSM != DPSM || ((spsm_s.pal + dpsm_s.pal) != 0 && !alpha_only))
|
||||
if (GSLocalMemory::m_psm[SPSM].bpp != GSLocalMemory::m_psm[DPSM].bpp || ((spsm_s.pal + dpsm_s.pal) != 0 && !alpha_only))
|
||||
{
|
||||
GL_CACHE("TC: Skipping HW move from 0x%X to 0x%X with SPSM=%s DPSM=%s", SBP, DBP, psm_str(SPSM), psm_str(DPSM));
|
||||
return false;
|
||||
@@ -4749,6 +4777,12 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
return false;
|
||||
}
|
||||
|
||||
bool req_resize = false;
|
||||
|
||||
// Save for later in case of page copy.
|
||||
const u32 start_SBP = SBP;
|
||||
const u32 start_DBP = DBP;
|
||||
|
||||
if (m_expected_src_bp == static_cast<int>(SBP) && m_expected_dst_bp == static_cast<int>(DBP))
|
||||
{
|
||||
// Get the new position so we can work out the offset.
|
||||
@@ -4759,17 +4793,18 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
sy += rect_offset.y;
|
||||
dx += rect_offset.x;
|
||||
dy += rect_offset.y;
|
||||
|
||||
req_resize = true;
|
||||
GL_INS("TC: Detected striped move, realigning from SBP %x->%x DBP %x->%x", SBP, m_remembered_src_bp, DBP, m_remembered_dst_bp);
|
||||
|
||||
SBP = m_remembered_src_bp;
|
||||
DBP = m_remembered_dst_bp;
|
||||
|
||||
m_expected_src_bp = -1;
|
||||
m_remembered_src_bp = -1;
|
||||
m_expected_dst_bp = -1;
|
||||
m_remembered_dst_bp = -1;
|
||||
}
|
||||
|
||||
m_expected_src_bp = -1;
|
||||
m_remembered_src_bp = -1;
|
||||
m_expected_dst_bp = -1;
|
||||
m_remembered_dst_bp = -1;
|
||||
|
||||
// Look for an exact match on the targets.
|
||||
GSTextureCache::Target* src = GetExactTarget(SBP, SBW, spsm_s.depth ? DepthStencil : RenderTarget, SBP);
|
||||
GSTextureCache::Target* dst = GetExactTarget(DBP, DBW, dpsm_s.depth ? DepthStencil : RenderTarget, DBP);
|
||||
@@ -4804,15 +4839,18 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
const GSVector2i target_size = GetTargetSize(DBP, DBW, DPSM, Common::AlignUpPow2(w, 64), h);
|
||||
dst = LookupTarget(new_TEX0, target_size, src->m_scale, src->m_type);
|
||||
if (!dst)
|
||||
dst = CreateTarget(new_TEX0, target_size, target_size, src->m_scale, src->m_type);
|
||||
{
|
||||
dst = Target::Create(new_TEX0, target_size.x, target_size.y, src->m_scale, GSLocalMemory::m_psm[DPSM].depth, true);
|
||||
if (!dst) [[unlikely]]
|
||||
return false;
|
||||
}
|
||||
else // Expand if necessary (Silent hill 4 takes an old target which is smaller).
|
||||
{
|
||||
dst->ResizeTexture(std::max(dst->m_unscaled_size.x, target_size.x), std::max(dst->m_unscaled_size.y, target_size.y));
|
||||
req_resize = true;
|
||||
|
||||
// If it was matched to an old target, make sure to clear the other type and update its information.
|
||||
if (dst->m_was_dst_matched)
|
||||
{
|
||||
g_texture_cache->InvalidateVideoMemType(GSTextureCache::DepthStencil - dst->m_type, dst->m_TEX0.TBP0);
|
||||
dst->m_TEX0 = new_TEX0;
|
||||
}
|
||||
}
|
||||
@@ -4827,6 +4865,24 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
if (!src || !dst || src->m_scale != dst->m_scale)
|
||||
return false;
|
||||
|
||||
// If we have an offset, adjust the base positions
|
||||
if (src->m_TEX0.TBP0 != SBP)
|
||||
{
|
||||
const GSVector4i offset = TranslateAlignedRectByPage(src, SBP, SPSM, SBW, GSVector4i(0, 1).xxyy(), false);
|
||||
|
||||
sx += offset.x;
|
||||
sy += offset.y;
|
||||
}
|
||||
|
||||
if (dst->m_TEX0.TBP0 != DBP)
|
||||
{
|
||||
const GSVector4i offset = TranslateAlignedRectByPage(dst, DBP, DPSM, DBW, GSVector4i(0, 1).xxyy(), false);
|
||||
|
||||
dx += offset.x;
|
||||
dy += offset.y;
|
||||
req_resize = true;
|
||||
}
|
||||
|
||||
// Scale coordinates.
|
||||
const float scale = src->m_scale;
|
||||
const int scaled_sx = static_cast<int>(sx * scale);
|
||||
@@ -4840,6 +4896,11 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
if ((scaled_sx + scaled_w) > src->m_texture->GetWidth() || (scaled_sy + scaled_h) > src->m_texture->GetHeight())
|
||||
return false;
|
||||
|
||||
if (req_resize)
|
||||
{
|
||||
const GSVector2i target_size = GetTargetSize(DBP, DBW, DPSM, Common::AlignUpPow2(dx + w, 64), dx + h);
|
||||
dst->ResizeTexture(std::max(dst->m_unscaled_size.x, target_size.x), std::max(dst->m_unscaled_size.y, target_size.y));
|
||||
}
|
||||
// We don't want to copy "old" data that the game has overwritten with writes,
|
||||
// so flush any overlapping dirty area.
|
||||
src->UpdateIfDirtyIntersects(GSVector4i(sx, sy, sx + w, sy + h));
|
||||
@@ -4848,6 +4909,9 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
// we're not going to be able to use it as a source.
|
||||
dst->Update();
|
||||
|
||||
// Invalidate any opposite targets.
|
||||
g_texture_cache->InvalidateVideoMemType(GSTextureCache::DepthStencil - dst->m_type, dst->m_TEX0.TBP0);
|
||||
|
||||
// Expand the target when we used a more conservative size.
|
||||
const int required_dh = scaled_dy + scaled_h;
|
||||
if ((scaled_dx + scaled_w) <= dst->m_texture->GetWidth() && required_dh > dst->m_texture->GetHeight())
|
||||
@@ -4936,9 +5000,30 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
{
|
||||
if (SPSM == PSMT8H && SPSM == DPSM)
|
||||
{
|
||||
ShaderConvert shader = ShaderConvert::COPY;
|
||||
|
||||
const GSVector4 src_rect = GSVector4(scaled_sx, scaled_sy, scaled_sx + scaled_w, scaled_sy + scaled_h) / (GSVector4(src->m_texture->GetSize()).xyxy());
|
||||
const GSVector4 dst_rect = GSVector4(scaled_dx, scaled_dy, (scaled_dx + scaled_w), (scaled_dy + scaled_h));
|
||||
g_gs_device->StretchRect(src->m_texture, src_rect, dst->m_texture, dst_rect, false, false, false, true);
|
||||
g_gs_device->StretchRect(src->m_texture, src_rect, dst->m_texture, dst_rect, false, false, false, true, shader);
|
||||
}
|
||||
else if (src->m_type != dst->m_type)
|
||||
{
|
||||
ShaderConvert shader = dst->m_type ? ShaderConvert::RGBA8_TO_FLOAT32 : ShaderConvert::FLOAT32_TO_RGBA8;
|
||||
|
||||
switch (dpsm_s.trbpp)
|
||||
{
|
||||
case 24:
|
||||
shader = dst->m_type ? ShaderConvert::RGBA8_TO_FLOAT24 : ShaderConvert::FLOAT32_TO_RGB8;
|
||||
break;
|
||||
case 16:
|
||||
shader = dst->m_type ? ShaderConvert::RGB5A1_TO_FLOAT16 : ShaderConvert::FLOAT16_TO_RGB5A1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
const GSVector4 src_rect = GSVector4(scaled_sx, scaled_sy, scaled_sx + scaled_w, scaled_sy + scaled_h) / (GSVector4(src->m_texture->GetSize()).xyxy());
|
||||
g_gs_device->StretchRect(src->m_texture, src_rect, dst->m_texture, GSVector4(scaled_sx, scaled_sy, scaled_sx + scaled_w, scaled_sy + scaled_h), shader, false);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4966,20 +5051,29 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
dst->m_alpha_range |= src->m_alpha_range;
|
||||
}
|
||||
|
||||
if (GSLocalMemory::IsPageAligned(src->m_TEX0.PSM, GSVector4i(sx, sy, sx + w, sy + h)) && (w == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.x || h == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.y))
|
||||
u32 page_mask = GSLocalMemory::IsPageAlignedMasked(src->m_TEX0.PSM, GSVector4i(sx, sy, sx + w, sy + h));
|
||||
if (((page_mask & 0x0f0f) == 0x0f0f || (page_mask & 0xf0f0) == 0xf0f0) && (w == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.x || h == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.y))
|
||||
{
|
||||
// Vertical Strips
|
||||
if (w == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.x)
|
||||
// Page copy
|
||||
if (w == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.x && h == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.y)
|
||||
{
|
||||
m_expected_src_bp = start_SBP + BLOCKS_PER_PAGE;
|
||||
m_expected_dst_bp = start_DBP + BLOCKS_PER_PAGE;
|
||||
}
|
||||
// Vertical Strips.
|
||||
else if (w == GSLocalMemory::m_psm[src->m_TEX0.PSM].pgs.x)
|
||||
{
|
||||
m_expected_src_bp = GSLocalMemory::GetStartBlockAddress(src->m_TEX0.TBP0, src->m_TEX0.TBW, src->m_TEX0.PSM, GSVector4i(sx + w, 0, sx + w + w, h));
|
||||
m_expected_dst_bp = GSLocalMemory::GetStartBlockAddress(dst->m_TEX0.TBP0, dst->m_TEX0.TBW, dst->m_TEX0.PSM, GSVector4i(dx + w, 0, dx + w + w, h));
|
||||
}
|
||||
// Horizontal Strips.
|
||||
else
|
||||
{
|
||||
m_expected_src_bp = GSLocalMemory::GetStartBlockAddress(src->m_TEX0.TBP0, src->m_TEX0.TBW, src->m_TEX0.PSM, GSVector4i(0, sy + h, w, sy + h + h));
|
||||
m_expected_dst_bp = GSLocalMemory::GetStartBlockAddress(dst->m_TEX0.TBP0, dst->m_TEX0.TBW, dst->m_TEX0.PSM, GSVector4i(0, dy + h, w, dy + h + h));
|
||||
}
|
||||
|
||||
// Only check the source, the destination might need expanding.
|
||||
if (static_cast<u32>(m_expected_src_bp) < src->UnwrappedEndBlock() && static_cast<u32>(m_expected_src_bp) >= src->m_TEX0.TBP0)
|
||||
{
|
||||
m_remembered_src_bp = src->m_TEX0.TBP0;
|
||||
@@ -5001,7 +5095,7 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||
|
||||
// Invalidate any sources that overlap with the target (since they're now stale).
|
||||
InvalidateVideoMem(g_gs_renderer->m_mem.GetOffset(DBP, DBW, DPSM), GSVector4i(dx, dy, dx + w, dy + h), false);
|
||||
|
||||
CombineAlignedInsideTargets(dst);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5188,7 +5282,7 @@ GSTextureCache::Target* GSTextureCache::GetExactTarget(u32 BP, u32 BW, int type,
|
||||
{
|
||||
Target* t = *it;
|
||||
const u32 tgt_bw = std::max(t->m_TEX0.TBW, 1U);
|
||||
if ((t->m_TEX0.TBP0 == BP || (GSConfig.UserHacks_TextureInsideRt >= GSTextureInRtMode::InsideTargets && t->m_TEX0.TBP0 < BP && (((BP - t->m_TEX0.TBP0) >> 5) % tgt_bw) == 0)) && tgt_bw == BW && t->UnwrappedEndBlock() >= end_bp)
|
||||
if ((t->m_TEX0.TBP0 == BP || (GSConfig.UserHacks_TextureInsideRt >= GSTextureInRtMode::InsideTargets && t->m_TEX0.TBP0 < BP && !(BP & 0x1f) && (((BP - t->m_TEX0.TBP0) >> 5) % tgt_bw) == 0)) && tgt_bw == BW && t->UnwrappedEndBlock() >= end_bp)
|
||||
{
|
||||
rts.MoveFront(it.Index());
|
||||
return t;
|
||||
|
||||
@@ -67,6 +67,12 @@ namespace Host
|
||||
bool ConfirmMessage(const std::string_view title, const std::string_view message);
|
||||
bool ConfirmFormattedMessage(const std::string_view title, const char* format, ...);
|
||||
|
||||
/// Sets batch mode (exit after game shutdown).
|
||||
bool InBatchMode();
|
||||
|
||||
/// Sets NoGUI mode (implys batch mode, does not display main window, exits on shutdown).
|
||||
bool InNoGUIMode();
|
||||
|
||||
/// Opens a URL, using the default application.
|
||||
void OpenURL(const std::string_view url);
|
||||
|
||||
|
||||
@@ -857,7 +857,7 @@ void AudioStreamParameters::LoadSave(SettingsWrapper& wrap, const char* section)
|
||||
wrap.EnumEntry(section, "ExpansionMode", expansion_mode, &AudioStream::ParseExpansionMode, &AudioStream::GetExpansionModeName, DEFAULT_EXPANSION_MODE);
|
||||
minimal_output_latency = wrap.EntryBitBool(section, "OutputLatencyMinimal", DEFAULT_OUTPUT_LATENCY_MINIMAL);
|
||||
buffer_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "BufferMS", buffer_ms, DEFAULT_BUFFER_MS), 0, std::numeric_limits<u16>::max()));
|
||||
output_latency_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "OutputLatencyMS", buffer_ms, DEFAULT_OUTPUT_LATENCY_MS), 0, std::numeric_limits<u16>::max()));
|
||||
output_latency_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "OutputLatencyMS", output_latency_ms, DEFAULT_OUTPUT_LATENCY_MS), 0, std::numeric_limits<u16>::max()));
|
||||
|
||||
stretch_sequence_length_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "StretchSequenceLengthMS", DEFAULT_STRETCH_SEQUENCE_LENGTH), 0, std::numeric_limits<u16>::max()));
|
||||
stretch_seekwindow_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "StretchSeekWindowMS", DEFAULT_STRETCH_SEEKWINDOW), 0, std::numeric_limits<u16>::max()));
|
||||
|
||||
@@ -1602,7 +1602,7 @@ void FullscreenUI::DrawExitWindow()
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, UIBackgroundTextColor);
|
||||
|
||||
if (BeginHorizontalMenu("exit_window", menu_pos, menu_size, 3))
|
||||
if (BeginHorizontalMenu("exit_window", menu_pos, menu_size, (Host::InNoGUIMode()) ? 2 : 3))
|
||||
{
|
||||
ResetFocusHere();
|
||||
|
||||
@@ -1621,10 +1621,13 @@ void FullscreenUI::DrawExitWindow()
|
||||
DoRequestExit();
|
||||
}
|
||||
|
||||
if (HorizontalMenuItem(GetCachedTexture("fullscreenui/desktop-mode.png"), FSUI_CSTR("Desktop Mode"),
|
||||
FSUI_CSTR("Exits Big Picture mode, returning to the desktop interface.")))
|
||||
if (!Host::InNoGUIMode())
|
||||
{
|
||||
DoDesktopMode();
|
||||
if (HorizontalMenuItem(GetCachedTexture("fullscreenui/desktop-mode.png"), FSUI_CSTR("Desktop Mode"),
|
||||
FSUI_CSTR("Exits Big Picture mode, returning to the desktop interface.")))
|
||||
{
|
||||
DoDesktopMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
EndHorizontalMenu();
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <cstring>
|
||||
#include <fmt/format.h>
|
||||
#include <sys/stat.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -641,7 +642,7 @@ namespace R3000A
|
||||
|
||||
for (size_t i = 0; i < handles.size(); i++)
|
||||
{
|
||||
if (handles[i].fd_index == (u32) fd - firstfd)
|
||||
if (handles[i].fd_index == (u32)fd - firstfd)
|
||||
{
|
||||
handles.erase(handles.begin() + i);
|
||||
break;
|
||||
@@ -928,12 +929,6 @@ namespace R3000A
|
||||
{
|
||||
int Kprintf_HLE()
|
||||
{
|
||||
// Using sprintf here is a bit nasty, but it has a large buffer..
|
||||
// Don't feel like rewriting it.
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
// Emulate the expected Kprintf functionality:
|
||||
iopMemWrite32(sp, a0);
|
||||
@@ -951,8 +946,12 @@ namespace R3000A
|
||||
if (!ConsoleLogging.iopConsole.IsActive())
|
||||
return 1;
|
||||
|
||||
char tmp[1024], tmp2[1024];
|
||||
// maximum allowed size for our buffer before we truncate
|
||||
const unsigned int max_len = 4096;
|
||||
char tmp[max_len], tmp2[max_len];
|
||||
char* ptmp = tmp;
|
||||
unsigned int printed_bytes = 0;
|
||||
int remaining_buf = max_len - 1;
|
||||
int n = 1, i = 0, j = 0;
|
||||
|
||||
while (fmt[i])
|
||||
@@ -963,21 +962,32 @@ namespace R3000A
|
||||
j = 0;
|
||||
tmp2[j++] = '%';
|
||||
_start:
|
||||
switch (fmt[++i])
|
||||
// let's check whether this is our null terminator
|
||||
// before allowing the parser to proceed
|
||||
if (fmt[i + 1])
|
||||
{
|
||||
case '.':
|
||||
case 'l':
|
||||
tmp2[j++] = fmt[i];
|
||||
goto _start;
|
||||
default:
|
||||
if (fmt[i] >= '0' && fmt[i] <= '9')
|
||||
{
|
||||
switch (fmt[++i])
|
||||
{
|
||||
case '.':
|
||||
case 'l':
|
||||
if (j >= max_len)
|
||||
break;
|
||||
tmp2[j++] = fmt[i];
|
||||
goto _start;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (fmt[i] >= '0' && fmt[i] <= '9')
|
||||
{
|
||||
if (j >= max_len)
|
||||
break;
|
||||
tmp2[j++] = fmt[i];
|
||||
goto _start;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j >= max_len)
|
||||
break;
|
||||
tmp2[j++] = fmt[i];
|
||||
tmp2[j] = 0;
|
||||
|
||||
@@ -985,7 +995,9 @@ namespace R3000A
|
||||
{
|
||||
case 'f':
|
||||
case 'F':
|
||||
ptmp += sprintf(ptmp, tmp2, (float)iopMemRead32(sp + n * 4));
|
||||
printed_bytes = std::min(remaining_buf, snprintf(ptmp, remaining_buf, tmp2, (float)iopMemRead32(sp + n * 4)));
|
||||
remaining_buf -= printed_bytes;
|
||||
ptmp += printed_bytes;
|
||||
n++;
|
||||
break;
|
||||
|
||||
@@ -995,7 +1007,9 @@ namespace R3000A
|
||||
case 'E':
|
||||
case 'g':
|
||||
case 'G':
|
||||
ptmp += sprintf(ptmp, tmp2, (double)iopMemRead32(sp + n * 4));
|
||||
printed_bytes = std::min(remaining_buf, snprintf(ptmp, remaining_buf, tmp2, (double)iopMemRead32(sp + n * 4)));
|
||||
remaining_buf -= printed_bytes;
|
||||
ptmp += printed_bytes;
|
||||
n++;
|
||||
break;
|
||||
|
||||
@@ -1007,19 +1021,27 @@ namespace R3000A
|
||||
case 'O':
|
||||
case 'x':
|
||||
case 'X':
|
||||
ptmp += sprintf(ptmp, tmp2, (u32)iopMemRead32(sp + n * 4));
|
||||
case 'u':
|
||||
case 'U':
|
||||
printed_bytes = std::min(remaining_buf, snprintf(ptmp, remaining_buf, tmp2, (u32)iopMemRead32(sp + n * 4)));
|
||||
remaining_buf -= printed_bytes;
|
||||
ptmp += printed_bytes;
|
||||
n++;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
ptmp += sprintf(ptmp, tmp2, (u8)iopMemRead32(sp + n * 4));
|
||||
printed_bytes = std::min(remaining_buf, snprintf(ptmp, remaining_buf, tmp2, (u8)iopMemRead32(sp + n * 4)));
|
||||
remaining_buf -= printed_bytes;
|
||||
ptmp += printed_bytes;
|
||||
n++;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
{
|
||||
std::string s = iopMemReadString(iopMemRead32(sp + n * 4));
|
||||
ptmp += sprintf(ptmp, tmp2, s.data());
|
||||
printed_bytes = std::min(remaining_buf, snprintf(ptmp, remaining_buf, tmp2, s.data()));
|
||||
remaining_buf -= printed_bytes;
|
||||
ptmp += printed_bytes;
|
||||
n++;
|
||||
}
|
||||
break;
|
||||
@@ -1043,10 +1065,6 @@ namespace R3000A
|
||||
iopConLog(ShiftJIS_ConvertString(tmp, 1023));
|
||||
|
||||
return 1;
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
} // namespace sysmem
|
||||
|
||||
|
||||
@@ -56,6 +56,16 @@ void Host::OpenURL(const std::string_view url)
|
||||
{
|
||||
}
|
||||
|
||||
bool Host::InBatchMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Host::InNoGUIMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Host::CopyTextToClipboard(const std::string_view text)
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user