auto PPU::Window::run(u32 x, u32 y) -> void {
  auto x1 = io.x1, x2 = io.x2;
  auto y1 = io.y1, y2 = io.y2;

  if(x2 < x1 || x2 > 240) x2 = 240;
  if(y2 < y1 || y2 > 160) y2 = 160;

  output = (x >= x1 && x < x2 && y >= y1 && y < y2);
}

auto PPU::Window::power(u32 id) -> void {
  this->id = id;

  io = {};
  output = 0;
}
