private function parse($char = '') { switch ($char) { case ESCAPE_KEY: ncurses_end(); exit; break; case ENTER: $buffer = $this->getBuffer(); ncurses_mvaddstr(0, 1, $buffer); ncurses_wclear($this->small); ncurses_wborder($this->small, 0, 0, 0, 0, 0, 0, 0, 0); ncurses_mvwaddstr($this->small, 5, 5, $buffer); ncurses_wrefresh($this->small); break; default: $this->pushBuffer(chr($char)); ncurses_wclear($this->small); ncurses_wborder($this->small, 0, 0, 0, 0, 0, 0, 0, 0); ncurses_mvwaddstr($this->small, 5, 5, chr($char)); ncurses_wrefresh($this->small); break; } }
/** * Redraw the debug Panel. */ public function redrawDebug() { ncurses_wclear($this->panels['debug']); ncurses_wborder($this->panels['debug'], 0, 0, 0, 0, 0, 0, 0, 0); ncurses_mvwaddstr($this->panels['debug'], 2, 2, "R1: [ " . $this->getVM()->get(0) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 3, 2, "R2: [ " . $this->getVM()->get(1) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 4, 2, "R3: [ " . $this->getVM()->get(2) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 2, 27, "R4: [ " . $this->getVM()->get(3) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 3, 27, "R5: [ " . $this->getVM()->get(4) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 4, 27, "R6: [ " . $this->getVM()->get(5) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 2, 52, "R7: [ " . $this->getVM()->get(6) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 3, 52, "R8: [ " . $this->getVM()->get(7) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 6, 2, "Location: [ " . $this->getVM()->getLocation() . " ]"); ncurses_mvwaddstr($this->panels['debug'], 6, 27, "Stack: [ " . implode(' ', $this->getVM()->getStack()) . " ]"); ncurses_mvwaddstr($this->panels['debug'], 0, 2, "[ Debug ]"); }