How do I get Arduino to work with a Mega1284P?
Sanguino should work with a mega1284. Its made for mega644, but mega1284 is the same only double memory.
You will need an ISP programmer, to get the bootloader on the mega1284. I don't know if a prebuild bootloader already exists. After that you can upload sketches from the IDE.