Article View: rec.games.programmer
Article #712Xor-programming
From: LEEUWERK
Date: Tue, 15 Sep 1992 14:00
Date: Tue, 15 Sep 1992 14:00
82 lines
2398 bytes
2398 bytes
Hello,
I have a question for all the game programmers that
use the methode XOR-animation on VGA
(or even a better methode!):
Could you please send me a mail about the assembly
technique. With examples, because the most books
I've read don't show examples. And probably I
need some examples to understand the THEORY.
So far I've got this code:
Type pic: ARRAY[0..19,0..19] OF BYTE;
{*
The colors are restricted to 16 foreground/ 16 background.
Bit 0..3 are for the background/ 4..8 fore the foreground
So for example:
1001|0110 Background
0110|0101 Foreground
--------------------
1111|0011 Xor
0110|0101 Foreground
--------------------
1001|0110 Xor
I've been told that this should be the fastest way for
creating smooth animation, because the adapter does
all the work.
*}
Var VideoMem:ARRAY[0..199,0..319] OF BYTE ABSOLUTE $A000h:0000;
procedure PutXOR(x,y: integer; p: pic);
var i,t: Integer;
b: Byte;
p1: Pointer;
begin
port[$3ce]:=3; {* ... Set dataregister *}
port[$3cf]:=24; {* ... to XOR *}
for t:=0 to 19 do
for i:=0 to 19 do
begin
b:=p[i,t];
p1:=@VideoMem[y+i,x+t];
asm
les di,p1 {* ... load destination adres *}
mov al,es:[di] {* ... in al *}
mov al,b {* ... load color byte in al *}
mov [es:di],al {* ... write it to the screen *}
{*
This all works, but it's to slow,
I'm looking for something that
*}
end;
end;
end;
end;
Please could someone help me for this, or else I can't
sleep.
Cu Robin
********************************************************************
Robin Leeuwerke
Noordelijke Hogeschool Leeuwarden
The Netherlands
e-mail: R.Leeuwerke@gamma.rug.nl
*******************************************************************
Technical Details
Message-ID:
<MAILQUEUE-101.920915112738.271@gamma.rug.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!gatewayShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!gateway From: LEEUWERK@PPSW.RUG.NL Newsgroups: rec.games.programmer Subject: Xor-programming Date: 15 Sep 1992 09:00:32 -0500 Organization: UTexas Mail-to-News Gateway Lines: 82 Sender: daemon@cs.utexas.edu Message-ID: <MAILQUEUE-101.920915112738.271@gamma.rug.nl> NNTP-Posting-Host: cs.utexas.edu