From 34632f1286243692c44c545e452c59d34a2123c0 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 5 Nov 2022 13:16:10 -0700 Subject: Smarter evt shorthand --- io/model.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'io/model.cpp') diff --git a/io/model.cpp b/io/model.cpp index 7d4e2b3..a05c719 100644 --- a/io/model.cpp +++ b/io/model.cpp @@ -54,7 +54,7 @@ void iomodel::load_evt(std::istream &fh) { // +time advances time by relative increment // regname=value/mask adds event that sets regname = (regname & ~mask) | value // regname=value adds event that sets regname = value - // $x adds event that writes x (a single character) to the keyboard buffer (TT_BITS=0x??01/0xFF01) + // $x adds events that input the remaining line (excluding trailing whitespace) character-at-a-time with 1000 cycles between them // FIXME: add assertions // FIXME: add DMA for (std::string line; std::getline(fh, line); ) { @@ -72,7 +72,10 @@ void iomodel::load_evt(std::istream &fh) { assert(end && *end == '\0'); load_time += step; } else if (line[0] == '$') { - log.emplace(load_time, event(TT_BITS, (line[1] << 8) | TTI_FLAG, TTI_DATA | TTI_FLAG)); + for (unsigned int i = 1; i < line.size(); ++i) { + log.emplace(load_time, event(TT_BITS, (line[i] << 8) | TTI_FLAG, TTI_DATA | TTI_FLAG)); + load_time += 1000; + } } else { auto eqpos = line.find('='); assert(eqpos != std::string::npos); -- cgit v1.2.3