FAQ  •  Register  •  Login

Double Size Print

<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Thu Apr 19, 2012 1:19 am

Double Size Print

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.

http://www.boriel.com/wiki/en/index.php ... ePrint.bas


No colour. That's what windowPaint - http://www.boriel.com/wiki/en/index.php ... indowPaint - is for!

(Yes, I also added this - though it's solidly based on the paint routine packaged with putChars)
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Thu Apr 19, 2012 3:08 pm

Re: Double Size Print

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!
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Thu Apr 19, 2012 6:09 pm

Re: Double Size Print

Double width = 2x1
Double height = 1x2
Double size = 2x2 :)

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 ( http://www.worldofspectrum.org/infoseek ... id=0011158 ) 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 :)
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Fri Apr 20, 2012 7:49 am

Re: Double Size Print

I see and understand, but I think, double SIZE is 1.41421356x1.41421356 :D (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!
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Apr 20, 2012 7:59 am

Re: Double Size Print

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).
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Fri Apr 20, 2012 4:38 pm

Re: Double Size Print

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)
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Fri Apr 20, 2012 7:12 pm

Re: Double Size Print

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!
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Apr 20, 2012 7:44 pm

Re: Double Size Print

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 ;-)
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Fri Apr 20, 2012 10:43 pm

Re: Double Size Print

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.

http://dl.dropbox.com/u/4903664/Proportional.z80

Return to Documentation

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO