- Messages
- 27
mmmmmmmmmmm isnt this https://cdn.discordapp.com/attachments/702598107220672652/996493936665309275/asmcyclecount.html accurate ? cuz it told me the adding was 20 cycles .... or there is this method Do this in the object load i did this in obj37 ring loss which is the object that slows down any sonic game on the md honestlySorry to break it to you, but no, it's not.
Code:movem.w obVelX(a0),d0/d2 ; 24 (16+(4*2)) lsl.l #8,d0 ; 24 (8+(2*8)) add.l d0,obX(a0) ; 24 lsl.l #8,d2 ; 24 (8+(2*8)) add.l d2,obY(a0) ; 24 ; Total: 120
Code:lea x_vel(a0),a5 ; 8 move.l (a5),d0 ; 12 move.w d0,d1 ; 4 swap d0 ; 4 ext.l d1 ; 4 asl.l #$8,d1 ; 24 (8+(2*8)) add.l d1,-(a5) ; 22 ext.l d0 ; 4 asl.l #$8,d0 ; 24 (8+(2*8)) add.l d0,-(a5) ; 22 ; Total: 128
"add.l dN,-(aN)" is 22 cycles, not 20, according to this and this. Even if it was 20, it'd total to 124 still. Honestly, the only way I see it being made any faster is to convert the velocity variables into 16.16 point instead of 8.8, so you can just do this:
Code:movem.l obVelX(a0),d0/d2 ; 32 (16+(8*2)) add.l d0,obX(a0) ; 24 add.l d2,obY(a0) ; 24 ; Total: 80
Code:
ext.l d2
ext.l d3
asl.l #$8,d2
asl.l #$8,d3
move.l d2,x_vel(a1)
move.l d3,ObRingsYVel(a1)
Code:
move.l x_vel(a0),d0
add.l d0,x_pos(a0)
move.l ObRingsYVel(a0),d0
add.l d0,y_pos(a0)
Last edited: