Hard PCI logic

TODO: reverse, document