Text adventures

Discussion, Reviews & High-scores

Moderator: Moderators

TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

TNT wrote:Small setback. I tried Seastalker yesterday and couldn't get past "Is this correct" after entering my name as it wouldn't accept neither "y", "yes", "n" nor "no" as valid answer.
I just found the reason - dictionary starts at $72xx in memory and spans over $80xx. Dictionary scan should skip $8000-$9fff and continue at $a000 and then wrap back to $0400, but it doesn't. Either $7fxx and $bfxx pages need to be handled separately or I have to change memory layout quite radically. If I move code and some tables all the way to $a000 and screen down to $0400, I have continuous memory for game data. If my source was for VIC-20 only I would do that without thinking twice, but having to maintain wildly different memory layouts for different target computers may end as a logistical nightmare.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

By "screen", do you refer to the actual video matrix read by the VIC chip? In that case, I can right now disappoint you that the VIC-I chip in the VIC-20 can only use onboard RAM: $0000-$03FF, $1000-$1FFF. The +3K at $0400 won't be possible to use for the video matrix.

Perhaps you already knew this, but it doesn't hurt to be repeated, in particular as some emulators ignore this limitation and will make some people write software not runnable on a real machine. Well, if you add internal memory expansion piggy backed on the RAM chips or something things come in a different light, but it might be asking a bit too much to require an internally modified computer to play the game.
Anders Carlsson

Image Image Image Image Image
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

Damn, I only did quick test with VICE to see if it's possible :(

That means there will be plenty of checks for memory splits, as all the code accessing resident Z-machine memory needs to check
a) if page increments from $7f to $80 (jump to $a0) or from $bf to $c0 (jump to $0c)
b) if page is $7f or $bf and current structure (dictionary entry, object, property, string) is only partially on current page
and kludge around the situation somehow.

Moving code to BLK5 would still help a bit, as there would be only one split from $7fff to $0400.
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

TNT wrote:b) if page is $7f or $bf and current structure (dictionary entry, object, property, string) is only partially on current page
I've decided to "waste" one or two pages (depending on whether I move parser code to BLK5) to duplicate memory accross splits - $7Fxx and $A0xx contain same data, same with $BFxx and $04xx. That way I can safely access $7Exx+index as it points to correct data even if page is crossed. Address high byte increments go like 7D, 7E, A0, ... , 9D, 9E, 04 ...

Memory writes still need separate checks to keep duplicated pages identical, but that's much less code than trying to kludge every resident memory access.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

TNT, any news about the development of this Z-code interpreter program? I'm eager to play Zork... :D
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

V3 z-machine seems 100% functional (Zork I can be completed) except save/restore functionality. Fastloader isn't in yet. Games where resident part exceeds $7fff don't work before changes mentioned in couple of earlier posts are done.

I just might have some more time for this now that ice hockey world championships is over ;)
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

TNT wrote:V3 z-machine seems 100% functional (Zork I can be completed) except save/restore functionality.
Oh, we can't skip this unless we play in VICE and use snapshots - but Zork deserves a real VIC...
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

Save/restore isn't much of a problem, splitting the resident part of story file is. I haven't gone through all V3 games yet, but so far it looks like I can limit the parser to games where resident part is under 27.25 KB without losing too many Infocom games. That changes memory map to

Code: Select all

$0400 - $0FFF - Virtual memory, some tables
$1000 - $12FF - Screen
$1300 - $7FFF - Resident part, virtual memory
$a000 - $BFFF - Parser, some tables
With some trickery I could put 22*23 char screen at $0200, but the only effect that would have (in addition to more complexity) is growing maximum resident part to 28 KB.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

TNT wrote:I haven't gone through all V3 games yet, but so far it looks like I can limit the parser to games where resident part is under 27.25 KB without losing too many Infocom games.
This means most of the classic ones, right? And what about Scott Adams'? I've seen that they were converted to z5 format, so your Z-machine is not ready for them?
Sorry for these stupid questions, but I'm too enthusiastic about this project. :oops:
User avatar
Ghislain
Realms of Quest
Posts: 1279
Joined: Sun Aug 08, 2004 12:54 am

Post by Ghislain »

Z code for the VIC-20, that's pretty sweet.

All kinds of interesting stuff coming out for the VIC-20 this year :)
"A slave is one who waits for someone to come and free him." -- Ezra Pound
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

orion70 wrote:
TNT wrote:I haven't gone through all V3 games yet, but so far it looks like I can limit the parser to games where resident part is under 27.25 KB without losing too many Infocom games.
This means most of the classic ones, right? And what about Scott Adams'? I've seen that they were converted to z5 format, so your Z-machine is not ready for them?
So far I have checked Ballyhoo, Cutthroats, Deadline, Enchanter, Four-In-One-Sampler I & II, Hithchiker's Guide to the Galaxy, Hollywood Hijinx and Infidel and all those are playable after memory map change assuming that the datafile headers were ok. I have story files from Lost Treasures I & II on the other computer, they are the ones I will use when I build the final disk images.

I did test V5 and the expanded memory range seems to work, but I have to implement the additional commands before games can really be played. It's possible that there are V5 story files which only use the larger virtual memory, but disassembling them and checking if V4/V5 opcodes are used is something I'm not planning to do.
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

Good news: all Infocom Z3 games (Ballyhoo, Cutthroats, Deadline, Enchanter, Hitchhiker's Guide to the Galaxy, Hollywood Hijinx, Infidel, Leather Goddesses of Phobos, Lurking, Moonmist, Planetfall, Plundered Hearts, Seastalker, Sorcerer, Spellbreaker, Starcross, Stationfall, Suspect, Suspended, Wishbringer, Witness, Zork I - III) fit into $1000-$7fff so they will be playable after I move the parser to BLK5.

V5 versions of Hitchhiker, Planetfall, Wishbringer and Zork I as well as Sherlock will be playable once I implament the new commands.

It's time to write the script which converts raw story files into D64 files :)
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Is it possible to just put the interpreter and the data file onto a disk and go?
I ask because redistributing the data files might irritate Activision.
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

Yes, that's how I'm going to distribute the interpreter. If someone else decides to release complete games then that's not my problem.

Disk layout differs slightly from Infocom C64 versions. Those used 17 sectors per track while I use only 16 as that's much easier to handle and there is just enough room for that. Tracks 1-15 and 19-35 (32 tracks, 128 KB in total) are used for game data, the rest is reserved for the parser.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

TNT wrote:Ballyhoo, Cutthroats, Deadline, Enchanter, Hitchhiker's Guide to the Galaxy, Hollywood Hijinx, Infidel, Leather Goddesses of Phobos, Lurking, Moonmist, Planetfall, Plundered Hearts, Seastalker, Sorcerer, Spellbreaker, Starcross, Stationfall, Suspect, Suspended, Wishbringer, Witness, Zork I - III
This is EXCELLENT news :D . Keep up the good work, TNT.
TNT wrote:V5 versions of Hitchhiker, Planetfall, Wishbringer and Zork I as well as Sherlock will be playable once I implament the new commands.
Good grief! Sherlock! You're saying that three out of four top things in my life will be played together at the same time? Sherlock Holmes, text adventures, and the VIC-20? (The fourth thing is censored, but theoretically it can be done together with the other three... :P ).
TNT wrote:It's time to write the script which converts raw story files into D64 files :)
How exactly will the whole thing work? Will the Z machine be loaded before the story, then the disk will be swapped, and the story loaded in chunks of information from a "story disk"? Pardon my ignorance...
Post Reply