Re-arranged files

This commit is contained in:
2022-08-31 20:01:39 +02:00
parent 7243b50fbc
commit b070dc655a
9 changed files with 69 additions and 61 deletions

View File

@@ -55,6 +55,7 @@
},
"settings": {
"C_Cpp.default.includePath": [
"include",
"../../include"
],
"C_Cpp.default.compilerPath": "",

View File

@@ -1,7 +1,7 @@
ARTIFACT = libJabyEngine
BUILD_DIR = bin
CCFLAGS += -I../../include
CCFLAGS += -Iinclude -I../../include
CCFLAGS += -save-temps=obj
include ../../lib/Wildcard.mk

View File

@@ -0,0 +1,8 @@
#ifndef BOOT_LOADER_HPP
#define BOOT_LOADER_HPP
namespace SPU {
void setup();
}
#endif //!BOOT_LOADER_HPP

View File

@@ -0,0 +1,26 @@
#include <PSX/System/IOPorts/SPU_IO.hpp>
namespace SPU {
static void clear_voice(Voice& voice) {
io_class__volatile_assign(voice.volumeLeft, SweepVolume());
io_class__volatile_assign(voice.volumeRight, SweepVolume());
io_class__volatile_assign(voice.sampleRate, SampleRate::from_HZ(0.0));
io_class__volatile_assign(voice.adsr, ADSR());
io_class__volatile_assign(voice.currentVolume, SweepVolume());
voice.adr = 0x200;
voice.repeatAdr = 0x200;
}
void setup() {
static constexpr auto StartVol = SweepVolume().set_volume_mode().set_volume_percent(50.0);
io_class__volatile_assign(MainVolume::Left, StartVol);
io_class__volatile_assign(MainVolume::Right, StartVol);
for(auto& voice : Voice::Channel) {
clear_voice(voice);
}
}
}

View File

@@ -0,0 +1,11 @@
#include "BootLoader/boot_loader.hpp"
#include <stdio.h>
namespace JabyEngine {
void start() {
printf("Hello Planschbecken\n");
SPU::setup();
printf("Setup done!\n");
}
}

View File

@@ -1,36 +0,0 @@
#include <PSX/SPU/SPU_Ports.hpp>
#include <stdio.h>
namespace JabyEngine {
namespace SPU {
static void clear_voice(::SPU::Voice& voice) {
io_class__volatile_assign(voice.volumeLeft, ::SPU::SweepVolume());
io_class__volatile_assign(voice.volumeRight, ::SPU::SweepVolume());
io_class__volatile_assign(voice.sampleRate, ::SPU::SampleRate::from_HZ(0.0));
io_class__volatile_assign(voice.adsr, ::SPU::ADSR());
io_class__volatile_assign(voice.currentVolume, ::SPU::SweepVolume());
voice.adr = 0x200;
voice.repeatAdr = 0x200;
}
static void setup() {
static constexpr auto StartVol = ::SPU::SweepVolume().set_volume_mode().set_volume_percent(50.0);
io_class__volatile_assign(::SPU::MainVolume::Left, StartVol);
io_class__volatile_assign(::SPU::MainVolume::Right, StartVol);
for(auto& voice : ::SPU::Voice::Channel) {
clear_voice(voice);
}
}
}
void start() {
printf("Hello Planschbecken\n");
SPU::setup();
printf("Setup done!\n");
}
}