landon@apple.UUCP (11/25/87)
0. I took Spectrum apart with a logic analyzer one day. This is not for the faint of heart: 1. Spectrum 512 is a kernel (any 2600 programmers out there?). 2. There is a clever synchronization technique. Basically they use the video scan register (the low byte of it) to determine how far the processor is into the line, using it as a jump-index into a table of NOPs when it changes. The number of NOPs is (are?) tuned so the 68000 starts off "on the right foot" of the kernel. 3. All interrupts are off (IPL-7) during the kernel, naturally. 4. Each line of the kernel itself looks something like: MOVEM.L <location>,<register-mask> ; suck-in pallette assignments MOVEM.L <register-mask>,COLOR0 ; set pallette registers MOVEM.L <location>,<register-mask> ; suck-in pallette assignments MOVEM.L <register-mask>,COLOR0 ; set pallette registers MOVEM.L <location>,<register-mask> ; suck-in pallette assignments MOVEM.L <register-mask>,COLOR0 ; set pallette registers (NOPs for alignment) ; sync with next scanline Quiz: how many registers do you need? How many cycles does this take? [Hint: you can get about 3.5 complete pallette changes on a scanline]. 5. This gets you 48+ colors on a LINE. I don't know how to get 48 CONSECUTIVE colors -- I suspect it is impossible without playing tricks with alternating video frames. There may be other even more hair-raising things you can do with MOVEM, however. -- I speak for me.