refactor(cpu): fix build warnings and clean up unused headers

This commit is contained in:
Stevan Freeborn
2026-07-18 16:41:38 -05:00
parent 401925d012
commit 25f044b14f
2 changed files with 5 additions and 3 deletions
+5 -2
View File
@@ -35,7 +35,9 @@ void chip8_init(chip_eight_t *chip) {
}
int chip8_load_rom(chip_eight_t *chip, const char *file_path) {
FILE *file_ptr = fopen(file_path, "rb");
FILE *file_ptr;
fopen_s(&file_ptr, file_path, "rb");
if (file_ptr == NULL) {
return FILE_MISSING;
@@ -186,10 +188,11 @@ void chip8_step(chip_eight_t *chip) {
case OPCODE_GROUP_JP_V0_ADDR:
chip->pc = nnn + chip->V[0];
break;
case OPCODE_GROUP_RND_VX_BYTE:
case OPCODE_GROUP_RND_VX_BYTE: {
uint8_t num = rand() % 256;
chip->V[x] = kk & num;
break;
}
case OPCODE_GROUP_DRW_VX_VY_N:
draw_sprite(chip, n, x, y);
break;
-1
View File
@@ -3,7 +3,6 @@
#include <stdlib.h>
#include <stdint.h>
#include <signal.h>
#include <string.h>
#include <math.h>
#include <raylib.h>
#include "chip8.h"