-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
44 lines (33 loc) · 807 Bytes
/
main.cpp
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 <raylib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "src/include/graphics.h"
#include "src/include/cpu.h"
const int
WIDTH = 800,
HEIGHT = 600;
int main() {
Mem mem;
CPU cpu;
mem.LoadFile("os.out");
cpu.Reset( mem );
InitWindow( WIDTH, HEIGHT, "6502 Emulator" );
while ( !WindowShouldClose() ) {
cpu.Execute( mem, false );
if ( GetCharPressed() ) {
char key = W_ProcessKey();
if (key) {
mem[0xD010] = key;
mem[0xD011] = 1;
}
}
if ( mem[0xD013] ) { // If draw call
BeginDrawing();
ClearBackground(BLACK);
W_RenderTextBuffer();
EndDrawing();
}
}
return 0;
}