src/ds/video.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 DS_VIDEO_H
7#define DS_VIDEO_H
8
9#include "util/common.h"
10
11#include "core/log.h"
12
13mLOG_DECLARE_CATEGORY(DS_VIDEO);
14
15enum {
16 DS_VIDEO_HORIZONTAL_PIXELS = 256,
17 DS_VIDEO_HBLANK_PIXELS = 99,
18 DS_VIDEO_HORIZONTAL_LENGTH = (DS_VIDEO_HORIZONTAL_PIXELS + DS_VIDEO_HBLANK_PIXELS) * 6,
19
20 DS_VIDEO_VERTICAL_PIXELS = 192,
21 DS_VIDEO_VBLANK_PIXELS = 71,
22 DS_VIDEO_VERTICAL_TOTAL_PIXELS = DS_VIDEO_VERTICAL_PIXELS + DS_VIDEO_VBLANK_PIXELS,
23
24 DS_VIDEO_TOTAL_LENGTH = DS_VIDEO_HORIZONTAL_LENGTH * DS_VIDEO_VERTICAL_TOTAL_PIXELS,
25};
26
27struct DS;
28struct DSVideo {
29 struct DS* p;
30
31 // VCOUNT
32 int vcount;
33
34 int32_t nextHblank;
35 int32_t nextEvent;
36 int32_t eventDiff;
37
38 int32_t nextHblankIRQ;
39 int32_t nextVblankIRQ;
40 int32_t nextVcounterIRQ;
41
42 int32_t frameCounter;
43 int frameskip;
44 int frameskipCounter;
45};
46
47void DSVideoInit(struct DSVideo* video);
48void DSVideoReset(struct DSVideo* video);
49void DSVideoDeinit(struct DSVideo* video);
50
51#endif