just a guess -
crack a cartridge open,
look up the data sheet on the read only memory chip,
hook up a device to read each memory location and save the contents to a file
-one way would be a program a microcontroller to generate a clock and clock in read commands
and send the responses to a computer via serial port maybe
the file is basically a exact copy of whats on the chip location for location so the emulator acts as if the file was the rom