Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cooming 2013: "Yumiko in the haunted Mansion"
#31
boriel Wrote:
LCD Wrote:BTW: How to extend PutChars to add masking? I want to have some parts of the background shine through the chars by defining bitmap of a mask.
boriel Wrote:Have a look at PRINT routine. PRINT uses OVER 2 and OVER 3 for masking. Wink
PRINT masking does not allow to shine through only selected parts of the bitmap to make them appear like "sprites" with a border around them. And if I'm low on memory, I replace all prints with a routine based on PutChars because this saves around 800 bytes of memory. Maybe you noticed in source of Yumiko.
.
That's right. PRINT is a very generic routine (as BASIC requires). Usually you need OVER 2 + OVER 3 (OVER 2 + OVER 1 will also work) to do masking, but you will need to precalculate the inverted mask in advance. I haven't read your code entirely, BTW, but if you managed to get a routine that calculates some masks automatically (this is usually not possible, I guess) and invert them (e.g. at the beginning of each game level, or whatever) you will save a lot of memory. I've always wanted something like this :roll:
Sorry, I wasn't questioning your code; just suggesting you can get some ideas from the default PRINT routine (as I do from many places, the ROM included).[/quote]

Ooops, now I see what you mean. I was expecting that britlionn was answering me. Did not have noticed that it was you, boriel.
Sorry...
The problem with the Print routine is that using it may eat much memory, if used for graphics.
Print at 4,6 "ABCDEFGHIJ";at 5,6;"KLMNOPQRST" uses much more memory than
PutChars(4,6,10,2,@GfxData)
Overlaying graphics characters may even make it too slow for action games. But for simple "tricks" where speed is not important or just a single character is needed, I'm using it.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)