VIC-2000 Expander. Modern Power Using Retro Parts!

Modding and Technical Issues

Moderator: Moderators

Post Reply
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

VIC-2000 Expander. Modern Power Using Retro Parts!

Post by Radical Brad »

Greets Denial!

Winter is almost here for me again, and I am planning to take on another crazy retro project this year.
This time, an expansion system that will bring my VIC-20 up a few levels in audio / video power.

This project will be called The VIC-2000 Expansion Module, or just V2K for short.

I am doing this as a personal challenge, and have no intentions of doing it the "easy" way.
I really enjoy 6502 assembly, and intend for my VIC to become a very usable development system.
Here are my goals and rules. I always set out strict rules to make the challenge more difficult.

**** GOALS ****
1) The VIC-20 cannot be altered on the inside in any way. It must remain pristine.
2) Video must be VGA with a minimum of 400x600 or 640x480 resolution.
3) Color palette must be at least 4096 colors on the screen simultaneously.
4) The VIC will be able to access 16 Megabytes of super fast Audio / Video memory.
5) A blitter system will be capable of drawing sprites if any size at 8MHZ minimum bandwidth.
6) Sound will be at least 4 channels of 8 bit sampled sound.

**** RULES ****
1) Only VIC-20 era logic components and static memory may be used.
2) All chips must be DIP format, and all testing will be done on a breadboard.
3) All chips must still be available and produced by more than one company today.
4) No special ICs such as FPGAs, GALs, or even ROMs will be used. Just pure 74 logic.
5) The entire V2K system must plug into the back of an unmodified VIC-20.

The above goals and rules are set in stone.
Other than that, the project will evolve as I start to work on it.

At this point, I am still considering options, such as what to do with the original 6560 output.
I am planning a full redo of the OS / Kernal, and instead of Basic, I will boot in an assembler / IDE.

The original VIC will be running the show, but I will probably end up with a second 6502 in my system as well.
I am thinking about having the VIC run the OS / Assembler, and it will assemble to the secondary 6502 for execution.
Such a system would basically be a "6502 Core-II Vic-20".

Much of the work on the video system shall be taken from my previous 6502 mega project called Vulcan-74.

Living a homesteading lifestyle, I am still very busy with outdoor work, so progress will be slow until the deep freeze.
Until I have some free time, let me end with my first project photo...

Image
Fresh out of the box, my original stock VIC-20 still ready to rock!

Talk to you deniers soon... thanks for defending the faith!
- 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 »

Another goal of the V2K project is to enjoy 6502 programming without reliance on the modern world.
All development of games and demos will be done directly on the VIC-20, and not on a PC.
This is why the new 60/80 column VGA display will be nice... not staring at wavering NTSC for hours.

When VIC-2000 is done, I will be coding, assembling, running, and saving programs directly on the VIC.
No modern PC or components will be used, just pure 1980's logic and an unmodified VIC-20.

I intend to use this system for all of my coding, so it's not just a novelty item for me.
I get no joy from programming a modern PC, and want to get back to 6502 assembly.

My next step is to create a board to fit the VIC expansion slot, and breadboard 32K of SRAM.
I will then have this bootstrapped serially from an external source.
Think if it like Amiga Kickstart for the VIC.
My OS (IDE and Assembler) will live in the kickstart image.
VIC-20 will boot, and run the OS directly.
The new OS will send its video output to the new VGA system.

Once I can get the VIC talking to some external SRAM, I can move ahead on the Video System.
From there, I will begin coding the new OS and assembler.

Can't wait to dig into this project!

Later,
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 »

A quick question for the VIC-20 experts here...

Reading info on expanded memory and cartridges, it appears that as long as there is code located on BLK5 (Address : $A000), then the VIC boots form there on power up. This is how a cartridge game starts up. So if I create a 32K expansion system that includes my OS (bootstrapped to SRAM from ROM), then the start of my code must reside at location $A000?

This is the memory map I have been studying...

0000-03FF 00000-01023 System variables BLK 0
0400-0FFF 01024-04095 3K expansion RAM area B0
1000-1DFF 04096-07679 User Basic area B0
1E00-1FFF 07680-08191 Screen memory BLK 0
* 2000-3FFF 08192-16383 8K expansion RAM/ROM BLK 1
* 4000-5FFF 16384-24575 8K expansion RAM/ROM BLK 2
* 6000-7FFF 24576-32767 8K expansion RAM/ROM BLK 3
8000-8FFF 32768-36863 4K Character ROM BLK 4
9000-93FF 36864-37887 I/O block 0 BLK 4
9400-95FF 37888-38399 COL RAM,BLK 1 filled BLK 4
9600-97FF 38400-38911 Normal COLOR RAM BLK 4
9800-9BFF 38912-39935 I/O block 2 BLK 4
9C00-9FFF 39936-40959 I/O block 3 BLK 4
* A000-BFFF 40960-49152 8K Expansion ROM BLK 5
C000-DFFF 49152-57343 8K BASIC ROM BLK 6
E000-FFFF 57344-65535 8K Kernal ROM BLK 7

I have marked the segments I intend to populate with an asterix.

My goal is to expand the VIC to 32K using the expansion port, and to have my own OS boot up.
I am using 15ns SRAM that will be bootstrapped by an external source while the VIC is held in reset.

Also, does anyone have a datasheet on the ROMs used for carts, or know the speed?
I heard they were 450ns.
If this is true, I could code an AVR to act as as a fake ROM as I develop my new OS.

This code would derive a ROM with 266ns access time in an AVR running at 30MHz...

Code: Select all

LOOP:
in ZL,PINA ;1
in ZH,PINC ;1
elpm r16,Z ;3
out PORTD,r16 ;1
rjmp LOOP ;2
The above code would assume that the VIC would wait at least 266 nanoseconds after issuing an address to then read the data put on the bus, since the very simple AVR loop just does a lookup from internal memory after reading the hi and lo address bits.

Using an AVR as a fake ROM would make it easy to develop the new VIC OS, since I already wrote a converter that takes output form the Kowalski 6502 Assembler and spits it out as a loadable AVR binary file.

Using this system, I can create the OS on my PC using the Kowalski assembler, and see it running on the VIC within 5 seconds of pressing the "Convert" button. Makes life much easier.

If this "realtime" fake ROM idea fails, then I will just have the AVR stuff a CY7C199 SRAM before unresetting the VIC.
Either way, it makes development of VOS-2K much quicker.

Once the VOS-2K Assembler is ready, I will cut the cord and no longer cross develop.
All coding done for VIC-2000 will be done on the actual hardware.

Thanks,
Radical Brad
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

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

Post by srowe »

Radical Brad wrote: Reading info on expanded memory and cartridges, it appears that as long as there is code located on BLK5 (Address : $A000), then the VIC boots form there on power up. This is how a cartridge game starts up. So if I create a 32K expansion system that includes my OS (bootstrapped to SRAM from ROM), then the start of my code must reside at location $A000?
The autostart sequence "A0CBM" must reside at $A004. The coldstart and warm start vectors can point to anywhere in memory.
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 srowe, searching for "A0CBM" brings up a good stockpile of info I had not previously found when searching for Vic-20 cartridge info.

This site seems to explain it all...

http://comp.sys.cbm.narkive.com/0WNJAHD ... dge-format

From the link...

Code: Select all

Address______Hex value_____Decimal value____ASCII values
$A004 $41 65 Capitol "A"
$A005 $30 48 Digit "zero"
$A006 $C3 195 Reverse "C" character
$A007 $C2 194 Reverse "B" character
$A008 $CD 205 Reverse "M" character

If the computer finds this five-byte sequence exactly as shown, it
turns control over to the machine language program in the cartridge.
To do so, it needs to know where the program begins. There are four
bytes which determine this, as shown below: (Also within the cart.)

Address______What this byte of information contains__________
$A000 Low-byte of a 16-bit "hard start" address (to begin at)
$A001 High-byte of the 16-bit "hard start" address

$A002 Low-byte of 16-bit "warm start" address (restore key)
$A003 High-byte of 16-bit "warm start" address
So it's basically a new reset vector placed at location $A002 instead of the usual $FFFC.
The Kernal peeks at location $A004 for the secret "boot the cart" code.
I should have enough info to get my VIC to book from external SRAM now, thanks.

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 »

Although I won't be able to put any large blocks of time into my project until the deep-freeze, I am trying to get at least a few minutes into it each day. In a week or two, i will be buried under 3 feet of snow, so V2K will get more attention!

Last night, I found an old Donkey Kong cartridge with a smashed case, and de-soldered the ROMs to make a prototyping connector for the expansion port. I am going to bring all signal lines out to my massive breadboard so I can get my on-the-fly ROM emulator up and running.

Once that is working, I will be able to start coding my new Operating System (VOS2K). My new OS will boot directly into an assembler that feels much like the Kowalski 6502 Assembler, which I find to be a very good program...

http://exifpro.com/utils.html

