First connect a second controller. Then, while playing, hold the Space key on the keyboard, hold one of the directional buttons presented below and press the fire button on the 2nd controller to active the cheat.
At the title screen, hold 1 + 5 + 0 and press Space. You'll start with infinite lives and all items.