Page 1 of 2

VIC 20 adaptive expansion cartridge up to +123K

Posted: Wed Nov 04, 2015 12:58 pm
by MCes
I propose a very flexible and powerful tool for your VIC 20,
it's a cartridge for memory expansion that is configurable via an internal 4bit PIO.
PIO is located in each address from 39936 to 40959 (for simplicity '40000') and it's Writable and Readable,
so the cartridge could be also DYNAMICALLY reconfigured by a running software.

At VIC20 startup you type "POKE40000,N" with 'N' that means:
0) unexpanded configuration (default at powering up)
1) +3K (RAM1+RAM2+RAM3) {+3k(Basic)}
2) like '1' and more: +16K (BLK1+BLK2) {+3k,+16k(Basic)}
3) like '2' and more: +16K WRITE PROTECTED (BLK3+BLK5)
4) like '3' but without the write protection of BLK3,5 {+3k,+24k(basic),+8k}
5..15) like '4' but BLK5 is re-addressed in another of 12 "RAM expansion segments".

So cartridge could become every expansion that you need and/or the memory support of a software that can dynamically chose a 8k page in BLK5 from a 12*8K=96K memory space .

After "POKE40000,N" you can type SYS64802 to restart the operative system of VIC20 for recognize the new memory asset.

PIO is readble with "PEEK(40000) AND 15"
REU.JPG
Price is 44€ +shipping (PayPall gift)

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Wed Nov 04, 2015 3:29 pm
by orion70
Impressive indeed :shock: . Like the label very much, too.
Just asking: what real use for it? Is there any existing software for VIC dynamically using more than 24 (+- 3) kilobytes of RAM?
Great techie stuff anyway!

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Wed Nov 04, 2015 7:23 pm
by dragos
I'll buy one, can you post more pics? and maybe a video of it in action? or is it more of an idea you are looking for input on, the posting isn't clear.

Thanks!

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Thu Nov 05, 2015 9:59 am
by MCes
The cartridge into the pic is the real object and it work like described.
This cartridge is a my project: now don't exists a SW that use this paging but this feature is available for a owner program.

Do you want to load a game that don't work on normal RAM in BLK5?
Put the cartridge and switch-on your VIC20, type POKE40000,4 then load the game: LOAD"dumped game",8,1 then type POKE40000,3:SYS64802 and the game will auto-start correctly.....

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Thu Nov 05, 2015 10:57 am
by dragos
ok, i'm in. anyway we can get some pics of the board? let me know how to purchase this!

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Thu Nov 05, 2015 12:03 pm
by MCes
This cartridge is composed by 2 chips:
the first is a 128K SRAM,
the second is a Programmable-Logic-Device that implement a 4 bit PIO and a Memory-Manager-Unit.

Tomorrow evening I'll try to make a video

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Thu Nov 05, 2015 3:35 pm
by tokra
Interesting design. In configuration 4 this seems to be a simple 35K-expander and the easiest solution to run the VIC-20 port of Doom right now. 128K total isn't too much though and if Jim Brain's UltiMem with 1 MB RAM and 8 MB FLASH ROM really comes out at the announced price of about $40-$50 it would blow all nearly existing expansions away.

Is the price of 44 EUR including the cartridge case? Do you sacrifice some other cartridges for these?

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Fri Nov 06, 2015 2:30 am
by MCes
The goal of my project is to be adaptable at what you need:
do you want a +3k for the relative memory configuration of VIC20 operative system? yes!
do you want a +16k/24k for the relative memory configuration of VIC20 operative system? yes!
do you want a +35k ? yes!
do you want a RAM expansion (with possibility of "Write-Disabling") to load dumped cartridge images with presence of other RAM free for data (example: loading image of LM or BASIC tools cartridges) ? yes!
Do you want to hide a SW (or DATAs) in a pagined BLK? 12 times yes......

It could be every kind of RAM expansion do you need, it's a simple HW-TOOL for improve ( adaptively ) the configuration of your VIC20 without denaturalize it!

I had to sacrified a cartridge for this: the object into the PIC is what I'm selling, case included

NOTE:
thanks for your appreciation and sorry for my English....

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Fri Nov 06, 2015 2:59 am
by orion70
Wait wait wait... You say you're selling only THIS ONE SINGLE cart?
I bet that if you were producing some 10 or 20 of them, you'd sell them in one week :) .

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Fri Nov 06, 2015 3:23 am
by MCes
I have now only (less or more) 10 games on cartridges that I can use to make other of this expansion, I don't know if somebody (else) want buy it... this selling 3d could tell me if I have to make other expansion cartridges or not....


