Remove No longer used files
This commit is contained in:
parent
2e5ecb175f
commit
46da019131
@ -1,38 +0,0 @@
|
|||||||
/**
|
|
||||||
********************************************************************************
|
|
||||||
* @file defs.h
|
|
||||||
* @brief Defines global constants and types used in the emulator.
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef DEFS_H
|
|
||||||
#define DEFS_H
|
|
||||||
#include "../global.h"
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
/************************************
|
|
||||||
* MACROS AND CONSTANTS
|
|
||||||
************************************/
|
|
||||||
#define EXIT_FAILURE 1
|
|
||||||
#define HALT_INSTRUCTION 0x8a000000;
|
|
||||||
|
|
||||||
/************************************
|
|
||||||
* TYPEDEFS
|
|
||||||
************************************/
|
|
||||||
typedef uint8_t byte;
|
|
||||||
typedef struct {
|
|
||||||
bool Negative;
|
|
||||||
bool Zero;
|
|
||||||
bool Carry;
|
|
||||||
bool Overflow;
|
|
||||||
} PSTATE;
|
|
||||||
typedef struct {
|
|
||||||
word registers[REGISTER_COUNT];
|
|
||||||
word PC;
|
|
||||||
byte memory[MEMORY_SIZE];
|
|
||||||
PSTATE conditionCodes;
|
|
||||||
} Machine;
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
/**
|
|
||||||
********************************************************************************
|
|
||||||
* @file objectloader.c
|
|
||||||
* @brief Object file loader for the emulator
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "objectloader.h"
|
|
||||||
#include "defs.h"
|
|
||||||
|
|
||||||
void loadObjectFile(const char *filename, byte *memoryAddress) {
|
|
||||||
FILE *file = fopen(filename, "rb");
|
|
||||||
|
|
||||||
// Check if the file exists
|
|
||||||
if (file == NULL) {
|
|
||||||
fprintf(stderr, "Error: Could not open file %s\n", filename);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the object file into memory (or as much as possible)
|
|
||||||
size_t bytesRead = fread(memoryAddress, MEMORY_SIZE, 1, file);
|
|
||||||
if (bytesRead == 0) {
|
|
||||||
if (feof(file))
|
|
||||||
exit(EXIT_SUCCESS);
|
|
||||||
|
|
||||||
fprintf(stderr, "Error: Could not read from file %s\n", filename);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(file);
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file objectloader.h
|
|
||||||
* @brief Object file loader for the emulator
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include "defs.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Loads an object file into memory starting at memoryAddress.
|
|
||||||
*
|
|
||||||
* @param filename The name of the file to be read
|
|
||||||
* @param memoryAddress The memory address to load the object file into
|
|
||||||
*/
|
|
||||||
void loadObjectFile(const char *filename, byte *memoryAddress);
|
|
||||||
Loading…
Reference in New Issue
Block a user