Page 1 of 1
Scott Adams cart images
Posted: Tue Aug 15, 2017 8:03 am
by Bobbi
I have been playing around with loading the Scott Adams adventure games into my 32K expansion. The behaviour seems a little bit odd both in VICE and on real hardware.
The Scott Adams games load into BLK2 ($4000-$5ffff) and BLK3 ($6000-$7fff). My memory expansion (Dorktronic 32K) allows each of BLK1,2,3,5 to be turned on/off individually and also for RAM1-3 to be enabled (this is shared with BLK5 though.)
If I start with RAM1-3 and BLK2,3 enabled (no BLK1), then I can load and run (SYS32592) the Scott Adams games just fine. In this case the VIC is booting in +3K expansion mode with ~6.5K for BASIC, BASIC starts at 1025.
If I also enable BLK1, the VIC then starts in 8K+ expansion mode, with ~27K for BASIC, BASIC starts at 4609. When i load and attempt to run the Scott Adams game it goes berserk, printing garbage to the screen. This makes me think it must be corrupted somehow in this memory setup. I played around lowering the top of BASIC but without any luck.
Then it occurred to me that perhaps the Scott Adams games expect the screen memory to be in the normal (unexpanded, +3K) place or they act weird? Or is there some corruption going on that I can't get to the bottom of yet? Poking around in memory using the VICE monitor would seem to suggest that BASIC is not trashing anything in BLK2/3 after I have lowered top of BASIC to below $4000.
Any idea folks?
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 8:18 am
by Mike
Bobbi wrote:Then it occurred to me that perhaps the Scott Adams games expect the screen memory to be in the normal (unexpanded, +3K) place or they act weird?
This.
The games store internal data at $1000 and following, consequently screen output to a screen buffer located at $1000 (as it is with RAM in BLK 1) will: A) make that behaviour visible, and B) shoot that workspace with the texts printed there.
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 8:23 am
by Bobbi
Awesome - that would explain the observed behaviour.
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 8:36 am
by taborj
From here:
http://www.zimmers.net/anonftp/pub/cbm/ ... index.html
You can check out the 00README file which has some more info; I've posted the text here:
HOW TO RUN AN ADVENTURE FROM SCOTT ADAMS
----------------------------------------
An adventure like this is a bit tricky to run, because they're intended to be
run from the original cartridge, rather than from an memory expanded VIC20.
However, with a little knowledge and luck, you'll play a high quality game
from one of the Masters of Adventures, mr Scott Adams.
Follow these guidelines:
1. Check that you have +24k of RAM in your machine. The game only needs +16k,
but it's located in block #2 and #3 of that extra memory. A few expansion
boards can switch every 8k block on or off.
2. Now, enter these few POKEs to turn the VIC20 into unexpanded mode:
POKE 648,30
^------- You'll have to press RUN/STOP + RESTORE after this one.
It moves screen memory to it's position when unexpanded.
POKE 56,30
^------- This one lowers memory top to unexpanded size.
POKE 44,16 : POKE 4096,0 : NEW
^------- This line should NOT be written in three parts, as it
moves start of BASIC to it's position when unexpanded.
Every other value that depends on memory expansion is automatically
changed after these POKEs, so we do not need to worry about them.
Notice that memory left now is exactly 3581 bytes, as the VIC20 would
be in unexpanded mode. Also notice the +24k is still there, but it's
hidden for BASIC. Invisible memory, huh?
3. Now load the game from either tape or disk with
LOAD "PIRATES COVE",x,1
^---- Device, 1 for tape and usually 8 for disk.
The second 1 is important, because it tells
the computer to load the game to the same
position in memory as it was saved on.
4. To run it, you have to know the secret start address:
SYS 32592
^------ All adventures by Scott Adams are supposed to start here.
A game being played can be saved to tape, but not to disk.
5. Exit the adventure with power off, software reset or RUN/STOP + RESTORE.
KNOWN ADVENTURES FOR THE VIC20 BY SCOTT ADAMS
---------------------------------------------
This procedure is supposed to work on at least these games:
Adventureland (Adventure 1)
Pirates Cove (Adventure 2)
Mission Impossible (Adventure 3)
Voodoo Castle (Adventure 4)
The Count (Adventure 5)
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 9:16 am
by Bobbi
Thanks for this readme ... I hadn't run across that.
I am currently writing a little loader program in BASIC for all the Commodore cartridges. I'll post it here once it is in better shape. Part of the motivation for this is so I don't have to remember the SYS addresses to start VICMON, Programmers Aid etc.
I guess it should be possible to write a little pre-loader to move screen memory, move BASIC and then chain my main loader program. I'll play with it when I get a chance later ...
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 1:33 pm
by srowe
One of the nice features of the Final Expansion cart is that it has a loader like this that can describe which RAM blocks to enable. It makes running unusual images like the Scott Adams carts easy.
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 2:02 pm
by Bobbi
It would be nice if my RAM cart had software control of bank selection, but I guess I will settle for a program that tells me which switch to move
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 2:56 pm
by eslapion
Bobbi wrote:I have been playing around with loading the Scott Adams adventure games into my 32K expansion. The behaviour seems a little bit odd both in VICE and on real hardware.
The Scott Adams games load into BLK2 ($4000-$5ffff) and BLK3 ($6000-$7fff). My memory expansion (Dorktronic 32K) allows each of BLK1,2,3,5 to be turned on/off individually and also for RAM1-3 to be enabled (this is shared with BLK5 though.)
If I start with RAM1-3 and BLK2,3 enabled (no BLK1), then I can load and run (SYS32592) the Scott Adams games just fine. In this case the VIC is booting in +3K expansion mode with ~6.5K for BASIC, BASIC starts at 1025.
If I also enable BLK1, the VIC then starts in 8K+ expansion mode, with ~27K for BASIC, BASIC starts at 4609. When i load and attempt to run the Scott Adams game it goes berserk, printing garbage to the screen. This makes me think it must be corrupted somehow in this memory setup. I played around lowering the top of BASIC but without any luck.
Then it occurred to me that perhaps the Scott Adams games expect the screen memory to be in the normal (unexpanded, +3K) place or they act weird? Or is there some corruption going on that I can't get to the bottom of yet? Poking around in memory using the VICE monitor would seem to suggest that BASIC is not trashing anything in BLK2/3 after I have lowered top of BASIC to below $4000.
Any idea folks?
You said it, Scott Adams games won't work if the screen has been relocated.
Start your VIC-20 with your RAM disabled or set to read-only (which will give you 3583 bytes free) and then enable BLK2 and BLK3 only if you can.
The real cartridge is ROM only so it does not alter the available RAM to BASIC.
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 3:39 pm
by Mike
Bobbi wrote:I guess it should be possible to write a little pre-loader to move screen memory, move BASIC and then chain my main loader program. I'll play with it when I get a chance later ...
The only thing
really necessary is to move the screen buffer to the position where it resides with an unexpanded VIC-20 (or +3K, for that matter). It is also useful to have BLK2 and, especially(!), BLK3 protected from BASIC - so string usage in the program below does not possibly corrupt the last few bytes of the soft-loaded cartridge.
Then this small loader here does the trick (with RAM at least in BLK2 and BLK3, and RAM in BLK1 does do no harm):
Code: Select all
1 POKE56,30:CLR:DN=PEEK(186)
2 SYS57809"1*",DN,1:POKE780,0:SYS65493
3 POKE648,30:SYS58648:SYS32592
Replace "1*" with any of "2*" ... "5*" for the files as found on
zimmers.net. Et voilĂ .
Re: Scott Adams cart images
Posted: Tue Aug 15, 2017 6:12 pm
by Bobbi
Thanks Mike - I think I am going to rework my loader program to use those SYS calls rather than LOAD (which restarts the program leaving variables intact). This will make it much simpler! It is much more elegant not to have to turn off BLK1 in order to load Scott Adams
Incidentally - is there is a canonical list of useful SYS entry points somewhere?
Re: Scott Adams cart images
Posted: Wed Aug 16, 2017 12:48 am
by Mike
Bobbi wrote:is there is a canonical list of useful SYS entry points somewhere?
The pinned thread '
ROM calls and other tricks' in the Programming section is a good starting point for sure, even if it's nowhere near an exhaustive list.
In the boot loader above,
SYS57809 scans the following BASIC program for the parameters of LOAD/SAVE, i.e. it prepares the corresponding KERNAL call in the same way as SETLFS and SETNAM would do.
SYS65493 then calls the KERNAL load routine, *without* any extras as done by the BASIC interpreter, like re-linking lines or restarting the program.
SYS58648 is a standard entry to restore I/O. In conjunction with
POKE648,30 it moves the screen to $1E00 and also corrects all other dependent variables in ZP and OS workspace.
SYS32592, well...
Re: Scott Adams cart images
Posted: Wed Aug 16, 2017 5:45 am
by Bobbi
The pinned post is pretty useful. As far as I am aware the KERNAL entry points are reasonably well documented (at least the official ones) but the BASIC entry points are harder to find out about. I guess in this case it is all KERNAL stuff since we are actively trying to *avoid* some of the stuff BASIC does though