Epson Research and Development Page 73
Vancouver Design Center
Programming Notes and Examples S1D13705
Issue Date: 02/01/22 X27A-G-002-03
/*
** Register 17h - Look-Up Table Data
** - Write 16 RGB triplets to the LUT.
*/
pLUT = LUT;
for (tmp = 0; tmp < 16; tmp++)
{SET_REG(0x17, *pLUT);// Set Red
pLUT++;
SET_REG(0x17, *pLUT);// Set Green
pLUT++;
SET_REG(0x17, *pLUT);// Set Blue
pLUT++;
}
/*
** Clear all of video memory by writing 81920 bytes of 0.
*/
pMem = p13705;
for (tmp = 0; tmp < MEM_SIZE; tmp++)
{*pMem = 0;
pMem++;
};
/*
** Draw a 100x100 red rectangle in the upper left corner (0,0)
** of the display.
*/
for (y = 0; y < 100; y++)
{/*
** Set the memory pointer at the start of each line.
** Pointer = MEM_OFFSET + (Y * Line_Width * BPP / 8) + (X * BPP / 8)
*/
pMem = p13705 + (y * 320 * BitsPerPixel / 8) + 0;
for (x = 0; x < 100; x++)
{*pMem = 0x4;/* Draw a pixel with LUT color 4 */
pMem++;
}
}
/*
** Wait for the user to press a key before continuing.
*/
printf("Press any key to continue");
getch();
/*
** Set and use PORTRAIT mode.
*/
/*