[stella] Usefull illegal opcodes (part 1)

Subject: [stella] Usefull illegal opcodes (part 1)
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
Date: Fri, 23 Feb 2001 08:59:28 +0100
Hi,
yesterday, i was thinking about a faster way to decide in a kernel if you are on a sprite drawing line or not.

The best way, i knew until now, was (if y contains linecounter):
  tya                   ; 2
 (sec                   ; 2) <- this can sometimes be avoided
  sbc SpriteEnd         ; 3
  adc #SPRITEHEIGHT     ; 2
  bcx .skipDraw         ; 2 = 9-11 cycles
  ...

If you like using illegal opcodes, you can use dcp (dec,cmp) here:
  lda #SPRITEHEIGHT     ; 2
  dcp SpriteEnd         ; 5     initial value has to be adjusted
  bcx .skipDraw         ; 2 = 9
  ...

Advantages:
- state of carry flag doesn't matter anymore (may save 2 cycles)
- a remains constant, could be useful for a 2nd sprite
- you could use the content of SpriteEnd instead of y for accesing sprite data
- ???

Have fun!
Thomas
_______________________________________________________
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |


_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
IhrName@xxxxxx, 8MB Speicher, Verschluesselung - http://freemail.web.de



-
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread