Merry Christmas,
I've done a huge deal of work for you, something like 2-3 months worth based the current trend.
Here is all the work I have done:
Increased ram to 28672 bytes + 1024 bytes for the palette filling out your current Cyckone IV.
The main GPU ram begins at address 0 and reads/writes up until byte 28671. (address $6FFF).
The palette is currently stored at $007C00 through $007FFF. The first 512 bytes is the ARGB 4444 palette while the second 512 bytes is the RGB 565 palette.
HW_regs now begin at address $006F00 through $6FFF.
MAGGIE code has been patched and text_mode_master/slave have been implemented.
Added MAGGIEs 0 through 4, 5 graphics layers in total.
When presenting bitmap/tile windows, the top MAGGIE, lower MAGGIE # has higher priority / sits above the lower ones.
All of the MAGGIEs have their HV resets set to HV_Trigger 8 & 9.
MAGGIE H&V top left window position begin with MAGGIE 0 @ 10 & 11. Increase each HV trigger pair for each sequential MAGGIE.
MAGGIE 0 control HW_regs + 128 bytes, for 16 bytes. Increase 16 bytes for each sequential MAGGIE.
When using text/font/tile mode, 2 adjacent MAGGIES must be used. The first one must have the 'text_mode_master' bit set in the 'BP2RAST_cmd' while the second MAGGIE must have the 'text_mode_slave' bit set in the 'BP2RAST_cmd'. The 'BP2RAST_cmd' video mode in both must match except in the master where the BP2RAST_cmd video enable [4] must be disabled, otherwise you will get junk on the screen.
The 16 control bytes for the 'text_mode_master' MAGGIE points to the text/tile IDs. All other controls are identical as when using it as a bitmap graphics window. The 'font_y_size', combined upper bits of '{hw_regs[Y_START_SUB][7:6],hw_regs[Y_SCALE][7:4]}' in the text_mode_master which must also be set to the font/tile height -1. EG: 0=1 line, 7=8lines, 15=16lines, 31=32lines when in text/font/tile master mode...
For the 'text_mode_slave' MAGGIE, the only functioning 4 controls are the 'reset_addr' which now points to the base memory address of the font/tiles graphics data, period_x[4] which defines a font being 16 pixels wide when set, or, 8 pixels when low, period_x[3:0] which mask out the upper bits for fonts/tile addressing for 256, 512, 1024, 2048, 4096 characters (used in 16 bit addressing mode, otherwise set these bits to 0), period_y[1:0] which defines the font height, 0=8, 1=16, 2=32, 3=64 lines tall, and 'BP2RAST_cmd' which should match the text_mode_master MAGGIE settings except for the master and slave bit.
All base memory address settings should be on an even byte when using 16 bit mode. Fonts/tile graphics data should always begin on an even byte address.
BART has been patched to embed the .window_ena_out,.mode_16bit,.mode_565 into it's .pixel_out bus.
Palette_mixer has been updated to receive the new BART's .pixel_out bus with the embeded .window_ena_out,.mode_16bit,.mode_565.
The palette is now 512 entries wide, with the 4444 color palette occupying the first 256x16 entries while the 565 palette occupies the second 256x16 entries.
It also now has 5 inputs which get mixed together to form 1 output.
This means without text, you can mix 5 on-screen sprites, or, 1 text layer and 4 sprites.
Other than a ram limitation, there are no other output limitations. Any mode ant any res with any palette may be all mixed simultaneously onscreen.
Right now, I disables the linear translucent alpha blending for a basic transparent of opaque pixel on each sprite layer until I figure out a good way to accomplish this across multiple layers without filling up your tiny FPGA. Maybe we can reserve the alpha blend technique for 2 sets of different paired layers while going back to basic stencil layering between all the remaining layers.
I'm having trouble with clock domain crossing in trying to get the 2x core GPU ram working which will give you all 15 graphic layers. Running everything at 2x clock would be simple, but I don't have the time to optimize your code to make this cyclone run at 250MHz.
Let's see if I can find the bug over the next day or 2.
Everything else is ready for you to get you Z80 running.
See the attached files and check the RS232_debugger quick load files which have a 16bit color text demo with 3 additional scaled sprites onscreen. Photograph to make sure that everything works. If you want nicer graphics, you will have to start generating you own files...