VIC-2000 Expander. Modern Power Using Retro Parts!

Modding and Technical Issues

Moderator: Moderators

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

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

Postby Mike » Fri Dec 01, 2017 10:20 am

Radical Brad wrote:I also have a rule to never use anyone else's code in my projects.

Sigh. :(

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

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

Postby Radical Brad » Fri Dec 01, 2017 11:06 am

Now having said that, it only applies to the "VIC20" side of this project.
When this thing is done, I look forward to converting all of the great games and demos to work on the "65C02" side.

It would be cool to see other 6502 coders write something for my system as well.

But until everything is working, I intend to force myself into self directed learning.
I am only using the original 1980's VIC and 6502 texts as a reference.

To be honest, the old 1980's books are WAY more accurate than a LOT of the stuff I found on the net.
.... go figure!

Brad

Mike wrote:
Radical Brad wrote:I also have a rule to never use anyone else's code in my projects.

Sigh. :(

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

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

Postby Mike » Fri Dec 01, 2017 11:38 am

Look, I've been in the field of programming for over 30 years now. That skill not only involves writing good code, but also being able to read, understand and value other people's code.

Exactly that statement "I [...] never use anyone else's code in my projects" tells me, that however good you might program, and however you rate your own skills, you're effectively excluding yourself to learn from others.

As an example, I once found an exceptionally well thought out method to convert a number from binary to BCD using the decimal mode of the 6502. It is listed on 6502.org somewhere in its code repository, written by Andrew Jacobs. My client application uses it in a directory viewer to display the number of blocks for each file. I had no issues crediting Andrew for this routine in the manual of MINIPAINT.

Radical Brad wrote:I look forward to converting all of the great games and demos to work on the "65C02" side.

The point being ...?

It would be cool to see other 6502 coders write something for my system as well.

Unlikely, given its prospected one-of-a-kind nature, given that it would only solve your problems, not theirs.

...

I'll continue to follow this thread, sure - but you won't read that much anymore from me concerning your project.

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

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

Postby Radical Brad » Fri Dec 01, 2017 11:56 am

Well, yes and no to that.

Everything I know about 6502 came from others.
A lot of effort went into all of the 1980's books I am currently using to learn from.

But yes, I am limiting myself to only information that requires a lot of self directed "some assembly required" learning.
I would never hit google for "VIC-20 keyboard routine", and use any code I found.
My keyscan routine is based on some of the info I found here regarding the VIA drive and port addresses.
The rest, I worked out for myself.

When I go back to optimize all of my code, I am sure I will learn a lot more as well.

I work in a machine shop for a living, and do not need to be the best 6502 programmer possible, as it is just a hobby for me.
This project is for fun only, and fun to me means being way over my head and constantly challenged.
For this reason, I only seek assistance when I am at the utter end of my frustration limits.

Ok, now back to the task at hand... thousands of wires, hundreds if ICs, and code I must learn.

Brad

Mike wrote:Exactly that statement "I [...] never use anyone else's code in my projects" tells me, that however good you might program, and however you rate your own skills, you're effectively excluding yourself to learn from others.

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

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

Postby Radical Brad » Mon Dec 04, 2017 3:02 pm

So far it looks like my 512K paging scheme will work.

I added a latch to the upper 4 bits of the 512K SRAM that boots and runs the Operating System, and I can have the VIC swap out the upper 32K on the fly. This offers 16 pages of 32K segments, each with a seperate part of the Operating System.

On power up, the VIC will boot to a "User Console", which looks and feels much like the original Basic console.
Using functions keys, any of the other 16 pages can be instantly swapped.
F1 might bring up the Assembly IDE, and maybe F2 will bring up a Sprite Editor.

Just have to tidy up the wiring and make a schematic.
I typically do not bother with schematics, as this kind of thing is mostly instinct, but it is going to get quite complex.

Will post a few schematics soon, showing where the project is at.

Cheers!
Radical Brad

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

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

Postby norm8332 » Tue Dec 05, 2017 11:13 pm

If you made a schematic, I'm wondering if the whole thing or most of it could be done in a FPGA...that would be cool as well. This is an exciting project and I'm sure a lot of people are following this based on views, but it just fly's over a lot of their heads (as well as mine). :D

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

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

Postby Radical Brad » Wed Dec 06, 2017 8:04 am

Thanks for your comments.
I build mechanical things for a living, so I often fly over my head as well.
Not knowing any better is sometimes an advantage, because I try anyhow.
Many times, with positive results!

It absolutely can be done in a single FPGA, and a few months ago I did that exact thing...

https://www.youtube.com/watch?v=CNVghL233FI

That is a real 65C02 talking to the FPGA, which is simulating most of the logic on the massive breadboard.
My original "Vulcan-74" project is similar to this current one (logic section), but used only a 65C02.
This project should offer a lot more, since the VIC-20 is in control!

I hacked up a MOJO FPGA board, and added 2MB of SRAM for graphics storage...

Image
The chip in the bottom right is a 65C02

The results were not bad, but nothing compared to what the retro logic board could do.
Ironic, but there is simply no (affordable) FPGA that has the IO required to emulate my breadboard.

I usually rate many of my graphics projects on how many balls it can move!
The FPGA variant could swing 16 boing balls of 100x100 size, and 256 colors...

Image
16 Boing Power!

In comparison, the 1980's logic based breadboard could easily move 100 balls of the same size with 4096 colors!!
I expect the same or better results from this V2K project, as I have learned a few new tricks since then.

I stopped using modern parts like FPGAs and Micro-controllers for my retro projects, as it took a lot of the challenge from it!
For me, the fun part is doing something on a breadboard that the experts say cannot be done.
40MHz clock speed, insane capacitance, endless cross-talk, and wires up to 2 feet in length!
Hackers do not fear "the rules"!

Verilog is actually easier to learn than even C, so it is a great way to put power in your hands if you want to experiment with seemingly endless speed. The MOJO FPGA board is a nice starting kit as well.

The 6502 enjoyed commanding 1000 Sprites!...

https://www.youtube.com/watch?v=GrsY4SpFpHs

So to answer your question... hell yeah it can be done in a single low end FPGA like a Spartan-6!
There was even enough room left in that FPGA to emulate the 6502 as well.
.... but that would be wrong, just wrong!

Cheers,
Radical Brad


norm8332 wrote:If you made a schematic, I'm wondering if the whole thing or most of it could be done in a FPGA...that would be cool as well. This is an exciting project and I'm sure a lot of people are following this based on views, but it just fly's over a lot of their heads (as well as mine). :D

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

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

Postby Radical Brad » Sat Dec 09, 2017 10:31 am

Over the week, I managed to pick away at the first part of the schematic (The Memory Expansion System).
There are some untested changes I hope to verify this weekend, but most of it is know to work...

Image
The Memory Expansion System - right click on View Image for larger view.

This section is really just the extended memory that the VIC runs the new OS from.
The 512K is broken into 16 pages of 32K, each having a different "hot swappable" program.

Since the internal VIC memory is shared, I can hot switch between pages to transfer information.

An example of this might be during the creation of a new game, I will swap from the Assembler IDE into the Sprite Editor, and then return with a set of graphics coordinates to place in the code. I could pop out to the 6502 Help Page to check out the cycle count for a certain instruction, and then swap over to the Music Tracker to work on the game into music.

With 16 pages (Applications) available, I should have a very complete development environment running on my VIC-20!

Some explanation of how the posted schematic works...

245.01 and 02 are bidirectional Data Bus buffers. 01 controls access to the OS Memory, and 02 sends read or write requests to what will be the multiple memory mapped devices such as Sync Memory, 6502 Memory, and low level logic functions.

245.03 and 04 are the address buffers.
These buffers keep load driving to a minimum for the VIC, and being 74HC logic, are almost invisible anyhow.

157.01 controls the Boot Mode, and has the job of holding the VIC in reset as the OS memory is populated on power up.
The OS Memory is SRAM, but it is boot loaded by ROM on power up.
This lets me use self modifying code and easily upgrade the OS when required.
Once the OS Memory is loaded, the 157 swaps all functions back to the VIC, and takes it out of reset.

574.01 is a data latch to the current page of the OS Memory. 16 pages requires 4 bits from the Data Bus.

To achieve seamless hot swapping of OS Memory pages, I have a common "Kernal2K" routine in the internal VIC memory that is accessed to control page swapping. This way, the changeover of memory does not cause any glitches in the operation. The secondary 65C02 that will run the assembled code also uses this banking scheme to get access to more memory, 8 pages of 64K in that case.

One other feture of this system is that it can be totally disabled without unplugging from the expansion port, leaving the VIC-20 starting up in unexpanded mode. There is a "Run" button on the V2K system that triggers the Boot Mode, so the VIC actually starts up unaware that it has super powers. Since I also like to program in "native" mode, this was a requirement.

If I get my chores done today, I might have time to put down all the new wires and run some tests tonight.
I pulled up all chips and wires the other day, as I didn't like where the VIC-20 plug was located on the breadboard.
Yeah, like I said... this is a project that will require mucho patience!

Cheers!
Radical Brad

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

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

Postby Radical Brad » Sat Dec 09, 2017 2:23 pm

Doing multiple R/W tests on 32,768 memory locations takes some time in Basic!

Image

Oh well, I am cleaning my lab today, so the VIC can churn away while I work.

Once the memory tests are good, I plan on adding some final wiring.
After that, the second external 6502 gets put down.

Brad

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

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

Postby Radical Brad » Sat Dec 09, 2017 3:29 pm

Forgot to mention that I also have 2.2K pullups on all TTL outputs from the VIC.
This brings up the level to the 3.5V low threshold of CMOS logic.

... some laws I cannot break as much as I try!

I know there are 74HCT devices available, but they are not easy to find in DIP format.
Resistors do the job just as well.

Brad

mingle
Vic 20 Newbie
Posts: 13
Joined: Sun Sep 25, 2016 2:38 am

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

Postby mingle » Sun Dec 10, 2017 12:50 am

Great Stuff Brad!

I'm no hardware-hacker (I'm barely a BASIC programmer!), but find this stuff fascinating, as do many other members, I'm sure.

I reckon you were born to late - you would've been a champ back in the CBM hey-days!

Cheers,

Mike.

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

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

Postby Radical Brad » Sun Dec 10, 2017 3:23 pm

Thanks!

It's great to see my VIC coming to life again after so many years in the original box!

I have read the amazing book "On The Edge : The Spectacular Rise and Fall of Commodore" at least 10 times now, and do wish I was working there in the rebellious days. That would have certainly been a good fit.

The response to this project has been unexpected for sure.
I have been contacted several times regarding the FPGA "Sub Project" I started, and have decided to keep it on the burner as well.
This will work out nicely, as I often have time away from my basement lab so I could be working on a portable side project.

I will start a new thread for that one soon, and give it a name as well.
The concept is similar (retargeted and expanded graphics to VGA), but can be easily reproduced.
And like this project, the VIC will remain 100% stock.

Time is scarce again for a while, but I will try to post something interesting again soon.

Cheers, and thanks for the comments.
Radical Brad



mingle wrote:Great Stuff Brad!
I'm no hardware-hacker (I'm barely a BASIC programmer!), but find this stuff fascinating, as do many other members, I'm sure.
I reckon you were born to late - you would've been a champ back in the CBM hey-days!
Cheers,
Mike.


Return to “Hardware and Tech”

Who is online

Users browsing this forum: norm8332 and 1 guest