mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-13 16:44:50 +02:00
#368 GBA TEX_2PX akill texturing, fix FTA/GTA unaligned VRAM write
This commit is contained in:
@@ -60,13 +60,14 @@ SP_RDX = 8
|
||||
SP_RDT = 12
|
||||
|
||||
.macro PUT_PIXELS
|
||||
#ifndef TEX_2PX
|
||||
tex indexA, t
|
||||
add t, dtdx
|
||||
|
||||
tex indexB, t
|
||||
add t, dtdx
|
||||
|
||||
// cheap non-accurate alpha test, skip pixels pair if one or both are transparent
|
||||
// cheap non-accurate alpha test, skip pixels pair if one or both are transparent
|
||||
ands indexA, #255
|
||||
andnes indexB, #255
|
||||
orrne indexB, indexA, indexB, lsl #8 // indexB = indexA | (indexB << 8)
|
||||
@@ -75,6 +76,14 @@ SP_RDT = 12
|
||||
orrne indexA, indexB, lsl #8
|
||||
strneh indexA, [tmp]
|
||||
add tmp, #2
|
||||
#else
|
||||
tex indexA, t
|
||||
add t, dtdx, lsl #1
|
||||
cmp indexA, #0
|
||||
ldrneb indexA, [LMAP, indexA]
|
||||
strneb indexA, [tmp]
|
||||
add tmp, #2
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.global rasterizeFTA_asm
|
||||
@@ -215,12 +224,11 @@ rasterizeFTA_asm:
|
||||
ldrb indexA, [TILE, indexA]
|
||||
|
||||
cmp indexA, #0
|
||||
ldrneb indexB, [tmp, #-1] // read pal index from VRAM (byte)
|
||||
ldrneb indexB, [tmp, #-1]! // read pal index from VRAM (byte)
|
||||
ldrneb indexA, [LMAP, indexA]
|
||||
orrne indexB, indexA, lsl #8
|
||||
strneh indexB, [tmp]
|
||||
|
||||
add tmp, #1
|
||||
strneh indexB, [tmp], #2
|
||||
addeq tmp, #1
|
||||
add t, dtdx
|
||||
|
||||
subs width, #1 // width--
|
||||
@@ -240,7 +248,8 @@ rasterizeFTA_asm:
|
||||
ldrneb indexA, [LMAP, indexA]
|
||||
ldrneb indexB, [tmp, width]
|
||||
orrne indexB, indexA, indexB, lsl #8
|
||||
strneh indexB, [tmp, width]
|
||||
addne indexA, tmp, width
|
||||
strneh indexB, [indexA, #-1]
|
||||
|
||||
subs width, #1 // width--
|
||||
beq .scanline_end // if (width == 0)
|
||||
|
@@ -88,13 +88,14 @@ SP_RDT = 20
|
||||
bic LMAP, g, #255
|
||||
add g, dgdx
|
||||
|
||||
#ifndef TEX_2PX
|
||||
tex indexA, t
|
||||
add t, dtdx
|
||||
|
||||
tex indexB, t
|
||||
add t, dtdx
|
||||
|
||||
// cheap non-accurate alpha test, skip pixels pair if one or both are transparent
|
||||
// cheap non-accurate alpha test, skip pixels pair if one or both are transparent
|
||||
ands indexA, #255
|
||||
andnes indexB, #255
|
||||
orrne indexB, indexA, indexB, lsl #8 // indexB = indexA | (indexB << 8)
|
||||
@@ -102,6 +103,14 @@ SP_RDT = 20
|
||||
ldrneb indexB, [LMAP, indexB, lsr #8]
|
||||
orrne indexA, indexB, lsl #8
|
||||
strneh indexA, [ptr]
|
||||
#else
|
||||
tex indexA, t
|
||||
add t, dtdx, lsl #1
|
||||
cmp indexA, #0
|
||||
ldrneb indexA, [LMAP, indexA]
|
||||
strneb indexA, [ptr]
|
||||
#endif
|
||||
|
||||
add ptr, #2
|
||||
.endm
|
||||
|
||||
@@ -270,9 +279,9 @@ rasterizeGTA_asm:
|
||||
bic LMAP, g, #255
|
||||
ldrb indexA, [LMAP, indexA]
|
||||
|
||||
ldrb indexB, [ptr, #-1] // read pal index from VRAM (byte)
|
||||
ldrb indexB, [ptr, #-1]! // read pal index from VRAM (byte)
|
||||
orr indexB, indexA, lsl #8
|
||||
strh indexB, [ptr]
|
||||
strh indexB, [ptr], #1
|
||||
|
||||
.skip_left:
|
||||
add ptr, #1
|
||||
|
@@ -121,18 +121,10 @@ transformMesh_asm:
|
||||
add y, y, #(FRAME_HEIGHT >> 1)
|
||||
|
||||
// store the result
|
||||
#if 1
|
||||
// 2+2+2+2 = 8 ticks
|
||||
strh x, [res], #2
|
||||
strh y, [res], #2
|
||||
strh z, [res], #2
|
||||
strh vg, [res], #2
|
||||
#else
|
||||
// 1+1+3 = 5 ticks SLOWER! WTF?
|
||||
orr x, x, y, lsl #16
|
||||
orr z, z, vg, lsl #16
|
||||
stmia res!, {x, z}
|
||||
#endif
|
||||
|
||||
subs count, #1
|
||||
bne .loop
|
||||
|
Reference in New Issue
Block a user