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 > Unexpected linecrunch
2016-09-06 08:58
ChristopherJam

Registered: Aug 2004
Posts: 1408
Unexpected linecrunch

I'm sure in the past I've displayed full screen FLI just by writing a new value to $d011 every 23 cycles, and using some of the intervening time to update $d018 (ie, writing to $d011 on what vic artikel refers to as cycle 14).
However, if I have sprites zero to five enabled, and am only writing d011 every second line, it appears that I need to perform the first $d011 write for new char rows at least one cycle earlier, lest I get a linecrunch.

Any idea what's going on here?

(every two lines, I'm running something like this:
	lda#efy0+ 71:sta $d007
	lda#d18v0
	ldx#$38+1
	ldy#0
	sta $d018
	sty VM0+$3f8:iny
	sty VM0+$3f9:iny
	sty VM0+$3fa:iny
	sty VM0+$3fb:iny
	sty VM0+$3fc:iny
	sty VM0+$3fd:nop
	stx $d011


Also: not sure if it's relevant, but I stabilise the interrupt by forcing a DMA one and a half lines before the first such block of code is run, ie the first block is preceded by
	sta $d011 ; trigger badline just before effct starts; this one's just to stabilise
	nop:nop:nop:nop:nop:nop  ;extra nops because there's no sprite DMA at the end of the above DMA
 
... 57 posts hidden. Click here to view all posts....
 
2016-09-10 07:10
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: digger, Jackasser did horizontal twisters with this, so to change column's twist phase you only update the char pointer on top. He says tho he only used 7 line high rows doubling method.

That was my bro and he used 8 lines. I used similar tricks in my rotozoomer (Andropolis) but 7 lines because I wanted a bad line but still be on 00-39 offsets. During the 7 lines I calculate the new chars and since I know the offset always is 00-39 the inner-loop becomes much faster (Krill's idea, my implementation). That's also why the effect isn't full width, I only had time for lik 35 chars or so. As I side effect I can scroll the whole screen sideways almost for free.
2016-09-10 07:49
Oswald

Registered: Apr 2002
Posts: 5086
Jackie, you lost me big time.

"I wanted a bad line but still be on 00-39 offsets"

why do you need a bad line if it just reloads the very same offsets ?

"During the 7 lines I calculate the new chars "

7 lines is not enough to redraw 35 complete chars, but if you calc new char pointers, how if its a fixed 00-39 ?! :)
2016-09-10 08:07
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Jackie, you lost me big time.

"I wanted a bad line but still be on 00-39 offsets"

why do you need a bad line if it just reloads the very same offsets ?

"During the 7 lines I calculate the new chars "

7 lines is not enough to redraw 35 complete chars, but if you calc new char pointers, how if its a fixed 00-39 ?! :)


You can refetch the char pointers, I.e. Badline without moving forward (if u do it on < line 7). Indeed I update char pointers but always on offset 00-39
2016-09-10 08:08
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: You can refetch the char pointers, I.e. Badline without moving forward (if u do it on < line 7). Indeed I update char pointers but always on offset 00-39

It's called FLI... ;) or may be not, I dunno. :P
2016-09-10 09:41
Oswald

Registered: Apr 2002
Posts: 5086
ah I get it, awesome trick. :)
2016-09-10 17:18
ChristopherJam

Registered: Aug 2004
Posts: 1408
Quoting JackAsser
During the 7 lines I calculate the new chars and since I know the offset always is 00-39 the inner-loop becomes much faster (Krill's idea, my implementation).


I did something similar with Jam Ball 2, but for different reasons. The decruncher spits out a new set of char indices every five rasters, always to the same 15 locations. Address calculation wasn't an issue as the decruncher was completely unrolled, but this way I could put all of the screen chars in zero page. Saved 15 cycles per row, and also saved 984 bytes of RAM.

(hmm, that unrolled loop would have taken a lot more ram.. Must.. resist.. revisiting..)
2016-09-11 22:38
Cruzer

Registered: Dec 2001
Posts: 1048
Great thread! I should check the CSDB forums more often. 😊
2016-09-13 11:13
HCL

Registered: Feb 2003
Posts: 727
..back to the original topic for a moment. FLI-timing *is* strange, if you start to fiddle with it. The usual FLI (each line) somehow works well with a periodic (23 cycle) write to $d011 to trigger badline. ..but if you reduce it to every 2:nd line or every 4:th line i recall the timing doesn't work the same way. I always wondered why, and i'm sure all those charts and diagrams explain why, but i rather just hammer on until it works and then i forget it :).
2016-09-13 12:27
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: ..back to the original topic for a moment. FLI-timing *is* strange, if you start to fiddle with it. The usual FLI (each line) somehow works well with a periodic (23 cycle) write to $d011 to trigger badline. ..but if you reduce it to every 2:nd line or every 4:th line i recall the timing doesn't work the same way. I always wondered why, and i'm sure all those charts and diagrams explain why, but i rather just hammer on until it works and then i forget it :).

Same here, the pragmatic approach.
2016-09-13 12:32
Radiant

Registered: Sep 2004
Posts: 639
I like hammering until it works, then I figure out why, and then I forget everything until next time. Repeat.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - 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
Didi/Laxity
GuyGavin/HF
Guests online: 81
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 The Demo Coder  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.2)
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.044 sec.