Hardware emulation

How would I figure out what sort of pulses to program to emulate a rotary encoder?

You'd get hold of the device's datasheet and look at the timing diagrams, which is what you'd have to do anyway if you were going to emulate it.