VOS2K will allow editing of at least 32,000 lines of assembly code, complete with code formatting and commenting.
My assembler will probably be a two pass type, and will assemble directly to the dedicated 6502 segment.
Source code will live as pure text in the 16MB of SRAM used for multimedia assets.
I will post my proposed memory map when I have the chance.

VOS2K will evolve as I start programming software and creating hardware, so I am not setting too many goals at this point. Multi-processor (65C02) and mouse support are a few of the options on the table.

When I am home tonight, I will post a few photos of the giant prototyping board I am going to be using.
My DIY breadboard uses 48 linked breadboards, for a total of 50,000 tie points!
I can support approximately 280 logic ICs on my board, but I may actually need more space.
It takes a lot of 1980 era 74 logic to create a high speed VGA blitter and sound system!

Cheers,
Radical Brad
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

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

Post by eslapion »

@Radical Brad
It looks to me like you're going to essentially build a new computer to which the VIC-20 is just going to serve as a keyboard connected via the cartridge port.
:?
Be normal.
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 »

The unmodified VIC-20 host will be completely running the show.
My hardware is really just a bunch of fast counters and some SRAM.
.... ok, LOTS of SRAM!

Yes, I am certainly retargeting the video and sound, but the original 6502 is doing all of the heavy lifting, including running the OS, assembler, and the assembled program.

I will even leverage the original Kernal routines to call the keyboard and joystick ports.
The original VIC sound will also be mixed with the new sound system and used as part of the user interface.

The only part of the VIC that will not be used will be the Video from the 6550 chip.
As this is going to be my main programming computer, I don't want to be glazing over a 21 column fluttering NTSC screen for hours will I code 6502 assembly. Been there, done that!

Think of this project as an external video card for the VIC. The VIC is certainly not optional!

The amount of "hardware" I am adding may seem excessive, but don't forget... the 1541 disc drive is a full computer with its own 6502, and probably 2x the circuitry than the VIC itself, and it is just a peripheral.

I want my VIC-20 to play Lemmings, and will probably recode many of my favorite VIC originals to take advantage of my new hardware as well.

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

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

Post by eslapion »

Radical Brad wrote:The unmodified VIC-20 host will be completely running the show.
My hardware is really just a bunch of fast counters and some SRAM.
.... ok, LOTS of SRAM!

Yes, I am certainly retargeting the video and sound, but the original 6502 is doing all of the heavy lifting, including running the OS, assembler, and the assembled program.
While there are many people who would like to keep the audio/video/io functions of the VIC-20 as is and simply increase the CPU speed, you choose to go the other way around.

It's an original approach that has it's merits.
I will even leverage the original Kernal routines to call the keyboard and joystick ports.
The original VIC sound will also be mixed with the new sound system and used as part of the user interface.
The kernal routines of the VIC-20 don't access the joystick port (a single one so, no 's').
The only part of the VIC that will not be used will be the Video from the 6550 chip.
As this is going to be my main programming computer, I don't want to be glazing over a 21 column fluttering NTSC screen for hours will I code 6502 assembly. Been there, done that!
The 6560 displays with no flutter at all if you use only black and white or use the S-Video mod.
Think of this project as an external video card for the VIC. The VIC is certainly not optional!
That's the way I saw it. A vast improvement on either using a C128's VDC or the Data-20 80 column display cartridge.

Considering the specs you have published, I suspect an Amiga's ECS Denise along with the usual surrounding analog circuitry and DRAM would do what you want.
The amount of "hardware" I am adding may seem excessive, but don't forget... the 1541 disc drive is a full computer with its own 6502, and probably 2x the circuitry than the VIC itself, and it is just a peripheral.
The hardware you're adding doesn't seem excessive considering the specs you want to achieve but it's not true there is more circuitry in a 1541 than a VIC-20.

The 1541 seems densely populated because it has it's own internal 5V/12V power supply. If you compare the board of a 1541-II which has the power supply fully external to the board of a VIC-20cr also using a fully external PSU then it is obvious the VIC-20's board is larger and has more ICs.
Be normal.
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 was probably too harsh on the good ole 6560!
On my NTSC enabled VGA monitor (above photo), the VIC actually looks great.

Perhaps I should reconsider ghosting the original VIC video, and put this to a vote...

(1) I continue as planned, all output redirected to my new VGA adapter and monitor, and no NTSC connection.

(2) I use the original VIC output as the assembler, and route the executing program to a second VGA display.


Option (2) is kind of cool because the entire VIC is being used, and it now has a dual display!
With the crisp VGA, shown above, I could probably do a 6x6 font and get a 29 x 30 char display instead of the original 22 x 23.

