I looked at DCS's iFastCopy routine in Calcsys, and I think it could be made more optimized. Here's my code:

Code:
 di
fastloop1:
 in a,($10)
 rla
 jr c,fastloop1
 ld a,$80
 out ($10),a
 ld hl,plotsscreen-11
 ld de,11
 ld c,$11
 ld a,$20
fastloop2:
 ex af,af'
fastloop3:
 in a,($10)
 rla
 jr c,fastloop3
 ex af,af'
 out ($10),a
 ex af,af'
 ld b,64
fastloop4:
 add hl,de
fastloop5:
 in a,($10)
 rla
 jr c,fastloop5
 outi
 jr nz,fastloop4
 ex af,af'
 dec h
 dec h
 dec h
 inc l
 inc a
 cp $2C
 jr nz,fastloop2
 ei
 ret
For one thing, there are no pushes or pops. For another thing, the data is outputted as soon as possible. And outi is faster than loading (hl) into a and outputting a to port $11.
True, but I'm purposely wasting time in my version. Those pushes and pops take the extra 4 clock cycles required for the routine not to generate the slanted screen on buggy LCDs. Smile I'll look into outi though...
I thought that was what the "in a,($10) rla jr c,loop" was for, though...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement