/* * Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved. */ #include "media.hpp" namespace nostalgia::core { ox::Result> loadRomFs(const char *path) noexcept { const auto lastDot = ox_lastIndexOf(path, '.'); const auto fsExt = lastDot != -1 ? path + lastDot : ""; if (ox_strcmp(fsExt, ".oxfs") == 0) { oxRequire(rom, core::loadRom(path)); return {ox::make_unique(rom, 32 * ox::units::MB, unloadRom)}; } else { #ifdef OX_HAS_PASSTHROUGHFS return {ox::make_unique(path)}; #else return OxError(2); #endif } } }