Introducing VFLI for VIC-20: 208x256 pixels in 16 colours!

Modding and Technical Issues

Moderator: Moderators

User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Today, the VFLI converter got a major rewrite.

Instead of 1D vertical dithering, it now does 2D Floyd-Steinberg dithering - not entirely trivial to implement with the different size of hires and multi-colour pixels in mixed mode. 8)

I think the effort well paid off: with the new dithering method, the horizontal line artifacts present in earlier conversions are now gone. The converter has also been updated to use an improved palette I recently photographed from real hardware.

Cheers,

Michael
Last edited by Mike on Sat Jul 28, 2012 1:25 pm, edited 2 times in total.
User avatar
GreyGhost
Vic 20 Nerd
Posts: 525
Joined: Wed Oct 05, 2005 11:10 pm

Post by GreyGhost »

I can definitely see the difference. The pics look very nice.

Well done man.

Just out of curiosity, have you ran into any programs that have been affected by the 3k expansion hardwired in. I am looking into to doing this myself(not the whole thing just the internal 3k mod)? Also is there a way to switch it off if need be?
Rob
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Hey Mike, congratulations on this. Your effort made for an impressive result pushes the limit for VIC hardware :shock: .
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

GreyGhost wrote:I can definitely see the difference. The pics look very nice.

Well done man.
:D
Just out of curiosity, have you ran into any programs that have been affected by the 3K expansion hardwired in?
I've checked quite a lot of programs, demos, games, and also FE3 and Mega-Cart. Thus far I didn't find anything unexpected.

The only class of programs that could sensibly be affected are ML programs for the unexpanded VIC-20, which are started with a BASIC stub that assumes the load address at $1001. When they are loaded to $0401, that stub obviously won't work. Most unexpanded BASIC programs show the same degree of compatibility with the new hardware as with an external 3K expander, i.e. very high.

Some cartridges (notably, 'Bug Crusher') won't work alongside a +8K RAM expansion or more, as these rely on screen memory located at the position for an unexpanded VIC-20. Both external or internal 3K expansions do not move screen memory, so no problems here either.
I am looking into to doing this myself (not the whole thing just the internal 3K mod). Also is there a way to switch it off if need be?
To cure the aforementioned problem with ML programs, you can temporarily 'unexpand' the VIC-20 by running '3k.prg' (download). Of course it is still possible for a program to detect the 3K expansion, since it is not really switched off, but just blocked from BASIC use. If a program doesn't work because of that, I'd consider it broken by design. For that reason, I didn't bother to include a enable/disable switch.

As soon as you stick in +8K RAM or more, the BASIC start is moved to $1201 (and screen memory to $1000), blocking the internal 3K expansion from BASIC use, in the same way as if an external 3K expander and 8K (or 16K, 24K, 32K) expander were combined in a module box. Unlike to the external 3K expander, you now can combine these expansions by moving screen memory to $0400 and the BASIC start to $0601, that's what 'max.prg' does (download). Load both utilities with ',8,1'. They are autostarting.

Good luck in performing the mod! :)

Michael
Last edited by Mike on Thu Feb 20, 2014 4:18 pm, edited 2 times in total.
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Post by tokra »

WOW again. Hard to believe these are from the VIC-chip at all. PM sent
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

I've made fli_quant.exe available for the software-only 72x256 FLI mode (link).
macc
Vic 20 Hobbyist
Posts: 143
Joined: Fri Dec 17, 2010 8:02 pm

Post by macc »

Awesome!
Now imagine if this had been done in 82!
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

macc wrote:Now imagine if this had been done in 82!
In 1982 you would have had a lot of difficulties in obtaining the true colour image data in the first place, let alone store it away. Furthermore, the conversion algorithm in use is very compute-intensive, and would have been considered impractical to run on everything below mainframe capacity at those times. That computing power is now easily available at your fingertips.

If it shows anything, then this: the VIC-I chip was underrated for quite a long time. To fully utilise its potential, it needs only a small hardware modification on the VIC-20 mainboard. And then, VFLI can provide a graphic display easily on par with NUFLI on the C64!

Greetings,

Michael
User avatar
rmelick
Vic 20 Hobbyist
Posts: 134
Joined: Sat Mar 26, 2005 7:29 pm
Website: http://www.geocities.ws/cbm/
Location: Bay Area
Occupation: IT

directions

Post by rmelick »

Mike wrote: Likewise, the mod can also be done on a 2-prong VIC-20. Instead of two 6116 chips, six 2114 chips are piggy-backed on the existing ones, and directly selected with UC4. U13 is not present in the 2-prong main board.
I have an spare 2-prong NTSC VIC and 6 static ram chips.

I'm still a little unclear on the exact process to follow.

Can someone document the procedure?

Thanks,
Rick
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: directions

Post by Mike »

rmelick wrote:I'm still a little unclear on the exact process to follow. Can someone document the procedure?
Posting instructions for the 2-prong PCB though - without actually having done it - would be a bit leaning out too far off the window for me. There had been some specialities to be sorted out during the mod on the CR mainboard, I expect them to crop up in a similar way with the older mainboard. I wouldn't want anyone to start the modification and then end up in a blind lane, just because I missed a necessary working step. And of course I cannot document the mod with photos, my VIC-20 CR that I modded also is the only one I own.
Last edited by Mike on Sat Jul 28, 2012 1:33 pm, edited 2 times in total.
macc
Vic 20 Hobbyist
Posts: 143
Joined: Fri Dec 17, 2010 8:02 pm

Post by macc »

Just to clarify my position I'm very willing to loan out one of my VIC's for postage if anyone wants to have a go who's proficient enough (if it works you can buy it for a fraction of what its listed for or I'll pay the postage for return, that way no-ones losing out on money either)
I'd have a go myself but it seems a step too far for me (and some things bound to go wrong, I'd hate to wreck a perfectly working VIC)
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

I was tempted to do this alteration on my "experiments" VIC but I don't quite understand why you have to expand the color RAM so much larger (I mean 16X... ouch!).

I have a pretty clear understanding on where you're going with the extra internal 3k... you just add 3k RAM but you place it on the VIC's side of the LS 245 barrier instead of the cart port or CPU side.

The Color RAM is 1k x 4 so AFAIK, we almost always use only half of it. Isn't using all of it enough?

The beauty of this mod is that Autro-compiled basic programs could have a full graphic character set.

Added edit:
I also happend to have a spare PAL 2-prong VIC I am willing to experiment on. I feel quite confident I can do the VFLI MOD on it. I truly have no other use for it.
Be normal.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

GreyGhost wrote:Also is there a way to switch it off if need be?
The alteration, as suggested by Mike involves rerouting accesses to RAM0 that normally go to a pair of 2114 SRAM chips onboard the VIC Cr to one of the 2116 added as a piggyback. This is NOT necessary if you change the onboard SRAM chips to faster ones IF NECESSARY.

If you simply reroute !RAM1, 2 and 3 to the chips piggybacked on the on-board ones then, to disable the internal extra 3k expansion all you have to do is tie the !OE lines of these piggybacked chips to 5V. Tie these lines to GND to activate the VFLI mod. A simple SPDT switch will do the job.

Target the !RAM1, 2 and 3 lines coming from the 74LS138 to the !CS lines of the piggybacked chips as described. Simply don't do it for pin 15 (RAM0) and don't remove the two 2114 chips related to that memory area on the board of the VIC-20 Cr. This way, you no longer have to tap into pins 1, 2 and 3 of U13. Pin 14 (RAM1) of UC4 goes directly to the !CS line of the first piggybacked 2116.

Normally, !CS lines and !OE lines are connected together and activated/deactivated simultaneously. However, even with !OE pulled low, the chip will do nothing if !CS is not also pulled low. Hence the !OE lines of the added chips become a sort of control line on the added memory. With RAM0 still going to the onboard SRAM, the added chips only carry RAM1, 2 and 3 therefore enabling/disabling their output becomes an effective control of the 3k internal expansion.

The VIC-20 can still write data to the added memory when !CS and !R/W are both pulled low but the VIC can't read back if !OE is always high.

This actually makes the mod SIMPLER... no need to remove the two 2114, less lines to solder.
Be normal.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

eslapion wrote:I was tempted to do this alteration on my "experiments" VIC but I don't quite understand why you have to expand the color RAM so much larger (I mean 16X... ouch!).
The underlying bitmap mode to display these pictures works with 8x16 pixel sized redefined characters. VIC thus accesses the same addresses in colour RAM for 16 lines, which means the attribute cells are normally also 8x16 pixels. To enhance the colour resolution, the display routine changes the upper 4 address lines of the replacement colour RAM chip on each raster, too, which results in 8x1 attribute cells.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

@Mike:
I take it you read the rest of what I posted and didn't find anything wrong with it.

How much memory would you get by moving the screen memory to $0400, basic start to $0601 along with 24k of external expansion? (using max.prg)

Right now, it is impossible for me to complete the VFLI mod as I can't find any source for a 5V 16k x 4bit SRAM chip.

Digikey has the CY7C192 which is 64k x 4bit but it is also a 28 pin SOJ chip which is a misery to adapt to the VIC-20's bus.

It also has the CY7C168A which is only 4k x 4bit. I would need 4 chips like that stacked and a decoder to do the job!
Be normal.
Post Reply