MAINLOOP:
CALL drawFRect
JP MAINLOOP
drawFRect:
CALL full_params
LD HL,0AFFH ; draw filled rectangle X[0],Y[0] to X[1],Y[1]
LD L,A
CALL send_gpu
RET
full_params:
LD HL,8000H ; set X[0] to 0
CALL send_gpu
LD HL,0C000H ; set Y[0] to 0
CALL send_gpu
LD HL,9140H ; set X[1] to 320
CALL send_gpu
LD HL,0D0C8H ; set Y[1] to 200
CALL send_gpu
recol: ; Cycle colours
INC B
LD A,B
CP 16
RET C ; RETurn if < 16
LD A,2
LD B,A ; Otherwise, set colour to 2
RETWho cares about the 2 black colors, let them draw.
I need to see this thing swing...
I'm trying to keep everything in 8 bit and only do adds or inc.
I think I could do better with a PIC16C54 microcontroller from the mid 1990s.
We might need to store graphic programs on the GPU to do any real work.
However, with the current rate of development, this would take forever.
Do you have any 20MHz Z80s?
CALL full_params ; Set rectangle coordinates
LD HL,0AFFH ; draw filled rectangle X[0],Y[0] to X[1],Y[1]
MAINLOOP:
LD L,A
INC A
AND 0FH ; restrict A to 0-15
CALL send_gpu
JP MAINLOOP
drawFRect:
CALL full_params
LD HL,0AFFH ; draw filled rectangle X[0],Y[0] to X[1],Y[1]
LD L,A
CALL send_gpu
RET
full_params:
LD HL,8000H ; set X[0] to 0
CALL send_gpu
LD HL,0C000H ; set Y[0] to 0
CALL send_gpu
LD HL,9140H ; set X[1] to 320
CALL send_gpu
LD HL,0D0C8H ; set Y[1] to 200
CALL send_gpu
RET
send_gpu:
PUSH AF
LD A,L
OUT (CMD_LO),A
LD A,H
OUT (CMD_HI),A
POP AF
RET
Code: [Select]CALL full_params ; Set rectangle coordinates
LD HL,0AFFH ; draw filled rectangle X[0],Y[0] to X[1],Y[1]
MAINLOOP:
LD L,A
INC A
AND 0FH ; restrict A to 0-15
CALL send_gpu
JP MAINLOOP
drawFRect:
CALL full_params
LD HL,0AFFH ; draw filled rectangle X[0],Y[0] to X[1],Y[1]
LD L,A
CALL send_gpu
RET
full_params:
LD HL,8000H ; set X[0] to 0
CALL send_gpu
LD HL,0C000H ; set Y[0] to 0
CALL send_gpu
LD HL,9140H ; set X[1] to 320
CALL send_gpu
LD HL,0D0C8H ; set Y[1] to 200
CALL send_gpu
RET
send_gpu:
PUSH AF
LD A,L
OUT (CMD_LO),A
LD A,H
OUT (CMD_HI),A
POP AF
RET
I'll touch up the copy color transformation feature and your can make sure all the rest of the features like the collision detectors and soft reset works.
Next, we will look at filled triangles.
Also, you can try a 640x400 hi-res 2 color B&W mode. The lines should look very sweet.
What am I doing wrong with the MAGGIE setup here? I'm trying to draw a grid in 640x480x2. I'm getting the grid drawn in memory, but with the current MAGGIE settings I can't see anything. 
08 00 00 00 12 00 00 50 7F 02 DF 01 00 00 00 00 ; set GPU base_addr for graphics
LD HL,0F001H ; set Y[3] to 01
CALL send_gpu
LD HL,0B200H ; set X[3] to 200
CALL send_gpu
LD HL,7F00H ; send cmd 124 to set destination base address
CALL send_gpu
; set raster width (H) and bit depth (L)
LD HL,0F000H ; reset Y[3] to 0
CALL send_gpu
LD HL,0B27FH ; set X[3] to 639
CALL send_gpu
LD HL,7100H ; set dest width to Y[3]X[3] and bpp to 0 for 2 colours
CALL send_gpu
; set X & Y limits
LD HL,827FH ; set X[0] to 639
CALL send_gpu
LD HL,0C1DFH ; set Y[0] to 479
CALL send_gpu
LD HL,5F00H ; set max X & Y to X[0],Y[0]
JP send_gpu
Your boot up values were already correct except for the character in blue which changed the text column address repeat mode to regular graphics.The manual is in docs/Microcom GPU Manual.docx.
There's been a fair bit of editing with the learning I've done over the last few days, I've yet to update that.


