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


Forums > C64 Coding > 4x4 FLI
2003-07-04 12:07
tecM0

Registered: Jan 2002
Posts: 40
4x4 FLI

hi,

i never used that (overused?) 4x4_effect by myself.
i think itb looks really cool with dithered chars.
the "fractal_vector_part" in MATHEMATICA uses
something like that, or?

how does this 4x4_FLI_FX work? as i sayd..i never
used FLI...and really hates timing.

but it could be a very short routine within a kind
of loop.

if i set a IRQ to the 1st line of the FLI...set the
screen and then set the IRQ to the next line of FLI
(4 pixellines down?) ....do this work? and how?

i never can find a demo_source around the net and
all demos i have "monitored" use speedcode(generators).

does a routine like the one i explained exist and does
it work like this at all?

thanx for help,
tecM0
2003-07-04 13:24
White Flame

Registered: Sep 2002
Posts: 136
For 4x4 FLI, there needs to be a "bad line" every 4 lines in order for this effect to work. Since the VIC automatically makes one every 8 lines if left alone, you could actually only set an IRQ every 8 lines, interleaved between the normal VIC bad lines. Read this for how to instigate bad lines, and basically everything else about the VIC-II itself: http://www.funet.fi/pub/cbm/documents/chipdata/VIC-Article.gz

I'm guessing that these modes use hi-res bitmap mode, with every byte set to %00001111 (or %11110000) so that one nybble of "screen ram" sets the left color of the pixel, and the other sets the right color. Again, it's just a guess. Every 4 lines, the VIC re-reads the 40 bytes for color info, and you get 4x4 pixels, each with an independent color from all 16.
2003-07-04 13:38
White Flame

Registered: Sep 2002
Posts: 136
oh, btw, those dithered ones usually use only 4 colors. How I would accomplish that would be to use multi-color char mode, and draw 16 levels of fade between them. Set up your font so that the left side & right side have all 16, giving the full 256 chars. From there out, use the exact same technique, using FLI to refresh the screen ram every 4 lines, and you get 80x50 res with 16 shades (using 4 colors) per pixel.
2003-07-04 14:52
Spinball

Registered: Sep 2002
Posts: 88
ftp://ftp.elysium.pl/gnu-generation/Brush/raster.zip

this file contains a 4x4 fli and a normal fli-source as well. but they are not commented at all :(
2003-07-05 00:13
fade
Account closed

Registered: Mar 2002
Posts: 290
i think there is also some documentation and source from the aussie mag by nitros, but i forget the name because it is too fucken early for my brain :)
2003-07-05 01:22
Stryyker

Registered: Dec 2001
Posts: 468
Emphatic is the diskmag. 4x4 mode is often done wiht multicolour mode to hide the 3 char bug along the left.

As for the source provided by Brush or someone not being commented, why would a coder need comments for something that is so simple? It is easy to see what is happening. It is nice of Brush to provide sources and anyone serious about using/reading it should do some homework to understand it, not read comments and not have much of an understanding how it really works.
2003-07-05 09:58
Spinball

Registered: Sep 2002
Posts: 88
stryyker: of course it´s great that brush released those sources, but i think it´s not that easy to understand such stuff if one doesn´t know to much about timing relevant vic coding. but i agree that one should learn the basics first, instead of just using such a routine. (like so many pc-people do, with there ready to use libraries for just everything)

for all who can read german there is some great tutorial about vic-stuff. it´s written by mr cursor was published by magic-disk from 11.1993-03.1995. (http://www.c64-mags.de/files.php?cat=20)

2003-07-06 18:34
St0fF

Registered: Oct 2002
Posts: 40
4x4d-fli ...
Basics:
you have one MC charset, 4 Colors.
each letter is filled with two half pixels of according darkness
so: char#0F will look like this:
+----|----+ the left is completely bright, =0
|OOOO| | the right is completely dark. =f
|OOOO| |
|OOOO| |
|OOOO| |
|OOOO| |
|OOOO| |
|OOOO| |
|OOOO| |
+----|----+
we have two screens. one for the even lines, one for odd lines. 1st Irq sets appropriate text mode for 1st screen.
2nd irq happens 3 lines after the first badline, and repeats every 8th line until end_of_display
2nd irq does: wait for appropriate point in the next rasterline to set the badline- and screen- states, then resets screen state (note: this reset occurs in the next regular badline, but you can issue it directly!)
end_of_display ... play music, whatever, reset irq state and continue with 1st Irq.

4x4d-ifli ...
you have two MC Charsets, 4 Colors.
in the 1st irq you just switch the charsets every frame -> gives a smoother picture using $800 bytes more.

This should explain the available routines a little ;)
2003-07-07 10:08
Cybernator

