From 621bbcb0fda324db550207253e78fb590f40d4a8 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 5 May 2015 20:02:38 -0700 Subject: 1273 - fix display.mu example program --- cpp/070display.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'cpp') diff --git a/cpp/070display.cc b/cpp/070display.cc index 350b9c4d..aa2c31b8 100644 --- a/cpp/070display.cc +++ b/cpp/070display.cc @@ -1,5 +1,9 @@ //: Take charge of the text-mode display and keyboard. +// uncomment to debug console programs +:(before "End Globals") +//? ofstream LOG("log.txt"); + //:: Display management :(before "End Globals") @@ -166,13 +170,18 @@ WAIT_FOR_KEY_FROM_KEYBOARD, Recipe_number["wait-for-key-from-keyboard"] = WAIT_FOR_KEY_FROM_KEYBOARD; :(before "End Primitive Recipe Implementations") case WAIT_FOR_KEY_FROM_KEYBOARD: { +//? LOG << "AAA\n"; LOG.flush(); struct tb_event event; do { tb_poll_event(&event); } while (event.type != TB_EVENT_KEY); +//? LOG << "AAA 2\n"; LOG.flush(); vector result; result.push_back(event.ch); - write_memory(current_instruction().products[0], result); +//? LOG << "AAA 3\n"; LOG.flush(); + if (!current_instruction().products.empty()) + write_memory(current_instruction().products[0], result); +//? LOG << "AAA 9\n"; LOG.flush(); break; } -- cgit 1.4.1-2-gfad0