Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
Re: Mapping question
Posted by: Patrice Mandin May,13.2014-21:44 

My fave is using roll and lsrw (specially since I needed variable texture size, for a single routine), shamelessly stolen from amiga doom originally:

;D0: U and V texture coordinates, packed in a 32bits value:
; UUuuVVvv
;D1: temp value
;D2: number of bits for V coordinate
;D3: number of bits for U coordinate
;D4: number of pixels to draw
;D5: DU and DV texture increments, like D0: DUduDVdv
;D6: texture pixel
;A0: texture data (1 BYTE per pixel)
;A1: palette data (1 LONG per color index, because it stores
; up to 32bits color value)
;A2: screen

loop:
move.l D0,D1 ; D1 = UUuuVVvv
lsr.w D2,D1 ; D1 = UUuu00VV
rol.l D3,D1 ; D1 = uu00VVUU
move.b (A0,D1.W),D6 ; read pixel from texture
move.b 3(A1,D6.W*4),D1 ; read color from palette
move.b D1,(A2)+ ; write pixel to screen
add.l D5,D0 ; increment texture coordinate

subq.l #1,D4
bpl.s loop

More about it on my site:
http://pmandin.atari.org/dotclear/index.php?2013/11/27/287-optimizing-for-68060-cpu







[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
Mapping question Laurent / Thadoss May,08.2014-16:22
  Re: Mapping question dml May,08.2014-19:04
    Re: Mapping question Laurent / Thadoss May,08.2014-20:39
      Re: Mapping question dml May,09.2014-00:27
    Re: Mapping question Laurent / Thadoss May,08.2014-22:24
      Re: Mapping question Defjam May,12.2014-16:57
        Re: Mapping question dml May,13.2014-10:41
          Re: Mapping question p01 Jan,06.2015-00:01
            Re: Mapping question evil Jan,06.2015-18:36
              Re: Mapping question Laurent / Thadoss Jan,06.2015-21:58
                Re: Mapping question p01 Jan,06.2015-23:17
              Re: Mapping question p01 Jan,09.2015-13:46
                Re: Mapping question Orion_ Jan,09.2015-17:15
            Re: Mapping question Cyg Jan,09.2015-23:34
    Re: Mapping question Patrice Mandin May,13.2014-21:44
      Re: Mapping question Laurent / Thadoss May,14.2014-22:08


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson