VIC-2000 Expander. Modern Power Using Retro Parts!

Modding and Technical Issues

Moderator: Moderators

User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

In my ongoing efforts to understand everything that happens under the hood, I added a ZIF socket to my 6560 chip.
The reason is so that I can tap the every signal, and bring it outside the case using a ribbon connector.
At that point, I am going to do a few different experiments to bring my VIC-20 display into the modern world...

(1) I will capture the 6560 data and use it to duplicate the VIC display on VGA with pixel perfect acuracy.
(2) I may create an actual 6560-V2 chip that will directly replace the 6560 in the socket and offer VGA.

Both options leave the original operation of the VIC in tact, but option (2) can also repair a VIC with a dead 6560.
Like I said, this project is on total flux at this point as I enjoy my learning curve.

I have several VICs, and the one helping me out already had a 6560 socket...

Image
Original 6560 in a socket. Looks like the RF shield was never installed.

ZIF (Zero Inertion Force) 40 pin socket installed in the existing socket...

Image
The lever allows quick removal of any 40 pin DIP chip.

Now I can remove or piggyback onto the 6560 with ease...

Image
The original 6560 back in its home and working just fine.

For my next trick, I will probably make a 40 pin connector with a ribbon cable and bring all the important signals outside the VIC case by sneaking it through the large hole in one of the external connector ports.

I believe that the 6560 will operate 12 inches away from its socket at the end of this cable with no issues.
My VGA breadboard runs at 30MHz with some wires 2 feet long, so 1.02MHz should be easy!

The end goal of doing this will be to recreate the VIC display to VGA so it is perfectly stable.
My experiments with NTSC have shown that the signal is a bit too messy to trust, and proper NTSC to RGB digitizer ICs are mostly extinct now.

By recreating the actual function of the 6560 using the address and data lines, I can solve many problems at once, giving my new system the original VIC display on VGA so all original titles work, and also allowing my new system to integrate and extend the display for high resolution.

Now where did I put that giant boc of old IDE connectors and ribbon cables??
Later,

Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Had an hour free this evening, and decided to try my crazy "Remote 6560" idea.
I will admit that I only gave this a 75% chance of working.

Started by soldering a socket to the ZIF socked so I could attach 40 wires.
The idea was that the 6560 could live outside the VIC-20 and at the same time on a breadboard.
The other end of the 40 wires will be soldered to another socket that goes back to the VIC-20.

Image
A few sockets and 40 lengths of 14" long wires.

Soldering the 40 wires was no big deal... I am very used to dealing with a LOT of wires in my projects.
See how the wires connect to the ZIF socket, and also allow it to drop in a breadboard...

Image
A dual purpose socket. One end for the 6560, the other end for a breadboard.

Here is the completed 40 pin, transplant socket extender, ready for testing...

Image
This will be useful for testing the 6560 and the 6502.

Open heart surgery on my VIC-20!
At this point, the VIC-20 is still unmodified. Chips are just "relocated".

Image
Is this the first example of a 6560 being used outside of a VIC-20?... literally!

Well, did this ugly hack work?
Mister Kong thinks so...

Image
The giant ape isn't happy about my hack, so he is tossing barrels at me.

Well, there ya have it... a 6560 operating outside of a VIC-20.
I can now drop the socket on my breadboard and start routing wires to my external circuit.

My first test will be to feed a new 14.318MHz clock into the 6560 so I have a complete sync.
After that, I will program something to spy on the address and data lines.
I should be able to have the original 6560 doing NTSC and my new circuit mirroring the display in VGA.

This will yield a much sharper result than an analog to digital scan converter (TV to VGA box).

So far, so good... let the hacking continue!
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Now that I have the 6560 working out of the VIC and on my breadboard, I am working out the IO mapping for the Spartan-6 FPGA I intend to use while I capture and examine the bus and control signals.

One issue is that the FPGA pins are not 5v tolerant, so I will need to do some level shifting.
Normally, I would just violate the rules and let it handle the overload, but this is my only board, so I want to play it safe.

The signals are also bi-directional, which makes a simple diode/resistor translator no good.
Looks like I will be on hold until I can order some 74LVC8T45s for this testing.

