File: dc_video.cpp

package info (click to toggle)
wolf4sdl 1.7+svn262+dfsg1-5
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye, buster, sid
  • size: 4,112 kB
  • sloc: cpp: 34,696; ansic: 1,257; objc: 246; makefile: 159; sh: 44
file content (37 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//Wolf4SDL\DC
//dc_video.cpp
//2009 - Cyle Terry

#if defined(_arch_dreamcast)

#include <string.h>
#include <malloc.h>
#include "../wl_def.h"
#include "dc/biosfont.h"
#include "dc/video.h"

static uint16 *bbuffer;

void DC_VideoInit() {
    bbuffer = (uint16 *)malloc(640 * 480 * 2);
    DC_CLS();
}

void DC_DrawString(int x, int y, char *str) {
    bfont_draw_str(bbuffer + ((y + 1) * 24 * 640) + (x * 12), 640, 0, str);
}

void DC_Flip() {
    memcpy(vram_s, bbuffer, 640 * 480 * 2);
}

void DC_CLS() {
    int x, y, ofs;
    for(y = 0; y < 480; y++) {
        ofs = (640 * y);
        for(x = 0; x < 640; x++)
            bbuffer[ofs + x] = 0;
    }
}

#endif