X-Git-Url: http://git.subgeniuskitty.com/screensavers/.git/blobdiff_plain/d87b1e06771aeb63ff43f5a289b19563d9af0eb0..b73247cfaa571f5f162eca6e55ee7ea803d31dd7:/hacks/NEDsim/simulator.h diff --git a/hacks/NEDsim/simulator.h b/hacks/NEDsim/simulator.h index 971e76c..51c461e 100644 --- a/hacks/NEDsim/simulator.h +++ b/hacks/NEDsim/simulator.h @@ -1,40 +1,22 @@ /* (c) 2021 Aaron Taylor */ /* See LICENSE.txt file for copyright and license details. */ -// TODO: Prune includes in both this header and the corresponding source file. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef NEDSIM_SIMULATOR_H +#define NEDSIM_SIMULATOR_H -#include "./a.out.h" +#include /* Bytes per word. */ #define BPW 4 -/* Number of stack words. */ -#define STACK_LENGTH 65536 +/* Syllables per word. */ +#define SPW 5 -/* Number of bytes of RAM. */ -#define RAM_LENGTH 67108864 +/* Storage definitions. */ +#define STACK_LENGTH 65536 +#define RAM_LENGTH 67108864 #define RAM_BASE_ADDRESS 0x20000000 -/* Number of syllables per word. */ -#define SPW 5 - struct NEDpsw { bool zero; bool negative; @@ -81,7 +63,8 @@ enum syllables { HALT = 0b00000000 }; -struct NEDstate * init_simulator(void); +struct NEDstate * init_simulator(char * input_file, const uint8_t * blob, const size_t * blob_size); struct NEDstate * run_simulator(struct NEDstate * state); uint32_t ram_r_word(struct NEDstate * state, uint32_t address); +#endif