-
Notifications
You must be signed in to change notification settings - Fork 0
/
Screen.h
44 lines (38 loc) · 1.39 KB
/
Screen.h
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
38
39
40
41
42
43
44
#include "Cpu.h"
#define ScreenWidth 64
#define ScreenHeight 32
static int ScreenScale = 6;
static int XOff = 7;
static int YOff = 24;
static bool Interlaced = false;
void ClearScreen(unsigned char Color){
for (int x = 0 ; x <= ScreenWidth; x ++){
for (int y = 0 ; y <= ScreenHeight; y ++){
ScreenMemory[x][y] = Color;
}
}
}
void DrawScreen(){
for (int x = 0 ; x < ScreenWidth; x ++){
for (int y = 0 ; y < ScreenHeight; y ++){
if (Interlaced){
if (y % 2 == 0){
if (ScreenMemory[x][y] == 1){
PD->graphics->fillRect((x * ScreenScale ) + XOff,(y * ScreenScale ) + YOff, 1* ScreenScale, 1* ScreenScale, kColorWhite);
}
else {
PD->graphics->fillRect((x * ScreenScale ) + XOff,(y * ScreenScale ) + YOff, 1* ScreenScale, 1* ScreenScale, kColorBlack);
}
}
}
else {
if (ScreenMemory[x][y] == 1){
PD->graphics->fillRect((x * ScreenScale ) + XOff,(y * ScreenScale ) + YOff, 1* ScreenScale, 1* ScreenScale, kColorWhite);
}
else {
PD->graphics->fillRect((x * ScreenScale ) + XOff,(y * ScreenScale ) + YOff, 1* ScreenScale, 1* ScreenScale, kColorBlack);
}
}
}
}
}