Re: A86: Sprite XOR


[Prev][Next][Index][Thread]

Re: A86: Sprite XOR



A. El-Helw wrote:

> Hello Everyone,
>
>         I am converting the famous "DuckHunt" into 86 ASM, from my
> friends 83 aSM
> version.  I did a lot, there is only one thing left - the sprites.  In
> this
> program, it used something called SPRXOR, which detected - if a sprite
> was
> on screen when you loaded coords and name, it erased it, if not, it
> put it.
>  i was wondering if someone (Dan ?  Alan?  Bill?)  can convert this
> program
> to 86 aSM , to make my life easier, as well as a lot of other peoples'
> =).
> I am attaching Movax's original 83 source code.

  It doesn't actually "DETECT" anything, the basic nature of XOR alows
that effect. notice:

AB AxorB
00   0
01   1
10   1
11   0

this is the basic idea of what you want to do...

HL = VidMem offset
DL = Pointer to Sprite

  ld a,(de) ; get byte from pic
  xor (hl) ; xor it with what's at the screen already
  ld (hl),a ; save XORed value in vid memory
--
Trent Lillehaugen
Computer Engineering Major
California Polytechnic University, San Luis Obispo
<tllilleh@polymail.calpoly.edu>



Follow-Ups: References: