|
Buzz
#13
12 февраля 1998 |
|
Ассемблер - Процедуры : Stretch texture engine, Texture mapping engine, Texture mapping + gourauds hading engine, Gouraudmapping engine for Z80.

▓▓░ ▓▓▓▓▓▓▓▓▓▓▓▓▓ ░▓▓
▓▓▓▓░ ▓▓░ ░▓▓ ░▓▓
▓▓░ ▓▓░ ▓▓▓▓▓▓▓▓▓ ░▓▓ ░▓▓▓▓
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▓▓░ ▓▓░ ░▓▓ ░▓▓ ░▓▓ ░▓▓ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▓▓▓▓▓▓░ ▓▓░ ░▓▓ ░▓▓▓▓▓▓ ░▓▓ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▓▓░ ░▓▓ ░▓▓ ░▓▓ ░▓▓ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▓▓░ ▓▓░▓▓ ░▓▓ ░▓▓ ░▓▓
▓▓░ RULEZ! ▓▓▓ ░▓▓ ░▓▓ ░▓▓
Мы продолжаем печатать ultra faaaaast алгоритмы by Exploder/
MegaCode/Extreme.
+------------------------------------------------------------+
| - Stretch texture engine for Z80 CPU - |
| - last n'joyment date: 11-JUL-97 - |
+------------------------------------------------------------+
And now...
Ultra faaaaast stretch texture algorythm
ver_1:
POP HL ; Read XY shifts
ADD HL,BC ; Increase YX pos in texture
LD A,(HL) ; Read texel from texture
LD (DE),A ; Write texel to chunky buffer
INC E ;
About 39 takts of CPU power
Really needed:
SP = Pointer to shifts-tab
BC = YX-increase
DE = Pointer to destination chunky buffer
ver_2:
LD HL,#0000 ; XY shifts data
ADD HL,BC ; Increase YX pos in texture
LD D,(HL) ; Read texel from texture
LD HL,#0000 ; XY shifts data
ADD HL,BC ; Increase YX pos in texture
LD E,(HL) ; Read texel from texture
PUSH DE ; Write 2texels to chunky buffer
About 67 takts of CPU power
Really needed:
BC = YX-increase
SP = Pointer to destination chunky buffer
ver_3: with light map mix
POP HL ; Read XY shifts
ADD HL,BC ; Increase YX pos in texture
LD L,(HL) ; Read texel from texture
LD H,(IX+#00) ; Read light tab pointer
LD (DE),A ; Write texel to chunky buffer
INC E ;
About 58 takts of CPU power
Really needed:
SP = Pointer to shifts-tab
BC = YX-increase
DE = Pointer to destination chunky buffer
IX = Pointer to light tab
ver_4: with light map mix
LD HL,#0000 ; XY shifts data
ADD HL,BC ; Increase YX pos in texture
LD L,(HL) ; Read texel from texture
LD H,#00 ; Light pointer data
LD D,(HL) ; Read mixed texel
LD HL,#0000 ; XY shifts data
ADD HL,BC ; Increase YX pos in texture
LD L,(HL) ; Read texel from texture
LD H,#00 ; Light pointer data
LD E,(HL) ; Read mixed texel
PUSH DE ; Write 2texels to chunky buffer
About 93 takts of CPU power
Really needed:
BC = YX-increase
SP = Pointer to destination chunky buffer
Is the fastest stretch texture code for Z80. Nothing else.
+------------------------------------------------------------+
| - Texturemapping engine for Z80 CPU - |
| - last n'joyment date: 25-NOV-97 - |
+------------------------------------------------------------+
And now...
Ultra faaaaast texturemapped algorythm
LD A,H ;
ADD HL,BC ; Increase Y-pos in texture
EXX ;
LD D,A ; Set Y-pos
LD E,H ; Set X-pos
LD A,(DE) ; Get texel from texture
ADD HL,BC ; Increase X-pos in texture
EXX ;
LD (DE),A ; Write texel to chunky buffer
INC E ;
About 60 takts of CPU power
Really needed:
HL = Y-position on texture
BC = Y-increase
DE = Pointer to destination chunky buffer
HL'= X-position on texture
BC'= X-increase
Is the fastest texturemapping code for Z80. Nothing else.
+------------------------------------------------------------+
| - Texturemapping + gouraudshading engine for Z80 CPU - |
| - last n'joyment date: 06-DEC-97 - |
+------------------------------------------------------------+
And now...
Ultra faaaaast tmap+gouraudshading algorythm
LD A,H ;
ADD HL,BC ; Increase Y-pos in texture
EXX ;
LD D,A ; Set Y-pos
LD E,H ; Set X-pos
LD A,(DE) ; Get texel from texture
LD HL,BC ; Increase X-pos in texture
LD E,A ;
LD D,(IX+#00) ; Get shading pointer
LD A,(DE) ; Get shaded texel
EXX ;
ADD IX,DE ; Increase shading-table pointer
LD (IY+#00),A ; Write shaded texel to buffer
About 113 takts of CPU power
Really needed:
HL = Y-position on texture
BC = Y-increase
IX = Pointer to shading-table
DE = Shading-increase
HL'= X-position on texture
BC'= X-increase
IY = Pointer to destination chunky buffer
Is the fastest tmap+gouraudshading code for Z80. Nothing else.
+------------------------------------------------------------+
| - Gouraudmapping engine for Z80 CPU - |
| - last n'joyment date: 05-DEC-97 - |
+------------------------------------------------------------+
And now...
Ultra faaaaast gouraudmapping algorythm
ver_1: extra fast
LDI ; Write shaded pixel to buffer
ADD HL,BC ; Increase shading-table pointer
About 27 takts of CPU power
ver_2: full correctly
LD A,(HL) ; Read data from shading-table
LD (DE),A ; Write shaded pixel to buffer
INC E
ADD HL,BC ; Increase shading-table pointer
About 29 takts of CPU power
Really needed:
HL = Pointer to shading-table
BC = Shading-increase
DE = Pointer to destination chunky buffer
Is the fastest gouraudmapping code for Z80. Nothing else.
+----------------------------------------*Exploder/Extreme*--+
| - exploder_xtm@usa.net - - +7 (0922) 29-04-25 - |
+-------------------------------------------<ZX128,A1200>----+
Другие статьи номера:
Похожие статьи:
В этот день... 1 января
SibNews #08,
Woot! #01,
Spectrum Magazine #01,
ACNews #25,
Psychoz #14,
ACNews #14,
Last 128 #08,
Last 128 #06,
Last 128 #05,
Last 128 #04,
Last 128 #03,
Last 128 #02,
Last 128 #09,
Last 128 #3.5,
Last 128 #8.025,
Sinclair Club #05,
Last 128 #M!R 01,
Fantadrom #01,
Buzz #20,
Last 128 #01,
DonNews #13,
Nicron #120,
Promised Land #01,
Inferno #01,
Marazm #25,
Ultimathum #01,
Marazm #21,
Hooy Mag #02,
KrNews #11,
Marazm #22,
Marazm #23,
ZX Football 2000 #01,
Codemania #01,
Always #03,
Bugs #02,
IzhNews #08,
Virtual Worlds #01,
Listok #04,
Scenergy #02,
Flash Info #18,
Marazm #16,
Marazm #17,
Zed #01,
Balagan #02,
ZX Format #08,
ZX Power #03,
Shock #01,
Impulse #02,
Deja Vu #03,
ZX Club #08,
ZX Club #06,
Numberology #01,
Marazm #13,
Marazm #12,
Marazm #14,
Gorodok #02,
Zodiac #01,
Marazm #15,
Deja Vu #07,
Marazm #11,
Deja Vu #07,
Playboy #03,
Crazy News #2,
Crazy News #4,
ZX Light #01,
Crazy News #5,
Playboy #02,
ZX News #03,
ZX Review #1-2,
Read Me #02,
Crazy News #3,
Nicron #13,
Read Me #01,
Public Spirit #01,
Faultless #06,
Faultless #05,
ZX Software #01,
Stump #04,
Speccy #07,
Возраждение #0,
Speccy #03,
On-Line #17,
Scene+ #01,
Welcome Press #01,
ZX Konig #04,
Adventurer #01,
Faultless #05,
Faultless #04,
Di Halt #01,
Faultless #01,
Playboy #01,
Crazy News #1,
Faultless #03,
Pioneer #03,
Sinclair Town #02,
ZX Magazine #01,
Eldorado #01,
ZX Magazine #02,
Spectron #01,
ZX News #01,
ZX Konig #02,
200 #W,
Welcome Press #00,
Dune #07,
Subliminal Extacy #01,
Subliminal Extacy #02,
ZX Konig #01,
Subliminal Extacy #00,
Muchomor #01,
Spectrofon #01,
ZX Revija #02,
Outlet #01,
Outlet #1-3