EDIT,
a video: https://youtu.be/2IBQCgudtB0

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Fri Nov 06, 2015 6:28 pm
by brain
Since some have asked, here is how Ultimem does this:
1) +3K (RAM1+RAM2+RAM3) {+3k(Basic)}

Code: Select all

poke 39921,3
2) like '1' and more: +16K (BLK1+BLK2) {+3k,+16k(Basic)}

Code: Select all

poke 39922,15:poke 39921,3
3) like '2' and more: +16K WRITE PROTECTED (BLK3+BLK5)

Code: Select all

poke 39922,175,poke 39921,3
4) like '3' but without the write protection of BLK3,5 {+3k,+24k(basic),+8k}

Code: Select all

poke 39922,255:poke39921,3
5..15) like '4' but BLK5 is re-addressed in another of 12 "RAM expansion segments".

Code: Select all

poke 39922,255:poke39921,3:poke39934,BANK

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Sat Nov 14, 2015 3:24 am
by JanD
My compliments for making this project, however I was wondering about compatibility issues.
Because the project is a RAM expansion, so that you can load games that require more RAM.
You can have RAM all across the 64KByte area, which is great for all sorts of reasons. And switching the functionality of the cartridge via computer control makes it possible to configure the cartridge automatically (if a program or programmer wants this). Which could lead to all sorts of smart and auto-configuring loader programs. For example a loader that checks what the required memory setup of a program should be and then sets the cart. to that configuration and loads the program. This would be nice, because the VIC20 is a bitch because you do not always know the exact loading details of a vic20 game/program (so it saves you the effort of trying the many different configurations of memory before you get it to load).

However, by switching the memory configuration of the cartridge via a memory location (39936 ($9C00) to 40959 ($9FFF)) I was wondering how this could work with games/programs that use that same memory space. Because does this not interfere with program data stored at that location. Or otherwise, does the program stored at the location change the settings of the cartridge? If that would be the case then what would be the point of having that memory area available?

I'm sure I'm missing something, so can somebody explain me how this works?
Kind regards,
Jan D.

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Sat Nov 14, 2015 3:45 am
by Mike
JanD wrote:You can have RAM all across the 64KByte area, [...]
No. The memory layout of the VIC-20 is fixed to map Character, BASIC and KERNAL ROM to $8000, $C000 and $E000 and no external expansion can do anything about that. RAM can only be mapped into "empty" places of the 64K address range, which correspond to RAM1..3 ($0400..$0FFF), BLK1..3 ($2000 .. $7FFF) and BLK5 ($A000..$BFFF).
However, by switching the memory configuration of the cartridge via a memory location (39936 ($9C00) to 40959 ($9FFF)) I was wondering how this could work with games/programs that use that same memory space.
In principle, it is also possible to map RAM into I/O 2 ($9800..$9BFF) and I/O 3 ($9C00..$9FFF) (see here), but this is not normally done. Rather - as the names of those two address ranges, and also their location within the I/O area suggest, they are intended to contain control registers of external expansions - exactly in that same spirit as done by the expansion at hand here.

And as most 3rd-party programs won't have any clue what kind of expansion might be inserted into the VIC-20, and what might be the results of any write or reads(!) to I/O 2 or I/O 3, they usually well advised to stay clear of any (stray) access to those address ranges.

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Sat Nov 14, 2015 3:54 am
by tokra
The area from $9800-$9fff (IO2/IO3) is basically not used by other programs. On an unexpanded VIC you have nothing there (no RAM, no ROM). The area was basically reserved by Commodore for IO-registers that expansion carts might use. No RAM-expansion from Commodore ever used that area.

The MegaCart and FinalExpansion also set their registers into this area. You can also modify a 3K-expansion to a 2K-expansion that fills this area with RAM. Uses are limited, however. MegaCart for example places SJLOAD08 into this area, which makes for nice fast loading times from SD2IEC. Any program in that area is nearly undisturbed as only very few programs use this area.

Regarding the auto-load to the correct address. The File Browser by nbla is pretty good at guessing, never had any real problem with it. I don't know how it's implemented, but basically you just need the load-address of the file which is in the first two bytes on disk:

Load address at
- $1001 means it's for unexpanded machine
- $0401 means it's for +3K
- $1201 means it's for at least +8K

With the last option you can just set the VIC to fully expanded (35K), as programs that will need the 3K area from $0400-$0fff (like Doom) will just use it if available and other expansions over 8K also work with programs that just require +8K - if the programmer didn't deliberately program it otherwise, for which there is really no reason.

Re: VIC 20 adaptive expansion cartridge up to +123K

Posted: Sat Nov 14, 2015 6:31 am
by JanD
Ahh, OK, now I understand. Thanks for making this clear.
Kind regards, Jan D.