Ok, I completely cleaned and rebuilt your 'GPU_EP4CE10'.
This means rename or backup-delete whatever folder you have now and begin this new one alone.
Two thing you need to do.
A) You have 2 IO pins in your design which still have no IO pin assignment. It's been like this awhile.
B) You need to change your PS2 keyboard decoder for a synchronous one. The one you have which crosses 3 clock domains is messing up the timing report and the compiler's efforts to rank how to optimize it's location in the FPGA fabric. You other choice is to learn how to setup and define cross domain clock correlation timing restrictions.
I've made some additional changes, so let me know if this latest version works fine & let me know if you can switch to a better all synchronous PS2 keyboard interface.
Ok, here is an enhanced cleaned up version which has a ton of wiggle room on the FMAX for the geometry unit at the limiting factors right now isn't even the geometry processor, but the Z80 bridge and vid_osd_generator. Download the new attached Quartus project. Make sure you older one is renamed so there is no chance some Quartus compile settings wont migrate between versions.
Though we are at 84% device utilization now, it is better than the 90% we were at last week.
My replacement of the 4 word 0 latency fifo for the new 2 word FWFT fifo really made it possible and I don't think the geometry unit has suffered. However, you need to test everything once again to make sure. A speed test of the filled full screen boxes will tell you. If you still get 20 vertical colored bars, then we are still at full pixel writing speed.
I also finished the pixel writer copy&paste color transformation feature to alter the color between source image and destination image. Simulation illustration coming.
(My new 2 word FWFT elastic FIFO designed purely to increase FMAX in large processing designs located here: 2 Word FWFT FIFO )
(New slacks now attached in image. Worst geometry now has 0.625ns clack and the system worst is 0.405ns slack instead of last week's version where the worst slack was 0.081ns and took 4.5 minutes to compile.)
Wow, thanks - performance seems to have jumped as far as I can tell. Just wondering if the compilation setting was right, though? I'm sure I saw it prioritising area at the expense of timing?
Before I start investing precious time working this new file into the project and getting it to work with the Z80 interface, do you think the attached PS2 module would be an improvement?
It looks all messed up. It looks slower in your video compared to the earlier stable ones, or at least stability-wise. Did you change your code? This may be a bug on my end. Try 1 or 2 earlier versions of the GPU. Or, has you cell phone video capture slowed down?
You didn't need to video the bars, just count them. Originally, your Z80 is clearly out-pacing the first 512 word geometry FIFO input, but you wont be able to see overshoot errors. I see around 20 bars in your still image. The question was not if it was going faster, but was it going slower.
What I needed to see was properly drawn lines. An also, my recommendation for a simple line algorithm in assemble which just incremented in 8 bit the x0,y0 and x1,y1 coordinates by those odd numbers, plus add 1 to color for every line, only checking the keyboard after every 256 lines drawn. All 8 bit single inc and odd opps to try and tax the line algorithm.
Since I do not have a board to test this module, I cannot say anything about it's function. However, it does seem to be a synchronous design and it also seems it can transmit something on the PS2 bus as well since it uses tristate ports for the PS2 IO. I think you can control the keyboard LEDs with it.
Give it a try, but there is 1 line in it which Quartus is ignoring. Take a look at line 652. You'll notice it is green/commented out. You'll need to delete the last character on line 651 to make that line active code, or, just add an additional space at the end of line 651.