Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Otium ! (Registered 2017-07-24) You are not logged in 
CSDb User Forums


Forums > C64 Coding > Sprite position with open side border
2017-05-07 16:24
tob1as

Registered: May 2017
Posts: 2
Sprite position with open side border

Hello,

Experimenting with open sideborder and sprites and have two questions.

1. I am Not able to view sprite 0 in sideborder. It this possible at all or do you have to use sprite 1-7 in side border?

2. When setting sprite1 x position to zero, there still is a 8 pixel gap in left sideborder before sprite. Is this just how it is or it is possible to push sprite all the way to the left?
(in right border sprite can be all the way to right - ie. no pixel gap).
2017-05-07 16:28
Oswald

Registered: Apr 2002
Posts: 4053
2, set 9th bit of sprite X hi in d010, then iirc next position to the left of pos 0 is $f8.
2017-05-07 18:18
Groepaz

Registered: Dec 2001
Posts: 8110
sprite 0 shouldnt be a problem either :)
2017-05-07 19:45
JackAsser

Registered: Jun 2002
Posts: 1221
There are 63x8 = 504 x-positions on a raster line.
Sprite registers are 9-bit = 512 x-positions.

Hence there has to be a 8-pixel gap somewhere, happens to be just at the left edge of the screen.
2017-05-07 19:49
Compyx

Registered: Jan 2005
Posts: 251
Like Oswald said:

lda #$f8
sta $d000
lda #0
sta $d002
clc
adc #$18
sta $d004
adc #$18
sta $d006
adc #$18
sta $d008
adc #$18
sta $d00a
adc #$18
sta $d00c
adc #$18
sta $d00e
lda #%00000001
sta $d010


That should give all 8 sprites properly aligned. Keep in mind that sprite 0 is a bit of a bitch, you'll need a read-modify-write on $d016 to get an open border for 8 sprites, so: DEC $d016/INC $d016, ST[AXY] won't work.

People other than me can explain why more clearly than I can.
2017-05-07 20:19
tob1as

Registered: May 2017
Posts: 2
Thanx, X-position was easy :-) I had the right theori, but just didnt hit correct value. Rookie mistake :-)

Sprite 0 is supposed to take 5 cycles, but damage my open side border timing. Just cant get it to work. Works fine with the other sprites.

But have a problem with enough cycles on bad line.

So bad line is 23 cycles. First sprite displayed takes 5 cycles and then the rest should take 2 cycles each if I am correct? I dont do DEC/INC d016, but rather sta/sty d016. Saves 4 cycles. So there should be time to at least 4 sprites (I need 4 in the border). Or do I miss something?
2017-05-07 20:31
Groepaz

Registered: Dec 2001
Posts: 8110
have a look at the vic article (or perhaps try Victimer) - its not only about how many cycles are free - its also about _which_ cycles are free :)
2017-05-07 21:00
Compyx

Registered: Jan 2005
Posts: 251
Like groepaz said, it's not only the number of cycles that are free but also where the horizontal beam is, I suggest taking a look at the VIC article, and indeed using Victimer (set your terminal window very wide when using that).

For using sprites including badlines, it's best to use the 'upper' sprites ie sprites 4-7. On a badline you can then use
sta $d016,y
stx $d016


Using A = 0-7, X = 8-15 and Y = 0. OR the X and A values with 16 if using multicolor.
2017-05-08 10:13
Trash

Registered: Jan 2002
Posts: 87
Quote: There are 63x8 = 504 x-positions on a raster line.
Sprite registers are 9-bit = 512 x-positions.

Hence there has to be a 8-pixel gap somewhere, happens to be just at the left edge of the screen.


How do you bridge that gap when for example making a multiplexed sideborder scroll (like in Revolutions)
2017-05-08 11:13
JackAsser

Registered: Jun 2002
Posts: 1221
If x<0 then x-=8
X&=0x1ff
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
jbevren/DAC
TheRyk/MYD
Sphinx/Arsenic
Zyron/GeNos¤ProjecTary
comankh/agony
Style/Chrome
Alias Medron/Padua
Guests online: 61
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 The Shores of Reflec..  (9.6)
4 Coma Light 13  (9.6)
5 Lunatico  (9.6)
6 Comaland 100%  (9.5)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Daah, Those Acid Pil..  (9.5)
3 Treu Love [reu]  (9.4)
4 Dawnfall  (9.3)
5 SidRok  (9.3)
6 One-Der  (9.2)
7 Tunnel Vision  (9.2)
8 Safe VSP  (9.1)
9 Globe 2016 [reu]  (9.1)
10 Black Magic  (9.0)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.4)
3 Oxyron  (9.4)
4 Crest  (9.3)
5 Arsenic  (9.3)
Top Coders
1 Axis  (9.8)
2 Crossbow  (9.8)
3 Graham  (9.8)
4 HCL  (9.8)
5 Lft  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2017
Page generated in: 6.8 sec.