1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Centralised and improved serial logging.

This commit is contained in:
Thomas Harte
2016-07-06 07:46:21 -04:00
parent 8819711bc8
commit 428fcdb978
4 changed files with 20 additions and 5 deletions
+13
View File
@@ -10,6 +10,18 @@
using namespace Commodore::Serial;
const char *::Commodore::Serial::StringForLine(Line line)
{
switch(line)
{
case ServiceRequest: return "Service request";
case Attention: return "Attention";
case Clock: return "Clock";
case Data: return "Data";
case Reset: return "Reset";
}
}
void Bus::add_port(std::shared_ptr<Port> port)
{
_ports.push_back(port);
@@ -39,6 +51,7 @@ void Bus::set_line_output_did_change(Line line)
// post an update only if one occurred
if(new_line_value != _line_values[line])
{
printf("[Bus] %s is %s\n", StringForLine(line), new_line_value ? "true" : "false");
_line_values[line] = new_line_value;
for(std::weak_ptr<Port> port : _ports)