diff --git a/src/nostalgia/core/gba/gba.hpp b/src/nostalgia/core/gba/gba.hpp deleted file mode 100644 index 11728843..00000000 --- a/src/nostalgia/core/gba/gba.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2016 - 2019 gtalent2@gmail.com - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#pragma once - -#include - -namespace nostalgia::core { - -typedef struct { uint32_t data[8]; } __attribute__((aligned(4))) Tile, Tile4; -// d-tile: double-sized tile (8bpp) -typedef struct { uint32_t data[16]; } __attribute__((aligned(4))) Tile8; -// tile block: 32x16 tiles, 16x16 d-tiles -using Palette = uint16_t[256]; -using CharBlock = Tile[512]; -using CharBlock8 = Tile8[256]; - -struct __attribute__((packed)) GbaImageDataHeader { - uint8_t bpp = 0; - uint16_t tileCount = 0; -}; - -struct __attribute__((packed)) GbaImageData { - GbaImageDataHeader header; - uint8_t colors = 0; // colors in the palette - Palette __attribute__((packed)) pal = {}; - uint8_t tiles[1]; -}; - -} diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index 49ed24a4..f109940a 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -14,15 +14,13 @@ #include #include "addresses.hpp" -#include "gba.hpp" #include "panic.hpp" namespace nostalgia::core { extern char charMap[128]; -#define TILE_ADDR ((CharBlock*) 0x06000000) -#define TILE8_ADDR ((CharBlock8*) 0x06000000) +#define TILE_ADDR reinterpret_cast(0x06000000) constexpr auto GBA_TILE_COLUMNS = 32; constexpr auto GBA_TILE_ROWS = 32; @@ -134,7 +132,7 @@ ox::Error loadTileSheet(Context *ctx, GbaTileMapTarget target; target.pal.palette = &MEM_PALLETE_BG[section]; target.bgCtl = &bgCtl(section); - target.tileMap = reinterpret_cast(&TILE_ADDR[section][0]); + target.tileMap = &TILE_ADDR[section]; oxReturnError(ox::readMC(ts, tsStat.size, &target)); // load external palette if available if (paletteAddr) { diff --git a/src/nostalgia/core/studio/imgconv.cpp b/src/nostalgia/core/studio/imgconv.cpp index 2bcec80b..6258d30b 100644 --- a/src/nostalgia/core/studio/imgconv.cpp +++ b/src/nostalgia/core/studio/imgconv.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include "imgconv.hpp" diff --git a/src/nostalgia/tools/pack.cpp b/src/nostalgia/tools/pack.cpp index 2e0cf1db..b6645d1b 100644 --- a/src/nostalgia/tools/pack.cpp +++ b/src/nostalgia/tools/pack.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -20,7 +19,6 @@ using namespace std; using namespace ox; -using namespace nostalgia::core; using namespace nostalgia::common; [[nodiscard]] ox::ValErr> loadFileBuff(std::string path, ::size_t *sizeOut = nullptr) { diff --git a/src/nostalgia/tools/pack/CMakeLists.txt b/src/nostalgia/tools/pack/CMakeLists.txt index 132ca1a8..ea0c5567 100644 --- a/src/nostalgia/tools/pack/CMakeLists.txt +++ b/src/nostalgia/tools/pack/CMakeLists.txt @@ -1,6 +1,6 @@ add_library( - NostalgiaPack SHARED + NostalgiaPack pack.cpp ) @@ -17,6 +17,6 @@ target_link_libraries( install( TARGETS NostalgiaPack - LIBRARY DESTINATION + ARCHIVE DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia )