-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.inc
59 lines (51 loc) · 2.15 KB
/
data.inc
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
;=========================================
; initialized data
include_debug_strings ; for debug-fdo
chip8_fontset db \
0xF0, 0x90, 0x90, 0x90, 0xF0, \ ; 0
0x20, 0x60, 0x20, 0x20, 0x70, \ ; 1
0xF0, 0x10, 0xF0, 0x80, 0xF0, \ ; 2
0xF0, 0x10, 0xF0, 0x10, 0xF0, \ ; 3
0x90, 0x90, 0xF0, 0x10, 0x10, \ ; 4
0xF0, 0x80, 0xF0, 0x10, 0xF0, \ ; 5
0xF0, 0x80, 0xF0, 0x90, 0xF0, \ ; 6
0xF0, 0x10, 0x20, 0x40, 0x40, \ ; 7
0xF0, 0x90, 0xF0, 0x90, 0xF0, \ ; 8
0xF0, 0x90, 0xF0, 0x10, 0xF0, \ ; 9
0xF0, 0x90, 0xF0, 0x90, 0x90, \ ; A
0xE0, 0x90, 0xE0, 0x90, 0xE0, \ ; B
0xF0, 0x80, 0x80, 0x80, 0xF0, \ ; C
0xE0, 0x90, 0x90, 0x90, 0xE0, \ ; D
0xF0, 0x80, 0xF0, 0x80, 0xF0, \ ; E
0xF0, 0x80, 0xF0, 0x80, 0x80 ; F
opcode dw 0 ; operation code
V db 16 dup(0) ; 16 8-bit registers
I dw 0 ; additional register (usually used for storing addresses)
P_C dw 0 ; program counter
S_P dw 0 ; stack pointer
delay_timer db 0
sound_timer db 0
stackmem dw STACK_SIZE dup(0) ; stack memory
key db KEY_SIZE dup (0) ; keyboard
chip8_draw_flag db 0
next_rand dd 1
align 4
fread_struct:
.subfunction dd 0 ; + 0
.offset_low dd 0 ; + 4
.offset_high dd 0 ; + 8
.size dd MAX_GAME_SIZE ; + 12
.buffer dd memory + 0x200 ; + 16
db 0 ; + 20
.filename: dd 0 ; + 24
sys_colors system_colors
main_window_title db 'CHIP-8 Emulator',0
imgbuf_ptr dd ? ; pointer to in-memory image buffer
;=========================================
align 16
_i_end:
; uninitialized data
cmdline rb 1024 ; reserve for command line arguments
memory rb MEM_SIZE
gfx rb GFX_SIZE
;tmp_buf rb 128