Integrate all the progress into master #6
|
@ -5,6 +5,8 @@
|
|||
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 : public GPU::internal::LinkedElementCreator<Frame> {
|
||||
private:
|
||||
GPU::TILE top_left[2];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<ISO_Project>
|
||||
<Description>
|
||||
<Publisher>Jaby</Publisher>
|
||||
<!--TODO: How to switch this between PAL and NTSC?-->
|
||||
<License>%PSX_LICENSE_PATH%/LICENSEE.DAT</License>
|
||||
</Description>
|
||||
<Track>
|
||||
|
|
|
@ -76,6 +76,9 @@ namespace JabyEngine {
|
|||
constexpr T* operator->() {
|
||||
return &this->element;
|
||||
}
|
||||
|
||||
// TODO: Remove this magic number?
|
||||
//static_assert((sizeof(T) >> 2) <= 16);
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace JabyEngine {
|
|||
|
||||
#ifdef __USE_DEBUG_COLOR__
|
||||
#define __debug_boot_color_at(color, x, y, scale) { \
|
||||
::JabyEngine::GPU::internal::quick_fill_fast(color, {{64*x, 64*y}, {static_cast<uint16_t>(64*scale), static_cast<uint16_t>(64*scale)}}); \
|
||||
::JabyEngine::GPU::internal::quick_fill_fast(color, ::JabyEngine::GPU::AreaU16::create(64*x, 64*y, static_cast<uint16_t>(64*scale), static_cast<uint16_t>(64*scale))); \
|
||||
}
|
||||
|
||||
#define __debug_boot_print_at(color, x, y, scale, ...) { \
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace JabyEngine {
|
|||
};
|
||||
|
||||
// Letters are actually only 16x15 but should be treated 16x16
|
||||
// TODO: DMA this?
|
||||
struct Letter : public GPU::internal::LinkedElementCreator<Letter> {
|
||||
CPU2VRAM cmd;
|
||||
Line lines[BIOS_Font::Size.height - 1];
|
||||
|
|
|
@ -16,42 +16,6 @@ extern "C" uint32_t __planschi_start;
|
|||
extern "C" uint32_t __planschi_end;
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace boot {
|
||||
namespace Start {
|
||||
static void enable_DMA() {
|
||||
DMA_IO::DPCR.write(DMA_IO::DPCR.read().set(DMA_IO::DPCR::SPUEnable, DMA_IO::DPCR::GPUEnable, DMA_IO::DPCR::CDROMEnable));
|
||||
}
|
||||
|
||||
static void setup() {
|
||||
static constexpr auto DebugX = 1;
|
||||
static constexpr auto DebugY = 0;
|
||||
static constexpr auto DebugScale = 1.0;
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale);
|
||||
Periphery::setup();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale);
|
||||
enable_DMA();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Red(), DebugX, DebugY, DebugScale);
|
||||
SPU::stop_voices();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Green(), DebugX, DebugY, DebugScale);
|
||||
CD::setup();
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Blue(), DebugX, DebugY, DebugScale);
|
||||
Timer::setup();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Yellow(), DebugX, DebugY, DebugScale);
|
||||
GPU::setup();
|
||||
GPU::display_logo();
|
||||
GTE::setup();
|
||||
|
||||
//Pause??
|
||||
SPU::setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void test_bios_font() {
|
||||
static constexpr uint16_t SJIS = 0x83B5;
|
||||
|
||||
|
@ -136,6 +100,44 @@ namespace JabyEngine {
|
|||
printf("---\n");
|
||||
}
|
||||
}
|
||||
|
||||
namespace boot {
|
||||
namespace Start {
|
||||
static void enable_DMA() {
|
||||
DMA_IO::DPCR.write(DMA_IO::DPCR.read().set(DMA_IO::DPCR::SPUEnable, DMA_IO::DPCR::GPUEnable, DMA_IO::DPCR::CDROMEnable));
|
||||
}
|
||||
|
||||
static void setup() {
|
||||
static constexpr auto DebugX = 1;
|
||||
static constexpr auto DebugY = 0;
|
||||
static constexpr auto DebugScale = 1.0;
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale);
|
||||
Periphery::setup();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale);
|
||||
enable_DMA();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Red(), DebugX, DebugY, DebugScale);
|
||||
SPU::stop_voices();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Green(), DebugX, DebugY, DebugScale);
|
||||
CD::setup();
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Blue(), DebugX, DebugY, DebugScale);
|
||||
Timer::setup();
|
||||
|
||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Yellow(), DebugX, DebugY, DebugScale);
|
||||
GPU::setup();
|
||||
GPU::display_logo();
|
||||
GTE::setup();
|
||||
test_bios_font();
|
||||
test_gte();
|
||||
|
||||
//Pause??
|
||||
SPU::setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void start() {
|
||||
static constexpr auto DebugX = 0;
|
||||
|
@ -145,8 +147,6 @@ namespace JabyEngine {
|
|||
__debug_boot_print_at(GPU::Color24::White(), DebugX, DebugY, DebugScale, "Starting Planschbecken\n");
|
||||
printf("Heap starts @0x%p\n", &__heap_start);
|
||||
printf("BSS from 0x%p to 0x%p (%u)\n", &__bss_start, &__bss_end, __bss_len);
|
||||
test_bios_font();
|
||||
test_gte();
|
||||
__debug_boot_print_at(GPU::Color24::Green(), DebugX, DebugY, DebugScale, "PLANSCHI from 0x%p to 0x%p\n", &__planschi_start, &__planschi_end);
|
||||
boot::Start::setup();
|
||||
|
||||
|
|
Loading…
Reference in New Issue