I am considering just over-loading some of the 74HC245s I have with 5v inputs while they run at 3.3v, since I don't have a lot of patience to wait for parts! The VIC LS logic should be ok with the 3.3v output of the 74HC245.

Another option is to overload an AVR XMega to 5v (I do this a lot), but even at 64MHz, I am not sure if I can get the resolution required to handle the bus requests while at the same time simulating video memory and writing out a VGA screen.

So many options.
At this point I am still studying the all of the 6560 resources I can find.
So far, these have been the best reference...

https://www.mdawson.net/vic20chrome/dis ... 61_vic.pdf
http://www.atarimagazines.com/compute/i ... E_CHIP.php

I have also decided that this experiment will have two goals...

(1) Secondary VGA output by spying on the original functioning 6560.
(2) Full emulation of the 6560, but output as VGA.

The second goal will be more difficult for sure (fun), as my new 6560 clone will have to not only fit directly into the socket on the VIC-20 main-board, it will also have to offer 100% compatibility with the original and put the video out as rock solid VGA.

With both of those goals realized, I should certainly know a complete understanding of the 6560.
Anyone interested in a drop-in 6560 replacement that will spit out VGA?

Brad
norm8332
Vic 20 Nerd
Posts: 626
Joined: Sun Nov 13, 2016 11:04 am
Location: USA

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by norm8332 »

This is very cool, and if you succeed in designing a 6560 replacement it would be spectacular! It is nearly impossible to find a 6560. It took six months for me to find one and I don't think many are left.
“In religion and politics people’s beliefs and convictions are in almost every case gotten at second-hand, and without examination... whose opinions about them were not worth a brass farthing.”

-Autobiography of Mark Twain
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Interesting, I didn't realize they were so hard to find.
I will make sure to touch ground before handling mine from now on!

Ok, I will dedicate to fitting this into the most minimal package I can.
There should be no problem making a tiny PCB not much larger than the original 40 pin DIP that will fit right into the socket.

I also found that there is more than enough room to sneak a cable out through the user port space, which is good considering this port is mostly not used. I will just put a female 15 pin VGA connector at the end of a cable.

Working up the memory map I need for 6560 emulation, it appears that I can easily get all of this into block RAM right on the FPGA...

Code: Select all

parameter SRAM_SCRN = 0007680; // 00512 BYTES FROM 07680 TO 08191
parameter SRAM_CHAR = 0032768; // 04096 BYTES FROM 32768 TO 36863
parameter SRAM_COLR = 0038400; // 00512 BYTES FROM 38400 TO 38911
parameter SRAM_VCOM = 0036864; // 00016 BYTES FROM 36864 TO 36879
This should be easy now that I don't even have to do any external SRAM IO.

I will even make the Character ROM writeable, so the VIC can "re-program" its own ROM.
That shouldn't break any compatibility, because why would anyone try it on a real 6560?

Ok, I will dedicate to making a real 6560 replacement, and do a full write-up on it when it works.
I cannot offer PAL, as I don not have a PAL machine or monitor to test with.

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

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Mike »

Please note: the VIC can access everything of the internal RAM (normally $0000..$03FF and $1000..$1FFF, but check out my VFLI mod!) for (text) screen data and RAM based character data. Furthermore, the colour RAM is 1K nibbles in size and spans the address range $9400..$97FF (as seen by the CPU, VIC-I uses the low 10 address bits to access the 2114 in parallel to the screen data while the 2114 is separated from the BD bus by a 4066). Finally, the VIC-I registers are mirrored 16x in the range $9000..$90FF.

The arrangement mainly applies to how VIC-I is used in the VIC-20. A replacement needs to be capable to address a 14 bit address range (the VA bus in the schematics), and create a CS for itself for its own registers in the range $1000..$10FF (which is translated to $9000..$90FF in the VIC-20 by VA13 = /BLK4 when the 6502 has the bus).

As I hinted above, in the VIC-20 one can make the range $0400..$0FFF also available for the VIC-I, by placing the RAM on the right side of the bus buffers. An external +3K RAM expansion in the same address range is *not* accessible.
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Thanks for the info.
Right, I only really need to throw the character ROM into the FPGA.
I keep forgetting that my clone will talk to the real SRAM on the mainboard.

I will hijack the character ROM address and put it into the FPGA so it could be written to as SRAM.
The VIC-20 will still operate normally, but now have the ability to redesign the default character set.
On startup, the FPGA will populate this memory with the actually expected ROM data.

I can't imagine a scenario where that would hurt compatibility.

Again, thanks for the info, the more the better!
All I know of the 6560 is what I have read in the last few days.
The knowledge base here is great.

For now, I am going to move ahead on just "leaching" the bus signals to make VGA.
I will not drive any signals on the VIC-20, just listen and create a VGA output.

Once that works, I will dig into making the "drop-in ready" 6560 version.

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

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Mike »

Radical Brad wrote:I can't imagine a scenario where [changing the ROM character generator] would hurt compatibility.
There actually exist quite a few programs that show unexpected behaviour when the contents of the character ROM are changed from the default. For example, the game Astro Nell generates level data from it, and MINIGRAFIK takes a certain byte sequence for granted which contains powers of 2. Anyhow - any program which wants to use user defined characters can do this. By softloading a character set into RAM.
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Koala paint was a 64 example as well.
I head of issues when it was converted to the C128 due to the character pixels being in the wrong place.

In my implementation though, this won't be a problem.
When my FPGA boots, it will fill the character "ROM" with the expected VIC-20 character set.
No native VIC software will care that these locations could actually be written to.

This new feature of being able to write to what should be ROM is only useful for new software made for this 6560 variant.
So I will not break any compatibility, but simply offer something new.

Well, that is unless you can think of any native VIC software that would actually try to test writing to the character ROM!
... that would be one strange bit of code indeed.

I have now completed the Verilog code to generate all of the clock required inside my new 6560 clone thingy.
For now, I am going to refer to this side project as...
"The 6562K... A 6560 Compatible VGA Replacement IC.".

This weekend, I will start testing by removing the clock lines on my external 6560 to feed in my new ones.
From there, perhaps some simple bus voyeuring to show some data on the VGA monitor based on what the VIC is showing.

Much fun!
Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

In case anyone needs to convert the standard VIC-20 palette into 12 BIT RGB...

Code: Select all

VICPAL[0]  <= 000+000+0000;
VICPAL[1]  <= 015+240+3840;
VICPAL[2]  <= 009+023+0000;
VICPAL[3]  <= 005+198+3328;
VICPAL[4]  <= 009+028+3072;
VICPAL[5]  <= 005+190+0000;
VICPAL[6]  <= 003+028+3328;
VICPAL[7]  <= 012+215+0256;
VICPAL[8]  <= 010+081+0000;
VICPAL[9]  <= 013+176+0256;
VICPAL[10] <= 014+121+1536;
VICPAL[11] <= 008+243+3840;
VICPAL[12] <= 013+115+3840;
VICPAL[13] <= 008+246+1024;
VICPAL[14] <= 008+112+3840;
VICPAL[15] <= 015+255+1280;
I started with the RGB values I grabbed from an emulator screen into Photoshop...

Code: Select all

00	Black			000,000,000
01	White		255,255,255
02	Red			148,023,000
03	Cyan			081,198,212
04	Purple		144,028,204
05	Green		081,190,000
06	Blue			048,028,213
07	Yellow		196,215,028
08	Orange		163,081,000
09	LT Orange		208,176,023
10	Pink			233,121,105
11	LT Cyan		132,243,255
12	LT Purple		221,115,255
13	LT Green		142,246,078
14	LT Blue		133,112,255		
15	LT Yellow		242,255,084
I needed to convert from R8,G8,B8 to R4,G4,B4 since I am using 12 bit color space.
With 4096 colors to chose from, I am sure I will get close to the original palette here.

Brad
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by lance.ewing »

Radical Brad wrote: For now, I am going to refer to this side project as...
"The 6562K... A 6560 Compatible VGA Replacement IC.".
That name might be mistaken as being compatible with the 6562 rather than the 6560:

https://sites.google.com/site/mos6561vi ... 63_vic.pdf

It sounds like an interesting project though. I was also thinking at one time about adding a logic analyzer of some kind to all the relevant pins of the 6561 to observe what is happening on them.
Radical Brad wrote: The second goal will be more difficult for sure (fun), as my new 6560 clone will have to not only fit directly into the socket on the VIC-20 main-board, it will also have to offer 100% compatibility with the original and put the video out as rock solid VGA.
100% compatibility will certainly be difficult. Only a few months back a previously unknown peculiarity was discovered. It is possible there are even more lurking in there.
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Good point. I will hold of on naming this project until it actually works.
I will try to emulate all of the 6560 functionality, even the quirks.
The only thing not emulated will be the composite video. This is a VGA output only project.
If those quirks are NTSC or PAL based, then they won't be part of my new design.

Something like... "hey, did you know you can create a new yellow hue by sending 2 bits really fast at pixel location 112?"
... yeah, those kind of analog quirks will not be part of my new system, only digital quirks I can do in VGA.

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

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Mike »

Radical Brad wrote:Something like... "hey, did you know you can create a new yellow hue by sending 2 bits really fast at pixel location 112?" ... yeah, those kind of analog quirks will not be part of my new system, only digital quirks I can do in VGA.
Don't worry. The VIC-I's pixel clock is a little bit too slow to produce artifact colours. :mrgreen:

What *does* happen is something like an inverse cross-colour effect, where signal components of chroma 'tear' the pixels apart. This is especially visible in PAL with the colours red, cyan, purple, green, orange and their light variants. That's an effect I was glad to eliminate with the S-Video mod.

Furthermore, also on PAL, the chroma signals of two adjacent lines are mixed and can produce extra colours or - in case of complementary colours - nearly desaturate the colour! I use this in a demo to produce a greyscale picture. However, this kind of mixing also works when you sit just far enough away from the monitor. :lol:

Go ahead. <thumbs up> :)
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

I have seen that "ghost bar" on my monitor as well. It's like the edge of the chroma signal is laying down a bit of luminance. This makes some sense if you consider the delay required to phase shift color in the chroma signal, which is at the same 3.579MHz frequency as the pixel clock.

I am one step closer to capturing the signals from the remotely operated 6560 chip now.
Added a 12 bit data bus (blue), and 14 bit address bus (brown) as well as the dual phase clock signals.

Image
Lines for all required 6560 signals.

I added a row of buffers that will translate between 5v and 3.3v as well.
The 6560 will drop in the top right corner, close to the buffers...

Image
Ready for the 6560 on the breadboard.

This thing is like VGER from StarTrek, a LOT of new tech to support a small bit of old tech!

I must now slap together some Verilog code in order to listen to the signals on the 6560.
The initial goal is going to be simple... regenerate the display in VGA.
That will form the basis of the "6560 Drop-in Replacement" sub project.

Once that is working, I will get into the entire GPU / overlay part of this project.

Thanks again for all the comments and ideas.
Hey... anyone here from Commodore?
I would have enjoyed being there back in the day.

Cheers!
Radical Brad
User avatar
Radical Brad
Vic 20 Devotee
Posts: 256
Joined: Sat Jun 24, 2017 8:18 pm
Website: http://www.AtomicZombie.com
Location: Kakabeka Falls, ONT
Occupation: hACKER

Re: VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

I only get a few minutes here and there to mess with this project, but so far it has come along nicely.
It actually looks like something now...

Image
Character generator in the FPGA dumping the VIC-20 character ROM

I converted the VIC-20 character ROM into a Verilog file, and then made a basic screen generator using the values worked out to fit the VIC screen onto the 800x600 VGA screen.

I think the borders fit quite well, and I am very happy with the razor sharp image.
It will be just fine using my VIC-20 as a 6502 development station. No more fuzzy NTSC!

Here is a close-up showing how crisp the image is...

Image
I wish it looked like this in 1982 when I was first using the VIC!

When I have more time, I will connect the 6560 to the FPGA and capture the data.
I have a bit of a learning curve to get around, but it should be fun.

Later,
Radical Brad
Post Reply