Capture 6560 Data From Cart Port

Modding and Technical Issues

Moderator: Moderators

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

Capture 6560 Data From Cart Port

Postby Radical Brad » Sat Oct 21, 2017 2:06 pm

Greets to all Deniers!

I am going to start a new project for my immortal VIC-20 that will connect to the cartridge port.
At this point, I am just data gathering all I can on the port and how the VIC deals with memory remapping.

My project will eventually need to intercept all data meant for the 6560, and so far this looks like an easy enough task.
I intend to design retargetable graphics along with many other upgrades for my favorite computer.
Rather then requiring an NTSC monitor along with the new 640x480 VGA output, I just want to hijack the 6560 data.

Looking at the schematic, it would seem that the cart port is exposed to address bus (CA) before it is switched by a pair of 245's onward to the video bus (VA). So anything destined for (VA) should be present on (CA).

I am just in the drawing board stage so far, so any good links with VIC-20 cartridge design and port info would be great.

Cheers!
Radical Brad

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

Re: Capture 6560 Data From Cart Port

Postby Mike » Sat Oct 21, 2017 2:48 pm

I'm sorry to say that you're on the wrong track with this one - the '245 buffers disconnect CPU- and VIC-side of the busses during VIC fetches. :(

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

Re: Capture 6560 Data From Cart Port

Postby Radical Brad » Sat Oct 21, 2017 4:34 pm

Right, I just noticed that DIR is low, so the buffer direction is A=B and not the other way around.

Looks like I will have to take a different approach.
Right now, I am thinking of something like this...

My expansion boots, expands RAM to capacity, then runs a new OS altogether.
I would rather have an assembler with console anyhow.

At that point, the 6560 is just a ghost, as the new OS will call my new VGA video system for display.

I will explain why I want to do such a nonsensical project later, but here are a few of my basic goals...

- The VIC-20 must remain completely untouched internally.
- The VIC OS (VOS-2000) will have reach of 8MB of 10ns SRAM.
- The new video system will be high resolution VGA with 4096 colors.
- The new sound system will be at least as good as an Amiga.
- All parts used to make this happen must be 1980's components.
- All parts must also be DIP, and currently available (active status) at Digikey.

...I am not afraid of a high chip count in my projects!

I will post a more detailed explanation of my goals soon.
For now, I must get my head around all available ports on the VIC.

I am not limiting myself to just the cart port.
Using the user port, and even possibly sampling the composite H-Sync is all fair game.
I just can't open the VIC... strict rule!

Ok, let the fun begin!
Radical Brad

User avatar
lance.ewing
Vic 20 Afficionado
Posts: 311
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/
Location: Berkshire, UK

Re: Capture 6560 Data From Cart Port

Postby lance.ewing » Sun Oct 22, 2017 3:19 am

Going back to the original post about capturing the 6560 data, I've had some related thoughts over the years. What I imagined was an expansion cartridge just a bit wider so that it also plugs in to the audio/video port. You'd then get the video output accessible in the cart. My thoughts were along the lines of mixing another video signal in to this one and then having a video output at the back of the cartridge.

