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 > Drazlace/Interlacing Theory
2003-09-07 07:13
Eyeth
Account closed

Registered: Apr 2002
Posts: 98
Drazlace/Interlacing Theory

Hello.

I'm trying to create a simple tool that will convert an ordinary 256-color BMP file into a Drazlace graphics format.

I already know how to code a Drazlace routine; It's just two MCM screens that are interlaced and one screen is offset by one hi-res pixel.

What I would like to know is the theory behind constructing a Drazlace or an interlaced screen. Apart from the background value, in a 8x8 pixel block, I can use three colors;

one for videoram high nybble
one for videoram low nybble
one for color ram

However, each color value can be interlaced and that creates more color possibilities. I'm guessing that up to 6 color combinations can be achieved? What about the screen-shifting? How do I compensate for that? How do I know which color values, when interlaced, become this specific color?

If someone has programmed a 256-color to drazlace conversion routine, I'd like to know more. I sure could use such an existing utility rather than programming a new one.

Thanks,
-Todd Elliott
2003-09-07 09:00
Dane

Registered: May 2002
Posts: 423
Actually, up to 10 colour combinations can be achieved, taken the background colour into account. However, all of these might not look very good. :)
2003-09-07 15:13
MagerValp

Registered: Dec 2001
Posts: 1078
Just treat the screen as a 320x200 bitmap, and disregard the fact that colours are blended. If you think about it, this is exactly what the interlace does.

2003-09-07 15:56
QuasaR

Registered: Dec 2001
Posts: 145
There are two mode: One with around 136 colours (theoretically...) with a resolution of 160x200 and one with the "standard" 16 colours and a resolution of 320x200 by altering the bit0 of $d016 each frame. Just try S or R in Drazlaces' show-mode.
2003-09-07 20:12
algorithm

Registered: May 2002
Posts: 705
If you want an interlace mode which can display over 100 theoritical colors, you simply have to flick two FLI pics and the combination of two different colored pixels will give you a huge amount of colors.

However you can use the screen shifting trick to have a resolution of 320x200 in 16 colors. (Luckily you get far more than that due to overlapping pixels and it looks better than expected.

I have created an application which converts truecolor images to 320x200 FLI interlace. Give it a try

www.algotech.co.uk
2003-09-07 20:34
QuasaR

Registered: Dec 2001
Posts: 145
ähm... sorry, but FLI only helps to "break" the limit of 4 different colours in one 4x8 pixel-area to bring it down to 4x1. INTERLACE makes it possible to have either more colours (without $d016-wanking) or higher-resolution (8 instead of 4 pixel width...)
2003-09-08 08:41
algorithm

Registered: May 2002
Posts: 705
Firstly converting an image to 16 C64 colors at 320x200 resolution and then finally converting it to IFLI will not just result in a 320x200 image in 16 colors. This is due to overlapping pixels (When using $d016) An approximate amount of colors will be 80+

Secondly, Using FLI mode is necessary when displaying quality interlaced images due to less attribute block limitations.

Yes, Interlacing can be just flicking two images together, but in C64 terms the following would apply

160x200 interlace (no $d016 tweaking) = Color interlace
160x200 interlace ($d016 adjustment) = 320x200 resolution (sort of) + semi color interlace
2003-09-08 08:59
MagerValp

Registered: Dec 2001
Posts: 1078
$d016 interlace is not just "sort of" interlace, it's the same effect as e.g. Amiga video modes or what you get out of your VCR. There's a certain amount of overlap in these two, based on the screen's dot pitch. You get the same kind of colour blends if you make every other line a different colour on an Amiga.

Making an image converter that takes $d016 interlaced colour blends into the calculation would be really difficult, as (potentially) all the pixels on a line are interdependent. Just treating the screen as 320x200 and applying dithering gives you the same effect, and is much easier to work with.

On the other hand, a skilled gfx artist working directly with the interlaced mode can of course use it to his or her advantage. Hand drawn graphics will always be superior to converted graphics.

PS: Todd, there's a BMP2MCI converter in the tools dir in serial slave. The source is GPL:d.
2003-09-08 14:37
Eyeth
Account closed

Registered: Apr 2002
Posts: 98
Hello, MagerValp-

Thanks for the tips regarding conversion. I did find myself scratching my head as to how to deal with color blending; your approach sounds more simpler and realstic. I did find jpg2mci converter on your website and will try to check it out. Hopefully it's easy to understand.

Enjoy.
-Todd Elliott
2003-09-08 19:02
Eyeth
Account closed

Registered: Apr 2002
Posts: 98
Hello, MagerValp-

Your utility did the job very well. I couldn't understand the source code very much. At least, I know some C to be a little bit dangerous and will be able to modify the utility to create standalone MCI files w/o the executable portion.

One other question; I noticed in the source code that you optimized the background color. That is a good thing. But what about optimizing the background color for every 8 scanlines, i.e. a cardrow? This would result in 25 such values and an IRQ would be used to insert them appropriately onscreen. Would that improve the MCI conversion results?

-Todd Elliott
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
kbs/Pht/Lxt
algorithm
radius75
Sychamis
Peacemaker/CENSOR/Hi..
Guests online: 93
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 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (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 Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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