io: i really ought to be working on the ppu and apu by now

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-06-13 03:53:25 +05:30
parent 933b622493
commit 08cc582f23
17 changed files with 1751 additions and 78 deletions

32
include/io/io.hh Normal file
View File

@@ -0,0 +1,32 @@
#pragma once
#include "lcd.hh"
#include "sound.hh"
#include <cstdint>
namespace matar {
class IoDevices {
public:
uint8_t read_byte(uint32_t) const;
void write_byte(uint32_t, uint8_t);
uint32_t read_word(uint32_t) const;
void write_word(uint32_t, uint32_t);
uint16_t read_halfword(uint32_t) const;
void write_halfword(uint32_t, uint16_t);
private:
struct {
using u16 = uint16_t;
bool post_boot_flag;
bool interrupt_master_enabler;
u16 interrupt_enable;
u16 interrupt_request_flags;
u16 waitstate_control;
bool low_power_mode;
} system = {};
struct lcd lcd = {};
struct sound sound = {};
};
}