From 5142b20036cf88f84fdf31e058771970f3bbd8d5 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 29 Jun 2020 11:38:56 -0500 Subject: [PATCH] [nostalgia/core/gba] Cleanup --- src/nostalgia/core/gba/gfx.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index 66e67cab..9e8acce6 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 - 2019 gtalent2@gmail.com + * Copyright 2016 - 2020 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 @@ -17,12 +17,11 @@ namespace nostalgia::core { -extern char charMap[128]; - -#define TILE_ADDR reinterpret_cast(0x06000000) - constexpr auto GBA_TILE_COLUMNS = 32; -constexpr auto GBA_TILE_ROWS = 32; + +using SpriteAttr = uint16_t[4]; + +SpriteAttr spriteBuffer[128]; struct GbaPaletteTarget { static constexpr auto TypeName = NostalgiaPalette::TypeName; @@ -142,7 +141,7 @@ ox::Error loadTileSheet(Context *ctx, GbaTileMapTarget target; target.pal.palette = &MEM_PALETTE_BG[section]; target.bgCtl = &bgCtl(section); - target.tileMap = &TILE_ADDR[section * 512]; + target.tileMap = &ox::bit_cast(MEM_BG_MAP)[section * 512]; oxReturnError(ox::readMC(ts, tsStat.size, &target)); // load external palette if available if (paletteAddr) {