Introduce the JabyEngine namespace to all files

This commit is contained in:
2022-12-23 21:18:25 +01:00
parent 791fe85ab8
commit def6c6d3b9
27 changed files with 1320 additions and 1282 deletions

View File

@@ -2,53 +2,55 @@
#define __JABYENGINE_BITS_HPP__
#include "../jabyengine_defines.h"
namespace bit {
template<typename T>
static constexpr T set(T raw_value, size_t bit) {
return (raw_value | (1 << bit));
}
template<typename T>
static constexpr T clear(T raw_value, size_t bit) {
return (raw_value & ~(1 << bit));
}
template<typename T>
static constexpr bool is_set(T raw_value, size_t bit) {
return static_cast<bool>(raw_value & (1 << bit));
}
namespace value {
namespace JabyEngine {
namespace bit {
template<typename T>
static constexpr T crop_value(T raw_value, size_t length) {
return (raw_value & ((1 << length) - 1));
static constexpr T set(T raw_value, size_t bit) {
return (raw_value | (1 << bit));
}
template<typename T>
static constexpr T range_mask(size_t start_bit, size_t length) {
return (((1 << length) - 1) << start_bit);
static constexpr T clear(T raw_value, size_t bit) {
return (raw_value & ~(1 << bit));
}
template<typename T>
static constexpr T clear_normalized(T raw_value, size_t start_bit, size_t length) {
return (raw_value & ~range_mask<T>(start_bit, length));
static constexpr bool is_set(T raw_value, size_t bit) {
return static_cast<bool>(raw_value & (1 << bit));
}
template<typename T>
static constexpr T set_normalized(T raw_value, T value, size_t start_bit, size_t length) {
return (clear_normalized(raw_value, start_bit, length) | (value << start_bit));
namespace value {
template<typename T>
static constexpr T crop_value(T raw_value, size_t length) {
return (raw_value & ((1 << length) - 1));
}
template<typename T>
static constexpr T range_mask(size_t start_bit, size_t length) {
return (((1 << length) - 1) << start_bit);
}
template<typename T>
static constexpr T clear_normalized(T raw_value, size_t start_bit, size_t length) {
return (raw_value & ~range_mask<T>(start_bit, length));
}
template<typename T>
static constexpr T set_normalized(T raw_value, T value, size_t start_bit, size_t length) {
return (clear_normalized(raw_value, start_bit, length) | (value << start_bit));
}
template<typename T>
static constexpr T get_normalized(T raw_value, size_t start_bit, size_t length) {
return (raw_value & range_mask<T>(start_bit, length)) >> start_bit;
}
}
template<typename T>
static constexpr T get_normalized(T raw_value, size_t start_bit, size_t length) {
return (raw_value & range_mask<T>(start_bit, length)) >> start_bit;
template<typename S, typename T>
static constexpr S cast(T value) {
return *reinterpret_cast<S*>(&value);
}
}
template<typename S, typename T>
static constexpr S cast(T value) {
return *reinterpret_cast<S*>(&value);
}
}
#define __start_end_bit2_start_length(start_bit, end_bit) start_bit, (end_bit - start_bit + 1)

View File

@@ -2,194 +2,196 @@
#define __JABYENGINE_COMPLEX_BITMAP_HPP__
#include "bits.hpp"
struct ClearBitValue {
size_t bit;
namespace JabyEngine {
struct ClearBitValue {
size_t bit;
constexpr ClearBitValue(size_t bit) : bit(bit) {
}
};
constexpr ClearBitValue(size_t bit) : bit(bit) {
}
};
template<typename T>
struct Bit {
typedef T ValueType;
template<typename T>
struct Bit {
typedef T ValueType;
size_t value;
size_t value;
constexpr Bit(size_t value) : value(value) {
constexpr Bit(size_t value) : value(value) {
}
constexpr operator size_t() const {
return this->value;
}
constexpr ClearBitValue operator!() const {
return ClearBitValue(this->value);
}
};
template<typename T>
struct BitRangeValue {
T value;
size_t begin;
size_t length;
};
template<typename T>
struct BitRange {
typedef T ValueType;
size_t begin;
size_t length;
static constexpr BitRange<T> from_to(size_t start, size_t end) {
return {start, (end - start + 1)};
}
constexpr BitRangeValue<T> with(T value) const {
return {value, this->begin, this->length};
}
};
template<typename T>
static constexpr __always_inline BitRangeValue<T> operator<<(const BitRange<T>& range, T value) {
return BitRangeValue{value, range.begin, range.length};
}
constexpr operator size_t() const {
return this->value;
}
template<typename T>
class ComplexBitMap {
public:
T raw;
constexpr ClearBitValue operator!() const {
return ClearBitValue(this->value);
}
};
private:
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set_va(const S& value) {
return this->set(value);
}
template<typename T>
struct BitRangeValue {
T value;
size_t begin;
size_t length;
};
template<typename S, typename...ARGS>
constexpr __always_inline ComplexBitMap<T>& set_va(const S& value, const ARGS&...args) {
return this->set_va(value).set_va(args...);
}
template<typename T>
struct BitRange {
typedef T ValueType;
public:
template<typename...ARGS>
static constexpr __always_inline ComplexBitMap<T> with(ARGS...args) {
return ComplexBitMap().set_va(args...);
}
size_t begin;
size_t length;
//Accesssing bits
template<typename S>
constexpr ComplexBitMap<T>& set_bit(S bit) {
this->raw = bit::set(this->raw, static_cast<size_t>(bit));
return *this;
}
static constexpr BitRange<T> from_to(size_t start, size_t end) {
return {start, (end - start + 1)};
}
template<typename S>
constexpr void set_bit(S bit) volatile {
this->raw = bit::set(this->raw, static_cast<size_t>(bit));
}
constexpr BitRangeValue<T> with(T value) const {
return {value, this->begin, this->length};
}
};
template<typename S>
constexpr ComplexBitMap<T>& clear_bit(S bit) {
this->raw = bit::clear(this->raw, static_cast<size_t>(bit));
return *this;
}
template<typename T>
static constexpr __always_inline BitRangeValue<T> operator<<(const BitRange<T>& range, T value) {
return BitRangeValue{value, range.begin, range.length};
template<typename S>
constexpr void clear_bit(S bit) volatile {
this->raw = bit::clear(this->raw, static_cast<size_t>(bit));
}
template<typename S>
constexpr bool is_bit_set(S bit) {
return bit::is_set(this->raw, static_cast<size_t>(bit));
}
template<typename S>
constexpr bool is_bit_set(S bit) const volatile {
return bit::is_set(this->raw, static_cast<size_t>(bit));
}
//Accessing values
template<typename S>
constexpr ComplexBitMap<T>& set_value(S value, const BitRange<S>& range) {
this->raw = bit::value::set_normalized(this->raw, static_cast<T>(value), range.begin, range.length);
return *this;
}
template<typename S>
constexpr void set_value(S value, const BitRange<S>& range) volatile {
this->raw = bit::value::set_normalized(this->raw, static_cast<T>(value), range.begin, range.length);
}
template<typename S>
constexpr ComplexBitMap<T>& clear_value(const BitRange<S>& range) {
this->raw = bit::value::clear_normalized(this->raw, range.begin, range.length);
return *this;
}
template<typename S>
constexpr void clear_value(const BitRange<S>& range) volatile {
this->raw = bit::value::clear_normalized(this->raw, range.begin, range.length);
}
template<typename S>
constexpr S get_value(const BitRange<S>& range) const {
return static_cast<S>(bit::value::get_normalized(this->raw, range.begin, range.length));
}
template<typename S>
constexpr S get_value(const BitRange<S>& range) const volatile {
return static_cast<S>(bit::value::get_normalized(this->raw, range.begin, range.length));
}
//For easier checking
constexpr bool is(Bit<T> bit) const {
return ComplexBitMap::is_bit_set(bit);
}
constexpr bool is(Bit<T> bit) const volatile {
return ComplexBitMap::is_bit_set(bit);
}
// For easier constructing
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set(const BitRange<S>& range, T value) {
this->set_value(value, range);
return *this;
}
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set(const BitRangeValue<S>& value) {
this->set_value(value.value, {value.begin, value.length});
return *this;
}
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set(const Bit<S>& bit) {
this->set_bit(bit.value);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& set(const ClearBitValue& value) {
this->clear_bit(value.bit);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& operator|(const BitRangeValue<T>& value) {
this->set_value(value.value, value.range);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& operator|(const Bit<T>& bit) {
this->set_bit(bit.value);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& operator|(const ClearBitValue& value) {
this->clear_bit(value.bit);
return *this;
}
};
}
template<typename T>
class ComplexBitMap {
public:
T raw;
private:
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set_va(const S& value) {
return this->set(value);
}
template<typename S, typename...ARGS>
constexpr __always_inline ComplexBitMap<T>& set_va(const S& value, const ARGS&...args) {
return this->set_va(value).set_va(args...);
}
public:
template<typename...ARGS>
static constexpr __always_inline ComplexBitMap<T> with(ARGS...args) {
return ComplexBitMap().set_va(args...);
}
//Accesssing bits
template<typename S>
constexpr ComplexBitMap<T>& set_bit(S bit) {
this->raw = bit::set(this->raw, static_cast<size_t>(bit));
return *this;
}
template<typename S>
constexpr void set_bit(S bit) volatile {
this->raw = bit::set(this->raw, static_cast<size_t>(bit));
}
template<typename S>
constexpr ComplexBitMap<T>& clear_bit(S bit) {
this->raw = bit::clear(this->raw, static_cast<size_t>(bit));
return *this;
}
template<typename S>
constexpr void clear_bit(S bit) volatile {
this->raw = bit::clear(this->raw, static_cast<size_t>(bit));
}
template<typename S>
constexpr bool is_bit_set(S bit) {
return bit::is_set(this->raw, static_cast<size_t>(bit));
}
template<typename S>
constexpr bool is_bit_set(S bit) const volatile {
return bit::is_set(this->raw, static_cast<size_t>(bit));
}
//Accessing values
template<typename S>
constexpr ComplexBitMap<T>& set_value(S value, const BitRange<S>& range) {
this->raw = bit::value::set_normalized(this->raw, static_cast<T>(value), range.begin, range.length);
return *this;
}
template<typename S>
constexpr void set_value(S value, const BitRange<S>& range) volatile {
this->raw = bit::value::set_normalized(this->raw, static_cast<T>(value), range.begin, range.length);
}
template<typename S>
constexpr ComplexBitMap<T>& clear_value(const BitRange<S>& range) {
this->raw = bit::value::clear_normalized(this->raw, range.begin, range.length);
return *this;
}
template<typename S>
constexpr void clear_value(const BitRange<S>& range) volatile {
this->raw = bit::value::clear_normalized(this->raw, range.begin, range.length);
}
template<typename S>
constexpr S get_value(const BitRange<S>& range) const {
return static_cast<S>(bit::value::get_normalized(this->raw, range.begin, range.length));
}
template<typename S>
constexpr S get_value(const BitRange<S>& range) const volatile {
return static_cast<S>(bit::value::get_normalized(this->raw, range.begin, range.length));
}
//For easier checking
constexpr bool is(Bit<T> bit) const {
return ComplexBitMap::is_bit_set(bit);
}
constexpr bool is(Bit<T> bit) const volatile {
return ComplexBitMap::is_bit_set(bit);
}
// For easier constructing
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set(const BitRange<S>& range, T value) {
this->set_value(value, range);
return *this;
}
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set(const BitRangeValue<S>& value) {
this->set_value(value.value, {value.begin, value.length});
return *this;
}
template<typename S>
constexpr __always_inline ComplexBitMap<T>& set(const Bit<S>& bit) {
this->set_bit(bit.value);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& set(const ClearBitValue& value) {
this->clear_bit(value.bit);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& operator|(const BitRangeValue<T>& value) {
this->set_value(value.value, value.range);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& operator|(const Bit<T>& bit) {
this->set_bit(bit.value);
return *this;
}
constexpr __always_inline ComplexBitMap<T>& operator|(const ClearBitValue& value) {
this->clear_bit(value.bit);
return *this;
}
};
#endif //!__JABYENGINE_COMPLEX_BITMAP_HPP__

View File

@@ -3,30 +3,32 @@
#include "../cd_file_types.hpp"
#include "file_processor.hpp"
namespace CDFileProcessor {
class State {
private:
FileProcessor::State file_processor_state;
const uint32_t* data_adr;
namespace JabyEngine {
namespace CDFileProcessor {
class State {
private:
FileProcessor::State file_processor_state;
const uint32_t* data_adr;
public:
State() = default;
public:
State() = default;
void setup(uint16_t lba, uint16_t size, const CDFile::Payload& payload);
bool process();
};
void setup(uint16_t lba, uint16_t size, const CDFile::Payload& payload);
bool process();
};
template<size_t Size>
static void load_from_cd(const OverlayLBA* overlay_lbas, const CDFile (&cd_files)[Size]) {
State state;
template<size_t Size>
static void load_from_cd(const OverlayLBA* overlay_lbas, const CDFile (&cd_files)[Size]) {
State state;
for(const auto& file : cd_files) {
const auto& lba_info = overlay_lbas[file.rel_lba_idx];
for(const auto& file : cd_files) {
const auto& lba_info = overlay_lbas[file.rel_lba_idx];
state.setup(lba_info.lba, lba_info.size, file.payload);
//while(state.process());???
}
}
state.setup(lba_info.lba, lba_info.size, file.payload);
//while(state.process());???
}
}
}
}
// This will be used as the file processor but will work on cd types

View File

@@ -2,50 +2,51 @@
#define __JABYENGINE_FILE_PROCESSOR_HPP__
#include "../file_types.hpp"
namespace FileProcessor {
class State {
private:
struct Reserved {
uint32_t reserved[4];
};
namespace JabyEngine {
namespace FileProcessor {
class State {
private:
struct Reserved {
uint32_t reserved[4];
};
struct Configuration;
typedef bool (*ProcessRoutine)(Configuration&, Reserved&);
struct Configuration;
typedef bool (*ProcessRoutine)(Configuration&, Reserved&);
struct Configuration {
ProcessRoutine process_routine = nullptr;
const uint32_t* data_adr = nullptr;
size_t data_word_size = 0ull;
struct Configuration {
ProcessRoutine process_routine = nullptr;
const uint32_t* data_adr = nullptr;
size_t data_word_size = 0ull;
template<typename T>
static __always_inline Configuration from(bool (*process_routine)(Configuration&, T&), const uint32_t* data_adr) {
return {reinterpret_cast<ProcessRoutine>(process_routine), data_adr};
}
constexpr void processed(size_t words) {
this->data_adr += words;
this->data_word_size -= words;
}
};
private:
Configuration config;
Reserved reserved;
template<typename T>
static __always_inline Configuration from(bool (*process_routine)(Configuration&, T&), const uint32_t* data_adr) {
return {reinterpret_cast<ProcessRoutine>(process_routine), data_adr};
static __always_inline State from(const T& reserved, const uint32_t* data_adr, bool (*process_routine)(Configuration&, T&)) {
return {Configuration::from(process_routine, data_adr), *reinterpret_cast<const Reserved*>(&reserved)};
static_assert(sizeof(T) <= sizeof(Reserved));
}
constexpr void processed(size_t words) {
this->data_adr += words;
this->data_word_size -= words;
public:
bool process(size_t word_size) {
this->config.data_word_size += word_size;
return (*this->config.process_routine)(this->config, this->reserved);
}
};
private:
Configuration config;
Reserved reserved;
template<typename T>
static __always_inline State from(const T& reserved, const uint32_t* data_adr, bool (*process_routine)(Configuration&, T&)) {
return {Configuration::from(process_routine, data_adr), *reinterpret_cast<const Reserved*>(&reserved)};
static_assert(sizeof(T) <= sizeof(Reserved));
}
public:
bool process(size_t word_size) {
this->config.data_word_size += word_size;
return (*this->config.process_routine)(this->config, this->reserved);
}
};
State create(const uint32_t* data_adr, const SimpleTIM& file);
State create(const uint32_t* data_adr, const SimpleTIM& file);
}
}
#endif // !__JABYENGINE_FILE_PROCESSOR_HPP__

View File

@@ -3,25 +3,27 @@
#include "../Overlay/overlay.hpp"
#include "file_types.hpp"
enum struct CDFileType : uint8_t {
SimpleTIM = 0,
Custom
};
struct __no_align CDFile {
union __no_align Payload {
uint32_t empty;
SimpleTIM simple_tim;
namespace JabyEngine {
enum struct CDFileType : uint8_t {
SimpleTIM = 0,
Custom
};
uint8_t rel_lba_idx;
CDFileType type;
Payload payload;
};
struct __no_align CDFile {
union __no_align Payload {
uint32_t empty;
SimpleTIM simple_tim;
};
namespace CDFileBuilder {
static constexpr CDFile simple_tim(uint8_t rel_lba_idx, SimpleTIM simple_tim) {
return CDFile{.rel_lba_idx = rel_lba_idx, .type = CDFileType::SimpleTIM, .payload = {.simple_tim = simple_tim}};
uint8_t rel_lba_idx;
CDFileType type;
Payload payload;
};
namespace CDFileBuilder {
static constexpr CDFile simple_tim(uint8_t rel_lba_idx, SimpleTIM simple_tim) {
return CDFile{.rel_lba_idx = rel_lba_idx, .type = CDFileType::SimpleTIM, .payload = {.simple_tim = simple_tim}};
}
}
}
#endif //!__JABYENGINE_CD_FILE_TYPES_HPP__

View File

@@ -3,35 +3,35 @@
#include "../Auxiliary/complex_bitmap.hpp"
#include "../jabyengine_defines.h"
struct __no_align SimpleTIM : private ComplexBitMap<uint32_t> {
static constexpr auto TextureX = BitRange<uint32_t>(0, 8);
static constexpr auto TextureY = BitRange<uint32_t>(9, 16);
static constexpr auto ClutX = BitRange<uint32_t>(17, 22);
static constexpr auto ClutY = BitRange<uint32_t>(23, 31);
namespace JabyEngine {
struct __no_align SimpleTIM : private ComplexBitMap<uint32_t> {
static constexpr auto TextureX = BitRange<uint32_t>(0, 8);
static constexpr auto TextureY = BitRange<uint32_t>(9, 16);
static constexpr auto ClutX = BitRange<uint32_t>(17, 22);
static constexpr auto ClutY = BitRange<uint32_t>(23, 31);
constexpr SimpleTIM() {
this->raw = 0;
}
constexpr SimpleTIM() {
this->raw = 0;
}
constexpr SimpleTIM(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) : ComplexBitMap(ComplexBitMap::with(TextureX.with(texX >> 1), TextureY.with(texY >> 1), ClutX.with(clutX >> 4), ClutY.with(clutY))) {
}
constexpr SimpleTIM(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) : ComplexBitMap(ComplexBitMap::with(TextureX.with(texX >> 1), TextureY.with(texY >> 1), ClutX.with(clutX >> 4), ClutY.with(clutY))) {
}
constexpr uint16_t getTextureX() const {
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureX) << 1);
}
constexpr uint16_t getTextureX() const {
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureX) << 1);
}
constexpr uint16_t getTextureY() const {
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureY) << 1);
}
constexpr uint16_t getClutX() const {
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutX) << 4);
}
constexpr uint16_t getClutY() const {
return ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutY);
}
};
constexpr uint16_t getTextureY() const {
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureY) << 1);
}
constexpr uint16_t getClutX() const {
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutX) << 4);
}
constexpr uint16_t getClutY() const {
return ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutY);
}
};
}
#endif // !__JABYENGINE_FILE_TYPES_HPP__

View File

@@ -10,32 +10,33 @@
#endif
#endif
namespace GPU {
namespace Display {
#ifdef JABYENGINE_PAL
static constexpr size_t Width = 320;
static constexpr size_t Height = 256;
#else
static constexpr size_t Width = 320;
static constexpr size_t Height = 240;
#endif
namespace JabyEngine {
namespace GPU {
namespace Display {
#ifdef JABYENGINE_PAL
static constexpr size_t Width = 320;
static constexpr size_t Height = 256;
#else
static constexpr size_t Width = 320;
static constexpr size_t Height = 240;
#endif
static void enable() {
GP1.write(Command::GP1::SetDisplayState(DisplayState::On));
static void enable() {
GP1.write(Command::GP1::SetDisplayState(DisplayState::On));
}
static void disable() {
GP1.write(Command::GP1::SetDisplayState(DisplayState::Off));
}
}
static void disable() {
GP1.write(Command::GP1::SetDisplayState(DisplayState::Off));
}
}
namespace Screen {
extern uint8_t CurrentDisplayAreaID;
namespace Screen {
extern uint8_t CurrentDisplayAreaID;
namespace Range {
void set_offset(uint16_t x, uint16_t y);
namespace Range {
void set_offset(uint16_t x, uint16_t y);
}
}
}
}
#endif //!__JABYENGINE_GPU_HPP__

View File

@@ -3,100 +3,101 @@
#include "../jabyengine_defines.h"
#include "../Auxiliary/complex_bitmap.hpp"
namespace GPU {
struct Color24 {
uint8_t red = 0;
uint8_t green = 0;
uint8_t blue = 0;
namespace JabyEngine {
namespace GPU {
struct Color24 {
uint8_t red = 0;
uint8_t green = 0;
uint8_t blue = 0;
constexpr Color24() = default;
constexpr Color24(uint8_t r, uint8_t g, uint8_t b) : blue(b), green(g), red(r) {
}
constexpr Color24() = default;
constexpr Color24(uint8_t r, uint8_t g, uint8_t b) : blue(b), green(g), red(r) {
}
constexpr uint32_t raw() const {
return ((this->blue << 16) | (this->green << 8) | this->red);
}
constexpr uint32_t raw() const {
return ((this->blue << 16) | (this->green << 8) | this->red);
}
static constexpr Color24 Black() {
return Color24(0, 0, 0);
}
static constexpr Color24 Black() {
return Color24(0, 0, 0);
}
static constexpr Color24 White() {
return Color24(0xFF, 0xFF, 0xFF);
}
static constexpr Color24 White() {
return Color24(0xFF, 0xFF, 0xFF);
}
static constexpr Color24 Red() {
return Color24(0xFF, 0x0, 0x0);
}
static constexpr Color24 Red() {
return Color24(0xFF, 0x0, 0x0);
}
static constexpr Color24 Green() {
return Color24(0x0, 0xFF, 0x0);
}
static constexpr Color24 Green() {
return Color24(0x0, 0xFF, 0x0);
}
static constexpr Color24 Blue() {
return Color24(0x0, 0x0, 0xFF);
}
};
static constexpr Color24 Blue() {
return Color24(0x0, 0x0, 0xFF);
}
};
class Color {
private:
static constexpr auto RedRange = BitRange<uint16_t>::from_to(0, 4);
static constexpr auto GreenRange = BitRange<uint16_t>::from_to(5, 9);
static constexpr auto BlueRange = BitRange<uint16_t>::from_to(10, 14);
static constexpr auto SemiTransperancyBit = Bit<uint16_t>(15);
class Color {
private:
static constexpr auto RedRange = BitRange<uint16_t>::from_to(0, 4);
static constexpr auto GreenRange = BitRange<uint16_t>::from_to(5, 9);
static constexpr auto BlueRange = BitRange<uint16_t>::from_to(10, 14);
static constexpr auto SemiTransperancyBit = Bit<uint16_t>(15);
ComplexBitMap<uint16_t> value = {0};
ComplexBitMap<uint16_t> value = {0};
public:
static constexpr Color from_rgb(uint8_t r, uint8_t g, uint8_t b) {
return Color().set_red(r).set_green(g).set_blue(b);
}
public:
static constexpr Color from_rgb(uint8_t r, uint8_t g, uint8_t b) {
return Color().set_red(r).set_green(g).set_blue(b);
}
static constexpr Color from(const Color24& color) {
return Color::from_rgb(color.red, color.green, color.blue);
}
static constexpr Color from(const Color24& color) {
return Color::from_rgb(color.red, color.green, color.blue);
}
constexpr Color& set_red(uint8_t red) {
this->value.set_value(static_cast<uint16_t>(red), RedRange);
return *this;
}
constexpr Color& set_red(uint8_t red) {
this->value.set_value(static_cast<uint16_t>(red), RedRange);
return *this;
}
constexpr Color& set_green(uint8_t green) {
this->value.set_value(static_cast<uint16_t>(green), GreenRange);
return *this;
}
constexpr Color& set_green(uint8_t green) {
this->value.set_value(static_cast<uint16_t>(green), GreenRange);
return *this;
}
constexpr Color& set_blue(uint8_t blue) {
this->value.set_value(static_cast<uint16_t>(blue), BlueRange);
return *this;
}
};
constexpr Color& set_blue(uint8_t blue) {
this->value.set_value(static_cast<uint16_t>(blue), BlueRange);
return *this;
}
};
template<typename T>
struct Position {
T x = 0;
T y = 0;
template<typename T>
struct Position {
T x = 0;
T y = 0;
constexpr Position() = default;
constexpr Position(T x, T y) : x(x), y(y) {
}
};
constexpr Position() = default;
constexpr Position(T x, T y) : x(x), y(y) {
}
};
template<typename T>
struct Size {
T width = 0;
T height = 0;
template<typename T>
struct Size {
T width = 0;
T height = 0;
constexpr Size() = default;
constexpr Size(T w, T h) : width(w), height(h) {
}
};
constexpr Size() = default;
constexpr Size(T w, T h) : width(w), height(h) {
}
};
typedef Position<int16_t> PositionI16;
typedef Position<uint16_t> PositionU16;
typedef Position<int16_t> PositionI16;
typedef Position<uint16_t> PositionU16;
typedef Size<int16_t> SizeI16;
typedef Size<uint16_t> SizeU16;
typedef Size<int16_t> SizeI16;
typedef Size<uint16_t> SizeU16;
}
}
#endif //!__JABYENGINE_GPU_TYPES_HPP__

View File

@@ -2,14 +2,16 @@
#define __JABYENGINE_OVERLAY__HPP__
#include "../../stdint.h"
struct __attribute__((packed)) OverlayHeader {
void (*execute)();
uint16_t lba_size;
};
namespace JabyEngine {
struct __attribute__((packed)) OverlayHeader {
void (*execute)();
uint16_t lba_size;
};
// Maybe encode attributes like "isLZ4" into size parameter
struct __attribute__((packed)) OverlayLBA {
uint16_t lba;
uint16_t size;
};
// Maybe encode attributes like "isLZ4" into size parameter
struct __attribute__((packed)) OverlayLBA {
uint16_t lba;
uint16_t size;
};
}
#endif //!__JABYENGINE_OVERLAY__HPP__

View File

@@ -3,12 +3,12 @@
// No include here because this header should be included in a namespace and we don't want multiple namespace definitions of OverlayHeader and OverlayLBA
extern const OverlayHeader overlay_header;
extern const OverlayLBA overlay_lba[];
extern const JabyEngine::OverlayHeader overlay_header;
extern const JabyEngine::OverlayLBA overlay_lba[];
#define __declare_overlay_header(function, enum_struct) \
[[gnu::used]] \
const OverlayHeader __section(".header") overlay_header = {.execute = &function, .lba_size = static_cast<uint16_t>(enum_struct::EndOfRequest)}; \
const JabyEngine::OverlayHeader __section(".header") overlay_header = {.execute = &function, .lba_size = static_cast<uint16_t>(enum_struct::EndOfRequest)}; \
[[gnu::used]] \
const OverlayLBA __section(".header.lbas") overlay_lba[static_cast<int>(enum_struct::EndOfRequest)] = {0}
const JabyEngine::OverlayLBA __section(".header.lbas") overlay_lba[static_cast<int>(enum_struct::EndOfRequest)] = {0}
#endif //!__JABYENGINE_OVERLAY_DECLARATION__HPP__

View File

@@ -2,143 +2,144 @@
#define __JABYENGINE_DMA_IO_HPP__
#include "ioport.hpp"
namespace DMA {
struct __no_align MADR : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(MADR);
namespace JabyEngine {
namespace DMA {
struct __no_align MADR : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(MADR);
static constexpr auto MemoryAdr = BitRange<uint32_t>::from_to(0, 23);
};
struct __no_align BCR : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(BCR);
struct __no_align SyncMode0 {
static constexpr auto NumberOfWords = BitRange<uint16_t>::from_to(0, 15);
static constexpr auto CD_OneBlock = Bit<uint16_t>(16);
static constexpr auto MemoryAdr = BitRange<uint32_t>::from_to(0, 23);
};
struct __no_align SyncMode1 : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(SyncMode1);
struct __no_align BCR : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(BCR);
static constexpr auto BlockSize = BitRange<uint32_t>::from_to(0, 15);
static constexpr auto BlockAmount = BitRange<uint32_t>::from_to(16, 31);
struct __no_align SyncMode0 {
static constexpr auto NumberOfWords = BitRange<uint16_t>::from_to(0, 15);
static constexpr auto CD_OneBlock = Bit<uint16_t>(16);
};
struct __no_align SyncMode1 : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(SyncMode1);
static constexpr auto BlockSize = BitRange<uint32_t>::from_to(0, 15);
static constexpr auto BlockAmount = BitRange<uint32_t>::from_to(16, 31);
};
struct __no_align SyncMode2 {
};
};
struct __no_align SyncMode2 {
};
};
struct __no_align CHCHR : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(CHCHR);
struct __no_align CHCHR : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(CHCHR);
enum _SyncMode {
Sync0 = 0, //Start immediately,
Sync1 = 1, //Sync blocks to DMA requests
Sync2 = 2, //Linked List
};
enum _SyncMode {
Sync0 = 0, //Start immediately,
Sync1 = 1, //Sync blocks to DMA requests
Sync2 = 2, //Linked List
static constexpr auto ManualStart = Bit<uint32_t>(28);
static constexpr auto Start = Bit<uint32_t>(24);
static constexpr auto Busy = Start;
static constexpr auto ChoppingCPUWindowSize = BitRange<uint32_t>::from_to(20, 22);
static constexpr auto ChoppingDMAWindowSize = BitRange<uint32_t>::from_to(16, 18);
static constexpr auto SyncMode = BitRange<_SyncMode>::from_to(9, 10);
static constexpr auto UseSyncMode0 = SyncMode.with(Sync0);
static constexpr auto UseSyncMode1 = SyncMode.with(Sync1);
static constexpr auto UseSyncMode2 = SyncMode.with(Sync2);
static constexpr auto UseChopping = Bit<uint32_t>(8);
static constexpr auto MemoryAdrDecreaseBy4 = Bit<uint32_t>(1);
static constexpr auto MemoryAdrIncreaseBy4 = !MemoryAdrDecreaseBy4;
static constexpr auto FromMainRAM = Bit<uint32_t>(0);
static constexpr auto ToMainRAM = !FromMainRAM;
static constexpr CHCHR StartMDECin() {
return ComplexBitMap{0x01000201};
}
static constexpr CHCHR StartMDECout() {
return ComplexBitMap{0x01000200};
}
static constexpr CHCHR StartGPUReceive() {
return ComplexBitMap{0x01000201};
}
static constexpr CHCHR StartCDROM() {
return ComplexBitMap{0x11000000};
}
static constexpr CHCHR StartSPUReceive() {
return ComplexBitMap{0x01000201};
}
static constexpr CHCHR StartOTC() {
return ComplexBitMap{0x11000002};
}
};
static constexpr auto ManualStart = Bit<uint32_t>(28);
struct __no_align Registers {
IOPort<MADR> adr;
IOPort<BCR> block_ctrl;
IOPort<CHCHR> channel_ctrl;
};
static constexpr auto Start = Bit<uint32_t>(24);
static constexpr auto Busy = Start;
//0: Highest, 7: Lowest
typedef uint32_t Priority;
static constexpr Priority HighestPriority = 0;
static constexpr Priority LowestPriority = 7;
static constexpr auto ChoppingCPUWindowSize = BitRange<uint32_t>::from_to(20, 22);
static constexpr auto ChoppingDMAWindowSize = BitRange<uint32_t>::from_to(16, 18);
struct __no_align DMAControlRegister : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(DMAControlRegister);
static constexpr auto SyncMode = BitRange<_SyncMode>::from_to(9, 10);
static constexpr auto UseSyncMode0 = SyncMode.with(Sync0);
static constexpr auto UseSyncMode1 = SyncMode.with(Sync1);
static constexpr auto UseSyncMode2 = SyncMode.with(Sync2);
static constexpr auto OTCEnable = Bit<uint32_t>(27);
static constexpr auto OTCPriority = BitRange<Priority>::from_to(24, 26);
static constexpr auto UseChopping = Bit<uint32_t>(8);
static constexpr auto PIOEnable = Bit<uint32_t>(23);
static constexpr auto PIOPriority = BitRange<Priority>::from_to(20, 22);
static constexpr auto MemoryAdrDecreaseBy4 = Bit<uint32_t>(1);
static constexpr auto MemoryAdrIncreaseBy4 = !MemoryAdrDecreaseBy4;
static constexpr auto SPUEnable = Bit<uint32_t>(19);
static constexpr auto SPUPriority = BitRange<Priority>::from_to(16, 18);
static constexpr auto FromMainRAM = Bit<uint32_t>(0);
static constexpr auto ToMainRAM = !FromMainRAM;
static constexpr auto CDROMEnable = Bit<uint32_t>(15);
static constexpr auto CDROMPriority = BitRange<Priority>::from_to(12, 14);
static constexpr CHCHR StartMDECin() {
return ComplexBitMap{0x01000201};
}
static constexpr auto GPUEnable = Bit<uint32_t>(11);
static constexpr auto GPUPriority = BitRange<Priority>::from_to(8, 10);
static constexpr CHCHR StartMDECout() {
return ComplexBitMap{0x01000200};
}
static constexpr auto MDECoutEnable = Bit<uint32_t>(7);
static constexpr auto MDECoutPriority = BitRange<Priority>::from_to(4, 6);
static constexpr CHCHR StartGPUReceive() {
return ComplexBitMap{0x01000201};
}
static constexpr auto MDECinEnable = Bit<uint32_t>(3);
static constexpr auto MDECinPriority = BitRange<Priority>::from_to(0, 2);
};
static constexpr CHCHR StartCDROM() {
return ComplexBitMap{0x11000000};
}
struct __no_align DMAInterruptRegister : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(DMAInterruptRegister);
static constexpr CHCHR StartSPUReceive() {
return ComplexBitMap{0x01000201};
}
static constexpr auto MasterEnable = Bit<uint32_t>(31);
static constexpr auto Flags = BitRange<uint32_t>::from_to(24, 30);
static constexpr auto MasterEnableDPCR = Bit<uint32_t>(23);
static constexpr auto EnableDPCR = BitRange<uint32_t>::from_to(16, 22);
static constexpr auto ForceIRQ = Bit<uint32_t>(15);
};
static constexpr CHCHR StartOTC() {
return ComplexBitMap{0x11000002};
}
};
__declare_io_port_global(Registers, MDECin, 0x1F801080);
__declare_io_port_global(Registers, MDECout, 0x1F801090);
__declare_io_port_global_struct(Registers, GPU, 0x1F8010A0);
__declare_io_port_global(Registers, CDROM, 0x1F8010B0);
__declare_io_port_global(Registers, SPU, 0x1F8010C0);
__declare_io_port_global(Registers, PIO, 0x1F8010D0);
__declare_io_port_global(Registers, OTC, 0x1F8010E0);
struct __no_align Registers {
IOPort<MADR> adr;
IOPort<BCR> block_ctrl;
IOPort<CHCHR> channel_ctrl;
};
//0: Highest, 7: Lowest
typedef uint32_t Priority;
static constexpr Priority HighestPriority = 0;
static constexpr Priority LowestPriority = 7;
struct __no_align DMAControlRegister : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(DMAControlRegister);
static constexpr auto OTCEnable = Bit<uint32_t>(27);
static constexpr auto OTCPriority = BitRange<Priority>::from_to(24, 26);
static constexpr auto PIOEnable = Bit<uint32_t>(23);
static constexpr auto PIOPriority = BitRange<Priority>::from_to(20, 22);
static constexpr auto SPUEnable = Bit<uint32_t>(19);
static constexpr auto SPUPriority = BitRange<Priority>::from_to(16, 18);
static constexpr auto CDROMEnable = Bit<uint32_t>(15);
static constexpr auto CDROMPriority = BitRange<Priority>::from_to(12, 14);
static constexpr auto GPUEnable = Bit<uint32_t>(11);
static constexpr auto GPUPriority = BitRange<Priority>::from_to(8, 10);
static constexpr auto MDECoutEnable = Bit<uint32_t>(7);
static constexpr auto MDECoutPriority = BitRange<Priority>::from_to(4, 6);
static constexpr auto MDECinEnable = Bit<uint32_t>(3);
static constexpr auto MDECinPriority = BitRange<Priority>::from_to(0, 2);
};
struct __no_align DMAInterruptRegister : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(DMAInterruptRegister);
static constexpr auto MasterEnable = Bit<uint32_t>(31);
static constexpr auto Flags = BitRange<uint32_t>::from_to(24, 30);
static constexpr auto MasterEnableDPCR = Bit<uint32_t>(23);
static constexpr auto EnableDPCR = BitRange<uint32_t>::from_to(16, 22);
static constexpr auto ForceIRQ = Bit<uint32_t>(15);
};
__declare_io_port_global(Registers, MDECin, 0x1F801080);
__declare_io_port_global(Registers, MDECout, 0x1F801090);
__declare_io_port_global_struct(Registers, GPU, 0x1F8010A0);
__declare_io_port_global(Registers, CDROM, 0x1F8010B0);
__declare_io_port_global(Registers, SPU, 0x1F8010C0);
__declare_io_port_global(Registers, PIO, 0x1F8010D0);
__declare_io_port_global(Registers, OTC, 0x1F8010E0);
__declare_io_port_global(DMAControlRegister, DPCR, 0x1F8010F0);
__declare_io_port_global(DMAInterruptRegister, DICR, 0x1F8010F4);
__declare_io_port_global(DMAControlRegister, DPCR, 0x1F8010F0);
__declare_io_port_global(DMAInterruptRegister, DICR, 0x1F8010F4);
}
}
#endif //!__JABYENGINE_DMA_IO_HPP__

View File

@@ -3,170 +3,171 @@
#include "ioport.hpp"
#include "../../GPU/gpu_types.hpp"
namespace GPU {
enum struct SemiTransparency {
B_Half_add_F_Half = 0,
B_add_F = 1,
B_sub_F = 2,
B_add_F_Quarter = 3,
};
enum struct DisplayAreaColorDepth {
$15bit = 0,
$24bit = 1,
};
enum struct TexturePageColor {
$4bit = 0,
$8bit = 1,
$15bit = 2,
};
enum struct HorizontalResolution {
$256 = 0,
$320 = 1,
$512 = 2,
$640 = 3,
};
enum struct VerticalResolution {
$240 = 0,
$480 = 1
};
enum struct DMADirection {
Off = 0,
Fifo = 1,
CPU2GPU = 2,
GPU2CPU = 3,
};
enum struct DisplayState {
On = 0,
Off = 1
};
namespace Command {
struct __no_align GP0 : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(GP0);
static constexpr GP0 QuickFill(Color24 color) {
return ComplexBitMap{(0x02 << 24) | color.raw()};
}
static constexpr GP0 CPU2VRAM_Blitting() {
return ComplexBitMap{(0b101u << 29)};
}
static constexpr GP0 DrawAreaTemplate(uint8_t code, uint16_t x, uint16_t y) {
constexpr auto Command = BitRange<uint32_t>::from_to(24, 31);
constexpr auto Y = BitRange<uint32_t>::from_to(10, 18);
constexpr auto X = BitRange<uint32_t>::from_to(0, 9);
return ComplexBitMap<uint32_t>::with(Command.with(code), Y.with(y), X.with(x));
}
static constexpr GP0 DrawAreaTopLeft(uint16_t x, uint16_t y) {
return DrawAreaTemplate(0xE3, x, y);
}
static constexpr GP0 DrawAreaBottomRight(uint16_t x, uint16_t y) {
return DrawAreaTemplate(0xE4, x, y);
}
static constexpr GP0 TopLeftPosition(uint16_t x, uint16_t y) {
return ComplexBitMap{static_cast<uint32_t>((y << 16u) | x)};
}
static constexpr GP0 WidthHeight(uint16_t w, uint16_t h) {
return ComplexBitMap{static_cast<uint32_t>((h << 16u) | w)};
}
namespace JabyEngine {
namespace GPU {
enum struct SemiTransparency {
B_Half_add_F_Half = 0,
B_add_F = 1,
B_sub_F = 2,
B_add_F_Quarter = 3,
};
struct __no_align GP1 : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(GP1);
static constexpr uint32_t construct_cmd(uint8_t cmd, uint32_t value) {
return ((cmd << 24) | value);
}
static constexpr GP1 Reset() {
return ComplexBitMap{0};
}
static constexpr GP1 ResetCMDBufer() {
return ComplexBitMap{construct_cmd(0x01, 0)};
}
static constexpr GP1 SetDisplayState(DisplayState state) {
return ComplexBitMap{construct_cmd(0x03, static_cast<uint32_t>(state))};
}
static constexpr GP1 DMADirection(DMADirection dir) {
return ComplexBitMap{construct_cmd(0x04, static_cast<uint32_t>(dir))};
}
static constexpr GP1 DisplayArea(uint16_t x, uint16_t y) {
constexpr auto X = BitRange<uint32_t>::from_to(0, 9);
constexpr auto Y = BitRange<uint32_t>::from_to(10, 18);
return ComplexBitMap{construct_cmd(0x05, ComplexBitMap<uint32_t>::with(X.with(x), Y.with(y)).raw)};
}
static constexpr GP1 HorizontalDisplayRange(uint32_t x1, uint32_t x2) {
constexpr auto X1 = BitRange<uint32_t>::from_to(0, 11);
constexpr auto X2 = BitRange<uint32_t>::from_to(12, 23);
return ComplexBitMap{construct_cmd(0x06, ComplexBitMap<uint32_t>::with(X1.with(x1), X2.with(x2)).raw)};
}
static constexpr GP1 VerticalDisplayRange(uint32_t y1, uint32_t y2) {
constexpr auto Y1 = BitRange<uint32_t>::from_to(0, 9);
constexpr auto Y2 = BitRange<uint32_t>::from_to(10, 19);
return ComplexBitMap{construct_cmd(0x07, ComplexBitMap<uint32_t>::with(Y1.with(y1), Y2.with(y2)).raw)};
}
static constexpr GP1 DisplayMode(uint32_t mode) {
return ComplexBitMap{construct_cmd(0x08, mode)};
}
enum struct DisplayAreaColorDepth {
$15bit = 0,
$24bit = 1,
};
enum struct TexturePageColor {
$4bit = 0,
$8bit = 1,
$15bit = 2,
};
enum struct HorizontalResolution {
$256 = 0,
$320 = 1,
$512 = 2,
$640 = 3,
};
enum struct VerticalResolution {
$240 = 0,
$480 = 1
};
enum struct DMADirection {
Off = 0,
Fifo = 1,
CPU2GPU = 2,
GPU2CPU = 3,
};
enum struct DisplayState {
On = 0,
Off = 1
};
namespace Command {
struct __no_align GP0 : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(GP0);
static constexpr GP0 QuickFill(Color24 color) {
return ComplexBitMap{(0x02 << 24) | color.raw()};
}
static constexpr GP0 CPU2VRAM_Blitting() {
return ComplexBitMap{(0b101u << 29)};
}
static constexpr GP0 DrawAreaTemplate(uint8_t code, uint16_t x, uint16_t y) {
constexpr auto Command = BitRange<uint32_t>::from_to(24, 31);
constexpr auto Y = BitRange<uint32_t>::from_to(10, 18);
constexpr auto X = BitRange<uint32_t>::from_to(0, 9);
return ComplexBitMap<uint32_t>::with(Command.with(code), Y.with(y), X.with(x));
}
static constexpr GP0 DrawAreaTopLeft(uint16_t x, uint16_t y) {
return DrawAreaTemplate(0xE3, x, y);
}
static constexpr GP0 DrawAreaBottomRight(uint16_t x, uint16_t y) {
return DrawAreaTemplate(0xE4, x, y);
}
static constexpr GP0 TopLeftPosition(uint16_t x, uint16_t y) {
return ComplexBitMap{static_cast<uint32_t>((y << 16u) | x)};
}
static constexpr GP0 WidthHeight(uint16_t w, uint16_t h) {
return ComplexBitMap{static_cast<uint32_t>((h << 16u) | w)};
}
};
struct __no_align GP1 : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(GP1);
static constexpr uint32_t construct_cmd(uint8_t cmd, uint32_t value) {
return ((cmd << 24) | value);
}
static constexpr GP1 Reset() {
return ComplexBitMap{0};
}
static constexpr GP1 ResetCMDBufer() {
return ComplexBitMap{construct_cmd(0x01, 0)};
}
static constexpr GP1 SetDisplayState(DisplayState state) {
return ComplexBitMap{construct_cmd(0x03, static_cast<uint32_t>(state))};
}
static constexpr GP1 DMADirection(DMADirection dir) {
return ComplexBitMap{construct_cmd(0x04, static_cast<uint32_t>(dir))};
}
static constexpr GP1 DisplayArea(uint16_t x, uint16_t y) {
constexpr auto X = BitRange<uint32_t>::from_to(0, 9);
constexpr auto Y = BitRange<uint32_t>::from_to(10, 18);
return ComplexBitMap{construct_cmd(0x05, ComplexBitMap<uint32_t>::with(X.with(x), Y.with(y)).raw)};
}
static constexpr GP1 HorizontalDisplayRange(uint32_t x1, uint32_t x2) {
constexpr auto X1 = BitRange<uint32_t>::from_to(0, 11);
constexpr auto X2 = BitRange<uint32_t>::from_to(12, 23);
return ComplexBitMap{construct_cmd(0x06, ComplexBitMap<uint32_t>::with(X1.with(x1), X2.with(x2)).raw)};
}
static constexpr GP1 VerticalDisplayRange(uint32_t y1, uint32_t y2) {
constexpr auto Y1 = BitRange<uint32_t>::from_to(0, 9);
constexpr auto Y2 = BitRange<uint32_t>::from_to(10, 19);
return ComplexBitMap{construct_cmd(0x07, ComplexBitMap<uint32_t>::with(Y1.with(y1), Y2.with(y2)).raw)};
}
static constexpr GP1 DisplayMode(uint32_t mode) {
return ComplexBitMap{construct_cmd(0x08, mode)};
}
};
}
struct __no_align GPUStatusRegister : public ComplexBitMap<uint32_t> {
static constexpr auto DrawingOddLinesInterlaced = Bit<uint32_t>(31);
static constexpr auto DMADirectionValue = BitRange<DMADirection>::from_to(29, 30);
static constexpr auto DMAReady = Bit<uint32_t>(28);
static constexpr auto VRAMtoCPUtransferReay = Bit<uint32_t>(27);
static constexpr auto GP0ReadyForCMD = Bit<uint32_t>(26);
static constexpr auto FifoNotFull = Bit<uint32_t>(25); // Only for Fifo
static constexpr auto InterruptRequest = Bit<uint32_t>(24);
static constexpr auto DisplayDisabled = Bit<uint32_t>(23);
static constexpr auto VerticalInterlaceOn = Bit<uint32_t>(22);
static constexpr auto DisplayAreaColorDepth = BitRange<GPU::DisplayAreaColorDepth>::from_to(21, 21);
static constexpr auto VideoModePal = Bit<uint32_t>(20);
static constexpr auto VerticalResolutionValue = BitRange<VerticalResolution>::from_to(19, 19);
static constexpr auto HorizontalResolutionValue = BitRange<HorizontalResolution>::from_to(17, 18);
static constexpr auto HorizontalResolution368 = Bit<uint32_t>(16);
static constexpr auto TexturesDisabled = Bit<uint32_t>(15);
static constexpr auto NotDrawingMaskedPixels = Bit<uint32_t>(12);
static constexpr auto MaskBitSetDuringDrawEnabled = Bit<uint32_t>(11);
static constexpr auto DrawingToDisplayAreadAllowed = Bit<uint32_t>(10);
static constexpr auto DitherEnabled = Bit<uint32_t>(9);
static constexpr auto TexturePageColorValue = BitRange<TexturePageColor>::from_to(7, 8);
static constexpr auto SemiTransparencyValue = BitRange<SemiTransparency>::from_to(5, 6);
static constexpr auto TexturePageY = BitRange<uint32_t>::from_to(4, 4); // N*256
static constexpr auto TexturePageX = BitRange<uint32_t>::from_to(0, 3); // N*64
static constexpr auto VerticalResolution480 = Bit<uint32_t>(19);
static constexpr auto TexturePageY256 = Bit<uint32_t>(4);
};
__declare_io_port_global(Command::GP0, GP0, 0x1F801810);
__declare_io_port_global(Command::GP1, GP1, 0x1F801814);
__declare_io_port_global_const(uint32_t, GPUREAD, 0x1F801810);
__declare_io_port_global_const(GPUStatusRegister, GPUSTAT, 0x1F801814);
}
struct __no_align GPUStatusRegister : public ComplexBitMap<uint32_t> {
static constexpr auto DrawingOddLinesInterlaced = Bit<uint32_t>(31);
static constexpr auto DMADirectionValue = BitRange<DMADirection>::from_to(29, 30);
static constexpr auto DMAReady = Bit<uint32_t>(28);
static constexpr auto VRAMtoCPUtransferReay = Bit<uint32_t>(27);
static constexpr auto GP0ReadyForCMD = Bit<uint32_t>(26);
static constexpr auto FifoNotFull = Bit<uint32_t>(25); // Only for Fifo
static constexpr auto InterruptRequest = Bit<uint32_t>(24);
static constexpr auto DisplayDisabled = Bit<uint32_t>(23);
static constexpr auto VerticalInterlaceOn = Bit<uint32_t>(22);
static constexpr auto DisplayAreaColorDepth = BitRange<GPU::DisplayAreaColorDepth>::from_to(21, 21);
static constexpr auto VideoModePal = Bit<uint32_t>(20);
static constexpr auto VerticalResolutionValue = BitRange<VerticalResolution>::from_to(19, 19);
static constexpr auto HorizontalResolutionValue = BitRange<HorizontalResolution>::from_to(17, 18);
static constexpr auto HorizontalResolution368 = Bit<uint32_t>(16);
static constexpr auto TexturesDisabled = Bit<uint32_t>(15);
static constexpr auto NotDrawingMaskedPixels = Bit<uint32_t>(12);
static constexpr auto MaskBitSetDuringDrawEnabled = Bit<uint32_t>(11);
static constexpr auto DrawingToDisplayAreadAllowed = Bit<uint32_t>(10);
static constexpr auto DitherEnabled = Bit<uint32_t>(9);
static constexpr auto TexturePageColorValue = BitRange<TexturePageColor>::from_to(7, 8);
static constexpr auto SemiTransparencyValue = BitRange<SemiTransparency>::from_to(5, 6);
static constexpr auto TexturePageY = BitRange<uint32_t>::from_to(4, 4); // N*256
static constexpr auto TexturePageX = BitRange<uint32_t>::from_to(0, 3); // N*64
static constexpr auto VerticalResolution480 = Bit<uint32_t>(19);
static constexpr auto TexturePageY256 = Bit<uint32_t>(4);
};
__declare_io_port_global(Command::GP0, GP0, 0x1F801810);
__declare_io_port_global(Command::GP1, GP1, 0x1F801814);
__declare_io_port_global_const(uint32_t, GPUREAD, 0x1F801810);
__declare_io_port_global_const(GPUStatusRegister, GPUSTAT, 0x1F801814);
}
#endif //!__JABYENGINE_GPU_IO_HPP__

View File

@@ -2,80 +2,81 @@
#define __JABYENGINE_IOPORT_HPP__
#include "../../Auxiliary/complex_bitmap.hpp"
template<typename T>
class __no_align IOPort {
private:
T value;
namespace JabyEngine {
template<typename T>
class __no_align IOPort {
private:
T value;
public:
//For easy access
constexpr T read() const {
return const_cast<volatile IOPort<T>*>(this)->value;
}
public:
//For easy access
constexpr T read() const {
return const_cast<volatile IOPort<T>*>(this)->value;
}
constexpr void write(T value) {
const_cast<volatile IOPort<T>*>(this)->value = value;
}
constexpr void write(T value) {
const_cast<volatile IOPort<T>*>(this)->value = value;
}
constexpr volatile T& ref() {
return const_cast<volatile IOPort<T>*>(this)->value;
}
constexpr volatile T& ref() {
return const_cast<volatile IOPort<T>*>(this)->value;
}
constexpr const volatile T& ref() const {
return const_cast<volatile IOPort<T>*>(this)->value;
}
};
constexpr const volatile T& ref() const {
return const_cast<volatile IOPort<T>*>(this)->value;
}
};
struct __no_align ubus32_t {
ComplexBitMap<uint16_t> low;
ComplexBitMap<uint16_t> high;
struct __no_align ubus32_t {
ComplexBitMap<uint16_t> low;
ComplexBitMap<uint16_t> high;
constexpr ubus32_t(uint32_t value) {
*this = value;
}
constexpr ubus32_t(uint32_t value) {
*this = value;
}
constexpr operator uint32_t() const {
return ((this->high.raw << 16) | this->low.raw);
}
constexpr operator uint32_t() const {
return ((this->high.raw << 16) | this->low.raw);
}
operator uint32_t() const volatile {
return ((this->high.raw << 16) | this->low.raw);
}
operator uint32_t() const volatile {
return ((this->high.raw << 16) | this->low.raw);
}
constexpr ubus32_t& operator=(uint32_t value) {
this->low.raw = (value & 0xFFFF);
this->high.raw = (value >> 16);
constexpr ubus32_t& operator=(uint32_t value) {
this->low.raw = (value & 0xFFFF);
this->high.raw = (value >> 16);
return *this;
}
return *this;
}
constexpr void operator=(uint32_t value) volatile {
this->low.raw = (value & 0xFFFF);
this->high.raw = (value >> 16);
}
};
static constexpr uintptr_t IO_Base_Mask = 0xF0000000;
static constexpr uintptr_t IO_Base_Adr = 0x10000000;
constexpr void operator=(uint32_t value) volatile {
this->low.raw = (value & 0xFFFF);
this->high.raw = (value >> 16);
}
};
static constexpr uintptr_t IO_Base_Mask = 0xF0000000;
static constexpr uintptr_t IO_Base_Adr = 0x10000000;
#define __io_port_adr(adr) (IO_Base_Adr + (adr & ~IO_Base_Mask))
#define __declare_io_port_global_raw(cv, type, name, adr) static __always_inline cv auto& name = *reinterpret_cast<IOPort<type>*>(__io_port_adr(adr))
#define __io_port_adr(adr) (IO_Base_Adr + (adr & ~IO_Base_Mask))
#define __declare_io_port_global_raw(cv, type, name, adr) static __always_inline cv auto& name = *reinterpret_cast<IOPort<type>*>(__io_port_adr(adr))
#define __declare_io_port_global(type, name, adr) __declare_io_port_global_raw(, type, name, adr)
#define __declare_io_port_global_const(type, name, adr) __declare_io_port_global_raw(const, type, name, adr)
#define __declare_io_port_global_array(type, name, adr, size) static __always_inline auto& name = reinterpret_cast<type(&)[size]>(*reinterpret_cast<type*>((IO_Base_Adr + (adr & ~IO_Base_Mask))))
#define __declare_io_port_global_struct(type, name, adr) static __always_inline auto& name = *reinterpret_cast<type*>(__io_port_adr(adr))
#define __io_port_inherit_complex_bit_map(name) \
constexpr __always_inline name() = default; \
constexpr __always_inline name(ComplexBitMap value) : ComplexBitMap(value) { \
} \
template<typename...ARGS> \
static constexpr __always_inline name with(ARGS...args) { \
return {ComplexBitMap::with(args...)}; \
}\
template<typename T> \
constexpr void __always_inline operator=(ComplexBitMap<T> value) volatile { \
this->raw = value.raw; \
}
#define __declare_io_port_global(type, name, adr) __declare_io_port_global_raw(, type, name, adr)
#define __declare_io_port_global_const(type, name, adr) __declare_io_port_global_raw(const, type, name, adr)
#define __declare_io_port_global_array(type, name, adr, size) static __always_inline auto& name = reinterpret_cast<type(&)[size]>(*reinterpret_cast<type*>((IO_Base_Adr + (adr & ~IO_Base_Mask))))
#define __declare_io_port_global_struct(type, name, adr) static __always_inline auto& name = *reinterpret_cast<type*>(__io_port_adr(adr))
#define __io_port_inherit_complex_bit_map(name) \
constexpr __always_inline name() = default; \
constexpr __always_inline name(ComplexBitMap value) : ComplexBitMap(value) { \
} \
template<typename...ARGS> \
static constexpr __always_inline name with(ARGS...args) { \
return {ComplexBitMap::with(args...)}; \
}\
template<typename T> \
constexpr void __always_inline operator=(ComplexBitMap<T> value) volatile { \
this->raw = value.raw; \
}
}
#endif //!__JABYENGINE_IOPORT_HPP__

View File

@@ -2,168 +2,169 @@
#define __JABYENGINE_SPU_IO_HPP__
#include "ioport.hpp"
namespace SPU {
enum struct Mode {
Linear = 0,
Exponential = 1,
};
enum struct Direction {
Increase = 0,
Decrease = 1,
};
enum struct Phase {
Posititve = 0,
Negative = 1,
};
//0..0x1F = Fast..Slow
typedef uint8_t Shift;
//0..3 = +7, +6, +5, +4 or -6, -7, -6, -5
typedef uint8_t Step;
typedef int16_t SimpleVolume;
struct __no_align SampleRate : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(SampleRate);
static constexpr SampleRate from_HZ(double freq) {
//4096 == 44100Hz
constexpr double Base = (4096.0 / 44100.0);
return ComplexBitMap<uint16_t>{static_cast<uint16_t>((freq*Base))};
}
};
struct __no_align SweepVolume : public ComplexBitMap<int16_t> {
__io_port_inherit_complex_bit_map(SweepVolume);
// For Volume Mode
static constexpr auto SweepEnable = Bit<int16_t>(15);
static constexpr auto VolumeEnable = !SweepEnable;
static constexpr auto Volume = BitRange<int16_t>::from_to(0, 14);
// For Sweep Mode
static constexpr auto SweepMode = Bit<Mode>(14);
static constexpr auto SweepDirection = Bit<Direction>(13);
static constexpr auto SweepPhase = Bit<Phase>(12);
static constexpr auto SweepShift = BitRange<Shift>::from_to(2, 6);
static constexpr auto SweepStep = BitRange<Step>::from_to(0, 1);
};
struct __no_align SR : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(SR);
static constexpr auto SustainMode = Bit<Mode>(31 - 16);
static constexpr auto SustainDirection = Bit<Direction>(30 - 16);
static constexpr auto SustainShift = BitRange<Shift>::from_to((24 - 16), (28 - 16));
static constexpr auto SustainStep = BitRange<Step>::from_to((22 - 16), (23 - 16));
static constexpr auto ReleaseMode = Bit<Mode>(21 - 16);
static constexpr auto ReleaseShift = BitRange<Shift>::from_to((16 - 16), (20 - 16));
};
struct __no_align AD : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(AD);
static constexpr auto AttackMode = Bit<Mode>(15);
static constexpr auto AttackShift = BitRange<Shift>::from_to(10, 14);
static constexpr auto AttackStep = BitRange<Step>::from_to(8, 9);
static constexpr auto DecayShift = BitRange<Shift>::from_to(4, 7);
static constexpr auto SustainLevel = BitRange<uint16_t>::from_to(0, 3);
};
struct __no_align Voice {
IOPort<SweepVolume> volumeLeft; //Offset: 0x0
IOPort<SweepVolume> volumeRight; //Offset: 0x2
IOPort<SampleRate> sampleRate; //Offset: 0x4;
IOPort<uint16_t> adr; //Offset: 0x6
IOPort<AD> ad; //Offset: 0x8
IOPort<SR> sr; //Offset: 0xA
IOPort<SimpleVolume> currentVolume; //Offset: 0xC
IOPort<uint16_t> repeatAdr; //Offset: 0xE
};
struct __no_align ControlRegister : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(ControlRegister);
enum RAMTransferMode {
Stop = 0,
ManualWrite = 1,
DMAWrite = 2,
DMARead = 3
namespace JabyEngine {
namespace SPU {
enum struct Mode {
Linear = 0,
Exponential = 1,
};
static constexpr auto Enable = Bit<uint16_t>(15);
static constexpr auto Unmute = Bit<uint16_t>(14);
static constexpr auto NoiseFrequcenyShift = BitRange<Shift>::from_to(10, 13);
static constexpr auto NoiseFrequcenyStep = BitRange<Step>::from_to(8, 9);
static constexpr auto ReverbMasterEnable = Bit<uint16_t>(7);
static constexpr auto IRQ9Enable = Bit<uint16_t>(6);
static constexpr auto TransferMode = BitRange<RAMTransferMode>::from_to(4, 5);
static constexpr auto ExternalAudioReverb = Bit<uint16_t>(3);
static constexpr auto CDAudioReverb = Bit<uint16_t>(2);
static constexpr auto ExternalAudioEnable = Bit<uint16_t>(1);
static constexpr auto CDAudioEnable = Bit<uint16_t>(0);
};
enum struct Direction {
Increase = 0,
Decrease = 1,
};
struct __no_align PitchModFlags : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(PitchModFlags);
enum struct Phase {
Posititve = 0,
Negative = 1,
};
static constexpr BitRange<uint16_t> EnableBits = BitRange<uint16_t>::from_to(1, 23);
};
//0..0x1F = Fast..Slow
typedef uint8_t Shift;
struct __no_align NoiseGenerator : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(NoiseGenerator);
//0..3 = +7, +6, +5, +4 or -6, -7, -6, -5
typedef uint8_t Step;
static constexpr BitRange<uint16_t> NoiseBits = BitRange<uint16_t>::from_to(0, 23);
};
typedef int16_t SimpleVolume;
struct __no_align EchoOn : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(EchoOn);
struct __no_align SampleRate : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(SampleRate);
static constexpr BitRange<uint16_t> EchoBits = BitRange<uint16_t>::from_to(0, 23);
};
static constexpr SampleRate from_HZ(double freq) {
//4096 == 44100Hz
constexpr double Base = (4096.0 / 44100.0);
static constexpr size_t VoiceCount = 24;
return ComplexBitMap<uint16_t>{static_cast<uint16_t>((freq*Base))};
}
};
namespace Key {
__declare_io_port_global(ubus32_t, on, 0x1F801D88);
__declare_io_port_global(ubus32_t, off, 0x1F801D8C);
__declare_io_port_global(ubus32_t, status, 0x1F801D9C);
}
struct __no_align SweepVolume : public ComplexBitMap<int16_t> {
__io_port_inherit_complex_bit_map(SweepVolume);
namespace MainVolume {
__declare_io_port_global(SweepVolume, left, 0x1F801D80);
__declare_io_port_global(SweepVolume, right, 0x1F801D82);
}
// For Volume Mode
static constexpr auto SweepEnable = Bit<int16_t>(15);
static constexpr auto VolumeEnable = !SweepEnable;
static constexpr auto Volume = BitRange<int16_t>::from_to(0, 14);
namespace CDVolume {
__declare_io_port_global(SimpleVolume, left, 0x1F801DB0);
__declare_io_port_global(SimpleVolume, right, 0x1F801DB2);
}
// For Sweep Mode
static constexpr auto SweepMode = Bit<Mode>(14);
static constexpr auto SweepDirection = Bit<Direction>(13);
static constexpr auto SweepPhase = Bit<Phase>(12);
static constexpr auto SweepShift = BitRange<Shift>::from_to(2, 6);
static constexpr auto SweepStep = BitRange<Step>::from_to(0, 1);
};
namespace ExternalAudioInputVolume {
__declare_io_port_global(SimpleVolume, left, 0x1F801DB4);
__declare_io_port_global(SimpleVolume, right, 0x1F801DB6);
}
struct __no_align SR : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(SR);
static constexpr auto SustainMode = Bit<Mode>(31 - 16);
static constexpr auto SustainDirection = Bit<Direction>(30 - 16);
static constexpr auto SustainShift = BitRange<Shift>::from_to((24 - 16), (28 - 16));
static constexpr auto SustainStep = BitRange<Step>::from_to((22 - 16), (23 - 16));
static constexpr auto ReleaseMode = Bit<Mode>(21 - 16);
static constexpr auto ReleaseShift = BitRange<Shift>::from_to((16 - 16), (20 - 16));
};
namespace Reverb {
namespace Volume {
__declare_io_port_global(SimpleVolume, left, 0x1F801D84);
__declare_io_port_global(SimpleVolume, right, 0x1F801D86);
struct __no_align AD : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(AD);
static constexpr auto AttackMode = Bit<Mode>(15);
static constexpr auto AttackShift = BitRange<Shift>::from_to(10, 14);
static constexpr auto AttackStep = BitRange<Step>::from_to(8, 9);
static constexpr auto DecayShift = BitRange<Shift>::from_to(4, 7);
static constexpr auto SustainLevel = BitRange<uint16_t>::from_to(0, 3);
};
struct __no_align Voice {
IOPort<SweepVolume> volumeLeft; //Offset: 0x0
IOPort<SweepVolume> volumeRight; //Offset: 0x2
IOPort<SampleRate> sampleRate; //Offset: 0x4;
IOPort<uint16_t> adr; //Offset: 0x6
IOPort<AD> ad; //Offset: 0x8
IOPort<SR> sr; //Offset: 0xA
IOPort<SimpleVolume> currentVolume; //Offset: 0xC
IOPort<uint16_t> repeatAdr; //Offset: 0xE
};
struct __no_align ControlRegister : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(ControlRegister);
enum RAMTransferMode {
Stop = 0,
ManualWrite = 1,
DMAWrite = 2,
DMARead = 3
};
static constexpr auto Enable = Bit<uint16_t>(15);
static constexpr auto Unmute = Bit<uint16_t>(14);
static constexpr auto NoiseFrequcenyShift = BitRange<Shift>::from_to(10, 13);
static constexpr auto NoiseFrequcenyStep = BitRange<Step>::from_to(8, 9);
static constexpr auto ReverbMasterEnable = Bit<uint16_t>(7);
static constexpr auto IRQ9Enable = Bit<uint16_t>(6);
static constexpr auto TransferMode = BitRange<RAMTransferMode>::from_to(4, 5);
static constexpr auto ExternalAudioReverb = Bit<uint16_t>(3);
static constexpr auto CDAudioReverb = Bit<uint16_t>(2);
static constexpr auto ExternalAudioEnable = Bit<uint16_t>(1);
static constexpr auto CDAudioEnable = Bit<uint16_t>(0);
};
struct __no_align PitchModFlags : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(PitchModFlags);
static constexpr BitRange<uint16_t> EnableBits = BitRange<uint16_t>::from_to(1, 23);
};
struct __no_align NoiseGenerator : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(NoiseGenerator);
static constexpr BitRange<uint16_t> NoiseBits = BitRange<uint16_t>::from_to(0, 23);
};
struct __no_align EchoOn : public ComplexBitMap<uint16_t> {
__io_port_inherit_complex_bit_map(EchoOn);
static constexpr BitRange<uint16_t> EchoBits = BitRange<uint16_t>::from_to(0, 23);
};
static constexpr size_t VoiceCount = 24;
namespace Key {
__declare_io_port_global(ubus32_t, on, 0x1F801D88);
__declare_io_port_global(ubus32_t, off, 0x1F801D8C);
__declare_io_port_global(ubus32_t, status, 0x1F801D9C);
}
__declare_io_port_global(uint16_t, work_area_adr, 0x1F801DA2);
namespace MainVolume {
__declare_io_port_global(SweepVolume, left, 0x1F801D80);
__declare_io_port_global(SweepVolume, right, 0x1F801D82);
}
namespace CDVolume {
__declare_io_port_global(SimpleVolume, left, 0x1F801DB0);
__declare_io_port_global(SimpleVolume, right, 0x1F801DB2);
}
namespace ExternalAudioInputVolume {
__declare_io_port_global(SimpleVolume, left, 0x1F801DB4);
__declare_io_port_global(SimpleVolume, right, 0x1F801DB6);
}
namespace Reverb {
namespace Volume {
__declare_io_port_global(SimpleVolume, left, 0x1F801D84);
__declare_io_port_global(SimpleVolume, right, 0x1F801D86);
}
__declare_io_port_global(uint16_t, work_area_adr, 0x1F801DA2);
}
__declare_io_port_global(ControlRegister, Control, 0x1F801DAA);
__declare_io_port_global(uint16_t, DataTransferControl, 0x1F801DAC);
__declare_io_port_global(PitchModFlags, PMON, 0x1F801D90);
__declare_io_port_global(NoiseGenerator, NON, 0x1F801D94);
__declare_io_port_global(EchoOn, EON, 0x1F801D98);
__declare_io_port_global_array(Voice, Voices, 0x1F801C00, VoiceCount);
}
__declare_io_port_global(ControlRegister, Control, 0x1F801DAA);
__declare_io_port_global(uint16_t, DataTransferControl, 0x1F801DAC);
__declare_io_port_global(PitchModFlags, PMON, 0x1F801D90);
__declare_io_port_global(NoiseGenerator, NON, 0x1F801D94);
__declare_io_port_global(EchoOn, EON, 0x1F801D98);
__declare_io_port_global_array(Voice, Voices, 0x1F801C00, VoiceCount);
}
#endif //!__JABYENGINE_SPU_IO_HPP__

View File

@@ -2,6 +2,7 @@
#define __JABYENGINE_SCRATCHPAD_HPP__
#include "../jabyengine_defines.h"
static __always_inline auto& ScratchPad = reinterpret_cast<uint8_t(&)[1024]>(*reinterpret_cast<uint8_t*>(0x1F800000));
namespace JabyEngine {
static __always_inline auto& ScratchPad = reinterpret_cast<uint8_t(&)[1024]>(*reinterpret_cast<uint8_t*>(0x1F800000));
}
#endif //!__JABYENGINE_SCRATCHPAD_HPP__

View File

@@ -1,5 +1,5 @@
#ifndef __JABYENGINE__H__
#define __JABYENGINE__H__
#ifndef __JABYENGINE__HPP__
#define __JABYENGINE__HPP__
#include "../stdint.h"
namespace JabyEngine {
@@ -33,4 +33,4 @@ namespace JabyEngine {
typedef NextRoutine::MainRoutine MainRoutine;
}
#endif //!__JABYENGINE__H__
#endif //!__JABYENGINE__HPP__