Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Negative sprite X-position ?
2009-09-26 09:26
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Negative sprite X-position ?

Hehe I kinda know it isnt doable, but still, i would ask what to do..

An expanded sprite goes to X-pos 0, and then half of it is visible on the screen.

So, when scrolling left, it suddenly disappears when it hits X-pos 0.

This looks ugly :D

If i set D010 at this point, its still not possible to give it a position, so it is hiding under the left border.

So what can i do ?


I have thought about the insane work, to, when X-pos=0, to start a left scrolling of the sprite data. This isnt very appealing to have to code.. :D

Also, dont we get the same problem if the whole sideborder is gone ? when sprite at pos 0 = it suddenly vanishes from there, because you set d010 and give it another position ?


I dont know what to do.
Ofcourse NOT using expanded sprites solves the problem, and my flying sprites can look nice.. but i WANT them expanded.


Anyone ?
2009-09-26 09:30
chatGPZ

Registered: Dec 2001
Posts: 11386
there is a "gap" in the sprite coordinates on the left side of the screen... to display a sprite further left than regular position 0, set MSB in $d010 and substract 8 extra pixels. (this is for pal, its different on ntsc)
2009-09-26 10:14
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
How is it possible to subtract 8 from 0 ?

poke d000,0
poke d010,0 = visible sprite in left

poke d000,0
poke d010,1 = visible sprites on pos $100

once on pos 0, and d010=0 - i have no way to subtract 8 from 0!!

sorry, i dont get it :D

i just tried all..
2009-09-26 10:17
chatGPZ

Registered: Dec 2001
Posts: 11386
$00 - $08 == $f8
2009-09-26 10:24
assiduous
Account closed

Registered: Jun 2007
Posts: 343
actually you should do:-

$00 - $09 == $f7
2009-09-26 10:34
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
mhhh. oh, but it needs to be 224 before the sprite is hidden away completely.

mmmm so any trick here ?

it is visible from 247 down to 225
at 224 its hidden
when d010=x1

so... scrolling left from 255, when it hits 0:
switch d010, put x to 247
do until x=224

auuu.. now i have to THINK when i code this :D


Thanks for your input!
2009-09-26 12:26
Stryyker

Registered: Dec 2001
Posts: 468
Grab the Vic Article. It has some notes about sprite positions. It is how those lovely side border scrollers managed to make it look nice on the left and the right of the screen.
2009-09-26 13:15
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
I have grab on it, but my flags to say where i am are a bit messed up :D

I take a break now, hehe.
2009-09-26 13:50
JackAsser

Registered: Jun 2002
Posts: 2014
I usually do this:

1) Have all sprite x-positions as signed 16-bit values.
2) If x<0 then x-=8.
3) If hibyte(x)!=0 then set corresponding $d010-bit else clear the corresponding $d010-bit.
4) poke lobyte(x) into the corresponding sprx-register.

This is not 100% general but covers most cases. One should really disable the sprite completly if it's outside the screen, with my method it will eventually wrap and show again if it's some 100 pixels or so outside the screen.

2009-09-27 00:52
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Jackasser: i asked how to hide an expanded sprite behind the left border, completely - and got it working with help from Groepaz.

d010=x1
d000=224 ;it is now completely hidden

so thats all.

Thanks for your input!
2009-09-27 15:40
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Jackasser: i asked how to hide an expanded sprite behind the left border, completely - and got it working with help from Groepaz.

d010=x1
d000=224 ;it is now completely hidden

so thats all.

Thanks for your input!


And I answered in a general way trying to give some hints but ok... :)

Border ends at 24. An expanded sprite is 48. To hide it you must place it at 24-48 = -24. But since -24 < 0 we must subtract by 8 => -24-8 = -32 ($e0 = 224).


 
... 9 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
iAN CooG/HVSC
t0m3000/hf^boom!^ibx
Peacemaker/CENSOR/Hi..
The Syndrom/TIA/Pret..
Alakran_64
MWR/Visdom
Mike
wil
Acidchild/Padua
Darkflight
tokra/Akronyme Analo..
Guests online: 122
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.052 sec.