Port to latest GCC and fix CD loading bug

This commit is contained in:
2023-09-03 01:57:28 +02:00
parent 1e94d0352b
commit 101e44b1ac
12 changed files with 83 additions and 67 deletions

View File

@@ -85,7 +85,8 @@ namespace JabyEngine {
}
);
struct __no_align Registers {
#pragma pack(push, 1)
struct Registers {
MADR_v adr;
BCR_v block_ctrl;
CHCHR_v channel_ctrl;
@@ -98,6 +99,7 @@ namespace JabyEngine {
while(this->channel_ctrl.is_set(CHCHR_t::Busy));
}
};
#pragma pack(pop)
// Those types do not need to be volatile because there members are
typedef Registers MDECin_v;

View File

@@ -113,7 +113,8 @@ namespace JabyEngine {
typedef name##_io_base<IOPort::IOValueType::Volatile> name##_v; \
typedef name##_io_base<IOPort::IOValueType::Normal> name##_t
struct __no_align ubus32_t {
#pragma pack(push, 1)
struct ubus32_t {
__declare_io_type(uint16_t, uint16_t,);
uint16_t_v low;
uint16_t_v high;
@@ -140,5 +141,6 @@ namespace JabyEngine {
return *this;
}
};
#pragma pack(pop)
}
#endif //!__JABYENGINE_IOPORT_HPP__

View File

@@ -71,7 +71,8 @@ namespace JabyEngine {
static constexpr auto SustainLevel = BitRange::from_to(0, 3);
);
struct __no_align Voice_v {
#pragma pack(push, 1)
struct Voice_v {
SweepVolume_v volumeLeft; //Offset: 0x0
SweepVolume_v volumeRight; //Offset: 0x2
SampleRate_v sampleRate; //Offset: 0x4;
@@ -81,6 +82,7 @@ namespace JabyEngine {
SimpleVolume_v currentVolume; //Offset: 0xC
Adr_v repeatAdr; //Offset: 0xE
};
#pragma pack(pop)
__declare_io_type(ControlRegister, uint16_t,
enum RAMTransferMode {

View File

@@ -29,7 +29,8 @@ namespace JabyEngine {
static constexpr auto Value = BitRange::from_to(0, 15);
);
struct __no_align Counter {
#pragma pack(push, 1)
struct Counter {
CounterValue_v value;
CounterMode_v mode;
CounterTarget_v target;
@@ -50,12 +51,14 @@ namespace JabyEngine {
this->mode = mode;
}
};
#pragma pack(pop)
static constexpr uintptr_t counter_base_adr(size_t ID) {
return (0x1F801100 + (ID*0x10));
}
struct __no_align Counter0_v : public Counter {
#pragma pack(push, 1)
struct Counter0_v : public Counter {
struct SyncMode {
static constexpr auto Pause_During_Hblank = CounterMode_v::SyncMode.with(0u);
static constexpr auto Zero_At_Hblank = CounterMode_v::SyncMode.with(1u);
@@ -71,7 +74,7 @@ namespace JabyEngine {
};
};
struct __no_align Counter1_v : public Counter {
struct Counter1_v : public Counter {
struct SyncMode {
static constexpr auto Pause_During_Vblank = CounterMode_v::SyncMode.with(0u);
static constexpr auto Zero_At_Vblank = CounterMode_v::SyncMode.with(1u);
@@ -87,7 +90,7 @@ namespace JabyEngine {
};
};
struct __no_align Counter2_v : public Counter {
struct Counter2_v : public Counter {
struct SyncMode {
static constexpr auto Stop_Counter = CounterMode_v::SyncMode.with(0u);
static constexpr auto FreeRun = CounterMode_v::SyncMode.with(1u);
@@ -102,6 +105,7 @@ namespace JabyEngine {
static constexpr auto System_Clock_Div_8_Too = CounterMode_v::ClockSource.with(3u);
};
};
#pragma pack(pop)
__declare_new_io_port(Counter0, counter_base_adr(0));
__declare_new_io_port(Counter1, counter_base_adr(1));