10 August 2016, 16:33 | #41 |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
|
Thanks for sharing the conversion code. Will be adapting it for my next project after RESHOOT ... it is already in and working, to be exact ...
|
12 August 2016, 00:27 | #42 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
on the subject of sorting, i prefer insertion sort to bubble sort, it is almost as simple and seems faster. Practical quicksort implementations generally switch to insertion sort when the range is small enough.
|
17 August 2016, 20:38 | #43 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Forgot about this & had a go, fastest solution is 46 cycles with cheeky preshifted height+attach bit in d2, add a move to keep it constant. d0-d2 in, d1-d2 out.
Code:
rol.w #8,d1 add.w d1,d2 addx.b d2,d2 lsr.w #1,d0 move.b d0,d1 addx.b d2,d2 |
03 June 2018, 22:45 | #44 |
Registered User
Join Date: Jan 2014
Location: Göteborg
Posts: 43
|
Seems like the code snippet contains a bug. For example if d1 < 255 (Sprite height) and d2 = 16, the #8 bit of the height will not be set in SPRxCTL.
Made some changes, but sadly also added 4 cycles. Ed. Which I also found a bug in Snippet updated and tested Code:
rol.w #8,d1 add.w d1,d2 addx.b d2,d2 or.b d1,d2 lsr.w #1,d0 addx.b d2,d2 move.b d0,d1 Last edited by highpuff; 06 June 2018 at 14:16. Reason: Code snippet updated to working version |
06 June 2018, 14:54 | #45 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Yep, found the same OR instruction. This "conditional bit copy" is necessary for ystart>=256.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Translating sprite coordinates to playfield coordinates | nandius_c | Coders. Asm / Hardware | 15 | 31 July 2014 23:17 |
32 and 64 bit sprite control words question | FrenchShark | Coders. General | 8 | 10 January 2008 02:32 |
Cpu problems...in other words, BRAIN | oldpx | support.Hardware | 2 | 24 March 2003 22:01 |
Swear words | Kodoichi | project.EAB | 19 | 14 December 2001 00:53 |
|
|