Simulated load of a file

This commit is contained in:
Jaby
2023-03-03 14:33:29 +01:00
committed by Jaby
parent aa59c38928
commit 0edc82c5e2
7 changed files with 106 additions and 38 deletions

View File

@@ -1,16 +1,24 @@
#ifndef __JABYENGINE_CD_INTERNAL_HPP__
#define __JABYENGINE_CD_INTERNAL_HPP__
#include "cd_types.hpp"
#include <PSX/System/IOPorts/cd_io.hpp>
namespace JabyEngine {
namespace CD {
namespace internal {
extern VolatilePOD<CD_IO::Interrupt::Type> last_interrupt;
extern CD_IO::Interrupt::Type last_interrupt;
extern State current_state;
static CD_IO::Interrupt::Type read_last_interrupt() {
return const_cast<volatile CD_IO::Interrupt::Type&>(last_interrupt);
}
static State read_current_state() {
return const_cast<volatile State&>(current_state);
}
struct Command {
static void wait_until(CD_IO::Interrupt::Type irq) {
while(last_interrupt.read() != irq);
while(read_last_interrupt() != irq);
}
template<typename...ARGS>
@@ -38,7 +46,7 @@ namespace JabyEngine {
}
};
State read_file(FileInfo file_info, const SectorBufferAllocator& buffer_allocator);
void read_file(FileInfo file_info, const SectorBufferAllocator& buffer_allocator);
}
}
}