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 > FPP - flexible pixel position
2003-02-04 15:39
Dr. Jay
Account closed

Registered: Jan 2003
Posts: 32
FPP - flexible pixel position

Anyone have a commented source example?
 
... 27 posts hidden. Click here to view all posts....
 
2017-10-09 19:40
xIII

Registered: Nov 2008
Posts: 210
I've been trying to do a FPP routine and I came across this topic which should give an answer to my questions but I still don't fully understand FPP. I also looked at codebase64 and I disassembled some FPP routines but I still need some advice.

lda d018_values,x
sta $d018
nop
nop
inx
lda #$1b
sta $d011


First of all, why 20 cycles between each $d011. I would think: badline is 23 cycles ?

example: I want to use charsets at $4000, $4800, $5000, $5800, $6000, $6800, $7000 and $7800.

1. spreading of the charset: 1st line of the original chars in 1ste byte of $4000, 2nd line in 1st byte of $4800, and so on ... correct?

2. Where and how should I spread the screen data, I don't understand this part :(.
If the values for d018 are 0-2-4-6-8-a-c and e the screendata should be located at $4000 ?
But there's a charset @$4000.

Thanks for clearing this up for me :)
2017-10-09 21:07
Oswald

Registered: Apr 2002
Posts: 5017
not sure why 20 cycles probably its how the VIC takes over the bus from the 6510. it needs 0-3 cycles to do that. CPU will be halted if it wants to write the bus, after VIC signaled it wants the cpu to stop, in your case it looks like VIC needs all that 3 cycles to stop the cpu.

1. correct
2. screen 0 first row will show your gfx first row, screen 1 first row will show your gfx second row, etc. similar to charset. charset should work around those 40 bytes. each screen only uses its first row.

why is all this? because FPP stretches 1 line endlessly. to change how the gfx looks you can change d018. but it always shows first pixel row of chars and first char row of screen. so this is why gfx is arranged like it is.
2017-10-09 21:45
chatGPZ

Registered: Dec 2001
Posts: 11116
you write d011 to trigger a badline *before* the counter to the videodata incremented, which results in the stretching.
2017-10-09 21:48
Cruzer

Registered: Dec 2001
Posts: 1048
Don't use the first 5 chars of each charset. That way you'll get 5 * 8 = 40 bytes for the screen row. Also only use every 2nd screen. This way you'll avoid also having to skip 5 chars in the middle of a charset. And you only need 6 screens if you don't use charpacked gfx.

So set up the first screen (4000-4027) with the values 05-2c, the next screen (4800-4827) with 2d-54, and so on. That way you can choose char row with the left nybble of d018, and charset with the right.
2017-10-09 21:57
Krill

Registered: Apr 2002
Posts: 2845
Allow me to clarify a few things.

Technically, the CPU isn't halted. Rather, it's kindly asked to please stop what it's doing asap and then wait. This is done by pulling its RDY line to ground, which is connected to VIC's BA (supposedly, "bus access") line. The CPU only observes this signal if it's reading from the bus, it ignores it on write access. However, it never writes to the bus for more than 3 consecutive cycles (when pushing PC and flags onto the stack on interrupt).

Now, in the example, a badline DMA is triggered by writing to $d011 such that its 3 LSBs match $d018's 3 LSBs - the badline condition. This is triggered right after the "sta $d011" is executed. It is possible to squeeze more cycles into the badline using RMW instructions (inc, dec, shift and rotate) for the $d011 write, as an RMW instruction ends in 2 write cycles. But it should also be possible to have at least one more than 20 cycles in such an FPP badline without that, by simply using more cycles. (Haven't tested it.)

2. The FPP screen is 40 chars wide. While this eats away 5 of the 256 characters in one of the 8 charsets, only 40 of the remaining 251 are used anyways. That is, the screen may reside at $4000..$4027, but the characters in the charsets at $4000, $4800, etc. are only at $x028..$x167.
Also note that there are many different FPP techniques, some using badlines, some using sprites, others without sprites nor badline usage.
2017-10-09 22:01
chatGPZ

Registered: Dec 2001
Posts: 11116
Quote:
a badline DMA is triggered by writing to $d011 such that its 3 LSBs match $d018's 3 LSBs

ooops :)
2017-10-09 22:02
Krill

Registered: Apr 2002
Posts: 2845
Yes, and you posted before i could edit to fix it. "Thanks".
2017-10-09 22:11
chatGPZ

Registered: Dec 2001
Posts: 11116
you're welcome =D
2017-10-10 07:01
ChristopherJam

Registered: Aug 2004
Posts: 1378
"Helping"
2017-10-10 07:19
Oswald

Registered: Apr 2002
Posts: 5017
my bad so its reading and all that :)

"Also only use every 2nd screen. This way you'll avoid also having to skip 5 chars in the middle of a charset. And you only need 6 screens if you don't use charpacked gfx."

I dont get this, why halve the nr of possible rows when it fits into the charset anyway? why only 6 screen ? thats 6 rows max ?
Previous - 1 | 2 | 3 | 4 - 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
St0rmfr0nt/Quantum
LMan
visionvortex
cba
neoman/titan
pcollins/Quantum
JackAsser/Booze Design
JEZ
Guests online: 111
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 Memento Mori  (9.6)
10 Bromance  (9.5)
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 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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