Files
6502PC/src/rom.c
T
2026-09-27 22:09:00 +02:00

28 lines
421 B
C

#include "rom.h"
#include <stdio.h>
#include "io.h"
uint8_t rom[ROM_SIZE] = {0};
void initRom(uint8_t *rom) {
FILE *fp = fopen("rom/tmp/rom.bin", "rb");
if (!fp) {
perror("fopen");
return;
}
DIAG_PUSH();
DIAG_IGNORE("-Wunused-result");
fread(rom, 1, ROM_SIZE, fp);
DIAG_POP();
if (ferror(fp)) {
perror("fread");
fclose(fp);
return;
}
fclose(fp);
}