Port registers for Mega2560

Hi, I'm trying to figure out why a particular library (ColorLCDShield) isn't working for my Mega2560 when another that was designed for the same LCD/Controllers (6100 with both Epson and Phillips controllers) works just fine.

I'm looking through the port definitions and see this:

#ifdef __AVR_ATmega1280__
	//*	Arduino Mega bit numbers
	#define LCD_RES		5		// D8
	#define LCD_CS			6		// D9
	#define LCD_DIO			5		// D11
	#define LCD_SCK			7		// D13

	//*	Arduino Mega ports
	#define	LCD_PORT_CS		PORTH
	#define	LCD_PORT_SCK	PORTB
	#define	LCD_PORT_RES	PORTH
	#define	LCD_PORT_DIO	PORTB
#else
	//*	Arduino Duemilanove bit numbers
	#define LCD_RES		0		// D8
	#define LCD_CS			1		// D9
	#define LCD_DIO			3		// D11
	#define LCD_SCK			5		// D13
	//#define LCD_PORT	PORTB

	//*	Arduino Duemilanove ports
	#define	LCD_PORT_CS		PORTB
	#define	LCD_PORT_SCK	PORTB
	#define	LCD_PORT_RES	PORTB
	#define	LCD_PORT_DIO	PORTB
#endif

Now, it is taking the Duemilanove definitions, which I have no idea if they are correct or not.

The numbers defined appear to be left shifts, like this:

DDRB = ((1<<LCD_CS)|(1<<LCD_DIO)|(1<<LCD_SCK)|(1<<LCD_RES));

Can anyone help? Or at least point me in the right direction?

Here is a port listing, may find the incorrect port off it. PortB on mega is pins 53 - 50 and 10 - 15

I suspect that the following line is not correct for the arduino mega2560 board. That was probably created before the release of the arudino mega2560 board.

#ifdef AVR_ATmega1280

That would not define the correct ports for a mega2560 board even though they have the same port/pin layout as the arduino mega1280 board.

Probably should be something like: (note, not tested)

#ifdef AVR_ATmega1280 || AVR_ATmega2560

Lefty