Save state before change

This commit is contained in:
2024-07-02 20:05:02 +02:00
parent 07756fd180
commit f5020e152b
6 changed files with 24 additions and 10 deletions

View File

@@ -13,6 +13,15 @@ namespace JabyEngine {
static constexpr T words_to_sectors(T size) {
return (size + static_cast<T>(DataSector::SizeWords - 1))/static_cast<T>(DataSector::SizeWords);
}
constexpr size_t hash() const {
uint32_t value = 0;
for(const auto word : this->data) {
value += word;
}
return value;
}
};
enum Index {
@@ -142,10 +151,10 @@ namespace JabyEngine {
static void ack_extended(IOPort<InterruptFlag>& port) {
port.write(InterruptFlag::from(InterruptFlag::InterruptTypValue.range_max<uint8_t>(), InterruptEnable::UnknownIRQ, InterruptEnable::CommandStartIRQ));
// *reinterpret_cast<uint32_t*>(0x0) = 0;
// *reinterpret_cast<uint32_t*>(0x0) = 0;
// *reinterpret_cast<uint32_t*>(0x0) = 0;
// *reinterpret_cast<uint32_t*>(0x0) = 0;
}
static void reset_parameter_fifo(IOPort<InterruptFlag>& port) {
port.write(InterruptFlag{0x40});
}
};