AERA
video_screen_io_device.h
1 //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
2 //_/_/
3 //_/_/ AERA
4 //_/_/ Autocatalytic Endogenous Reflective Architecture
5 //_/_/
6 //_/_/ Copyright (c) 2022-2025 Jeff Thompson
7 //_/_/ Copyright (c) 2022-2025 Icelandic Institute for Intelligent Machines
8 //_/_/ http://www.iiim.is
9 //_/_/
10 //_/_/ --- Open-Source BSD License, with CADIA Clause v 1.0 ---
11 //_/_/
12 //_/_/ Redistribution and use in source and binary forms, with or without
13 //_/_/ modification, is permitted provided that the following conditions
14 //_/_/ are met:
15 //_/_/ - Redistributions of source code must retain the above copyright
16 //_/_/ and collaboration notice, this list of conditions and the
17 //_/_/ following disclaimer.
18 //_/_/ - Redistributions in binary form must reproduce the above copyright
19 //_/_/ notice, this list of conditions and the following disclaimer
20 //_/_/ in the documentation and/or other materials provided with
21 //_/_/ the distribution.
22 //_/_/
23 //_/_/ - Neither the name of its copyright holders nor the names of its
24 //_/_/ contributors may be used to endorse or promote products
25 //_/_/ derived from this software without specific prior
26 //_/_/ written permission.
27 //_/_/
28 //_/_/ - CADIA Clause: The license granted in and to the software
29 //_/_/ under this agreement is a limited-use license.
30 //_/_/ The software may not be used in furtherance of:
31 //_/_/ (i) intentionally causing bodily injury or severe emotional
32 //_/_/ distress to any person;
33 //_/_/ (ii) invading the personal privacy or violating the human
34 //_/_/ rights of any person; or
35 //_/_/ (iii) committing or preparing for any act of war.
36 //_/_/
37 //_/_/ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
38 //_/_/ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
39 //_/_/ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
40 //_/_/ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41 //_/_/ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
42 //_/_/ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 //_/_/ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
44 //_/_/ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
45 //_/_/ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
46 //_/_/ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
47 //_/_/ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
48 //_/_/ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
49 //_/_/ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
50 //_/_/ OF SUCH DAMAGE.
51 //_/_/
52 //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
53 
54 #ifndef video_screen_io_device_h
55 #define video_screen_io_device_h
56 
57 #include "../r_exec/mem.h"
58 #include "video_screen.h"
59 
60 namespace video_screen {
61 
62 template<class O, class S> class VideoScreenIoDevice :
63  public r_exec::MemExec<O, S> {
64 public:
66 
68 
72  bool load(const std::vector<r_code::Code *> *objects, uint32 stdin_oid, uint32 stdout_oid, uint32 self_oid) override;
73 
82  r_code::Code* eject(r_code::Code *command) override;
83 
88  void on_diagnostic_time_tick() override { on_time_tick(); }
89 
90 private:
91  void on_time_tick();
92 
93  Timestamp lastInjectTime_;
94  uint16 ready_opcode_;
95  uint16 move_opcode_;
96  r_code::Code* fovea_pattern_property_;
97  r_code::Code* eye_obj_;
98  Timestamp lastCommandTime_;
99 
100  VideoScreen* video_screen_;
101 };
102 
103 }
104 
105 #endif
video_screen::VideoScreen
Definition: video_screen.h:61
video_screen::VideoScreenIoDevice::on_diagnostic_time_tick
void on_diagnostic_time_tick() override
Definition: video_screen_io_device.h:88
r_code::Code
Definition: r_code/object.h:224
video_screen::VideoScreenIoDevice::eject
r_code::Code * eject(r_code::Code *command) override
Definition: video_screen_io_device.cpp:103
video_screen::VideoScreenIoDevice
Definition: video_screen_io_device.h:63
video_screen::VideoScreenIoDevice::load
bool load(const std::vector< r_code::Code * > *objects, uint32 stdin_oid, uint32 stdout_oid, uint32 self_oid) override
Definition: video_screen_io_device.cpp:80
r_exec::MemExec
Definition: mem.h:979