Remove Overlayhader and support loading overlays

This commit is contained in:
2023-04-10 17:01:28 +02:00
parent 7a373a38ff
commit 1a0d175779
8 changed files with 47 additions and 65 deletions

View File

@@ -3,11 +3,9 @@
#include "../AutoLBA/auto_lba.hpp"
namespace JabyEngine {
struct __attribute__((packed)) OverlayHeader {
void (*execute)();
uint16_t lba_size; //< The size of the OverlayLBA section
};
typedef AutoLBAEntry OverlayLBA;
// Can be used to create dummy values to trick LZ4 into compressing an uncompressed overlay
#define __create_dummy_fill(length) static const uint8_t __section(".keep.dummy") __used DummyFilling[length] = {0x0}
}
#endif //!__JABYENGINE_OVERLAY__HPP__

View File

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