vbt
Staff member
I'm still playing to find speed on emulators and i find memset slow, anybody tried to write a fast memset, i only found this :
_memclrwh: ! terulet torlo: memclrwh(byte* buf, long width, long height, long step)
! step = map width - brush width
xor r2,r2
lswh_1:
mov r5,r1
lswh_2:
mov.b r2,@r4
add #1,r4
dt r1
bf lswh_2
add r7,r4
dt r6
bf lswh_1
rts
nop
i'd like to replace such thing :
memset(SpriteOnScreenMap, 255, 0x10000);
_memclrwh: ! terulet torlo: memclrwh(byte* buf, long width, long height, long step)
! step = map width - brush width
xor r2,r2
lswh_1:
mov r5,r1
lswh_2:
mov.b r2,@r4
add #1,r4
dt r1
bf lswh_2
add r7,r4
dt r6
bf lswh_1
rts
nop
i'd like to replace such thing :
memset(SpriteOnScreenMap, 255, 0x10000);