English Amiga Board


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

 
 
Thread Tools
Old 03 July 2018, 17:16   #1
Yragael
Registered User

 
Join Date: Jun 2017
Location: Paris
Posts: 25
Little trouble with sprite horizontal position

Hi,



I have some trouble positioning a sprite horizontally.


The DIWSTRT of my screen is the usual $2C81, meaning that the starting X position is $81.


If (X, Y) are the sprite coordinates, and DY is the height of the sprite, should not the control words for the sprite be (! means OR in ASM-One) :


DC.W ((Y&$FF)<<8)!((X&$1FE)>>1)
DC.W (((Y+DY)&$FF)<<8)!((Y&$100)>>6)!(((Y+DY)&$100)>>7)!(X&$1)


If X = $81 and Y = $2C, this gives $2C40 and $3C01. But my sprite is displayed one pixel to the right of $81. Must have missed something...

Last edited by Yragael; 03 July 2018 at 17:37.
Yragael is offline  
AdSense AdSense  
Old 03 July 2018, 18:15   #2
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 890
Hi Yragael, nothing wrong here.

It's not documented but bitmaps are delayed by one lores pixel compared to sprites.

Last edited by ross; 03 July 2018 at 18:27. Reason: bad english :)
ross is offline  
Old 03 July 2018, 18:18   #3
Yragael
Registered User

 
Join Date: Jun 2017
Location: Paris
Posts: 25
Quote:
Originally Posted by ross View Post
Hi Yragael, nothing wrong here.

It's not documented but bitplanes are delayed by one lores pixel in sprites respect.
Thanks!
Yragael is offline  
Old 03 July 2018, 18:44   #4
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 890
my bad english...

respect is a 'false friend' in italian, something like 'par rapport à' in french (il peut aussi être utilisé avec le même sens qu'il a en anglais/français)
ross is offline  
Old 05 July 2018, 00:52   #5
DanScott
Lemon. / Core Design

DanScott's Avatar
 
Join Date: Mar 2016
Location: Belgrade, Serbia
Posts: 291
I think it's the same as copper wait / move is 1 pixel behind bitplane data too

You can see this in my 3D chess / bitmap layer zoom in The Fall (BG colour is set using copper wait for a 256 pixel wide screen)
DanScott is offline  
Old 05 July 2018, 08:10   #6
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 890
Quote:
Originally Posted by DanScott View Post
I think it's the same as copper wait / move is 1 pixel behind bitplane data too
And this is annoying because if you want to use COLOR00 as an extra color (syncing with border) you are forced to some trick...

Quote:
You can see this in my 3D chess / bitmap layer zoom in The Fall (BG colour is set using copper wait for a 256 pixel wide screen)
ross is offline  
Old 05 July 2018, 13:59   #7
Yragael
Registered User

 
Join Date: Jun 2017
Location: Paris
Posts: 25
What is the deal with bit SH0 of SPRxCTL during horizontal comparison ?

Another question related to the horizontal position of a sprite. The Hardware Reference Manual figure describing the inner workings of the DMA for the sprites shows that the horizontal position of the electron beam is compared to the horizontal value of the sprite in SPRxPOS.


Something bothers me : SPRxPOS does contain the 8 high order bits of the horizontal position of the sprite. The last low order bit lies in SPRxCTL (it's bit SH0, hence the title of my question). When is this bit taken into account ?
Yragael is offline  
Old 05 July 2018, 15:41   #8
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 890
Quote:
Originally Posted by Yragael View Post
Another question related to the horizontal position of a sprite. The Hardware Reference Manual figure describing the inner workings of the DMA for the sprites shows that the horizontal position of the electron beam is compared to the horizontal value of the sprite in SPRxPOS.


Something bothers me : SPRxPOS does contain the 8 high order bits of the horizontal position of the sprite. The last low order bit lies in SPRxCTL (it's bit SH0, hence the title of my question). When is this bit taken into account ?
If I understood the question correctly answer is simple but could imply some little quirks..
Obviously in horizontal comparison SH0 is always considered (otherwise it would not be possible to move it by a single pixel) BUT
DMA fetch is at fixed h position (see HRM) so on far left video position you can possibly display data from previous line, depending on sprite number...
ross is offline  
Old 12 July 2018, 08:21   #9
fstarred
Registered User

fstarred's Avatar
 
Join Date: Mar 2018
Location: Rome
Posts: 61
Quote:
Originally Posted by Yragael View Post
Another question related to the horizontal position of a sprite. The Hardware Reference Manual figure describing the inner workings of the DMA for the sprites shows that the horizontal position of the electron beam is compared to the horizontal value of the sprite in SPRxPOS.


Something bothers me : SPRxPOS does contain the 8 high order bits of the horizontal position of the sprite. The last low order bit lies in SPRxCTL (it's bit SH0, hence the title of my question). When is this bit taken into account ?
You could set the bit 0 to set the exact horizontal position of the sprite and avoid the pixel jump.
fstarred is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Games - Best Resolution + Horizontal & Vertical + Position DamienD support.Games 0 27 December 2015 13:28
Horizontal Sprite Position Confused!? h0ffman Coders. Asm / Hardware 3 25 February 2014 17:27
Horizontal Blanking sandruzzo Coders. General 18 17 January 2012 09:27
Unstable horizontal picture position on 1084S monitor Photon support.Hardware 5 15 April 2011 03:25
M1438S Horizontal Position ancalimon support.Hardware 11 16 December 2009 18:19

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 23:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06702 seconds with 14 queries