add file loading
This commit is contained in:
20
src/util.h
Normal file
20
src/util.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#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);
|
||||
Reference in New Issue
Block a user