@mjs513 - @KurtE The RA8876 uses screen memory in this way:
Code:
/*Page(image buffer) configure*/
/*The maximum number of pages is based on SDRAM capacity and color depth and width and height of one page*/
/*For example we used W9812G6JH SDRAM that capacity = 16Mbyte = 16777216 bytes*/
/*The SDRAM is divided into several image buffers and the maximum number of image buffers is limited by the
memory size. For example : page_size = 1024*600*2byte(16bpp) = 1228800byte, maximum number = 16/1.2288 */
/*vertical multi page application*/
#define PAGE1_START_ADDR 0
#define PAGE2_START_ADDR 1024*600*2 // 1228800 bytes
#define PAGE3_START_ADDR 1024*600*2*2 // 2457600 bytes
#define PAGE4_START_ADDR 1024*600*2*3
#define PAGE5_START_ADDR 1024*600*2*4
#define PAGE6_START_ADDR 1024*600*2*5
#define PAGE7_START_ADDR 1024*600*2*6
#define PAGE8_START_ADDR 1024*600*2*7
#define PAGE9_START_ADDR 1024*600*2*8
#define PAGE10_START_ADDR 1024*600*2*9
#define PATTERN1_RAM_START_ADDR 1024*600*2*10
#define PATTERN2_RAM_START_ADDR (1024*600*2*10)+(16*16*2)
#define PATTERN3_RAM_START_ADDR (1024*600*2*10)+(16*16*2)+(16*16*2)
This gives ~13 pages of (1024x600) at 16bpp. This obviously changes with larger or smaller color depths. When you are setting the active screen you are using one of the above starting page address for that screen buffer that will be displayed.
Here is part of the selectScreen() function that does that:
Code:
// Setup params to rebuild selected screen
pageOffset = screenPage;
currentPage = screenPage;
displayImageStartAddress(currentPage);
displayImageWidth(SCREEN_WIDTH);
displayWindowStartXY(0,0);
canvasImageStartAddress(currentPage);
canvasImageWidth(SCREEN_WIDTH);
activeWindowXY(0,0);
activeWindowWH(SCREEN_WIDTH,600);
setTextCursor(_cursorX, _cursorY);
textColor(_TXTForeColor,_TXTBackColor);
// Rebuild the display
buildTextScreen();
In the RA8876.pdf starting at page 48 11.2 it kinda explains this.
There are two modes of addressing available. Memory_XY_Mode and Memory_Linear_Mode.
The RA8876 uses the Block Transfer Engine (BTE) in the Memory_XY_Mode to copy, move etc...
Then there is the Memory_Linear_Mode which I have played around with very little. But is very slow when passing data between T.x and the RA8876 at 34MHz.
I have not figured out yet whether using DMA would help or not. At 1228800 bytes per screen page more T.x memory would be needed.
Hopefully I have not confused the issue here