include/mgba/core/cache-set.h (view raw)
1/* Copyright (c) 2013-2017 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef M_CACHE_SET_H
7#define M_CACHE_SET_H
8
9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/map-cache.h>
14#include <mgba/core/tile-cache.h>
15#include <mgba-util/vector.h>
16
17DECLARE_VECTOR(mMapCacheSet, struct mMapCache);
18DECLARE_VECTOR(mTileCacheSet, struct mTileCache);
19
20struct mCacheSet {
21 struct mMapCacheSet maps;
22 struct mTileCacheSet tiles;
23};
24
25void mCacheSetInit(struct mCacheSet*, size_t nMaps, size_t nTiles);
26void mCacheSetDeinit(struct mCacheSet*);
27
28void mCacheSetAssignVRAM(struct mCacheSet*, void* vram);
29
30void mCacheSetWriteVRAM(struct mCacheSet*, uint32_t address);
31void mCacheSetWritePalette(struct mCacheSet*, uint32_t entry, color_t color);
32
33CXX_GUARD_END
34
35#endif