duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

cdrom.h (1073B)


      1 // SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
      2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
      3 
      4 #pragma once
      5 #include "types.h"
      6 #include <memory>
      7 #include <string>
      8 #include <tuple>
      9 
     10 class CDImage;
     11 class StateWrapper;
     12 
     13 namespace CDROM {
     14 
     15 void Initialize();
     16 void Shutdown();
     17 void Reset();
     18 bool DoState(StateWrapper& sw);
     19 
     20 bool HasMedia();
     21 const std::string& GetMediaFileName();
     22 const CDImage* GetMedia();
     23 DiscRegion GetDiscRegion();
     24 bool IsMediaPS1Disc();
     25 bool IsMediaAudioCD();
     26 bool DoesMediaRegionMatchConsole();
     27 
     28 void InsertMedia(std::unique_ptr<CDImage> media, DiscRegion region);
     29 std::unique_ptr<CDImage> RemoveMedia(bool for_disc_swap);
     30 bool PrecacheMedia();
     31 
     32 void CPUClockChanged();
     33 
     34 // I/O
     35 u8 ReadRegister(u32 offset);
     36 void WriteRegister(u32 offset, u8 value);
     37 void DMARead(u32* words, u32 word_count);
     38 
     39 // Render statistics debug window.
     40 void DrawDebugWindow();
     41 
     42 void SetReadaheadSectors(u32 readahead_sectors);
     43 
     44 /// Reads a frame from the audio FIFO, used by the SPU.
     45 std::tuple<s16, s16> GetAudioFrame();
     46 
     47 } // namespace CDROM