diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index 6bd60622..7b421a84 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -205,6 +205,12 @@ ox::Error loadSpritePalette(Context *ctx, int section, ox::FileAddress paletteAd } // Do NOT use Context in the GBA version of this function. +void puts(Context *ctx, int column, int row, const char *str) { + for (int i = 0; str[i]; i++) { + setTile(ctx, 0, column + i, row, static_cast(charMap[static_cast(str[i])])); + } +} + void setTile(Context*, int layer, int column, int row, uint8_t tile) { MEM_BG_MAP[layer][row * GbaTileColumns + column] = tile; } diff --git a/src/nostalgia/core/gfx.cpp b/src/nostalgia/core/gfx.cpp index 617ead0a..b23a503f 100644 --- a/src/nostalgia/core/gfx.cpp +++ b/src/nostalgia/core/gfx.cpp @@ -11,7 +11,7 @@ namespace nostalgia::core { // map ASCII values to the nostalgia charset -static char charMap[128] = { +char charMap[128] = { 0, 0, 0, @@ -175,12 +175,6 @@ uint8_t blue32(Color16 c) noexcept { return blue16(c) * 8; } -void puts(Context *ctx, int column, int row, const char *str) { - for (int i = 0; str[i]; i++) { - setTile(ctx, 0, column + i, row, static_cast(charMap[static_cast(str[i])])); - } -} - static_assert(color16(0, 31, 0, 0) == 992); static_assert(color16(16, 31, 0, 0) == 1008); static_assert(color16(16, 31, 8, 0) == 9200); diff --git a/src/nostalgia/core/gfx.hpp b/src/nostalgia/core/gfx.hpp index c35b863b..c2851442 100644 --- a/src/nostalgia/core/gfx.hpp +++ b/src/nostalgia/core/gfx.hpp @@ -14,6 +14,8 @@ namespace nostalgia::core { +extern char charMap[128]; + enum class TileSheetSpace { Background, Sprite diff --git a/src/nostalgia/core/qt/CMakeLists.txt b/src/nostalgia/core/qt/CMakeLists.txt index 9683dcc8..5c0f33be 100644 --- a/src/nostalgia/core/qt/CMakeLists.txt +++ b/src/nostalgia/core/qt/CMakeLists.txt @@ -3,7 +3,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) add_library( - NostalgiaCore-Qt SHARED + NostalgiaCore-Qt OBJECT gfx.cpp ) diff --git a/src/nostalgia/core/qt/gfx.cpp b/src/nostalgia/core/qt/gfx.cpp index 71481a20..cfa3533f 100644 --- a/src/nostalgia/core/qt/gfx.cpp +++ b/src/nostalgia/core/qt/gfx.cpp @@ -29,7 +29,16 @@ ox::Error loadBgTileSheet(Context*, return OxError(1); } +void puts(Context *ctx, int column, int row, const char *str) { + for (int i = 0; str[i]; i++) { + setTile(ctx, 0, column + i, row, static_cast(charMap[static_cast(str[i])])); + } +} + void setTile(Context*, int, int, int, uint8_t) { } +void setSprite(Context*, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned) { +} + } diff --git a/src/nostalgia/core/sdl/gfx.cpp b/src/nostalgia/core/sdl/gfx.cpp index d5357608..40a77e12 100644 --- a/src/nostalgia/core/sdl/gfx.cpp +++ b/src/nostalgia/core/sdl/gfx.cpp @@ -194,6 +194,12 @@ void draw(Context *ctx) { SDL_RenderPresent(id->renderer); } +void puts(Context *ctx, int column, int row, const char *str) { + for (int i = 0; str[i]; i++) { + setTile(ctx, 0, column + i, row, static_cast(charMap[static_cast(str[i])])); + } +} + void setTile(Context *ctx, int layer, int column, int row, uint8_t tile) { auto id = ctx->implData(); auto z = static_cast(layer); diff --git a/src/nostalgia/studio/lib/CMakeLists.txt b/src/nostalgia/studio/lib/CMakeLists.txt index 541a90d9..96a7e7df 100644 --- a/src/nostalgia/studio/lib/CMakeLists.txt +++ b/src/nostalgia/studio/lib/CMakeLists.txt @@ -2,7 +2,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) add_library( - NostalgiaStudio SHARED + NostalgiaStudio OBJECT editor.cpp wizard.cpp module.cpp diff --git a/src/nostalgia/studio/mainwindow.hpp b/src/nostalgia/studio/mainwindow.hpp index 16725976..c30f0bb6 100644 --- a/src/nostalgia/studio/mainwindow.hpp +++ b/src/nostalgia/studio/mainwindow.hpp @@ -46,8 +46,8 @@ ox::Error model(T *io, NostalgiaStudioState *obj) { } struct NostalgiaStudioProfile { - QString appName; - QString orgName; + QString appName = "Nostalgia Studio"; + QString orgName = "Drinking Tea"; QVector modulesPath; };