So i modded my VIC-20CR with 32k, how can i test it?

Modding and Technical Issues

Moderator: Moderators

Post Reply
Robert_99
Vic 20 Newbie
Posts: 3
Joined: Mon Jun 08, 2020 8:08 am
Location: Vienna
Occupation: Teacher

So i modded my VIC-20CR with 32k, how can i test it?

Post by Robert_99 »

I upgraded my VIC-20 with one 62256 instead of all the RAM which was in the Computer (UE2, UD2, U15 and U14). I also combined Basi, Kernel and, if needed, BLK5 inside one 27C257 EEPROM. All the addressdecoding is done with one GAL (16V8). I can even switch from 8k to 32k. I also did NOT use the Kernel or Basic socket for my Upgrade but U15 (the leftmost RAM Socket).
I am new (again) to Commodore and especially VIC-20. As far as my understanding goes there are programs which run <=8k and others >8k. It should matter if 8, 16 or 32k. How can i test this? Which programs can you suggest to test (they should be available too). I have a Pi1541 so getting software on is possible. I already tried a RAM-Test Program which ran fine.
I can document my changes and the .eqn file for the GAL if there is interest.
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: So i modded my VIC-20CR with 32k, how can i test it?

Post by Noizer »

Why not coding you own program to test the expansion?
Simply transfer datas from the 4 blocks to another and verify the patterns.
RAM ranges are:
$1000 - 2FFF
$3000 - 5FFF
$6000 - 6FFF
$A000 - BFFF
As you can see every block hat the same size of 8K.
Bye for now
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: So i modded my VIC-20CR with 32k, how can i test it?

Post by Mike »

Hi, Robert,
Robert_99 wrote:I upgraded my VIC-20 with one 62256 instead of all the RAM which was in the Computer (UE2, UD2, U15 and U14). [...]
from your description that looks like a quite elaborate project. You should in any case follow up with detailed descriptions so others are able to replicate your mod, if they'd like to.

I find it quite interesting you managed to make all that RAM accessible on the "VIC side" of the bus buffers. Normally, only (part of BLK0) and BLK4 are routed through the three 74LS245, everything else remains at the "CPU side", including the cartridge port. Is the VIC chip able to access $0400..$0FFF with your mod?

You should find some interesting info in the sticky thread about my VFLI mod here in the hardware section. Also, there's a quite elaborate test I wrote some time ago, which specifically checks for memory ranges mirrored by design and/or timing errors.

Greetings,

Michael
Robert_99
Vic 20 Newbie
Posts: 3
Joined: Mon Jun 08, 2020 8:08 am
Location: Vienna
Occupation: Teacher

Re: So i modded my VIC-20CR with 32k, how can i test it?

Post by Robert_99 »

Hello Mike, thank you for your reply. I actually used your ram test already and everything works fine. I was unclear about the testing. AFAIK there is sotware which runs only with <=8k and ther is software which needs >8k sometimes 24k sometimes more. But the start of video ram and basic is different with these two configurations. I have a switch now to select 8k or 32k and i want some suggestions of "problematic" software which i can use to test this.
But to make things more clear here are my files:
This is the .eqn file for the GAL:

Code: Select all

GAL16V8    ; first line : used GAL
;Commodore VIC20 SRAM Upgrade

;Fifth Stage is like an alternate 4th stage. We leave the LS138 IO-Dec.
; (UC6) and piggiback the GAL on top.
; We now have four more Outputs and can replace UC5 (LS138 BLK-Decoder).
; We need only /BLK4 anyway
; Also we add two switches (SW1, SW2) to switch between Ram Configurations

;Fourth Stage is RAM Expansion
; We remove UC6 (LS138 IO-Decoder), we get CA10-CA15 and IO0-IO3.
; We remove UD9 (AND Gate) - Pin9 is /BD_E,
; we already removed UC4 (LS138 RAM Decoder) Pin6 is VA13 and
; U13 (AND Gate for RAM Decode) Pin6 is /RAM_CS.
; we also need A13 which we get from Pin 23 of the 6502 (UE10)
; but we need to connect it to the Buffer UE8 (LS245) Pin 11 and at 
; Pin 9 is the output to A13 from 62256 with a pulldown (10k).
; VA14 is conn. to A14 of the 62256.

CA10  CA11  CA12  CA13  CA14  CA15  SW2 S2   VA13     GND
SW1   nc2   nc3   nc4   /BLK4 /RCS  /BDE VA14  /BLK67  VCC

;@UES Sydex

;FIELD addr = [A11..A15];
;FIELD cs = [CE];
;
;TABLE addr => cs {
;	[1000..1F00] => b'0;
;}

;EQUATIONS

;###############################################
;              Original UC5 (BLK Select)
;###############################################
BLK4 = CA15 & !CA14 & !CA13;

