diff --git a/deps/nostalgia/.lldbinit b/deps/nostalgia/.lldbinit new file mode 100644 index 0000000..b646fcc --- /dev/null +++ b/deps/nostalgia/.lldbinit @@ -0,0 +1 @@ +type summary add --summary-string "${var.m_buff.m_items}" ox::String diff --git a/deps/nostalgia/deps/ox/src/ox/std/error.hpp b/deps/nostalgia/deps/ox/src/ox/std/error.hpp index a3de895..af36c10 100644 --- a/deps/nostalgia/deps/ox/src/ox/std/error.hpp +++ b/deps/nostalgia/deps/ox/src/ox/std/error.hpp @@ -264,6 +264,54 @@ struct [[nodiscard]] Result { return f(std::move(value)); } + /** + * Returns parameter alt if Result contains an error. + * @param alt + * @return value of Result or alt + */ + constexpr T orVal(T &&alt) & noexcept { + if (error) { + return std::move(alt); + } + return value; + } + + /** + * Returns parameter alt if Result contains an error. + * @param alt + * @return value of Result or alt + */ + constexpr T orVal(T &&alt) && noexcept { + if (error) { + return std::move(alt); + } + return std::move(value); + } + + /** + * Returns parameter alt if Result contains an error. + * @param alt + * @return value of Result or alt + */ + constexpr T orVal(T const&alt) & noexcept { + if (error) { + return alt; + } + return value; + } + + /** + * Returns parameter alt if Result contains an error. + * @param alt + * @return value of Result or alt + */ + constexpr T orVal(T const&alt) && noexcept { + if (error) { + return alt; + } + return std::move(value); + } + }; namespace detail { diff --git a/deps/nostalgia/developer-handbook.md b/deps/nostalgia/developer-handbook.md index 72d5607..7276191 100644 --- a/deps/nostalgia/developer-handbook.md +++ b/deps/nostalgia/developer-handbook.md @@ -20,14 +20,6 @@ All components have a platform indicator next to them: (-G) - GBA (P-) - PC -* GlUtils - OpenGL helpers (P-) -* Keel - asset management system (PG) -* Turbine - platform abstraction and user I/O (PG) - * gba - GBA implementation (PG) - * glfw - GLFW implementation (P-) -* Studio - where most of the studio code lives as library (P-) - * applib - used for per project studio executables - * modlib - used for studio modules to interact with studio * Nostalgia * modules * core - graphics system for Nostalgia (PG) @@ -42,6 +34,15 @@ All components have a platform indicator next to them: * studio - makes the games (P-) * tools - command line tools (P-) * pack - packs a studio project directory into an OxFS file (P-) +* Olympic + * Applib - Library for creating apps as libraries that injects Keel and Studio modules + * Keel - asset management system (PG) + * Studio - where most of the studio code lives as library (P-) + * applib - used for per project studio executables + * modlib - used for studio modules to interact with studio + * Turbine - platform abstraction and user I/O (PG) + * gba - GBA implementation (PG) + * glfw - GLFW implementation (P-) * deps - project dependencies * Ox - Library of things useful for portable bare metal and userland code. Not really that external... * clargs - Command Line Args processing (PG) @@ -54,9 +55,19 @@ All components have a platform indicator next to them: * model - Data structure modelling (PG) * preloader - library for handling preloading of data (PG) * std - Standard-ish Library with a lot missing and some things added (PG) + * GlUtils - OpenGL helpers (P-) * teagba - GBA assembly startup code (mostly pulled from devkitPro under MPL 2.0), and custom GBA hardware interop code (-G) +## Platform Notes + +### GBA + +#### Graphics + +* Background Palette: 256 colors +* Sprite Palette: 256 colors + ## Code Base Conventions ### Formatting diff --git a/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.CompactTileSheet;1 b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.CompactTileSheet;1 new file mode 100644 index 0000000..2f891fa --- /dev/null +++ b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.CompactTileSheet;1 @@ -0,0 +1,27 @@ +O1;net.drinkingtea.ox.TypeDescriptor;1;{ + "fieldList" : + [ + { + "fieldName" : "bpp", + "typeId" : "B.int8;0" + }, + { + "fieldName" : "defaultPalette", + "typeId" : "net.drinkingtea.ox.FileAddress;1" + }, + { + "fieldName" : "pixels", + "subscriptLevels" : 1, + "subscriptStack" : + [ + { + "subscriptType" : 4 + } + ], + "typeId" : "B.uint8;0" + } + ], + "primitiveType" : 5, + "typeName" : "net.drinkingtea.nostalgia.core.CompactTileSheet", + "typeVersion" : 1 +} diff --git a/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaGraphic;1 b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaGraphic;1 new file mode 100644 index 0000000..1427537 --- /dev/null +++ b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaGraphic;1 @@ -0,0 +1,39 @@ +O1;net.drinkingtea.ox.TypeDescriptor;1;{ + "fieldList" : + [ + { + "fieldName" : "bpp", + "typeId" : "B.int8;0" + }, + { + "fieldName" : "rows", + "typeId" : "B.int32;0" + }, + { + "fieldName" : "columns", + "typeId" : "B.int32;0" + }, + { + "fieldName" : "defaultPalette", + "typeId" : "net.drinkingtea.ox.FileAddress;1" + }, + { + "fieldName" : "pal", + "typeId" : "net.drinkingtea.nostalgia.core.Palette;1" + }, + { + "fieldName" : "pixels", + "subscriptLevels" : 1, + "subscriptStack" : + [ + { + "subscriptType" : 4 + } + ], + "typeId" : "B.uint8;0" + } + ], + "primitiveType" : 5, + "typeName" : "net.drinkingtea.nostalgia.core.NostalgiaGraphic", + "typeVersion" : 1 +} diff --git a/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.SceneDoc;1 b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.SceneDoc;1 new file mode 100644 index 0000000..07dabd5 --- /dev/null +++ b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.SceneDoc;1 @@ -0,0 +1,41 @@ +O1;net.drinkingtea.ox.TypeDescriptor;1;{ + "fieldList" : + [ + { + "fieldName" : "tilesheet", + "typeId" : "net.drinkingtea.ox.BasicString#8#;1" + }, + { + "fieldName" : "palettes", + "subscriptLevels" : 1, + "subscriptStack" : + [ + { + "subscriptType" : 4 + } + ], + "typeId" : "net.drinkingtea.ox.BasicString#8#;1" + }, + { + "fieldName" : "tiles", + "subscriptLevels" : 3, + "subscriptStack" : + [ + { + "subscriptType" : 4 + }, + { + "subscriptType" : 4 + }, + { + "subscriptType" : 4 + } + ], + "typeId" : "net.drinkingtea.nostalgia.scene.TileDoc;1" + } + ], + "preloadable" : true, + "primitiveType" : 5, + "typeName" : "net.drinkingtea.nostalgia.scene.SceneDoc", + "typeVersion" : 1 +} diff --git a/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.SceneStatic;1 b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.SceneStatic;1 new file mode 100644 index 0000000..8482e49 --- /dev/null +++ b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.SceneStatic;1 @@ -0,0 +1,88 @@ +O1;net.drinkingtea.ox.TypeDescriptor;1;{ + "fieldList" : + [ + { + "fieldName" : "tilesheet", + "typeId" : "net.drinkingtea.ox.FileAddress;1" + }, + { + "fieldName" : "palettes", + "subscriptLevels" : 1, + "subscriptStack" : + [ + { + "subscriptType" : 4 + } + ], + "typeId" : "net.drinkingtea.ox.FileAddress;1" + }, + { + "fieldName" : "columns", + "subscriptLevels" : 1, + "subscriptStack" : + [ + { + "subscriptType" : 4 + } + ], + "typeId" : "B.uint16;0" + }, + { + "fieldName" : "rows", + "subscriptLevels" : 1, + "subscriptStack" : + [ + { + "subscriptType" : 4 + } + ], + "typeId" : "B.uint16;0" + }, + { + "fieldName" : "tileMapIdx", + "subscriptLevels" : 2, + "subscriptStack" : + [ + { + "subscriptType" : 4 + }, + { + "subscriptType" : 4 + } + ], + "typeId" : "B.uint16;0" + }, + { + "fieldName" : "tileType", + "subscriptLevels" : 2, + "subscriptStack" : + [ + { + "subscriptType" : 4 + }, + { + "subscriptType" : 4 + } + ], + "typeId" : "B.uint8;0" + }, + { + "fieldName" : "layerAttachments", + "subscriptLevels" : 2, + "subscriptStack" : + [ + { + "subscriptType" : 4 + }, + { + "subscriptType" : 4 + } + ], + "typeId" : "B.uint8;0" + } + ], + "preloadable" : true, + "primitiveType" : 5, + "typeName" : "net.drinkingtea.nostalgia.scene.SceneStatic", + "typeVersion" : 1 +} diff --git a/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.TileDoc;1 b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.TileDoc;1 new file mode 100644 index 0000000..3853479 --- /dev/null +++ b/deps/nostalgia/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.scene.TileDoc;1 @@ -0,0 +1,33 @@ +O1;net.drinkingtea.ox.TypeDescriptor;1;{ + "fieldList" : + [ + { + "fieldName" : "subsheet_id", + "typeId" : "B.int32;0" + }, + { + "fieldName" : "subsheet_path", + "typeId" : "net.drinkingtea.ox.BasicString#8#;1" + }, + { + "fieldName" : "type", + "typeId" : "B.uint8;0" + }, + { + "fieldName" : "layer_attachments", + "subscriptLevels" : 1, + "subscriptStack" : + [ + { + "length" : 4, + "subscriptType" : 3 + } + ], + "typeId" : "B.uint8;0" + } + ], + "preloadable" : true, + "primitiveType" : 5, + "typeName" : "net.drinkingtea.nostalgia.scene.TileDoc", + "typeVersion" : 1 +} diff --git a/deps/nostalgia/sample_project/TileSheets/AB.ng b/deps/nostalgia/sample_project/TileSheets/AB.ng new file mode 100644 index 0000000..dacc19b --- /dev/null +++ b/deps/nostalgia/sample_project/TileSheets/AB.ng @@ -0,0 +1 @@ +K1;e41abcbc-0146-4f74-eaa5-5891d21e5de4;M2;net.drinkingtea.nostalgia.core.TileSheet;3; Vuuid://4895ab08-b7fd-4337-81e9-a8013166e723Root€f™Ÿ §jª    ""   """" "" \ No newline at end of file diff --git a/deps/nostalgia/sample_project/TileSheets/CD.ng b/deps/nostalgia/sample_project/TileSheets/CD.ng new file mode 100644 index 0000000..60c0f87 --- /dev/null +++ b/deps/nostalgia/sample_project/TileSheets/CD.ng @@ -0,0 +1 @@ +K1;24d20460-0a28-4642-d846-1a712681cfab;M2;net.drinkingtea.nostalgia.core.TileSheet;3; Vuuid://4895ab08-b7fd-4337-81e9-a8013166e723Root€§ªª"" "" "" "" \ No newline at end of file