Simulating the cosmic dawn