One such idea I had was to put a second 6560/6561 in to the cartridge. It would then be completely in sync with the internal 6561 because its the same device with the same input clock started at the same moment (I'm hoping those assumptions are all correct). So if their syncs are in sync, then mixing their video output might be far simpler than what these very expensive analog video mixers do. I've seen web sites mention very hacky and simple analog video mixers that have side effects due to the signals being out of sync, but this hopefully wouldn't be an issue if they're in sync.

After I read your posts, I wondered whether maybe you had a similar idea about mixing something as an overlay in to the VIC's video output. Maybe some sprites or something. But then I realised you are maybe trying to replicate what the VIC chip does using the same data that it would fetch. I'll encourage you not to leave the 6560 as a ghost because to me that's the heart of what makes the VIC the VIC, so something that adds to its output would be great in my opinion.

eslapion
ultimate expander
Posts: 4539
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: Capture 6560 Data From Cart Port

Postby eslapion » Sun Oct 22, 2017 7:20 am

Radical Brad wrote:I will explain why I want to do such a nonsensical project later, but here are a few of my basic goals...

- The VIC-20 must remain completely untouched internally.
- The VIC OS (VOS-2000) will have reach of 8MB of 10ns SRAM.
- The new video system will be high resolution VGA with 4096 colors.
- The new sound system will be at least as good as an Amiga.
- All parts used to make this happen must be 1980's components.
- All parts must also be DIP, and currently available (active status) at Digikey.

...I am not afraid of a high chip count in my projects!

At this pint you can probably take an old 8 or 16 bit ISA VGA video card and build a new 6502/65816 computer around it.

Your last 2 requirements are very much contradictory.
No one can do everything. Everyone can do something.

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

Re: Capture 6560 Data From Cart Port

Postby Radical Brad » Sun Oct 22, 2017 10:35 am

Thanks for the replies and ideas!
I should probably explain what my goals are and what I like to do in my basement lab a little more.

I like to travel back to the 80's and build projects using technologies that were available in the good days of computing.
When I say 1980's components, I mean 74 logic in DIP format.
And yes, every IC I use is still active production by several manufacturers.
74HC245, 74HC128, 74HC574, static RAM, etc.
They are certainly less $$$ than they were 30 years ago, but the logic is the same.

I am not new to doing this kind of thing, so making a 640x480 VIC with Amiga style sound is totally possible.
Here is my last project, a 640x480 Video Game System made from 100% pure 74 logic and a single 6502...

Image

A video of it about half way completed...

https://www.youtube.com/watch?v=3fXuFCxMHVI
https://www.youtube.com/watch?v=HqSYwKYwtOo

And if you have nothing but free time, my 50 page build log...

http://forum.6502.org/viewtopic.php?f=4&t=3329



Now that my Vulcan-74 Video System was a success, I want it to evolve as a VIC-20 expansion system.
I now have a clear set of rules and goals, and will post a new thread soon.
The entire build log will follow in that thread, so I hope everyone likes photos. a LOT of photos!

Lance, your idea of an overlay is interesting, and I did not consider that in my ideas list.
I have made NTSC capture systems using 74 counters and SRAM in the past, so it may be something to explore.

At this point, I am aiming towards having the VIC boot and run a new OS with built in assembler.
It will talk to the "VIC-2000" expander via memory mapped segment of 256 bytes.
I want my IDE to offer at least 60 horizontal characters, and perhaps 80, so NTSC is out.

When I have time, I will start a new post with my goals, and start uploading photos.
I have my VIC-20 sitting in the original box beside me, just waiting to come back to life!
Just imagine... a stock VIC-20 kicking the Amiga's ass using only 1980's logic parts.
... it's going to be a fund journey!

Later,
Radical Brad
Last edited by Radical Brad on Sun Oct 22, 2017 11:42 am, edited 1 time in total.

User avatar
lance.ewing
Vic 20 Afficionado
Posts: 311
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/
Location: Berkshire, UK

Re: Capture 6560 Data From Cart Port

Postby lance.ewing » Sun Oct 22, 2017 11:02 am

That Vulcan-74 breadboard system looks amazing, and its certainly something that I'd be interested in reading over in a bit more detail. Over the past year, I've been playing around on a breadboard with a 6561 chip. I was also playing around with building a 4-bit cpu from 7400 series chips, but nothing like what you've built there.

Edit 1: Although I was initially hesitant about this expansion, after seeing that video, I really want to see this happen. I think the purests wouldn't consider this a VIC 20 anymore, in fact even what Kakemoms is building isn't really a VIC 20 anymore. But I quite like the concept of plugging a cart in to the back of an unmodified VIC and it boots up something much more powerful. I'm kind of torn actually. The 6561 is one of my favourite topics with regards to the VIC 20, but I also have a general interest in the type of thing you're working on.

Edit 2: As an aside, are you a fellow lucid dreamer? I saw your name Oneironaut. I used to be very much in to Lucid Dreaming 20+ years ago. If you are, we could branch out to a new thread in the "Off Topic" forum to discuss further.

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

Re: Capture 6560 Data From Cart Port

Postby Mike » Sun Oct 22, 2017 4:37 pm

Radical Brad wrote:I will explain why I want to do such a nonsensical project later, but here are a few of my basic goals...

- The VIC-20 must remain completely untouched internally.
[...]

Some years ago, in 2010, I went to violate exactly that rule to remove some restrictions on the VIC-20 mainboard, which happened to be there just by accident - resulting in those video outputs ... from the VIC-I chip: :mrgreen:

Image Image
Image Image

The hardware modification however was only part of the job. The VIC-20 also runs a dedicated display driver and the pictures are prepared from true-colour images with a converter running on a PC.

At least the wiring in my VIC-20 now bears some resemblance to your approach of building a video processor from discrete components, even if mine's not nearly as complex as your breadboard design. Hats off! :)

norm8332
Vic 20 Devotee
Posts: 289
Joined: Sun Nov 13, 2016 11:04 am
Location: USA

Re: Capture 6560 Data From Cart Port

Postby norm8332 » Sun Oct 22, 2017 4:54 pm

That breadboard logic chip computer is something! I'd never have the patience for that. Nice job!

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

Re: Capture 6560 Data From Cart Port

Postby Radical Brad » Sun Oct 22, 2017 6:30 pm

Amazing stuff!

It gets me charged to see what is still being done with the best computer ever made.
I soldered up a new A/V cable and tweaked my VIC output to look nice on my LCD.

My new project shall now commence.
I will start a new thread, and won't be checking this one.

Thanks,
Brad

eslapion
ultimate expander
Posts: 4539
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: Capture 6560 Data From Cart Port

Postby eslapion » Mon Oct 23, 2017 6:26 pm

@Radical Brad :
Because of the way they are accessed, I know it's possible to adapt the C128's VDC and the C64's SID (or a number of them) to the VIC-20's cartridge port ...and I would know what to do to get it to completion.

What you have done is miles ahead of anything like that.
No one can do everything. Everyone can do something.

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

Re: Capture 6560 Data From Cart Port

Postby Radical Brad » Sat Dec 16, 2017 2:41 pm

As I await a parts order for my current VIC-20 project, I had some time to consider my original thought of capturing the VIC-20 video using only the expansion port.

I know... why bother since the task is impossible?

- Impossible because the 6560 grabs data on the "wrong" side of the bus, which is invisible from the expansion port.
- Impossible because there are not enough address lines connected to the expansion port to reach color data.
- impossible because a device on the expansion port cannot assert R/W and read data from the VIC memory.

Well, I do not dispute any of the above facts.

Having said that... Impossible is not in my vocabulary!

Now I would like to present the following impossibility...

Image
This is an unmodified VIC-20 with a VGA Display!

On the left is the original NTSC display, and on the right an exact copy in VGA.
The only thing plugged into the VIC-20 is an expansion port adapter.
The VIC is completely stock, and requires no wedge software at all.

Here is a video of everything being powered on and working...

https://youtu.be/gKqa0y7E38o

The random screen glitches are due to me being too impatient to wait for level translators!
I am pushing the TTL output form the VIC directly into the 3.3v CMOS inputs on the FPGA.
Yeah... I ain't afraid to hit the NOS switch in my lab when necessary!

Before I explain how I managed to get around "impossible", I would like to leave this open for discussion.
No doubt, those that know the VIC much better than I do will reveal my secret formula easily.

I don't actually intend to use this for anything, I was just bored. This is not a 6560 replacement.
When I am bored I like to try things that I am told won't work.
Sometimes I win, sometimes I set off the smoke detectors!

Cheers!
Radical Brad

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

Re: Capture 6560 Data From Cart Port

Postby Mike » Sat Dec 16, 2017 3:17 pm

It's all smoke and mirrors.

Of course nothing hinders you to capture CPU writes into $1E00..$1FFF and $9600..$97FF and translate their "leftover" addresses on CA0..CA13 (with /BLKx, /RAMx all being high) with a pre-programmed character set into VGA output. That won't work with much more than the text screen. For example, you won't be able to tell VIC register writes from RAM accesses to $1000..$10FF.

What gave you away was the content of the VGA output before the VIC-20 was switched on. :wink:

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

Re: Capture 6560 Data From Cart Port

Postby Radical Brad » Sat Dec 16, 2017 8:46 pm

There may be a mirror or two in this trick, but so far no smoke.

Everything you said is accurate as usual, and the FPGA does set up its own character display, complete with the VIC-20 character ROM stored in the internal block RAM.

But there is more going on here, and you must think outside the box.
If all I did was the few things that you pointed out, then my FPGA would be nothing but a blind man trying to ride half a bus!

Consider these other facts, and you will see a bit more of the picture...

- The 6560-101 generates all of the clocks, from a 14MHz oscillator.
- The divided 1.018MHz clock is available at the expansion port.
- There are 65 clocks per line, and 261 total lines per frame.
- TTL chips are seriously noisy, and an FPGA can be a fast signal processor.

As long as I start my FPG before the VIC boots, I can actually know what where and when the 6560 is going to make a write or read because of the operation of the VIC during a frame (every 16965) cycles. The FPGA can "see" the initialization, and know exactly when the VIC and 6560 begin to access memory.

The FPGA is not so blind all of a sudden.

Now consider what can be done with a 200MHz FPGA and a sensitive comparator on a few of its input pins.
Its amazing what you can "see" when you look at a noisy signal using the right filter.

So it's not all just smoke and mirrors... my VIC is showing mirrored VGA, and that was the only point of the project.
Even this simple test would allow me do do some assembly and look at a crisp VGA screen instead of fuzzy NTSC.

If I have time to me with this project again, I will get your TRON game up and running.
It is totally capable of doing so. I can't beat the game, but it's still fun!

Brad





Mike wrote:It's all smoke and mirrors.

Of course nothing hinders you to capture CPU writes into $1E00..$1FFF and $9600..$97FF and translate their "leftover" addresses on CA0..CA13 (with /BLKx, /RAMx all being high) with a pre-programmed character set into VGA output. That won't work with much more than the text screen. For example, you won't be able to tell VIC register writes from RAM accesses to $1000..$10FF.

What gave you away was the content of the VGA output before the VIC-20 was switched on. :wink:

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

Re: Capture 6560 Data From Cart Port

Postby Mike » Sun Dec 17, 2017 3:48 am

Radical Brad wrote:But there is more going on here, and you must think outside the box. If all I did was the few things that you pointed out, then my FPGA would be nothing but a blind man trying to ride half a bus!

I just stated the minimal requirements to pull off the trick as seen in the video. ;)

If you snoop more on what the 6502 produces as data traffic, you can surely improve on the model of the VIC-20 inside the FPGA, up to the point that the FPGA faithfully reproduces writes into the VIC registers: you'd need to emulate the instruction stream inside the FPGA to infer the missing address bits CA14 and CA15. Next you'd have to mirror the VIA chips, to account for any interrupts and I/O. People here are doing nice things by running VIC, CPU and VIAs in lock-step. :mrgreen:

At one point you have a complete model of the VIC-20 inside the FPGA, and then you'd have something like the current emulators like VICE achieve without a VIC-20 being there 'in person'. :)

If I have time to me with this project again, I will get your TRON game up and running.
It is totally capable of doing so. I can't beat the game, but it's still fun!

Good luck!

Michael


P.S. you actually remember the original purpose of the TRON program in the movie? ;)


Return to “Hardware and Tech”

Who is online

Users browsing this forum: No registered users and 1 guest