;Combined Chip Select for 27128 EPROM
;BLK67 = CA15 & CA14;

;Combined Chip Select for 27256 EPROM + A000
BLK67 = CA15 & CA14
      # CA15 & CA13;
;###############################################
;              Original UC4 (RAM Select)
;###############################################
; S01 = !S2
; VAE = S01 = !S2 
; BLK4 = (!CA13 & !CA14 & CA15 & S2) - !BLK4 = CA13 # CA14 # !CA15 - No RAM from 0x8000-0x9FFF
; BLK0 = (!CA13 & !CA14 & !CA15 & S2)
; VA13 = (/BLK4 & /VAE) or (/BLK4 & S2) or (CA13 & S2 # CA14 & S2 # !CA15 & S2)
; E1 = (!S2 # BLK0)
;########### Universal (8k and 32k)
RCS = VA13 & !S2
    # !CA13 & !CA14 & !CA15 & S2 & SW1
    # !CA15 & S2 & !SW1;

 VA14 = CA14 & S2 & !SW1;
;###############################################
;       Activate this for 6655 Byte (8k)
;###############################################
;RCS = VA13 & !S2
;    # !CA13 & !CA14 & !CA15 & S2;
;###############################################

;###############################################
;       Activate this for 11775 Byte (16k)
;###############################################
;RCS = VA13 & !S2
;    # !CA14 & !CA15 & S2;
;###############################################

;###############################################
;       Activate this for 28159 Byte (32k)
;###############################################
;RCS = VA13 & !S2
;    # !CA15 & S2;
;
;VA14 = CA14 & VAE;
; TEST - works /VAE is not neccessary
;VA14 = CA14 & S2;
;###############################################

;RCS = VA13 & !S2                         BLK4 S1 8000-9FFF (VIC)
;    # VA13 & CA13 & !CA14 & !CA15 & S2;  BLK1 S2 2000-3FFF (8k)
;    # VA13 & !CA13 & !CA14 & !CA15 & S2; BLK0 S2 0000-1FFF (8k)


;###############################################
;                Original UD9 (AND Gate)
;###############################################

;########### Universal (8k and 32k)
BDE = !CA13 & !CA14 & !CA15 & S2 & SW1
    # !CA15 & S2 & !SW1
    # !CA12 & !CA13 & !CA14 & CA15 & S2
    # !CA11 & CA12 & !CA13 & !CA14 & CA15 & S2;

;###############################################
;       Activate this for 6655 Byte (8k)
;###############################################
;BDE = !CA13 & !CA14 & !CA15 & S2
;    # !CA12 & !CA13 & !CA14 & CA15 & S2
;    # !CA11 & CA12 & !CA13 & !CA14 & CA15 & S2;
;###############################################

;###############################################
;       Activate this for 11775 Byte (16k)
;###############################################
;BDE = !CA14 & !CA15 & S2
;    # !CA12 & !CA13 & !CA14 & CA15 & S2
;    # !CA11 & CA12 & !CA13 & !CA14 & CA15 & S2;
;###############################################

;###############################################
;       Activate this for 28159 Byte (32k)
;###############################################
;BDE = !CA15 & S2
;    # !CA12 & !CA13 & !CA14 & CA15 & S2
;    # !CA11 & CA12 & !CA13 & !CA14 & CA15 & S2;
;###############################################
;BDE = !CA13 & !CA14 & !CA15 & S2                 BLK0 0000-1FFF
;    # CA13 & !CA14 & !CA15 & S2                  BLK1 2000-3FFF
;    # !CA12 & !CA13 & !CA14 & CA15 & S2          8000-8FFF
;    # !CA11 & CA12 & !CA13 & !CA14 & CA15 & S2;  9000-97FF
;
DESCRIPTION
VIC20 SRAM Upgrade Address Decoder
to be compiled with galasm.

The Schematics are the original ones just redrawn with kicad. I find it much clearer this way.
Schematics are attached.

Changes are:
Removed:
ALL Ram except Color ram (U15, U14, UD2, UE2)
U13, UC4, UD9, UC5
also i combined Basic and Kernal into one 27c256 which can include BLK5 (switchable) because why not.
I then made an adapter for one 62256 SRAM in U15 and piggybacked the GAL16V8 onto UC6.
I took the unused Pins from UE8 (the '245 Buffer) for A13 and one Output from the GAL for A14.
This makes the Memory much clearer instead of adding 32k after the Ram which is already onboard.
Now i can add another 8k for BLK5 or another 32k (from which are maybe 9-10k useable) to BLK5 and IO2..3.
I have an empty socket from Basic ROM and three Pins left on the GAL so no problem at all.
Let me know what you think.

PS:
BOM: 1x62256, 1x GAL16V8, TL866 (MiniPro) to program the GAL. That's it.

PPS:
And yes the VIC can access all 16k (because it only has 14 Address Lines).
Attachments
right.jpeg
left.jpeg
VIC-VIC.png
VIC20_CR.png
RAM_ROM-RAM_ROM.png
Power-Power.png
IO-IO.png
CPU-CPU.png
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: So i modded my VIC-20CR with 32k, how can i test it?

Post by Mike »

Hi, Robert,
Robert_99 wrote:I actually used your ram test already and everything works fine.
Ah, O.K.

That means, BLK0 (especially RAMx) and BLK1..3 work - from the CPUs view - as expected. You can practically exclude the possibility that 'regular' programs/games/tools/whatever will get into trouble with your RAM expansion. If you populate BLK5 with RAM (i.e., if this is possible), you should also check this.

Having RAM in BLK5 and being able to write-protect that RAM after softloading a cartridge image is a necessity if you don't want to use cartridges anymore. I don't see any cartridge port de-multiplexer in your design, and that precludes any cartridge use with your modded VIC-20 for the time being.
I was unclear about the testing. AFAIK there is sotware which runs only with <=8k and ther is software which needs >8k sometimes 24k sometimes more. But the start of video ram and basic is different with these two configurations. I have a switch now to select 8k or 32k and i want some suggestions of "problematic" software which i can use to test this.
That has been discussed quite extensively here in Denial, and is not something I'd consider "problematic" in any sense. Well written software simply restricts any extra RAM to the configuration of the unexpanded VIC-20, otherwise there are exactly three different RAM configurations you'll have to take into account:
  • unexpanded VIC-20: BASIC start at $1001, BASIC end at $1DFF, screen RAM at $1E00, colour RAM at $9600,
  • +3K expanded VIC-20: BASIC start at $0401, BASIC end at $1DFF, screen RAM at $1E00, colour RAM at $9600,
  • >= +8K expanded VIC-20: BASIC start at $1201, BASIC end at $3FFF/$5FFF/$7FFF, screen RAM at $1000, colour RAM at $9400
These three configurations are mutually exclusive for running programs. Two exceptions to this rule:
  • pure BASIC programs (also those using user defined graphics) written for unexpanded VIC-20 will also run on a +3K expanded VIC-20 (not that this will buy you much), and
  • programs written for +8K will also run with +16K or +24K (and those written for +16K will also run with +24K)
You find more details in the sticky thread "VIC-20 memory layout" in the Programming section.

As an example for the aforementioned 'well written software', you may try my games collection: all those games are designed for the unexpanded VIC-20. If you run the boot loader, it temporarily deactivates any RAM expansion present, and this allows the games to run even if a RAM expansion is there. :) If you, OTOH directly run one of the included games with +8K RAM (i.e., in your parlance, 16K RAM in total), they won't run.

As example for a program, which requires +16K RAM (or more - in your parlance, you'd use 32K RAM in total, i.e. a +24K RAM expansion), you can try out MINIPAINT.

...

Your schematics could be improved by showing the new setup, including how the GAL wedges in.

BTW, VA13 *is* actually /BLK4, not CA15. The original schematic has an error regarding the CS2 input pin of the character ROM, this one is really active low.
And yes the VIC can access all 16k (because it only has 14 Address Lines).
If you now replace your colour RAM by a 16Kx4 SRAM and wire the 4 new address lines to the user port as I did with my VFLI mod, you can also display 208x256 pixels in 16 colours with your VIC-20. :)

Greetings,

Michael
Robert_99
Vic 20 Newbie
Posts: 3
Joined: Mon Jun 08, 2020 8:08 am
Location: Vienna
Occupation: Teacher

Re: So i modded my VIC-20CR with 32k, how can i test it?

Post by Robert_99 »

New schematics:
(nothing new in Power and in IO, switched Addresslines on Font ROM).

I don't have any Cartridges, i can either put BLK5 in my EPROM (along Kernal and Basic) or i can put another SRAM in the BASIC Socket UE11 and use one Output of the GAL for decoding (and maybe another for Writeprotect). For now i use my EPROM-Emulator. I can shoot a .prg file into BLK5 (minus the first two bytes of course) and after a reset it is there and gets usually started.

I also can use another 62256 (i have A LOT of them) and can use it for IO2..3 and BLK5. It doesn't use any extra pins, just decoding in the GAL.

I tried one or two Games from your collection and Minipaint. Everything works as expected (Loader and Tron works with 8k setting, Minipaint with 32k).

I am looking for a Color Ram (or maybe i use another 62256) :)
Attachments
VIC-VIC.png
VIC20_CR_GAL.png
CPU-CPU.png
Post Reply