MSXPad - TPSET

By Snatcher-br

Supporter (12)

Snatcher-br's picture

19-05-2004, 06:18

Hi to all,

I'm traing make a little game for MSX 2 in screen 5, using Pascal (MSXPad).

I don't know how I can set the TPSET in Pasca.l I'm using the Kari Lammassaari libraries and exit a function to copy portions in VRAM that r implemeted the logical copy .. I tried this one.. but don't work.

can anyone here give a help with this ??

thx

Login or register to post comments

By SLotman

Paragon (1236)

SLotman's picture

19-05-2004, 07:43

On MSXPad, start a Game Project.

then to make a VRAM->VRAM copy with logical operation, use:

CopyL(X1,Y1,X2,Y2,SrcPage,DestX,DestY,DestPage:integer; LogOp:byte);

where you have LogOP just replace it with TPSET (or 8 if you prefer using numbers)

By Snatcher-br

Supporter (12)

Snatcher-br's picture

19-05-2004, 14:02

Hi Slotman
well .. are the LogOp the color of the TPSET ???
if my trasparecy color is black that r color 0 of my palette, i'll use the copy command like this ??

CopyL(1,1,2,2,0,10,10,1, 0 );

thanks

By SLotman

Paragon (1236)

SLotman's picture

20-05-2004, 13:23

On MSX the transparent color is allways zero, no matter if you are in Basic, ASM or Pascal =)
LogOp is the Logical Operation performed, this case TPSET. Could be XOR, OR, AND, NOT.... each one has it's own value. Try passing diferent values, like 0, 1,2 and see the differences between the copies.

By SLotman

Paragon (1236)

SLotman's picture

20-05-2004, 13:34

Lets make it even easier:

Imagine you have this rectangle drawn on page 1 (the outline color 15, the interior color 0):

(1,1)
==============
|.............................|
|.............................|
|.............................|
|.............................|
==============
...............................(25,15)

And you want it to appear on page 0 at 100,100 and transparent (not drawing everything with palette color 0), the command should be:

CopyL(1,1,25,15,1,100,100,0,TPSET);

(remember: CopyL(X1,Y1,X2,Y2,SrcPage,DestX,DestY,DestPage:integer; LogOp:byte)Wink

The same command in basic would be:

Copy(1,1)-(25,15),1 to (100,100),0,TPSET

Understand now?

Now change TPSET with 0, and color 0 will be copied as well - it will work like a normal copy command, no logical operation will be performed.

Now you can replace it with:

0 - Overwrite
1 - AND operation
2 - OR
3 - XOR
4 - NOT
8 - TPSET (already defined in MSX.INC, that's why you can write TPSET in the command without any problem)
9 - TAND
10 - TOR
11 - TXOR
12 - TNOT

Try these values and see for yourself the different copy options... some are very usefull, like using NOT to draw menu bars =)