projects
/
screensavers
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added `-binary` CLI flag to NEDsim for loading a.out format programs.
[screensavers]
/
hacks
/
NEDsim
/
simulator.h
diff --git
a/hacks/NEDsim/simulator.h
b/hacks/NEDsim/simulator.h
index
927f73b
..
bf014eb
100644
(file)
--- a/
hacks/NEDsim/simulator.h
+++ b/
hacks/NEDsim/simulator.h
@@
-22,20
+22,15
@@
#include "./a.out.h"
#include "./a.out.h"
-// TODO: Can get rid of this since I don't do a show_usage() anymore?
-#define VERSION 5
-
/* Bytes per word. */
#define BPW 4
/* Number of stack words. */
/* Bytes per word. */
#define BPW 4
/* Number of stack words. */
-#define STACK_LENGTH
104857
6
+#define STACK_LENGTH
6553
6
/* Number of bytes of RAM. */
/* Number of bytes of RAM. */
-#define RAM_LENGTH 1073741824
-
-/* Number of hardware threads. */
-#define THREAD_COUNT 8
+#define RAM_LENGTH 67108864
+#define RAM_BASE_ADDRESS 0x20000000
/* Number of syllables per word. */
#define SPW 5
/* Number of syllables per word. */
#define SPW 5
@@
-58,11
+53,11
@@
struct NEDhack {
bool resume_word;
};
bool resume_word;
};
-// TODO: Make this a single thread before committing. Multi-thread is broken with my current main loop.
struct NEDstate {
bool halted;
uint8_t ram[RAM_LENGTH];
struct NEDstate {
bool halted;
uint8_t ram[RAM_LENGTH];
- struct NEDthread * thread[THREAD_COUNT];
+ /* Although NED is multi-threaded, this screensaver is restricted to a single thread. */
+ struct NEDthread * thread[1];
struct NEDthread * active_thread;
struct NEDhack * hack;
};
struct NEDthread * active_thread;
struct NEDhack * hack;
};
@@
-86,7
+81,7
@@
enum syllables {
HALT = 0b00000000
};
HALT = 0b00000000
};
-struct NEDstate * init_simulator(
void
);
+struct NEDstate * init_simulator(
char * input_file
);
struct NEDstate * run_simulator(struct NEDstate * state);
uint32_t ram_r_word(struct NEDstate * state, uint32_t address);
struct NEDstate * run_simulator(struct NEDstate * state);
uint32_t ram_r_word(struct NEDstate * state, uint32_t address);