diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-12-12 14:34:05 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-12-16 16:29:10 -0600 |
| commit | 02712d69cdd859d702cc7577e72db27d6f0c9ad5 (patch) | |
| tree | 01d0c36111a99f596588816a2529f661ba56d023 /tb/vga.hpp | |
| parent | 397245139af754af07e61a10a91fdc9b9e72153f (diff) | |
Implement fast video
Diffstat (limited to '')
| -rw-r--r-- | tb/vga.hpp | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -8,6 +8,8 @@ #include <SDL2/SDL_surface.h> #include <SDL2/SDL_video.h> +#include "avalon.hpp" + namespace taller::vga { struct timings @@ -26,14 +28,19 @@ namespace taller::vga }; template<class Crtc> - class display + class display : public avalon::slave { public: - display(Crtc &crtc, std::uint32_t clock_hz) noexcept; + display(Crtc &crtc, std::uint32_t base, std::uint32_t clock_hz, std::uint32_t bus_hz = 0) noexcept; ~display() noexcept; - void tick(bool clk) noexcept; + virtual void tick() noexcept final override; + + virtual bool read(std::uint32_t addr, std::uint32_t &data) noexcept final override; + virtual bool write(std::uint32_t addr, std::uint32_t data, unsigned byte_enable) noexcept final override; + + void signal_tick(bool clk) noexcept; inline bool key(std::size_t index) { @@ -41,6 +48,9 @@ namespace taller::vga } private: + unsigned ticks = 0; + unsigned refresh_ticks = 0; + unsigned max_addr = 0; Crtc& crtc; SDL_Window *window = nullptr; const video_mode *mode = nullptr; |
