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 uint8_t row[GB_VIDEO_HORIZONTAL_PIXELS + 8];
26
27 color_t palette[128];
28
29 uint32_t* temporaryBuffer;
30
31 uint8_t scy;
32 uint8_t scx;
33 uint8_t wy;
34 uint8_t wx;
35
36 GBRegisterLCDC lcdc;
37
38 struct GBObj* obj[40];
39 int oamMax;
40 bool oamDirty;
41};
42
43void GBVideoSoftwareRendererCreate(struct GBVideoSoftwareRenderer*);
44
45#endif