-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
61 lines (47 loc) · 1013 Bytes
/
Copy pathmain.go
File metadata and controls
61 lines (47 loc) · 1013 Bytes
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"chip-8/chip"
)
const (
screenWidth = 64
screenHeight = 32
)
func main() {
keyboard := make(map[byte]byte)
keyboard['1'] = 0;
keyboard['2'] = 1;
keyboard['3'] = 2;
keyboard['4'] = 3;
keyboard['q'] = 4;
keyboard['w'] = 5;
keyboard['e'] = 6;
keyboard['r'] = 7;
keyboard['a'] = 8;
keyboard['s'] = 9;
keyboard['d'] = 10;
keyboard['f'] = 11;
keyboard['z'] = 12;
keyboard['x'] = 13;
keyboard['c'] = 14;
keyboard['v'] = 15;
c := chip.New(false, keyboard)
// test display
// n := "./ibm_logo.ch8"
//n := "./2-ibm-logo.ch8"
// test codes
//n := "./test_opcode.ch8"
//n := "./test2.ch8"
// falgs
//n := "./4-flags.ch8"
// quirks
//n := "./5-quirks.ch8"
// keyboard
//n := "./6-keypad.ch8"
// game
//n := "./invaders.rom"
//n := "./connect4.rom"
n := "./pong.rom"
c.LoadRom(n, 0x200)
c.Start()
// c.Test()
}