I may have already convinced myself just typing that out, but will see what y'all think about it.
It's always great to get input as these projects start to take shape.

Cheers!
Radical 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:On my NTSC enabled VGA monitor (above photo), the VIC actually looks great.
Of course it does. :)
With the crisp VGA, shown above, I could probably do a 6x6 font and get a 29 x 30 char display instead of the original 22 x 23.
People have been doing a 40x24 text display (on a stock VIC-20, just with RAM expansion) with 4x8 pixel glyphs on a 160x192 bitmap for quite some time now, see:

http://www.sleepingelephant.com/ipw-web ... 9&start=15

... with a list of example programs mentioned in the thread (MINIPAINT, MG BROWSE, VIN, etc.) a few posts further down.
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, I am convinced now!

My VIC will remain fully functional, and V2K will become a secondary display and sound system.
Now I am even tossing around this idea...

- Generate NTSC from my logic instead of VGA and go old-school CRT instead of VGA.
- Overlay the new video right over the original VIC screen, using a PLL on the VIC HSync to time my board.

There are some limitations I am aware of with NTSC, as I did many years of design with it.
For instance, 320x224/400 is the maximum resolution you can get decent color text.
I have however, done decent game systems that generate 512x400 images on NTSC.
With moving sprites, and fat text, you can do high resolution just fine.

Here is a simple 7400 based NTSC video generator I made years ago...

Image
256x240 Resolution and 256 colors. NTSC chroma generated by logic delays.

https://www.youtube.com/watch?v=MQO-aXIFvFs

I will have to drag up a decent 1084 or similar composite monitor though.
I do not have a CRT in my collection currently.
Anyone in out there in Ontario have something in good shape for sale?

I knew the project would evolve... some great ideas and advice here, thanks.
Brad
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

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

Post by Schema »

Radical Brad wrote:Anyone in out there in Ontario have something in good shape for sale?
I'm in Toronto and have some spares, but that's still quite far away...Ontario is huge!

I see you're close to Thunder Bay, do you know Robin Harbron? He's got a decent collection of Commodore equipment and is very knowledgeable, I'll point him to this thread and see if he has a spare monitor etc.
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, yes I know him.
It would be nice to acquire a good condition 1084 or 1080 for this project, and I would certainly offer what it's worth.

I have been doing some figuring while I cut the last bit of wood today. Just in for a break!

Now that I am dedicated to keeping the original VIC output in my project, I am really considering an overlay.
The 6560 is clocked at 14.318 MHz, which id 4 times the color burst. Good, I like that frequency, and used it a lot in the past.

At 14MHz, that's about 908 cycles per horizontal line, 680 of which can display in the active video area.
Divide that by two, and it gives a very nice 320 x 200 display if I choose to toss the interlace.
I could also try for a 640 x 400 interlace display, knowing that only moving images would look decent.

This leaves me with two different options that would work out nicely if I choose retro NTSC all the way instead of VGA.

Option One...
Overlay a 320 x 200 image directly on the original VIC display, using the 14.318 MHz clock as my new pixel clock.
When the VIC commands the new hardware to draw, it could just issue a black screen to hide its display.
The VIC could also use its display along with the new display as a kind of hybrid.
At 320x200 with 256 colors, the new enhanced display would be like a VIC/C64/Amiga hybrid.

Option Two...
Dual displays with the VIC running on one NTSC monitor, and the new video system on another identical monitor.
This has the advantage of allowing the VIC IDE / Assembler to keep on displaying as the game / demo is running.
Timing could also be "tweaked" to divide a 28.636MHz clock by 3 to display 450 x 400 interlaced lines.
Yes, the new display would not be great for text, but the goal is games and demos, and the original VIC will now be the IDE.

Not sure which way to go yet.
Option One is cool because it mixes the new video with the original VIC.
Option Two offers a bit more power.

So many choices... wish I had that problem back in 1981 when I was first using this VIC-20.
Back then the only dilemma was... washed out color on channel 3, or wavery image on channel 4!

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

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

Post by eslapion »

Radical Brad wrote:It would be nice to acquire a good condition 1084 or 1080 for this project, and I would certainly offer what it's worth.
Back in 2010, I bought one of the very last RCA TruFlat 20" CRT TVs. It has an S-Video input and I use it with both the C64 and VIC-20 (with S-Video mod).

It offers an image quality that is on par with what I had with the Amiga 1080 (early model) when set to separate video input. Keep in mind the 1080 was 25 years old when I bought the RCA set.
Be normal.
Post Reply