|
|
Atari coding BBS
Re: 5-bit C2P? |
Posted by: Kalms
|
Jan,12.2006-23:18
|
Here's an innerloop for you;
it converts 16 bytes (in d0-d3) while writing out the results from the previous conversion (a4-a6). If you run on 060, unroll it like Mikro's version and you should be fine. Otherwise just use the inner as-is (with an extra setup iteration where you don't write to memory).
It's not extensively tested, not much of warranties given etc, and let's hope the BBS software won't mangle the code to a melange...
moveq #14,d4
.pix16:
move.l (a0)+,d0
move.l (a0)+,d1
move.l (a0)+,d2
move.l (a0)+,d3
; ------a4a3a2a1a0 ------b4b3b2b1b0 ------c4c3c2c1c0 ------d4d3d2d1d0
; ------e4e3e2e1e0 ------f4f3f2f1f0 ------g4g3g2g1g0 ------h4h3h2h1h0
; ------i4i3i2i1i0 ------j4j3j2j1j0 ------k4k3k2k1k0 ------l4l3l2l1l0
; ------m4m3m2m1m0 ------n4n3n2n1n0 ------o4o3o2o1o0 ------p4p3p2p1p0
move.l a4,(a1)+
move.l d1,d6
move.l d3,d7
lsr.l #4,d6
lsr.l #4,d7
eor.l d0,d6
eor.l d2,d7
and.l #$0f0f0f0f,d6
and.l #$0f0f0f0f,d7
eor.l d6,d0
eor.l d7,d2
lsl.l #4,d6
lsl.l #4,d7
eor.l d6,d1
eor.l d7,d3
; ------a4------e4 ------b4------f4 ------c4------g4 ------d4------h4
; a3a2a1a0e3e2e1e0 b3b2b1b0f3f2f1f0 c3c2c1c0g3g2g1g0 d3d2d1d0h3h2h1h0
; ------i4------m4 ------j4------n4 ------k4------o4 ------l4------p4
; i3i2i1i0m3m2m1m0 j3j2j1j0n3n2n1n0 k3k2k1k0o3o2o1o0 l3l2l1l0p3p2p1p0
move.l d3,d5
move.l d0,d6
lsr.l #8,d5
move.l d2,d7
eor.l d1,d5
lsr.l d4,d0
move.l a5,(a1)+
and.l #$00ff00ff,d5
lsr.l d4,d2
eor.l d5,d1
or.w d6,d0
lsl.l #8,d5
or.w d7,d2
eor.l d5,d3
; ---------------- ---------------- --a4--c4--e4--g4 --b4--d4--f4--h4
; a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0
; ---------------- ---------------- --i4--k4--m4--o4 --j4--l4--n4--p4
; b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0
move.b d0,d6
move.l d3,d7
lsl.w #8,d6
lsr.l #1,d7
move.b d2,d6
eor.l d1,d7
lsr.w #8,d2
and.l #$55555555,d7
move.b d2,d0
eor.l d7,d1
add.w d0,d0
add.l d7,d7
or.w d6,d0
eor.l d7,d3
move.w a6,(a1)+
addq.l #6,a1
; ---------------- ---------------- a4b4c4d4e4f4g4h4 i4j4k4l4m4n4o4p4
; a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1
; ---------------- ---------------- ---------------- ----------------
; a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
move.w d3,d7
move.w d1,d3
swap d3
move.w d3,d1
move.w d7,d3
; ---------------- ---------------- a4b4c4d4e4f4g4h4 i4j4k4l4m4n4o4p4
; a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0
; ---------------- ---------------- ---------------- ----------------
; c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
move.l d3,d7
lsr.l #2,d7
eor.l d1,d7
and.l #$33333333,d7
eor.l d7,d1
lsl.l #2,d7
eor.l d7,d3
; ---------------- ---------------- a4b4c4d4e4f4g4h4 i4j4k4l4m4n4o4p4
; a3b3c3d3e3f3g3h3 i3j3k3l3m3n3o3p3 a2b2c2d2e2f2g2h2 i2j2k2l2m2n2o2p2
; ---------------- ---------------- ---------------- ----------------
; a1b1c1d1e1f1g1h1 i1j1k1l1m1n1o1p1 a0b0c0d0e0f0g0h0 i0j0k0l0m0n0o0p0
swap d1
swap d3
move.w d0,a6
move.l d1,a5
move.l d3,a4
cmp.l a0,a2
bne .pix16
|
[All messages in this thread] [Start new thread]
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.
|
|
|