Registered: Jun 2002
Posts: 154
About dithered 4x4, how can I calculate the pixels? (Drawing them by hand is the last thing I would do. Don't ask why! :)) I'm about to create a bumpmapper. Now I can create a dithered environment map, and extract blocks out of it. Or I can create pixels using some algorithm which takes the shade (0-15) as input parameter. Which one is, in your opinion, better?

Btw, I'm still having problems with the Floyd-Steinberg thingy. ;-P Anyone has experience with it?
2003-07-07 11:46
Graham
Account closed

Registered: Dec 2002
Posts: 990
just draw the shades. it's only 2x4x16 pixels. not worth the effort and code something.
2003-07-07 12:00
St0fF

Registered: Oct 2002
Posts: 40
Floyd-Steinberg thingy? What's that?
2003-07-07 12:23
Cybernator

Registered: Jun 2002
Posts: 154
Quote: Floyd-Steinberg thingy? What's that?

A dithering algorithm based on error diffusion.
2003-07-07 12:46
Graham
Account closed

Registered: Dec 2002
Posts: 990
floyd steinberg on 2x4 pixels... yeah sure
2003-07-07 14:08
tecM0

Registered: Jan 2002
Posts: 40
hello graham,

have seen this:
"...and I suddenly came up with this very simple idea how to do 4x4 without losing 60% of the rastertime..."
on
http://c64.rulez.org/onslaught/interviews/int25.php

can you explain this simple idea to a unsuspecting /me?

thanx a lot,
tecM0
2003-07-07 17:15
Cybernator

Registered: Jun 2002
Posts: 154
Quote: floyd steinberg on 2x4 pixels... yeah sure

I've just created an environment map, and dithered it using Photoshop. Then exctracted the blocks, and I ended up with a dithered charset. It did work. :) IMO, pattern dithering produced better result than error diffusion, in this case.
2003-07-09 13:15
tecM0

Registered: Jan 2002
Posts: 40
no OXY_tutorial?

btw...i still also dont know how this
screendisorting worx... .. .

=(
2003-07-09 15:05
Graham
Account closed

Registered: Dec 2002
Posts: 990
the idea was to have a small irq every 8 rasterlines. nowadays this might sound pretty simple but back then it was the first custom resolution running in fullscreen size without munching up all the rastertime. before that any custom gfx mode based on fli ate up all cycles in the display area.
2003-07-09 17:51
Cybernator

Registered: Jun 2002
Posts: 154
The bumpmapper works! :-D It wasn't difficult as I first thought. However, it is slow even if it's using unrolled code.
Yeah, I need to use chained interrupts. But I can also have a separate IRQ every 4th rasterline, instead of every 8th, right? There comes the stable raster issue again. The double IRQ method would be inefficient for this case, wouldn't it? I'm studing the auxilary timer method now, but wouldn't different CIAs give different results? I'll probably need to wait an additional cycle on newer CIAs, and that takes CIA type recognition routine and such crap. Any easier method?
Only the lines where badline should be given at cycle 14 are a problem. The others are easier as I've got cycles 1-11.
--
OT: I found this about Deus Ex Machina in the interview above:
"Another guy wondered why I did the interference part because 'it's easy to do' "

The multiplexer was cerainly not simple. It took me two weeks of coding to replicate Graham's interferences! (Maybe I could have done it faster if there wasn't for BOFH :))
Of course I had all the guidelines from the original like where sprites are positioned, how layers are organized, etc. And the most important: As I saw it was possible, I was encouraged to go to the end. If I've never seen it, I might drop it saying: "This is impossible!"
The most problematic is the presence of two sprite layers. What if the rasters get too close? It would flicker. Then what if there's a badline? (Have in mind that there's also a char layer!)
In my experience, the bumpmapper was much easier than the interferences. And the complexity of an effect is not always important. The effect looks awesome, no matter what.
2003-07-10 12:33
Cybernator

Registered: Jun 2002
Posts: 154
I've been thinking... I don't need an IRQ every 4th rasterline. :) I can generate a badline at cycle 14, then immediately set $D012 four rasterlines below. RC is supposed to reset so there's no problem.
2003-07-10 18:27
Cybernator

Registered: Jun 2002
Posts: 154
I really don't get it! I made the chained IRQs using the auxilary timer method, and it works perfectly on both CIA types. Both CIAs generate IRQ at the same cycle. And if I try the proggy Yago told me about, it is really able to detect the CIA. Are there special cases when this occures? It's cool that I don't need a CIA recognition routine, but I have to know about this stuff. Maybe I should check the detection routine. :)

Now let's see if this will speed-up the bumpmapper.
2003-07-10 21:59
tecM0

Registered: Jan 2002
Posts: 40
i have checked the routines from

ftp://ftp.elysium.pl/gnu-generation/Brush/raster.zip

(not reachable anymore...user/pass...:( )

and it does the same graham explained. dont know if it is
the same way he made it but its a lot of rastertime left
on screen!

thx!

2003-07-23 12:22
tecM0

Registered: Jan 2002
Posts: 40
ok, the 4x4_sourcecodes are not downloadable at the
elysium_page anymore...dunno why!?

for all who wanna look at the nice sources try to
find "C=64 ML Tutorial" at http://videocam.net.au/~hannibal/
this archive contains the 4x4/fli-sources and much..much
more.

bye and thanx a lot,
tecM0/+H
2003-07-25 15:05
Krill

Registered: Apr 2002
Posts: 2980
tecmo: why don't ask your groupmates first? ;)
2003-07-27 01:24
tecM0

Registered: Jan 2002
Posts: 40
haven't i asked? ;)

you can still help me with the disortion FX.
graham told me "it's to easy to explain" ;)

anyway, the turtorial above could be usefull for other
user.

thx,
tecM0
2003-07-29 13:09
Oswald

Registered: Apr 2002
Posts: 5094
the distort effect is about:

-have the gfx in a charsets
-have 4 versions of each char row, where each version is shifted by 1-1 pixel
-NOW, if your gfx is 32 char wide, you can mix out of the
4 sets 32 different phases for zoom.
-You do the vertical zooming by a simple vic effect: repeat the first or first 2 raster lines of char rows by d011 trickery when needed.

cant explain shorter :)
2003-07-29 14:44
TDJ

Registered: Dec 2001
Posts: 1879
I can:

Don't
do
it
2003-07-29 15:37
Graham
Account closed

Registered: Dec 2002
Posts: 990
@Oswald: spoiler!
2003-07-29 16:47
CreaMD

Registered: Dec 2001
Posts: 3057
;-)))))
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
slimeysmine
Black Hole
The Phantom
Guests online: 116
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (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 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
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 Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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