Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
2 changed files with 44 additions and 4 deletions
Showing only changes of commit 3651c4c405 - Show all commits

View File

@ -153,6 +153,30 @@ namespace JabyEngine {
}
};
struct LookUpColor8 {
static constexpr BitRange LUPosition[] = {
BitRange::from_to(0, 7),
BitRange::from_to(8, 15)
};
uint8_t lu_id[2];
static constexpr LookUpColor8 from_ids(uint8_t px0, uint8_t px1) {
return {{px0, px1}};
}
constexpr uint8_t get_lu_id(size_t at) const {
return this->lu_id[at];
}
constexpr void set_lu_id(uint8_t new_lu_id, size_t at) {
this->lu_id[at] = new_lu_id;
}
uint16_t force_read() const {
return *const_cast<const volatile uint16_t*>(reinterpret_cast<const uint16_t*>(this->lu_id));
}
};
template<typename T>
struct Position : public internal::XYMovement<Position<T>, T> {
T x;

View File

@ -32,10 +32,9 @@ namespace JabyEngine {
const CLUT clut {
.cmd = CPU2VRAM::create(AreaU16::create(dst_cord, GPU::SizeU16::create(16, 1))),
.data = {
Color::Blue(), Color::White(),
Color::Blue(), Color::White(), Color::Blue(), Color::White(), Color::Blue(), Color::White(),
Color::Blue(), Color::White(),
Color::Blue(), Color::White(), Color::Blue(), Color::White(), Color::Blue(), Color::White(),
Color::Grey(), Color::White(),
Color::Black(), Color::Black(), Color::Black(), Color::Black(), Color::Black(), Color::Black(), Color::Black(),
Color::Black(), Color::Black(), Color::Black(), Color::Black(), Color::Black(), Color::Black(), Color::Black(),
}
};
@ -93,6 +92,23 @@ namespace JabyEngine {
}
void setup() {
asm("# Planschi1");
auto test = LookUpColor8::from_ids(0xAA, 0xBB);
test.force_read();
asm("# Planschi2");
test.set_lu_id(0xCC, 0);
test.set_lu_id(0xDD, 1);
test.force_read();
asm("# Planschi3");
test.set_lu_id(*reinterpret_cast<uint8_t*>(0xAA), 0);
test.set_lu_id(*reinterpret_cast<uint8_t*>(0xDD), 1);
test.force_read();
asm("# Planschi4");
test.set_lu_id(*reinterpret_cast<uint8_t*>(0xAA), *reinterpret_cast<uint8_t*>(0xAE));
test.set_lu_id(*reinterpret_cast<uint8_t*>(0xDD), *reinterpret_cast<uint8_t*>(0xDE));
test.force_read();
asm("# Planschi5");
GPU_IO::GP1.write(GPU_IO::Command::Reset());
configurate_display();
::JabyEngine::GPU::internal::Display::exchange_buffer_and_display();