﻿ [Axiom] Aiming Utility
22 May, 2013, 07:29:12
 OmnomIRC You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

 Pages: [1]   Go Down
 Author Topic: [Axiom] Aiming Utility -  (Read 1184 times) 0 Members and 1 Guest are viewing this topic.
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)

Offline

Gender:
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022

Total Post Ratings: +1019

 « on: 28 November, 2011, 23:39:15 » +1

Yeah, mine is lossy, but its very compact and tiny.  The most I have seen it off is by 4 binary degrees but on average its usually less than 3.  It is exact every 45 degrees.  This is the routine I'm using:

 123456789101112131415161718192021222324252627282930313233 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:

The arguments are currently backwards; (X,Y) instead of the traditional (Y,X).  I'm not sure which one I'm going to use yet.
 « Last Edit: 28 November, 2011, 23:40:07 by Quigibo » Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
 Pages: [1]   Go Up