English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 10 August 2016, 16:33   #41
buzzybee
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 ...
buzzybee is online now  
Old 12 August 2016, 00:27   #42
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
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.
Mrs Beanbag is offline  
Old 17 August 2016, 20:38   #43
Photon
Moderator
 
Photon's Avatar
 
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
Photon is offline  
Old 03 June 2018, 22:45   #44
highpuff
Registered User
 
highpuff's Avatar
 
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
Thanks for a very interesting thread!

Last edited by highpuff; 06 June 2018 at 14:16. Reason: Code snippet updated to working version
highpuff is offline  
Old 06 June 2018, 14:54   #45
Photon
Moderator
 
Photon's Avatar
 
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.
Photon is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13519 seconds with 15 queries