0 Members and 2 Guests are viewing this topic.
so with this, we can have that crazy shitload of bullets like CaDan in Axe? Perfect.
So this takes in X,Y,deltaX and deltaY?How does it handle inflation...I'm supposing the coder has to inflate it theirself. *256?
So basically this is the function better known as "atan2". That's cool! I added this recently for the next version of axe.
p_ArcTan: .db __ArcTanEnd-1-$ ex de,hl ;de = y pop hl ex (sp),hl ;hl = x push hl ld a,h ;\ xor d ; |Get pairity rla ;/ jr c,__ArcTanSS ;\ add hl,de ; | add hl,de ; |__ArcTanSS: ; | or a ; |hl = x +- y sbc hl,de ;/ ex de,hl ;de = x +- y ld b,6 ;\__ArcTan64: ; | add hl,hl ; |hl = 64y djnz __ArcTan64 ;/ call $3F00+sub_SDiv ;hl = 64y/(x +- y) pop af ;\ rla ; |Right side, fine ret nc ;/ sbc a,a ;\ sub h ; |Reverse sign extend ld h,a ;/ ld a,l ;\ add a,128 ; |Add or sub 128 ld l,a ;/ ret__ArcTanEnd: