Introduce internal and normal GPU functions

This commit is contained in:
Jaby
2022-09-11 10:10:51 +02:00
parent b523c2c73f
commit 3317867f1d
7 changed files with 73 additions and 12 deletions

View File

@@ -2,6 +2,7 @@
#define BOOT_LOADER_HPP
namespace GPU {
void display_logo();
void setup();
}

View File

@@ -0,0 +1,14 @@
#ifndef __JABYENGINE_INTERNAL_GPU_HPP__
#define __JABYENGINE_INTERNAL_GPU_HPP__
#include <PSX/GPU/GPU_Types.hpp>
#include <PSX/System/IOPorts/GPU_IO.hpp>
namespace GPU {
static void quick_fill_fast(const Color& color, const PositionU16& pos, const SizeU16& size) {
Port::GP0.write(Port::Command::GP0::QuickFill(color));
Port::GP0.write(Port::Command::GP0::TopLeftPosition(pos.x, pos.y));
Port::GP0.write(Port::Command::GP0::WidthHeight(size.width, size.height));
}
}
#endif //!__JABYENGINE_INTERNAL_GPU_HPP__

View File

@@ -1,14 +1,16 @@
#include <PSX/System/IOPorts/GPU_IO.hpp>
#include "../../include/GPU/GPU.h"
#include <PSX/GPU/GPU.h>
namespace GPU {
void display_logo() {
Display::disable();
quick_fill_fast(Color(0x0, 0x80, 0x80), PositionU16(0, 0), SizeU16(640, 480));
Display::enable();
}
void setup() {
//Port::GP1.write(Port::Command::GP1::Reset());
Port::GP1.write(Port::Command::GP1::Reset());
//Quickfill
Port::GP0.write(Port::Command::GP0::QuickFill(Color(0xFF, 0x0, 0x0)));
Port::GP0.write(Port::Command::GP0::TopLeftPosition(8, 8));
Port::GP0.write(Port::Command::GP0::WidthHeight(32, 32));
//Port::GP1.write(Port::Command::GP1::SetDisplayState(Port::DisplayState::On));
quick_fill_fast(Color(0x0, 0x0, 0x0), PositionU16(0, 0), SizeU16(640, 480));
}
}

View File

@@ -4,14 +4,15 @@
namespace JabyEngine {
void start() {
printf("Hello Planschbecken\n");
//We key off the voices
SPU::stop_voices();
GPU::display_logo();
//Load picture here
//Pause??
//Do the real setup
GPU::setup();
//Do not setup GPU for now
//GPU::setup();
SPU::setup();
printf("Setup done!\n");
}