Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double Size Print
#1
You know, I've focused so much on making itty bitty unreadable text, that it was time to make up the balance.

A whole evening poking in assembly, and it's 143 bytes? Heck, I'm slow!

Anyway - Double sized printing. Including UDG.

<!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:DoubleSizePrint.bas">http://www.boriel.com/wiki/en/index.php ... ePrint.bas</a><!-- m -->


No colour. That's what windowPaint - <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:WindowPaint">http://www.boriel.com/wiki/en/index.php ... indowPaint</a><!-- m --> - is for!

(Yes, I also added this - though it's solidly based on the paint routine packaged with putChars)
Reply
#2
Wow, very fast that is, but I don't think, it is double size. In fact it prints 2x2=4 (Quadruple) size.
I did the same effect with 512 byte table (each graphic byte=16 bit Word stored in table to put it on screen). Your routine is much more compact. Thanks!
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#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
#4
I see and understand, but I think, double SIZE is 1.41421356x1.41421356 Big Grin (Size=surface), but you are right that in graphics programs 8 x zoom=8x8 pixels (really 64x zoom, thats how it is measured for telescopes, witout the pixels of course).
Cool, excellent idea. BTW: I saw the sources of Laser Basic on ZX opensource website, but the comments are russian and the texts are in hobeta format. Maybe they are useful anyway. XOR sprites are useful too. There are many other useful sources of games that can be adapted.
The Library grows and grows steady.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#5
In the compiler examples/ folder there is also a simple routine that uses plot/point to create big-letter effects, BTW. I learned that trick from a MicroHobby (a Spanish speccy magazine) during my childhood (nostalgia) :roll: It first prints the string in another screen region (usually hiding it with paper & ink set to the same color).
Reply
#6
boriel Wrote:In the compiler examples/ folder there is also a simple routine that uses plot/point to create big-letter effects, BTW. I learned that trick from a MicroHobby (a Spanish speccy magazine) during my childhood (nostalgia) :roll: It first prints the string in another screen region (usually hiding it with paper & ink set to the same color).

There is? What's it called? Couldn't seem to find it.

I notice that some of these have oddities. scroll.bas has #include <scroll.bas> in it - which will work, of course - but it's a bit confusing.

And library/<scroll.bas> is broken - I think it should scroll {left, right, up, down}. Instead it has {right,left,left} (yes, left twice, no up or down)
Reply
#7
boriel Wrote:In the compiler examples/ folder there is also a simple routine that uses plot/point to create big-letter effects, BTW. I learned that trick from a MicroHobby (a Spanish speccy magazine) during my childhood (nostalgia) :roll: It first prints the string in another screen region (usually hiding it with paper & ink set to the same color).
Thats something I did 20 years ago too. It needs a part of screen for it, but it allows additional effects like 3D translations.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#8
LCD Wrote:
boriel Wrote:In the compiler examples/ folder there is also a simple routine that uses plot/point to create big-letter effects, BTW. I learned that trick from a MicroHobby (a Spanish speccy magazine) during my childhood (nostalgia) :roll: It first prints the string in another screen region (usually hiding it with paper & ink set to the same color).
Thats something I did 20 years ago too. It needs a part of screen for it, but it allows additional effects like 3D translations.
It is exacly that! The program is located in examples/led.bas ;-)
Reply
#9
That's a lot faster than I'd expect, based on the method. Very nice. I might consider that for a big text ASM.

Right now I'm toying with a generic proportional print routine, that should handle any bitmap and proportional space it.

<!-- m --><a class="postlink" href="http://dl.dropbox.com/u/4903664/Proportional.z80">http://dl.dropbox.com/u/4903664/Proportional.z80</a><!-- m -->
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)