Skip to content

Commit

Permalink
Merge branch 'PCSX2:master' into gsdumpfile-prealloc
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBraben authored Nov 25, 2024
2 parents 424e42e + 31ffcfc commit 503a00e
Show file tree
Hide file tree
Showing 63 changed files with 1,100 additions and 757 deletions.
14 changes: 8 additions & 6 deletions 3rdparty/ccc/src/ccc/elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const ElfProgramHeader* ElfFile::entry_point_segment() const
return entry_segment;
}

Result<std::span<const u8>> ElfFile::get_virtual(u32 address, u32 size) const
std::optional<std::span<const u8>> ElfFile::get_virtual(u32 address, u32 size) const
{
u32 end_address = address + size;

Expand All @@ -109,17 +109,19 @@ Result<std::span<const u8>> ElfFile::get_virtual(u32 address, u32 size) const
}
}

return CCC_FAILURE("No ELF segment for address range 0x%x to 0x%x.", address, end_address);
return std::nullopt;
}

Result<void> ElfFile::copy_virtual(u8* dest, u32 address, u32 size) const
bool ElfFile::copy_virtual(u8* dest, u32 address, u32 size) const
{
Result<std::span<const u8>> block = get_virtual(address, size);
CCC_RETURN_IF_ERROR(block);
std::optional<std::span<const u8>> block = get_virtual(address, size);
if(!block.has_value()) {
return false;
}

memcpy(dest, block->data(), size);

return Result<void>();
return true;
}

}
20 changes: 12 additions & 8 deletions 3rdparty/ccc/src/ccc/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,29 +125,33 @@ struct ElfFile {
const ElfProgramHeader* entry_point_segment() const;

// Retrieve a block of data in an ELF file given its address and size.
Result<std::span<const u8>> get_virtual(u32 address, u32 size) const;
std::optional<std::span<const u8>> get_virtual(u32 address, u32 size) const;

// Copy a block of data in an ELF file to the destination buffer given its
// address and size.
Result<void> copy_virtual(u8* dest, u32 address, u32 size) const;
bool copy_virtual(u8* dest, u32 address, u32 size) const;

// Retrieve an object of type T from an ELF file given its address.
template <typename T>
Result<T> get_object_virtual(u32 address) const
std::optional<T> get_object_virtual(u32 address) const
{
Result<std::span<const u8>> result = get_virtual(address, sizeof(T));
CCC_RETURN_IF_ERROR(result);
std::optional<std::span<const u8>> result = get_virtual(address, sizeof(T));
if(!result.has_value()) {
return std::nullopt;
}

return *(T*) result->data();
}

// Retrieve an array of objects of type T from an ELF file given its
// address and element count.
template <typename T>
Result<std::span<const T>> get_array_virtual(u32 address, u32 element_count) const
std::optional<std::span<const T>> get_array_virtual(u32 address, u32 element_count) const
{
Result<std::span<const u8>> result = get_virtual(address, element_count * sizeof(T));
CCC_RETURN_IF_ERROR(result);
std::optional<std::span<const u8>> result = get_virtual(address, element_count * sizeof(T));
if(!result.has_value()) {
return std::nullopt;
}

return std::span<const T>((T*) result->data(), (T*) (result->data() + result->size()));
}
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/ccc/src/ccc/symbol_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class Label : public Symbol {
public:
static constexpr const SymbolDescriptor DESCRIPTOR = LABEL;
static constexpr const char* NAME = "Label";
static constexpr u32 FLAGS = WITH_ADDRESS_MAP;
static constexpr u32 FLAGS = WITH_ADDRESS_MAP | WITH_NAME_MAP;

LabelHandle handle() const { return m_handle; }

Expand Down
6 changes: 4 additions & 2 deletions 3rdparty/ccc/src/ccc/symbol_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,18 @@ Result<std::unique_ptr<SymbolTable>> create_elf_symbol_table(

Result<ModuleHandle> import_symbol_tables(
SymbolDatabase& database,
std::string module_name,
const std::vector<std::unique_ptr<SymbolTable>>& symbol_tables,
std::string module_name,
Address base_address,
u32 importer_flags,
DemanglerFunctions demangler,
const std::atomic_bool* interrupt)
{
Result<SymbolSourceHandle> module_source = database.get_symbol_source("Symbol Table Importer");
CCC_RETURN_IF_ERROR(module_source);

Result<Module*> module_symbol = database.modules.create_symbol(std::move(module_name), *module_source, nullptr);
Result<Module*> module_symbol = database.modules.create_symbol(
std::move(module_name), base_address, *module_source, nullptr);
CCC_RETURN_IF_ERROR(module_symbol);

ModuleHandle module_handle = (*module_symbol)->handle();
Expand Down
3 changes: 2 additions & 1 deletion 3rdparty/ccc/src/ccc/symbol_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ Result<std::unique_ptr<SymbolTable>> create_elf_symbol_table(
// and to generate a module handle.
Result<ModuleHandle> import_symbol_tables(
SymbolDatabase& database,
std::string module_name,
const std::vector<std::unique_ptr<SymbolTable>>& symbol_tables,
std::string module_name,
Address base_address,
u32 importer_flags,
DemanglerFunctions demangler,
const std::atomic_bool* interrupt);
Expand Down
64 changes: 34 additions & 30 deletions bin/resources/GameIndex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18509,6 +18509,8 @@ SLES-52256:
SLES-52257:
name: "P.T.O. IV - Pacific Theater of Operations IV"
region: "PAL-E"
gsHWFixes:
minimumBlendingLevel: 3 # Fixes graphical flickering.
SLES-52258:
name: "Romance of the Three Kingdoms VIII"
region: "PAL-E"
Expand Down Expand Up @@ -21503,47 +21505,42 @@ SLES-53332:
region: "PAL-M4"
compat: 5
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLES-53333:
name: "Medal of Honor - Les Faucons de Guerre"
region: "PAL-F"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLES-53334:
name: "Medal of Honor - European Assault"
region: "PAL-G"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLES-53335:
name: "Medal of Honor - European Assault"
region: "PAL-I"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLES-53336:
name: "Medal of Honor - European Assault"
region: "PAL-S"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLES-53338:
name: "Victorious Boxers 2 - Fighting Spirit"
region: "PAL-M3"
Expand Down Expand Up @@ -29948,11 +29945,10 @@ SLKA-25243:
name: "Medal of Honor - European Assault"
region: "NTSC-K"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLKA-25244:
name: "WWE SmackDown! vs. Raw"
region: "NTSC-K"
Expand Down Expand Up @@ -31187,11 +31183,10 @@ SLPM-55037:
name: "Medal of Honor - European Assault [EASY 1980]"
region: "NTSC-J"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLPM-55038:
name: "Grand Theft Auto - Liberty City Stories [Best Price]"
region: "NTSC-J"
Expand Down Expand Up @@ -33919,6 +33914,8 @@ SLPM-62144:
SLPM-62145:
name: "Teitoku no Ketsudan IV"
region: "NTSC-J"
gsHWFixes:
minimumBlendingLevel: 3 # Fixes graphical flickering.
SLPM-62146:
name: "Chou Kousoku Mahjong Plus"
region: "NTSC-J"
Expand Down Expand Up @@ -35381,6 +35378,8 @@ SLPM-62469:
SLPM-62470:
name: "Teitoku no Ketsudan IV with Power Up Kit"
region: "NTSC-J"
gsHWFixes:
minimumBlendingLevel: 3 # Fixes graphical flickering.
memcardFilters:
- "SLPM-62145"
- "SLPM-62470"
Expand Down Expand Up @@ -35652,6 +35651,8 @@ SLPM-62518:
name-sort: "ていとくのけつだん4 [KOEI The Best]"
name-en: "Teitoku no Ketsudan IV [Koei the Best]"
region: "NTSC-J"
gsHWFixes:
minimumBlendingLevel: 3 # Fixes graphical flickering.
SLPM-62519:
name: "三國志VIII [KOEI The Best]"
name-sort: "さんごくし8 [KOEI The Best]"
Expand Down Expand Up @@ -43063,11 +43064,10 @@ SLPM-66079:
name: "Medal of Honor - Europe Kyoushuu"
region: "NTSC-J"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLPM-66080:
name: "GENERATION OF CHAOSIII 〜時の封印〜 [IFコレクション]"
name-sort: "じぇねれーしょんおぶかおす 3 ときのふういん [あいであふぁくとりーこれくしょん]"
Expand Down Expand Up @@ -45807,11 +45807,10 @@ SLPM-66514:
name-en: "Medal of Honor - European Assault [EA Best Hits]"
region: "NTSC-J"
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLPM-66515:
name: "EA BEST HITS スター・ウォーズ エピソード3 シスの復讐"
name-sort: "すたーうぉーず えぴそーど3 しすのふくしゅう [EA BEST HITS]"
Expand Down Expand Up @@ -61062,6 +61061,8 @@ SLUS-20567:
name: "P.T.O. IV - Pacific Theater of Operations"
region: "NTSC-U"
compat: 5
gsHWFixes:
minimumBlendingLevel: 3 # Fixes graphical flickering.
SLUS-20568:
name: "Hard Hitter Tennis"
region: "NTSC-U"
Expand Down Expand Up @@ -64136,6 +64137,10 @@ SLUS-21113:
name: "Atelier Iris - Eternal Mana"
region: "NTSC-U"
compat: 5
gameFixes:
- SoftwareRendererFMVHack # Fixes horizontal lines in FMV and prevents hash cache from disabling itself.
gsHWFixes:
roundSprite: 2 # Fixes character portraits when upscaling and reduces lines in FMVs when using HW renderer.
SLUS-21114:
name: "NHRA Championship Drag Racing"
region: "NTSC-U"
Expand Down Expand Up @@ -64606,11 +64611,10 @@ SLUS-21199:
region: "NTSC-U"
compat: 5
gsHWFixes:
recommendedBlendingLevel: 2
recommendedBlendingLevel: 3 # Fixes banding and level lighting.
autoFlush: 1 # Fixes sun shinging through surfaces and graphical corruptions.
halfPixelOffset: 2 # Fixes misaligned blur.
cpuSpriteRenderBW: 2 # Fixes black spots appearing on some surfaces and massively reduces RP TC and TU count.
cpuSpriteRenderLevel: 2 # Needed for above.
nativeScaling: 2 # Fixes bloom misaligment.
SLUS-21200:
name: "Armored Core - Nine Breaker"
region: "NTSC-U"
Expand Down
Loading

0 comments on commit 503a00e

Please sign in to comment.