all repos — mgba @ 60577e83948647d36a2e6a8b4ec8f8556df3f72f

mGBA Game Boy Advance Emulator

include/mgba/internal/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 <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/core.h>
14#include <mgba/internal/gb/gb.h>
15#include <mgba/internal/gb/video.h>
16
17struct GBVideoSoftwareRenderer {
18	struct GBVideoRenderer d;
19
20	color_t* outputBuffer;
21	int outputBufferStride;
22
23	uint8_t row[GB_VIDEO_HORIZONTAL_PIXELS + 8];
24
25	color_t palette[128];
26	uint8_t lookup[64];
27
28	uint32_t* temporaryBuffer;
29
30	uint8_t scy;
31	uint8_t scx;
32	uint8_t wy;
33	uint8_t wx;
34	uint8_t currentWy;
35	int lastY;
36	bool hasWindow;
37
38	GBRegisterLCDC lcdc;
39	enum GBModel model;
40
41	int16_t objOffsetX;
42	int16_t objOffsetY;
43	int16_t offsetScx;
44	int16_t offsetScy;
45	int16_t offsetWx;
46	int16_t offsetWy;
47
48	int sgbTransfer;
49	uint8_t sgbPacket[128];
50	uint8_t sgbCommandHeader;
51	bool sgbBorders;
52};
53
54void GBVideoSoftwareRendererCreate(struct GBVideoSoftwareRenderer*);
55
56CXX_GUARD_END
57
58#endif