Dr Jefyll wrote:
Very nice, Bill!
Can you give us a little more detail, please, re the ISR for NMI? I have a feeling there's a trick involved, but I'd like to hear you explain it.
-- Jeff
Quote:
HSync also drives 6502's interrupt such that 80 bytes of video data are shifted out in the interrupt service routine to form 640 pixels per HSync
Jeff,
I used IRQ instead of NMI, but now you've mentioned it, NMI may be a better choice, assuming it is turned off initially and can be turned on by writing to a magic location.
The program always waits for IRQ while executing WAI instruction so it has a consistent interrupt response time. The IRQ service starts off with some NOP as front porch followed by 80 set of the following instructions:
.byte 3 ;single cycle NOP
LDA ($b0),y
INY
Each set of instructions take 8 clocks to execute; ZP $b0,$b1 points to graphic data in RAM region $4000-$DFFF; hardware in CPLD snoops memory access between $4000-$DFFF and load the data into a 8-bit shift register that shifts data out at 25.175MHz. Oh, maybe this is the trick you are thinking of: the original graphic data needs to be reformatted to fit 3 lines per page so LDA ($b0),y does not cross page boundary. The reformatting is done to the original graphic data during the vertical retrace period.
While 6502 has some spare capacity to receive/store serial input during each horizontal retrace, processing of the serial data needs to be done during the vertical retrace period.
Attached are the VGA test program and schematic of CPLD (the VGA-related logic is in the bottom 1/4 of the CPLD schematic).
Bill