private void fill(int y0, int x0, int y1, int x1, int c) { int d0 = width * y0 + x0; int d1 = width * (y1 - 1) + x1; if (d0 <= d1) { Arrays.fill(screen, width * y0 + x0, width * (y1 - 1) + x1, c); setDirty(); } }
private void cursor_set_y(int y) { cy = Math.max(0, Math.min(height - 1, y)); setDirty(); }
private void cursor_set_x(int x) { eol = false; cx = Math.max(0, x); setDirty(); }
private void cursor_right(int n) { eol = cx + n >= width; cx = Math.min(width - 1, cx + n); setDirty(); }
private void cursor_left(int n) { eol = false; cx = Math.max(0, cx - n); setDirty(); }
private void cursor_down(int n) { cy = Math.min(scroll_area_y1 - 1, cy + n); setDirty(); }
private void cursor_up(int n) { cy = Math.max(scroll_area_y0, cy - n); setDirty(); }
private void poke(int y, int x, int[] s) { System.arraycopy(s, 0, screen, width * y + x, s.length); setDirty(); }