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 > Kefrens bars
2019-11-27 08:35
Strepto

Registered: Dec 2015
Posts: 11
Kefrens bars

I've been thinking about kefrens bars on the c64.
How do you think it is implemented?
Perhaps using repeated char lines and update the chars using cycle exact timing?
2019-11-27 09:12
Dano

Registered: Jul 2004
Posts: 228
Yes exactly that's how it is done usually.

Having no badlines you have all cycles per line available which is enough to paint one bar per line.
2019-11-27 11:00
Krill

Registered: Apr 2002
Posts: 2855
To be precise, the standard approach is to use linecrunching in char mode.

The last rasterline of a char row is repeated, without badlines.

You then draw over the char patterns right within the raster routine, so make sure you write exclusively before or after the individual chars are displayed.

Bonus points for putting the charset to $0000, so 32 of the 40 char patterns are in zeropage, allowing for wider bars.
Extra bonus points for using sprites at the top and a repeated char row at the bottom (with open Y-border), so you get 216 lines of effect.
2019-11-27 11:34
Smasher

Registered: Feb 2003
Posts: 512
hey, I'm not a fan of Kefrens bars, but cool to have you back in bizz Strepto! :)
2019-11-27 16:26
HCL

Registered: Feb 2003
Posts: 717
@Krill: :)
2019-11-27 16:45
Oswald

Registered: Apr 2002
Posts: 5031
repeating last row is now not stretching but linecrunch ?! or that is the same timing that results in bitmap move up ?
2019-11-27 17:06
Golara
Account closed

Registered: Jan 2018
Posts: 212
Quote: repeating last row is now not stretching but linecrunch ?! or that is the same timing that results in bitmap move up ?

Linecrunch is what is used for moving the bitmap up, but what really happens is that the last pixel line of a char is displayed only, so you skip the 7 pixel lines, because of that, the next char line is drawn higher than normal, repeat that and you scroll bitmap up. Here the same technique is used but instead of moving bitmap data, the whole screen is just these pixel lines from 7th line of a char and that line is modified to look like kefrens.
2019-11-27 18:38
Oswald

Registered: Apr 2002
Posts: 5031
yes I get all that, I was asking why is Krill calling a stretcher linecrunch, probably same routine with different result in different gfxmode. I havent coded linecrunch, but have done kefrens.
2019-11-27 19:42
Krill

Registered: Apr 2002
Posts: 2855
Quoting Oswald
I was asking why is Krill calling a stretcher linecrunch
Mostly because the term "stretcher" is rather ambiguous, as it could be repeated badlines, repeated char rows (without badlines), linecrunching, or something i just forgot.
2019-11-27 21:12
Oswald

Registered: Apr 2002
Posts: 5031
linecrunch as I understood it, reduces whole char rows to a single rasterline, what is being stretched ?
2019-11-27 21:26
Krill

Registered: Apr 2002
Posts: 2855
Quoting Oswald
linecrunch as I understood it, reduces whole char rows to a single rasterline, what is being stretched ?
The same rasterline will be repeated, as there is no DMA (badline) to fetch new char data, and RC will remain at 7. Thus, there is stretching.
2019-11-27 21:28
Oswald

Registered: Apr 2002
Posts: 5031
linecrunch crunches lines (char rows) down to a single rasterline, and this is used to move the screen upwards, so there should be badlines and not the same single rasterline displayed but in each rasterline a new char row in 1 pixel high glory ?
2019-11-27 21:53
Krill

Registered: Apr 2002
Posts: 2855
Quoting Oswald
linecrunch crunches lines (char rows) down to a single rasterline, and this is used to move the screen upwards, so there should be badlines and not the same single rasterline displayed but in each rasterline a new char row in 1 pixel high glory ?
If you linecrunch continuously, with a write to $d011 each rasterline, there will be no badlines. Once you stop writing to $d011, the last rasterline of the current char row will be repeated, but after that, there will be normal badline DMA action and new lines as normal, with whatever line counter is left after all the linecrunching.
2019-11-28 00:10
JackAsser

Registered: Jun 2002
Posts: 1995
Quote: linecrunch crunches lines (char rows) down to a single rasterline, and this is used to move the screen upwards, so there should be badlines and not the same single rasterline displayed but in each rasterline a new char row in 1 pixel high glory ?

A DMA fetch != VC->VCBASE

With line crunch you avoid bad line condition by setting $d011&7 != $d017&7, then at cycle 59 you trigger bad line condition to avoid entering IDLE, then repeat. So basically you trick the VIC-chip into badline condition, but at the same time avoid the actual DMA.
2019-11-28 14:27
Oswald

Registered: Apr 2002
Posts: 5031
okay, some old c= hacking described it as really crunching down rows, and as I only ever used it for stretching (without knowing its the linecrunch effect) and not for moving screen, I didnt realize its really stretching. thanks :)
2019-11-28 16:25
Golara
Account closed

Registered: Jan 2018
Posts: 212
Quote: okay, some old c= hacking described it as really crunching down rows, and as I only ever used it for stretching (without knowing its the linecrunch effect) and not for moving screen, I didnt realize its really stretching. thanks :)

Yeah, C64 names are weird, some refer to the visible effect (you can do 'FLD' in software I guess, just copy graphics down) others to the actual technique. Also using word "line" as in charline, "pixel" as actual one raster line... I always found "Different Y char position" so weird. It sounds awkward, but it's exactly what it is.

It's even better when you hear some scener and not just read it, cuz I pronouce all kids of stuff differently, for example FLI as just FLEE and not EF EL AY or DYSP as.. well, DYSP not DEE UAJ ES PEE
2019-11-28 17:43
Krill

Registered: Apr 2002
Posts: 2855
Quoting Golara
for example FLI as just FLEE and not EF EL AY or DYSP as.. well, DYSP not DEE UAJ ES PEE
As long as you don't pronounce "char" like "car"... =)
2019-11-28 18:31
Smasher

Registered: Feb 2003
Posts: 512
Quote:
It's even better when you hear some scener and not just read it, cuz I pronouce all kids of stuff differently, for example FLI as just FLEE and not EF EL AY or DYSP as.. well, DYSP not DEE UAJ ES PEE


hehe lol. not only routine acronyms, my head automagically translates all your handles/groups in a very Italian way. so I'm in "effequattrocigi" while "milleunocriu'" were first in opening the sideborder. and poor "federation against copyright" sounded like "f**k" :)
I remember the good old days chatting with sceners over PSTN... if you called you needed minimum 10 minutes to make me understand who you were. ehm, sorry for that :)
2019-11-28 21:05
Street Tuff

Registered: Feb 2002
Posts: 88
https://bitbucket.org/streetuff/4krawall-final/src/master/kefre..
2019-11-29 00:18
CyberBrain
Administrator

Posts: 392
I included the source code in the zip-file for Kefrens Without For, if you want to have some example code to look at.
("igenigen code" means "againagain code" which means "speedcode" :))
2019-11-29 10:19
Oswald

Registered: Apr 2002
Posts: 5031
Quote: https://bitbucket.org/streetuff/4krawall-final/src/master/kefre..

that pha in the kernel is very sexy.
2019-11-29 12:33
Krill

Registered: Apr 2002
Posts: 2855
Quoting Oswald
that pha in the kernel is very sexy.
Both of them are! =)

In my contribution to Singles Collection Volume 2 *, i used chained rts to go from one bar-drawing snippet to the next. Saves a lot of table-lookup overhead and allows for immediate mask and pattern arguments. There's some trickery going on to have more than 128 return addresses on the stack (as there are 216 rather wide bars).

* You can load and run file "06*" directly, and do use x64sc (not x64) if you must resort to an emulator.
2019-11-29 13:31
Dano

Registered: Jul 2004
Posts: 228
Quote: Quoting Oswald
that pha in the kernel is very sexy.
Both of them are! =)

In my contribution to Singles Collection Volume 2 *, i used chained rts to go from one bar-drawing snippet to the next. Saves a lot of table-lookup overhead and allows for immediate mask and pattern arguments. There's some trickery going on to have more than 128 return addresses on the stack (as there are 216 rather wide bars).

* You can load and run file "06*" directly, and do use x64sc (not x64) if you must resort to an emulator.


like i told you on BCC this is about as clever, tricky and beautiful as it can get. some hardcore adress brainfuck with that stack-split. :) was fun to analyse how you got this done. HCL and i took a somewhat easier approach though.
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
iceout/Avatar/HF
Guests online: 81
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 No Bounds  (9.6)
7 Aliens in Wonderland  (9.6)
8 Comaland 100%  (9.6)
9 Uncensored  (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 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 It's More Fun to Com..  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Talent  (9.6)
4 Facet  (9.6)
5 Hend  (9.6)

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