all repos — mgba @ 90d280026d282df09036c6b1ff2ed1c636912466

mGBA Game Boy Advance Emulator

src/gb/renderers/software.h (view raw)

 1/* Copyright (c) 2013-2016 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 GB_RENDERER_SOFTWARE_H
 7#define GB_RENDERER_SOFTWARE_H
 8
 9#include "util/common.h"
10
11#include "gb/video.h"
12
13#ifdef COLOR_16_BIT
14typedef uint16_t color_t;
15#else
16typedef uint32_t color_t;
17#endif
18
19struct GBVideoSoftwareRenderer {
20	struct GBVideoRenderer d;
21
22	color_t* outputBuffer;
23	int outputBufferStride;
24
25	uint32_t row[GB_VIDEO_HORIZONTAL_PIXELS];
26
27	color_t bgPalette[4];
28	color_t objPalette[2][4];
29
30	uint32_t* temporaryBuffer;
31
32	uint8_t scy;
33	uint8_t scx;
34	uint8_t wy;
35	uint8_t wx;
36
37	GBRegisterLCDC lcdc;
38
39	struct GBObj* obj[40];
40	int oamMax;
41	bool oamDirty;
42};
43
44void GBVideoSoftwareRendererCreate(struct GBVideoSoftwareRenderer*);
45
46#endif