summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/dvdrom.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/dvdrom.h')
-rw-r--r--src/lib/util/dvdrom.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/util/dvdrom.h b/src/lib/util/dvdrom.h
new file mode 100644
index 00000000000..47bd6a26172
--- /dev/null
+++ b/src/lib/util/dvdrom.h
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles,R. Belmont
+/***************************************************************************
+
+ dvdrom.h
+
+ Generic MAME dvd-rom implementation
+
+***************************************************************************/
+#ifndef MAME_LIB_UTIL_DVDROM_H
+#define MAME_LIB_UTIL_DVDROM_H
+
+#pragma once
+
+#include "chd.h"
+#include "ioprocs.h"
+#include "osdcore.h"
+
+class dvdrom_file {
+public:
+ dvdrom_file(chd_file *chd);
+ dvdrom_file(std::string_view inputfile);
+ ~dvdrom_file();
+
+ uint32_t get_sector_count() const { return sector_count; }
+
+ /* core read access */
+ std::error_condition read_data(uint32_t lbasector, void *buffer);
+
+private:
+ /** @brief The chd, when there's one */
+ chd_file * chd; /* CHD file */
+
+ /** @brief The raw file, when there isn't */
+ util::random_read_write * fhandle; // file if not a CHD
+
+ /** @brief Size of the dvd image in sectors */
+ uint32_t sector_count;
+};
+
+#endif // MAME_LIB_UTIL_DVDROM_H