Re: A85: Fighter relase
[Prev][Next][Index][Thread]
Re: A85: Fighter relase
>I took a look at your sprite routine and I have some optimization suggestions:
>
>1) Get rid of most (if not all) the call statements inside the routine.
>Each one takes 19 clock cycles and a lot of these can be removed to
>increase the speed. After that and after a couple other speed
>optimizations, you can claim it is fast.
I added these primarily to simplify the code when others looked at it and
also because if I didn't MANY jr's would become jp's and that would slow it
down as well (not quite sure how much) only 2 calls maximum are called
during the routine so I don't see it as a big problem.
>2) The mask idea is EXCELLENT! However, the downside is, if you only have
>a few foreground objects (masked) and the rest are background (unmasked)
>objects. So, if you don't mask a sprite, you waste space since every
>sprite must be masked.
Yes, this is a problem, and I have made a version of the routine that
doesn't use masks I just haven't released it yet. I'm gonna clean up the
code some then re-release the code in 4 versions, masking/clipping,masking
only,clipping only, and no masking or clipping.
>3) The routine doesn't support anything other than 8x8 images, partly due
>to the fact that you use an aligned sprite section in your code. Most
>games use 8x8 sprites, but not all.
This really can't be changed without MAJOR changed to the code, and its not
worth it. This routine was designed as being 8x8 from the ground up and
I'm not gonna change that. It still is possible to use the same technique
to draw larger sprites, but then that would have to be 12x12 only or
something like that. It would be tough to write a universal size routine
using this technique that obtained decent speed.
>4) Uses the VIDEO_MEM buffer. This can cause serious flicker problems in
>some games. Use the GRAPH_MEM instead and have the user copy everything at
>once instead of each seperate sprite being drawn directly to the video
>display, therefore avoiding any possible flicker.
No, this causes major slowdown for many games and it really not worth it.
If you really want this change then you can just change to reference from
VIDEO_MEM to GRAPH_MEM. Personally I would never do this though because it
causes too much of a slow down.
-Zico Kolter
Follow-Ups:
References: