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 > Has ECM been implemented on the VIC chip in the most efficient way?
2016-12-11 17:45
Rastah Bar
Account closed

Registered: Oct 2012
Posts: 336
Has ECM been implemented on the VIC chip in the most efficient way?

In ECM mode bit 6 and 7 are used to select a color register, but they are not used for selection of the character image. It seems to me that this may be inefficient.

To explain what I mean: suppose bits 6 and 7 were also used for the character image (I don't know if that was technically possible when the VIC chip was designed, but let's suppose it was). Let's call this ECM2 mode. This hypothetical mode uses bits 6 and 7 twice: for the character code and for selecting a color register.

Suppose also that a character set is used with 256 distinct characters. Now, if two or more of the color registers contain the same color code, then it is possible in ECM that two different character codes, for example code 65 and 129, are indistinguishable from each other on the screen, if $d022 and $d023 contain the same color.

With the hypothetical ECM2 mode, however, these are distinguishable, since they show a different character, although on the same background color, because all bits are used for the character code.

So I seems ECM is wasting bits compared to ECM2 mode. But probably there is a flaw in my logic and I would appreciate it if someone could point that out.

If this reasoning is correct, then a more efficient multicolor mode could have been implemented by displaying an "10" and "01" exactly like that on the screen (in high resolution, that is), and let the color of the 1 be determined as in MC mode as it exist on the C64 now.
2016-12-11 19:03
Hein

Registered: Apr 2004
Posts: 954
I guess character code bits 6 & 7 would then have to correspond to $d018 bits 1 & 2? :)
2016-12-11 20:35
ChristopherJam

Registered: Aug 2004
Posts: 1409
Well, there are pros and cons. Upside of the way it was actually done is that the charset uses only 512 bytes, freeing up 1536 for other purposes.

What would have been really cool would have been if bit 0 of $d018 had actually become active in ECM mode, allowing for 16 charsets per bank instead of just 8...

Easy enough to add to an emulator or one of the FPGA clones, but then it's not a c64 anymore.
2016-12-11 20:43
lft

Registered: Jul 2007
Posts: 369
I think the rationale was that you could use the standard ROM fonts and get letters, digits and punctuation, with individually assigned foreground and background colours. That way, you'd still have 64 kB RAM for the business logic and data.
2016-12-11 20:52
Digger

Registered: Mar 2005
Posts: 437
I always felt sorry for the fact you can't have multicolor ECM. Kinda coder's dream. Some coders (Crossbow) claimed to "force" this mode AFAIR ;-)

Or the unused hi-nibble of color RAM could be a background color for the char.
2016-12-11 20:58
Cruzer

Registered: Dec 2001
Posts: 1048
Some VIC tricks take advantage of the fact that the chars wrap at 64, e.g. Crossbow's 56 lines sideborder FPP in Krestage. Also a routine I'm coding at the moment, which isn't a VIC trick, but it still saves some cycles because of this.

Edit: But it would make some amazing PETSCII possible with 256 chars ECM. :)
2016-12-11 21:33
4mat

Registered: May 2010
Posts: 66
Not quite the same, but I did a little bit of code to pop PETSCII pics into hires bitmap mode. So you get independent background colour per char that way.
2016-12-11 22:39
Oswald

Registered: Apr 2002
Posts: 5094
VICII is doing quite a lot already with d800, on a badline it reads 12 bit of data on each cycle, or with sprites make it 20 bits at almost every cycle, however on a 2nd badline it could read a 2nd background color tho, but that would mean another 40x4bit color buffer ON chip, which would make it explode :)

edit:

somehow never missed multi-ecm, in fact for plasma basic ecm seems more powerful (AEG plasma)
and crossbow was just talking bullshit to fool other coders with that mode.
2016-12-11 23:12
Jammer

Registered: Nov 2002
Posts: 1335
For me biggest waste is always higher Colour RAM nybble. Why wasn't it used for example for 16 luma levels or hires/multicolor switch in MC charmode? :(
2016-12-12 00:31
Cruzer

Registered: Dec 2001
Posts: 1048
Jammer: To quote Oswald, because the VIC chip would explode if it had to handle more. It's 1982 technology after all. Have you checked how hot it gets after running for some hours?
2016-12-12 05:59
ChristopherJam

Registered: Aug 2004
Posts: 1409
Quote: For me biggest waste is always higher Colour RAM nybble. Why wasn't it used for example for 16 luma levels or hires/multicolor switch in MC charmode? :(

Not so much wasted as never installed; colour ram is a whole seperate chip that's only four bits wide; there are a whole extra four pins on the VIC chip just so it can read colour ram at the same time as the char indices.

Hi nybbles of colour ram would have needed an extra or more expensive color ram chip, and more traces on the circuit board, and more pins on vic.. (that or 50% faster ram ($$$!!!) across the board and a three phase timing cycle, to read char index then colour then charset each tick...)
 
... 1 post hidden. Click here to view all posts....
 
Previous - 1 | 2 - 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
BANDIT/BANDIT-COOL-S..
Unlock/Padua/Albion
Jericho/Draco/Tropyx..
Krill/Plush
Freeze/Blazon
REBEL 1/HF
Alakran_64
St0rmfr0nt/Quantum
Brataccas/HF
algorithm
Holy Moses/Role
Steveboy
E$G/HF ⭐ 7
Guests online: 98
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
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 Triad  (9.3)
5 Censor Design  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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