diff options
| author | Julian Blake Kongslie | 2022-11-05 12:52:12 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-11-05 12:52:12 -0700 |
| commit | 908ce861f032543062b58cc606c58cb9c369943c (patch) | |
| tree | d51a93324559a28bac6c0682af404abb612c9f0a /io/model.cpp | |
| parent | Ignore leading/trailing whitespace and #comments in evt files (diff) | |
| download | biggolf-908ce861f032543062b58cc606c58cb9c369943c.tar.xz | |
Add $char shorthand in evt
Diffstat (limited to '')
| -rw-r--r-- | io/model.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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) { | |||
| 54 | // +time advances time by relative increment | 54 | // +time advances time by relative increment |
| 55 | // regname=value/mask adds event that sets regname = (regname & ~mask) | value | 55 | // regname=value/mask adds event that sets regname = (regname & ~mask) | value |
| 56 | // regname=value adds event that sets regname = value | 56 | // regname=value adds event that sets regname = value |
| 57 | // $x adds event that writes x (a single character) to the keyboard buffer (TT_BITS=0x??01/0xFF01) | ||
| 57 | // FIXME: add assertions | 58 | // FIXME: add assertions |
| 58 | // FIXME: add DMA | 59 | // FIXME: add DMA |
| 59 | for (std::string line; std::getline(fh, line); ) { | 60 | for (std::string line; std::getline(fh, line); ) { |
| @@ -70,6 +71,8 @@ void iomodel::load_evt(std::istream &fh) { | |||
| 70 | auto step = std::strtoull(line.c_str(), &end, 0); | 71 | auto step = std::strtoull(line.c_str(), &end, 0); |
| 71 | assert(end && *end == '\0'); | 72 | assert(end && *end == '\0'); |
| 72 | load_time += step; | 73 | load_time += step; |
| 74 | } else if (line[0] == '$') { | ||
| 75 | log.emplace(load_time, event(TT_BITS, (line[1] << 8) | TTI_FLAG, TTI_DATA | TTI_FLAG)); | ||
| 73 | } else { | 76 | } else { |
| 74 | auto eqpos = line.find('='); | 77 | auto eqpos = line.find('='); |
| 75 | assert(eqpos != std::string::npos); | 78 | assert(eqpos != std::string::npos); |
