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 > Changing definitions of 8 sprites on badlines
2016-06-04 10:51
Fresh

Registered: Jan 2005
Posts: 101
Changing definitions of 8 sprites on badlines

This is based on something I've been talking about on http://csdb.dk/forums/?roomid=11&topicid=117493, I didn't want to flood that thread with stuff that wasn't strictly related to Rudi's question.
I've written a simple test program to show that a STx is enough to change charpage (and so sprite defs) after preceeding sprite DMA and before badline DMA: https://www.dropbox.com/s/llnjj9vfwtiifmt/sprtest.zip?dl=0
The program starts with the correct values but you can use your joy on port 2 to do the following:
- move the cycle with left/right
- change the affected i/o port ($d016/$18/$20/$21) with up/down

Edit: source to be assembled with kickass
2016-06-04 13:52
Oswald

Registered: Apr 2002
Posts: 5017
give binary too :) do you also have 8 sprites before and after STx ?
2016-06-04 14:18
Fresh

Registered: Jan 2005
Posts: 101
The attached file contains both the source and the binary.
Yes, I'm dealing with the second line of the 8 sprites.
2016-06-04 14:30
Oswald

Registered: Apr 2002
Posts: 5017
the line where the sprite shape changes is 1 line after the badline, so it either doesnt works, or I dont understand how this demonstrates that it does.
2016-06-04 14:47
Fresh

Registered: Jan 2005
Posts: 101
The sprites are displayed one line after their definitions are read so here the problem is changing line 2 (the one following BL) without affecting line 1.
It works like this:
ldx #newvalue
ldy #oldvalue
1: stx $d018   ; first 2 (R,R) cycles
=> fetch line 1 of sprites
1: stx $d018   ; last 2 (R,W) cycles
=> char DMA (Badline)
=> fetch line 2 of sprites
2: sty $d018   ; recover original defs

If instruction 1 is too early the change will affect both line 1 and 2; if instruction 1 is too late it won't affect any of them.
Changing line 1 or 3 is trivial, you don't even need a stable raster routine.
2016-06-04 15:08
Oswald

Registered: Apr 2002
Posts: 5017
Thanks, I get it now. I wonder why couldnt I do it back then.
2016-06-05 18:59
Smasher

Registered: Feb 2003
Posts: 512
very interesting. thanks!
2016-06-06 14:59
DKT

Registered: Aug 2004
Posts: 96
I've made a walk-around in Forever Lost for this problem. "Forever Lost" logo in intro is using 8 sprites in a row. There is hires scrolling background.
I was rewriting sprite content during sprite display.
I was copying last pixel row of next sprites row to the previous sprites row already displayed and was changing $d018 one line before bad line. I was displaying new sprite definitions (in last line) but it was still the old sprite.
It's not a clean solution and would be horrible for multiplexer but for a stable graphic just worked :).
2016-06-06 15:28
Fresh

Registered: Jan 2005
Posts: 101
That's basically what Groepaz called the "Overlapping data trick" in Rudi's thread.
Yes, it may be considered a bit less cleaner, but it's often a faster and safer solution in many situations.
2016-06-06 21:04
chatGPZ

Registered: Dec 2001
Posts: 11114
for a lot of situations its the perfect solution actually :)
2016-06-07 18:53
Frantic

Registered: Mar 2003
Posts: 1627
A short little codebase article on this, anyone?

http://codebase64.org/
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
CA$H/TRiAD
www.gb64.com
Andy/AEG
Grue/Extend
Rare Candy
Airwolf/F4CG
Arcane/Glance
Didi/Laxity
Apollyon/ALD
Guests online: 109
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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