mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-22 11:25:02 +00:00
some fixup to playgo , makes Worms go further
This commit is contained in:
parent
a475b38e5f
commit
b4916ef2ca
4 changed files with 62 additions and 5 deletions
16
src/core/file_format/playgo_chunk.cpp
Normal file
16
src/core/file_format/playgo_chunk.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/io_file.h"
|
||||
|
||||
#include "playgo_chunk.h"
|
||||
|
||||
bool PlaygoChunk::Open(const std::filesystem::path& filepath) {
|
||||
Common::FS::IOFile file(filepath, Common::FS::FileAccessMode::Read);
|
||||
if (!file.IsOpen()) {
|
||||
return false;
|
||||
}
|
||||
file.Read(playgoHeader);
|
||||
|
||||
return true;
|
||||
}
|
31
src/core/file_format/playgo_chunk.h
Normal file
31
src/core/file_format/playgo_chunk.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
#include <filesystem>
|
||||
#include "common/types.h"
|
||||
|
||||
struct PlaygoHeader {
|
||||
u32 magic;
|
||||
|
||||
u16 version_major;
|
||||
u16 version_minor;
|
||||
u16 image_count;
|
||||
u16 chunk_count;
|
||||
u16 mchunk_count;
|
||||
u16 scenario_count;
|
||||
// TODO fill the rest
|
||||
};
|
||||
class PlaygoChunk {
|
||||
public:
|
||||
PlaygoChunk() = default;
|
||||
~PlaygoChunk() = default;
|
||||
|
||||
bool Open(const std::filesystem::path& filepath);
|
||||
PlaygoHeader GetPlaygoHeader() {
|
||||
return playgoHeader;
|
||||
}
|
||||
|
||||
private:
|
||||
PlaygoHeader playgoHeader;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue