New Low-Cost 32k RAM expanders

Vic 20 Item Exchange

Moderator: Moderators

User avatar
Schema
factor
Posts: 1436
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Sorry to open such a can of worms! :oops:

I agree with carlsson - it might not work for many games. Even if the screen memory is in the right place, there may be assumptions about zero page values and so on. Pure BASIC games are more likely to work, as you said. Even if there's a small ML component in DATA statements or at the end of the BASIC program, then it won't work.

But it's worth a try. I think this is all you need to do:

Code: Select all

POKE 56,128:POKE44,32:POKE8192,0:NEW
These move top/bottom of BASIC to be $7FFF and $2000, then NEWs it. The POKE8192,0 probably isn't needed but they did it in the link orion70 provided.

I just tried this in VICE and FRE(0) reports 24573 bytes free, so it seems to have worked. I started with no expansion, then added it in the Settings menu (as though I had flipped the R/W switch on eslapion's adapter)

Note that you then must load the game with ,8 instead of ,8,1
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Don't forget to move the screen and colour pointers:

POKE 36869,240:POKE 36866,150:POKE 648,30

Hmm.. did I forget something? Of course, programs that redefine custom characters will store those at 7168 or lower, then try to lower RAMTOP by re-poking 56 with 28 or lower. Oops, suddenly end of Basic RAM is lower than start of Basic RAM so we need a way to make sure the expansion memory "intercepts" such POKEs.
Anders Carlsson

Image Image Image Image Image
User avatar
Schema
factor
Posts: 1436
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

carlsson wrote:Don't forget to move the screen and colour pointers:
POKE 36869,240:POKE 36866,150:POKE 648,30
I had assumed that eslapion's trick of leaving the R/W switch in read-only mode at startup was used, and screen location was already as in the 0K/3K configuration. Good POKEs to know anyway.

You're right about things like custom characters though. :x
User avatar
eslapion
ultimate expander
Posts: 5037
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

carlsson wrote:Don't forget to move the screen and colour pointers:

POKE 36869,240:POKE 36866,150:POKE 648,30
The screen and color should already be at the right place if you start the VIC with the expander in Read-only.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Of course, a smart program will do POKE 56,PEEK(56)-2 which wastes 0.5K of our huge 24K memory expansion, but is neglectable if it is only intended to simulate a 3K expansion.

Perhaps one can install some interrupt handler that will "write protect" some pointers for increased compatibility:

Code: Select all

    SEI
    LDA #<irq
    STA $0314
    LDA #>irq
    STA $0315
    CLI
    RTS
irq LDA #$80
    STA $38
    JMP $EABF
Extend example as desired, if there are other pointers that an "emulated" 3K mode doesn't have to adjust. POKEs into arbitrary parts of memory are more difficult to intercept or redirect, but then we're getting into the few really advanced +3K programs that rather would have to be completely rewritten for +8K instead.
Anders Carlsson

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

Post by Mike »

My variant: POKE642,32:POKE644,58:POKE648,30:SYS64818

Of course, the RAMTOP problem remains. Fixing the pointer in the IRQ is not guaranteed to work: If I write-protect RAM for characters, I write 'POKE 55,0:POKE 56,28:CLR' or similar. CLR then sets 51/52 (String TOP) from 55/56. Most probably the IRQ routine did *not* correct the pointer between the POKE and CLR. You'd need to alter the POKE routine itself. Still ML programs would go unaffected.

Well, setting up a complete memory manager, just to get a few +3K programs running on +8K isn't worth the hassle, IMO.

Greetings,

Michael
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Hm yes, we don't want a CLR to happen 60 times a second when running a Basic program. :-) Of course we can restore both 51/52 and 55/56 if that would be the ultimate solution.

Maybe it is possible to write a Basic extention that hi-jacks the POKE (and PEEK) commands, and re-route them to a different memory block? It would be along the ideas of a PET emulator discussed in that other thread.
Anders Carlsson

Image Image Image Image Image
User avatar
Victragic
Frogger '07
Posts: 599
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Post by Victragic »

Hmm...

reading the recent posts, I no longer know if this is on topic or off topic.. lol

But, I want to say I just bought one of these expanders from Eslapion (even before I got a working VIC!) and now that I'm using it I'm thrilled with it.

For me, not having to design it, source the parts, solder it, debug it, buy an eprom burner, etc was well worth the money. It does exactly what it is meant to do and is better put together than I could manage, even with a month of Sundays.

Being able to load carts into the $A000-$BFFF slot is brilliant, and means I don't have to change carts, just load them from disk. So it sits in my cartridge port and will probably never leave..

..And, having no less than 4 cartridges on hand at the touch of a switch is definitely a luxury. It would take a multi-slot expander with at least 5 slots to achieve what this cartridge does, and even then there's no guarantee the carts would be compatible with each other.

So, I would definitely recommend this to anyone (other than to unexpanded freaks - but hey, you use your VIC your way, I'll use mine my way :wink: )

Cheers
-Glen
3^4 is 81.0000001
User avatar
eslapion
ultimate expander
Posts: 5037
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

Victragic wrote:For me, not having to design it, source the parts, solder it, debug it, buy an eprom burner, etc was well worth the money. It does exactly what it is meant to do and is better put together than I could manage, even with a month of Sundays.
Well, I am flattered... :oops: Thank you for your feedback!

Happy to know you enjoy!
:)
Post Reply