This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
calc84maniac


Elite


Joined: 22 Jan 2007
Posts: 770

Posted: 25 Apr 2009 03:17:53 pm    Post subject:

TKD_01 wrote:
EDIT:
The push method works a bit faster, but the only problem is that the last 7 pixel pixels of the bottom row constantly flash on and off when one of my sprites goes on top of that section.


Okay, try this instead (which is the correct version):

Code:
di
ld b,(768/2)/6
ld hl,0
ld d,h \ ld e,l ;little optimization here
add hl,sp
ld sp,plotSScreen+768 ;PUSH decreases SP before writing the MSB
loop:
push de
push de
push de
push de
push de
push de
djnz loop
ld sp,hl
ei
Back to top
Taricorp


Member


Joined: 09 Mar 2006
Posts: 188

Posted: 25 Apr 2009 05:27:24 pm    Post subject:

Oh yes, I forgot about that. (I wasn't sure exactly what the behavior of PUSH is, and forgot to put in a disclaimer.)
Back to top
Mapar007


Advanced Member


Joined: 04 Oct 2008
Posts: 365

Posted: 26 Apr 2009 04:17:47 am    Post subject:

darkstone knight wrote:
also, the "fast" code is waaaay overkill


When was the last time I heard you say "overkill" in an optimization discussion? XD
Back to top
darkstone knight


Advanced Member


Joined: 07 Sep 2008
Posts: 438

Posted: 26 Apr 2009 10:45:32 am    Post subject:

this time Smile
Back to top
TKD_01


Advanced Newbie


Joined: 20 Feb 2009
Posts: 51

Posted: 26 Apr 2009 07:19:25 pm    Post subject:

FloppusMaximus wrote:
In any case I think this is a rather silly thing to be arguing about. For most purposes, LDIR is quite fast enough to clear the screen. If you really need the extra speed, use the PUSH loop or the funky copy-and-clear routine Galandros mentioned.

First of all, I dont believe we were arguing about that matter. We were simply recommending multiple methods to acheive a common end.
Second, thank you for clearing that up, FloppusMaximus, about the randseed. So, for further clarification, if randseed1 is located at plotsscreen+768, then randseed2 would be located at plotsscreen+777? I didnt think the plotsscreen was that large...

@calc84maniac:
So the pushing was essientially going beyond the plotsscreen in the faulty code?


Last edited by Guest on 26 Apr 2009 07:36:25 pm; edited 1 time in total
Back to top
calc84maniac


Elite


Joined: 22 Jan 2007
Posts: 770

Posted: 26 Apr 2009 07:53:10 pm    Post subject:

TKD_01 wrote:
@calc84maniac:
So the pushing was essientially going beyond the plotsscreen in the faulty code?

It wasn't overwriting the last byte in the buffer, and it was overwriting the byte before the buffer. A simple change of the value of SP fixed that.
Back to top
Display posts from previous:   
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
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Page 2 of 2 » All times are UTC - 5 Hours

 

Advertisement