Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double Size Print
#3
Double width = 2x1
Double height = 1x2
Double size = 2x2 Smile

That is, doubled in each dimension.

I'm glad you like it. In a typical me fashion, I was looking at a routine by someone that did all sorts of strange things, and in a fit of "I could do better than that" I wrote one from scratch instead, and spent a while optimizing it - which, considering what it is, may well be pointless, but it was fun, which is why I do it.

The original ( <!-- m --><a class="postlink" href="http://www.worldofspectrum.org/infoseekid.cgi?id=0011158">http://www.worldofspectrum.org/infoseek ... id=0011158</a><!-- m --> ) used an algorithm that was rather messy - though reasonably integrated for Sinclair Basic users. However, it copied the string to a specific table, rather than parsed it in place (slow, wasteful of memory - and used a basic routine to do this part); it located the bitmaps for characters by getting chars, adding 256 to it, to point to the bitmaps, then loads BC with 8, and adds bc to hl until it reaches the right character. This is a pretty poor multiply routine, compared to a=a*8 done with bitshifting, and then add that to (Chars) - which is deliberately set at bitmaps-256, because the ascii code for space is 32, and 32*8=256. Finally, it constructed the bigprint bytes - 32 of them - in 32 temporary buffer bytes before putting them on the screen. My routine screen prints as it goes, and uses 2 registers to do the same job as those 32 memory bytes of buffer. Which does mean it needs to push and pop data sometimes to free up registers. I considered using alternate registers, but I don't think we're that speed desperate!

Add to that quite a lot of flag adjustment, and unnecessary saving data that's already in memory in one place to variable locations in others, made for a routine that was slow and quite clunky - bigger than mine, even if we don't include several hundred bytes of temporary space.

So, glad it was worth it. I think I see a use for a big pacman and ghosts in my tutorial, using this Smile
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)