all repos — mgba @ fbe375fab992cb4bb2fbc005ed26bc488ccb3389

mGBA Game Boy Advance Emulator

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/bitmap-cache.h>
14#include <mgba/core/map-cache.h>
15#include <mgba/core/tile-cache.h>
16#include <mgba-util/vector.h>
17
18DECLARE_VECTOR(mMapCacheSet, struct mMapCache);
19DECLARE_VECTOR(mBitmapCacheSet, struct mBitmapCache);
20DECLARE_VECTOR(mTileCacheSet, struct mTileCache);
21
22struct mCacheSet {
23	struct mMapCacheSet maps;
24	struct mBitmapCacheSet bitmaps;
25	struct mTileCacheSet tiles;
26};
27
28void mCacheSetInit(struct mCacheSet*, size_t nMaps, size_t nBitmaps, size_t nTiles);
29void mCacheSetDeinit(struct mCacheSet*);
30
31void mCacheSetAssignVRAM(struct mCacheSet*, void* vram);
32
33void mCacheSetWriteVRAM(struct mCacheSet*, uint32_t address);
34void mCacheSetWritePalette(struct mCacheSet*, uint32_t entry, color_t color);
35
36CXX_GUARD_END
37
38#endif