28 lines
424 B
C
28 lines
424 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/kilian.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);
|
|
} |