FYI.
I found a 2068 technical manual with a section called something like "How to make a Scramble like game". Their solution says to use the Z80 block copy. This means that it scrolls 8 pixels at a time. If your objects are 16x16 then I think that 8 pixel scrolling is okay, but obviously not as good as smooth scrolling.
However, the block copy is slow. At 21 clock cycles per byte, and with 6912 bytes counting the color attributes, this works out to be about 1/25th of a second. However, it can only move these bytes during the vertical and horizontal blanking periods, which might make it take 4 times longer, although I'm not sure because I am trying to get more information. I say 4 times longer because the slow mode on the TS1000 ran only at 25% speed because the processor spent most of its time sending bytes to the display hardware, which is how the Atari 2600 worked. On the 2600 the program had to do this manually, whereas on TS1000 it is more automatic, but it still ties up the processor.
The 2068 only draws every other line on the NTSC screen, so maybe there is much more time available to draw to the screen.
I don't remember if used the block copy on my Diamond Mike game. I think that I chose to redraw the entire screen on each frame, which is likely slower. However, on the 2068, this appeared to be the perfect frame rate for this type of game. If the game had been too slow then I would have tried the block copy. I did the same full screen redraw on the Atari ST version of Diamond Mike and got roughly the same frame rate. The Atari ST has a faster processor, but the screen memory is 4.5 times bigger.
If you know the size of your buffer, then there is a way to make the Z80 block copy slightly faster by not looping as much. Instead of using the LDDR instruction, which does the entire block copy, a person could use the LDD instruction which only moves one byte and updates the pointers and the counter. It only takes 17 clock cycles. You could have 32 or 256 of these instructions in a row and then loop however many times as you need to. Since the instruction decrements the BC counter, you can test the zero flag and loop if not zero. This would increase the speed by about 24%.
No comments:
Post a Comment