View Single Post
Old 31 May 2021, 12:03   #11
buzzybee
Registered User
 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
Quote:
Originally Posted by ross View Post
I have serious doubts this will work
Just try it for positive y values greater than positive x values and you will have problems ..

---

For a bare 68k I would have no doubts and would simply do:
Code:
    move.w  objectListAcc+2(a2),d7
    sub.w   viewPosition+vPyAccConvertWorldToView(pc),d7
    bpl.b   .1
    neg.w   d7
.1  move.w  objectListAcc(a2),d4
    bpl.b   .2
    neg.w   d4
.2  cmp.w   d7,d4
    shi d6
For 020+ you could try:
Code:
    move.l  objectListAcc(a2),d7
    move.l  d7,d4
    swap    d4
    sub.w   viewPosition+vPyAccConvertWorldToView(pc),d7
    bpl.b   .1
    neg.w   d7
.1  tst.w   d4
    bpl.b   .2
    neg.w   d4
.2  cmp.w   d7,d4
    shi d6
Game will run on 68020+, as AGA is the target platform. But code will not run in a cached loop as it is too big. Therefore: Could this really be faster, with all these branches? A solution with no branching certainly looks more elegant to me ...
buzzybee is offline  
 
Page generated in 0.06015 seconds with 11 queries