[nostalgia/core] Add loadRomFs
This commit is contained in:
parent
e927c51b61
commit
afab2f6878
23
src/nostalgia/core/media.cpp
Normal file
23
src/nostalgia/core/media.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2016 - 2020 gtalent2@gmail.com
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ox/fs/fs.hpp>
|
||||||
|
|
||||||
|
#include "media.hpp"
|
||||||
|
#include "ox/std/bit.hpp"
|
||||||
|
|
||||||
|
namespace nostalgia::core {
|
||||||
|
|
||||||
|
ox::FileSystem *loadRomFs(const char *path) {
|
||||||
|
auto rom = loadRom(path);
|
||||||
|
return new ox::FileSystem32(rom, 32 * ox::units::MB, [](uint8_t *buff) {
|
||||||
|
unloadRom(ox::bit_cast<char*>(buff));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user