From 908ce861f032543062b58cc606c58cb9c369943c Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 5 Nov 2022 12:52:12 -0700 Subject: Add $char shorthand in evt --- io/model.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'io') diff --git a/io/model.cpp b/io/model.cpp index 80986a6..7d4e2b3 100644 --- a/io/model.cpp +++ b/io/model.cpp @@ -54,6 +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) // FIXME: add assertions // FIXME: add DMA for (std::string line; std::getline(fh, line); ) { @@ -70,6 +71,8 @@ void iomodel::load_evt(std::istream &fh) { auto step = std::strtoull(line.c_str(), &end, 0); 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)); } else { auto eqpos = line.find('='); assert(eqpos != std::string::npos); -- cgit v1.2.3