Edwin Blink wrote:
The fastest scrollleft code I could think of is the folowing code snippet
which should be repeated 9*height times and
It's best to write a routine to generate it runtime and fill in the proper
SP values.
[snip]
It's 20% faster and takes 29% less space then LDI's.
BTW These timings (and earlier mentioned) are RAM timings when the ASIC is
NOT updating the display.
Trying to think this through...
Given that a contended memory access is 8 cycles, a contended PUSH/POP
would be 48 cycles
8 - read &F1 from PC++
8 - read A from SP++
8 - read F from SP++
8 - read &F5 from PC++
8 - write F to SP--
8 - write A to SP--
or 24Ts per byte, plus the extra 48 for every 14 bytes transferred ie
just under 28Ts per byte(?)
IIRC An uncontended LDIR is listed as 21/17 cycles (21 cycles for each
except the last ?) -
read ED B0 from PC+=2 (4 x 2)
read (HL++) (3)
write (DE++) (3)
BC--, if !0 then PC-=2
On Sam that probably comes up to what, 24?
A contended LDIR will be what?
16 - read EDBO
8 - read HL
8 - write DE
How much for the BC calculation and the PC--? Does that fit into the 32
T-states?
HOWEVER, if you use the ROM LDIR routine (008F), then it comes down to
8 - read EDBO
8 - read HL
8 - write DE
24 cycles, plus whatever the BC/PC bit takes. 28?
Obviously when uncontended your push/pop method is best but once the
screen draw kicks in it might be worth calling the ROM.
This would then be confused by the borders, of course... :) Has anyone
tried a comparison on a real Sam?
G