Resolve some TODOs

This commit is contained in:
jaby 2024-02-08 21:29:18 -05:00
parent e5f8a18acb
commit 97b3de834f
4 changed files with 9 additions and 13 deletions

View File

@ -6,8 +6,6 @@
namespace ScreenCenter {
using namespace JabyEngine;
// TODO: Fit these pieces into 16Word buffers (sizeof(T) >> 2 == words)
// TODO: Can we DMA all of this?
class Frame {
private:
struct TopBorder : public GPU::internal::LinkedElementCreator<TopBorder> {
@ -90,10 +88,7 @@ namespace ScreenCenter {
}
void setup() {
// TODO: I want this in one line
this->top_border.concat(this->bottom_border);
this->bottom_border.concat(this->line_border);
this->line_border.concat(this->line_cross);
this->top_border.concat(this->bottom_border.concat(this->line_border.concat(this->line_cross)));
}
void render() const {

View File

@ -1,6 +1,7 @@
#pragma once
#include "../../Auxiliary/bits.hpp"
#include "../../Auxiliary/type_traits.hpp"
#include "../../System/IOPorts/gpu_io.hpp"
namespace JabyEngine {
namespace GPU {
@ -38,14 +39,14 @@ namespace JabyEngine {
}
template<typename T>
enable_if<!is_pointer<T>::value, T&>::type concat(T& obj) {
enable_if<!is_pointer<T>::value, Link&>::type concat(T& obj) {
Link::set_adr(&obj);
return obj;
return *this;
}
template<typename T>
enable_if<!is_pointer<T>::value, const T&>::type concat(const T& obj) {
return concat(const_cast<T&>(obj));
enable_if<!is_pointer<T>::value, const Link&>::type concat(const T& obj) {
return concat(const_cast<Link&>(obj));
}
constexpr void terminate() {
@ -77,8 +78,7 @@ namespace JabyEngine {
return &this->element;
}
// TODO: Replace this magic number?
static_assert((sizeof(T) >> 2) <= 16);
static_assert((sizeof(T) >> 2) <= GPU_IO::FIFOWordSize);
};
namespace internal {

View File

@ -216,6 +216,8 @@ namespace JabyEngine {
static constexpr auto TexturePageY256 = Bit(4);
};
static constexpr size_t FIFOWordSize = 16;
__declare_io_port(, GP0, 0x1F801810);
__declare_io_port(, GP1, 0x1F801814);

View File

@ -48,7 +48,6 @@ namespace JabyEngine {
using namespace JabyEngine::GPU;
static void configurate_display() {
// Ideal I hope that an offset of 0,0 will produce a well enough centered picture for every TV for now
GPU_IO::GP1.write(GPU_IO::Command::DisplayMode(::JabyEngine::GPU::internal::Display::DisplayMode));
GPU::Display::set_offset(0, 0);
}