2022-12-04 11:03:45 +00:00
|
|
|
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
|
2019-09-17 09:22:39 +00:00
|
|
|
#pragma once
|
2019-09-21 15:12:16 +00:00
|
|
|
#include "types.h"
|
2023-01-09 09:34:40 +00:00
|
|
|
#include <memory>
|
2019-09-24 13:55:22 +00:00
|
|
|
#include <string>
|
2020-07-21 14:03:44 +00:00
|
|
|
#include <tuple>
|
2022-07-23 03:23:54 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
class CDImage;
|
2019-09-17 09:22:39 +00:00
|
|
|
class StateWrapper;
|
2019-10-15 07:27:35 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
namespace CDROM {
|
2019-10-15 07:27:35 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
void Initialize();
|
|
|
|
void Shutdown();
|
|
|
|
void Reset();
|
|
|
|
bool DoState(StateWrapper& sw);
|
2019-10-04 09:05:19 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
bool HasMedia();
|
|
|
|
const std::string& GetMediaFileName();
|
|
|
|
const CDImage* GetMedia();
|
|
|
|
DiscRegion GetDiscRegion();
|
|
|
|
bool IsMediaPS1Disc();
|
|
|
|
bool DoesMediaRegionMatchConsole();
|
2019-10-15 07:27:35 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
void InsertMedia(std::unique_ptr<CDImage> media);
|
|
|
|
std::unique_ptr<CDImage> RemoveMedia(bool for_disc_swap);
|
|
|
|
bool PrecacheMedia();
|
2019-09-17 09:22:39 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
void CPUClockChanged();
|
2020-03-12 05:32:41 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
// I/O
|
|
|
|
u8 ReadRegister(u32 offset);
|
|
|
|
void WriteRegister(u32 offset, u8 value);
|
|
|
|
void DMARead(u32* words, u32 word_count);
|
2020-03-12 05:32:41 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
// Render statistics debug window.
|
|
|
|
void DrawDebugWindow();
|
2020-02-21 15:19:10 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
void SetReadaheadSectors(u32 readahead_sectors);
|
2020-07-21 14:03:44 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
/// Reads a frame from the audio FIFO, used by the SPU.
|
|
|
|
std::tuple<s16, s16> GetAudioFrame();
|
2020-07-31 07:09:18 +00:00
|
|
|
|
2023-01-09 09:34:40 +00:00
|
|
|
} // namespace CDROM
|