20 lines
351 B
C
20 lines
351 B
C
#pragma once
|
|
|
|
#include "instruction.h"
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
// -- TYPES -- //
|
|
typedef struct {
|
|
char magic[4];
|
|
uint8_t version;
|
|
uint32_t numInstructions;
|
|
} ROMFileHeader;
|
|
|
|
typedef struct {
|
|
ROMFileHeader header;
|
|
Instruction* instructions;
|
|
} RomFile;
|
|
|
|
// -- FUNCTIONS -- //
|
|
RomFile* readProgramFromFile(char* path); |