Hi Nockieboy, please approve the new tile layer modes and features:
// **********************************************************************************
// Tile selection when using different 'CMD_vid_bpp' modes, 8/16a/32/16b bpp modes.
// * On a tile layer, bpp will actually mean bpc -> Bits Per Character Tile.
// ----------------------------------------------------------------------------------
// FGC = Foreground color. Adds this FGC value to any tile pixels whose color data is != 0.
// BGC = Background color. Replace tile pixels whose color data = 0 with this BGC value.
// MIR = Mirror the tile.
// FLIP = Vertically flip the tile.
// ----------------------------------------------------------------------------------
//
//'CMD_vid_bpp' mode:
//
// 8 bpp -> Each byte = 1 character, 0 through 255, no color, mirror or flip functions.
//
// BGC, FGC, Char 0-255. *** BGC & FGC are multiplied by 16 in this mode.
// 16a bpp -> {4'h0, 4'h0, 8'h00 } = 16 bits / 256 possible tiles.
//
// FLIP, MIR, Char 0-16383.
// 16b bpp -> {1'b0, 1'b0, 14'h0000 } = 16 bits / 16384 possible tiles.
//
// BGC, FGC, FLIP, MIR, Char 0-16383.
// 32 bpp -> {8'h00, 8'h00, 1'b0, 1'b0, 14'h0000 } = 32 bits / 16384 possible tiles.
//
//
// Remember, the contents inside a tile set's 'CMD_vid_tile_bpp' can be 1/2/4/8/16a/32/16b bpp.
// The tile set can only be as large as the reserved fixed available FPGA blockram.
// It is possible to have multiple tile layers when using the 'SDI_LAYERS' feature
// where each layer may share or have different tile sets so long as there is enough
// room in the single reserved FPGA blockram.
//
// **********************************************************************************
Note that your GPU will be using 2 for 'SDI_LAYERS' when running 720p60, 1080p30 modes.
If you stick to 480p, you can bump that up to 4 or maybe even 8 layers. Because of FMAX routing on the MAX10 fpga, the 'SDI_LAYERS' can only be set to 1 for 1080p60. (2 for 1080p60, 4 for 1080p30 would be pushing timings into the red, but most likely functional...) The Lattice EPC5 series may allow doubling all the SDI_LAYER figures as their core ram in some scenarios will clear the required 300MHz.
Also note that multiple window modules may run in parallel, in tile or graphics mode. So, running 4 graphics plus 1 tile unit in 480p at 4xSDI_LAYERS means your total layer count will be 4x4 graphics = 16 graphics layers and 4 tile layers for a total of 20 layers. The FPGA blockram exclusively holds the tile sets and individual palettes for each layer or combined palette within each module to save on blockram.
The text data and graphics data for each layer are all stored on DDR3 with a limit of 65535x65535 pixel window size. IE, on a tile layer, with a 16x16 pixel tile set, you can open a window displaying 1048576x1048576 pixels, but do to a lack of DDR3 ram, your limit would be more like 16384x16384, a window display of 262144x262144 pixels.
Is this enough for your Z80?
How about a 68000?
Maybe a 68040, or even 68060 as they are only 75Mhz... I think my DDR3 could handle it with graphics and sound. Especially if we were to design a pcb with 32 or 64 bit DDR3 instead of 16bit.