File tree Expand file tree Collapse file tree 2 files changed +12
-28
lines changed Expand file tree Collapse file tree 2 files changed +12
-28
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,6 @@ void emulate_cycle(chip8 *chip) {
128128Y = (opcode & 0x00F0 ) >> 4 ;
129129NN = opcode & 0x00FF ;
130130
131- // debug statement displaying opcode
132- // printf("Opcode: %x\n", opcode);
133-
134131// decode and execute opcode in giant opcode switch statement
135132switch (opcode & 0xF000 ) {
136133case 0x0000 :
@@ -393,15 +390,4 @@ void emulate_cycle(chip8 *chip) {
393390
394391// increment program counter if there is no memory address jump
395392if (!jump ) { chip -> pctr += 2 ; }
396- }
397-
398- // for debugging purposes only
399- void draw_screen (chip8 * chip ) {
400- int i , j ;
401- for (i = 0 ; i < SCREEN_HEIGHT ; i ++ ) {
402- for (j = 0 ; j < SCREEN_WIDTH ; j ++ ) {
403- printf ("%d" , chip -> display [j ][i ]);
404- }
405- printf ("\n" );
406- }
407393}
Original file line number Diff line number Diff line change 22#ifndef CHIP8_H
33#define CHIP8_H
44
5- #define FONTSET_SIZE 80
6- #define MAX_FILE_SIZE 3584
7- #define NUM_KEYS 16
8- #define NUM_REGISTERS 16
9- #define SCREEN_WIDTH 64
10- #define SCREEN_HEIGHT 32
11- #define SPRITE_WIDTH 8
12- #define STACK_SIZE 16
13- #define SYSTEM_MEMORY 4096
14- #define F 15
5+ #define FONTSET_SIZE 80
6+ #define MAX_FILE_SIZE 3584
7+ #define NUM_KEYS 16
8+ #define NUM_REGISTERS 16
9+ #define SCREEN_WIDTH 64
10+ #define SCREEN_HEIGHT 32
11+ #define SPRITE_WIDTH 8
12+ #define STACK_SIZE 16
13+ #define SYSTEM_MEMORY 4096
14+ #define F 15
1515
1616// since C doesn't handle bool, typedef our own
1717typedef int bool ;
18- #define FALSE 0
19- #define TRUE 1
18+ #define FALSE 0
19+ #define TRUE 1
2020
2121/* SUMMARY:
2222* Chip 8 Virtual Machine. Can run Pong.
@@ -54,8 +54,6 @@ extern void initialize(chip8 *chip);
5454
5555extern void emulate_cycle (chip8 * chip );
5656
57- extern void draw_screen (chip8 * chip );
58-
5957extern void handle_input (chip8 * chip , unsigned char key );
6058
6159extern int load_file (char * file_name , unsigned char * buffer );
You can’t perform that action at this time.
0 commit comments