expanded vs unexpanded

Basic and Machine Language

Moderator: Moderators

Post Reply
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

expanded vs unexpanded

Post by groepaz »

hoy!

now that i am done with converting most of the C64 tests from VICE .... i am doing the VIC20 programs next. one thing i want to do is provide .prg files that everyone is able to run, with least hazzle. so what i am planning to do is (if possible) making one version that runs on standard unexpanded vic20, and then another that runs on expanded ones. (no, i dont want to create binaries that run on both :))

now the question is, if i make the "expanded" version run on "8k (block1)" config (11775 bytes free), will it work on all the other expanded configs? (i choose that because the vic20 i own has that expansion hardwired into it, with no way to physically disable it).

also, is there anything special about the "3k (block0)" expansion? will "unexpanded" programs run on it, or is it a third config that is different from the others?
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
wimoos
Vic 20 Afficionado
Posts: 345
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Re: expanded vs unexpanded

Post by wimoos »

The one major thing that changes is the location of screen memory. It moves from $1E00 to $1000, when an expansion other than 3K is applied. Along with that, the location of the color-RAM is changed from $9600 to $9400.

Because all Basic programs have to be continuous in memory (no gaps between parts of the program), these memory locations are changed as well. Start-of-Basic moves from $1000 to $0400 with an expansion of 3K; to $1200 with a larger expansion. End-of-Basic moves from $1DFF to the end of the expansion with an expansion other than 3K. An expansion of 3K does not move end-of-Basic.

So practically you have to calculate the screen repositioning when you want your program to run independent of the memory configuration.

Oh, and should you make use of WimBasic you can (again) practically get rid of all POKEs, change them to COKEs and WimBasic does the recalculation for you.

Regards,

wimoos
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: expanded vs unexpanded

Post by Mike »

I wrote similar considerations in the thread 'RAM... what to get?'.

Other than that - just use the RAM you deem necessary for a certain test to run, and state that requirement along with each test (or group them by RAM config). If some people aren't able to run a test because they don't have that RAM expansion at hand, it's entirely their problem, not yours.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: expanded vs unexpanded

Post by groepaz »

oh when i want as much people as possible run tests at all, its certainly my problem :) (its hard enough to convince anyone to do it, unfortunately :/)

in reality though, quite some of those programs will need 8k anyway. oh well. so i guess ideally there would be "unexpanded", "+3k" and "+8k" versions, i guess.
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: expanded vs unexpanded

Post by Mike »

groepaz wrote:(its hard enough to convince anyone to do it, unfortunately :/)
True enough. Yet I think anyone who uses a VIC-20 in a "serious" way (as far as can be said about our retro hobby) also has access to a switchable RAM expansion for doing unexpanded, +3K and >= +8K.
in reality though, quite some of those programs will need 8k anyway. oh well. so i guess ideally there would be "unexpanded", "+3k" and "+8k" versions, i guess.
With your permanent +8K RAM expansion, be careful about programs for the +3K config - a RAM expansion in BLK1 takes precedence over the +3K RAM expansion. The limits for BASIC programs, especially the BASIC start address will be set as if the +3K RAM expansion were not present! Of course the RAM in $0400..$0FFF is still there and can be used, just not (normally) for BASIC programs.

Inthusfar the RAM setup you'll get on your VIC-20 - with an additional +3K expansion - will be different from that if you could switch off your internal RAM expansion. To reproduce the original scenario, you'll have to enter: POKE642,4:POKE644,30:POKE648,30:SYS64818

Cheers,

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

Re: expanded vs unexpanded

Post by eslapion »

AFAIK, the configuration of BASIC area and screen memory is almost the same for 8k, 16k, 24k and 32k RAM expansions.

Statistically, in my youth, almost every one had a memory expansion for their VIC-20. Most of them were 8k expansion, about 1/3rd were 16k, you could count 24k and 3k expansion owners by hand.

I knew of one person who had a RAMAX (24k+3k) and less than half a dozen had 3k expansions or Super Expander with 3K.

That was back in 1982/83. I was a member of the Sorel VIC-20 computer club which had about 150 members. I estimate from memory about 100 people had RAM expansions, only 3 people had disk drives.

The BASIC V4 ROM is posted on funet (now Zimmers) in 2006 came from that club.
Be normal.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: expanded vs unexpanded

Post by groepaz »

AFAIK, the configuration of BASIC area and screen memory is almost the same for 8k, 16k, 24k and 32k RAM expansions.
ehrm sorry, but "its almost the same" is completely useless in this context. (actually its.... the same. except for the total amount of available memory of course, but that doesnt really matter)

so far i have made "unexpanded" and "+8k" versions (which should run on anything that have +8k or more) - good enough i think
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: expanded vs unexpanded

Post by eslapion »

groepaz wrote:ehrm sorry, but "its almost the same" is completely useless in this context. (actually its.... the same. except for the total amount of available memory of course, but that doesnt really matter)
BASIC variables location changes...
so far i have made "unexpanded" and "+8k" versions (which should run on anything that have +8k or more) - good enough i think
That's the idea...
Be normal.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: expanded vs unexpanded

Post by groepaz »

BASIC variables location changes...
perhaps, but who cares - most test programs are not BASIC anyway :) (and when they are, the location of the variables doesnt matter at all)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
srowe
Vic 20 Scientist
Posts: 1338
Joined: Mon Jun 16, 2014 3:19 pm

Re: expanded vs unexpanded

Post by srowe »

eslapion wrote: The BASIC V4 ROM is posted on funet (now Zimmers) in 2006 came from that club.
Ah, that's very interesting, I'd been wondering where it originated. Do you know who wrote it? The quality of the code is very good, compact and efficient. Did the club also produce an IEEE-488 cart? The code that interacts with the hardware shows it was quite different from the VC-1112.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: expanded vs unexpanded

Post by eslapion »

@srowe
Unfortunately, the founder of the club, Mr François Lefebvre, is dead. No way to know where this came from.
Be normal.
User avatar
srowe
Vic 20 Scientist
Posts: 1338
Joined: Mon Jun 16, 2014 3:19 pm

Re: expanded vs unexpanded

Post by srowe »

Shame, could you tell me the name of the club? I've modified it to work with the VIC-1112 and I'd like to give proper credit in the header of the source.

Ah, you mention it in your post, Sorel.
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: expanded vs unexpanded

Post by Mike »

Serious topic drift ahead. ;)

@srowe: I found strong similarities between your's and eslapion's BASIC 4.0 and the BASIC extension included with the RTC V-Link cartridge. Maybe you could take a look at the (rather raw) reconstructed source code?
User avatar
srowe
Vic 20 Scientist
Posts: 1338
Joined: Mon Jun 16, 2014 3:19 pm

Re: expanded vs unexpanded

Post by srowe »

Bingo, I'll follow up on that post.
Post Reply