Auto repeat CDXA - Game freezes after a while

This commit is contained in:
2024-05-29 20:33:18 +02:00
parent 676ad434d7
commit 30495279eb
5 changed files with 198 additions and 129 deletions

View File

@@ -4,6 +4,17 @@
namespace JabyEngine {
namespace CD {
namespace internal {
enum struct State {
Ready = 0,
Done = 0,
XAMode,
Reading,
BufferFull,
Error,
};
extern State current_state;
extern uint8_t cmd_interrupt_bit;
@@ -43,7 +54,7 @@ namespace JabyEngine {
}
void read_file(AutoLBAEntry file_info, const SectorBufferAllocator& buffer_allocator);
void read_xa(uint32_t lba);
void read_xa(uint32_t lba, uint8_t channel);
void continue_reading();
CDTimeStamp get_lock();

View File

@@ -6,16 +6,31 @@
namespace JabyEngine {
namespace CD {
using BCD = uint8_t;
using CodingInfo = uint8_t;
using Mode = uint8_t;
using SubMode = uint8_t;
struct Header {
BCD minute;
BCD second;
BCD sector;
Mode mode;
};
struct SubHeader {
uint8_t file_number;
uint8_t channel_number;
SubMode sub_mode;
CodingInfo coding_info;
};
namespace internal {
enum struct State {
Ready = 0,
Done = 0,
XAMode,
Reading,
BufferFull,
Error,
struct XASectorHeader {
Header header;
SubHeader sub_header;
SubHeader copy_subheader;
uint32_t part_data;
};
class SectorBufferAllocator {