For my 1284P based projects, I use Mighty Core, with the Bobuino pinout selected, and serail bootloader. Never had a problem with pins not being the number they are supposed to be or getting the SD working.
and what dev board do you use?
I design and build my own. One is a plug in replacement for a Pro Mini ...........................
can you post a photo of your 1284p dev board?
do you have a pin mapping between the MCU io pins and the pins of the board? if not, create one.do you use the MightyCore? you can add your pin mapping if the existing mappings don't match your board
why do you use USBasp if you have a bootloader?
Images should work now, sorry. So in other words that Mighty1284 bootloader is long gone and I didn't have a clue I usually write small blink-code and try with voltage meter. That's how I know how messed my pins are.It's odd how spiEEPROM work's well. It has no pin-setups as it uses those main mapped pins.I did try CS,MISO,MOSI,SCK definitions directly to Sd2Pinmap.h but it didn't like it.I'll look for newest Arduino IDE tomorrow and see how outdated my code is.