TNT's Z-code interpreter, and FE3

Discussion, Reviews & High-scores

Moderator: Moderators

Unseen
Vic 20 Amateur
Posts: 47
Joined: Sun Feb 01, 2009 9:16 am

Post by Unseen »

carlsson wrote:TNT has written his own Z-machine interpreter which runs on PET, VIC-20 and so on.
Oh, neat.

In that case you could just send "CD_" (left arrow) and "CD:<name_of_disk2.d64>" to the drive, the button does basically the same but with less choice which file to change into.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

OK thanks Unseen - but the problem is: once you load the Z-machine, you can't exit to BASIC, but you have to swap disks and load the story disk from the Z-Loader menu. This is the problem with Infocom adventures on *.d64. :cry:
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Is it at all possible that the sd2iec/uIEC could emulate two drives in one device, i.e. 0: and 1: ? If so, it could've been setup with game disk into 0 and save disk into 1. It would be quite natural on a PET but unusual on a VIC.
Anders Carlsson

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

Post by Mike »

Orion70 provided me with enough information, so I could make sure, that the method I described above would work:

The game disc data is mirrored in a CBM partition on a *.d81 file, and the interpreter itself is copied over as regular file. As far as the standard U1/U2 commands are concerned, they access the data on the CBM partition as if it were on a 1541: the track/sector range on a 1581 is 80 tracks@40 sectors, a superset of the 1541 track/sector layout with 35 tracks (@ 21 sectors, max.). And the CBM partition simply allocates the first 35 tracks for this to work.

Orion70, and/or TNT surely will disclose further details in due time.
Unseen
Vic 20 Amateur
Posts: 47
Joined: Sun Feb 01, 2009 9:16 am

Post by Unseen »

orion70 wrote:OK thanks Unseen - but the problem is: once you load the Z-machine, you can't exit to BASIC, but you have to swap disks and load the story disk from the Z-Loader menu. This is the problem with Infocom adventures on *.d64. :cry:
Now guess why the firmware supports two "disk change" buttons which walk the list of disk images (AUTOSWAP.LST by default, can be overridden with XS:<filename>) forward and backward...
carlsson wrote:Is it at all possible that the sd2iec/uIEC could emulate two drives in one device, i.e. 0: and 1: ? If so, it could've been setup with game disk into 0 and save disk into 1. It would be quite natural on a PET but unusual on a VIC.
They already do, in a way similiar to the CMD drives. If you have more than one partition on your storage medium (SD/CF card, IDE drive) they will show up as 1:, 2: and so on. If you have more than one medium (for example two drives on a uIEC/CF) the partitions of the second medium will follow the ones of the first. 0: points to 1: by default but can be moved to any other number with "C-P<number>", which is quite useful when you're dealing with software that doesn't send a device at all or always adds 0:.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Unseen wrote:
orion70 wrote:OK thanks Unseen - but the problem is: once you load the Z-machine, you can't exit to BASIC, but you have to swap disks and load the story disk from the Z-Loader menu. This is the problem with Infocom adventures on *.d64. :cry:
Now guess why the firmware supports two "disk change" buttons which walk the list of disk images (AUTOSWAP.LST by default, can be overridden with XS:<filename>) forward and backward...
Me stupid! I didn't think I was going to need them :evil: .
Hope the *.d81 will eventually get rid of this problem.
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

Mike wrote:Orion70 provided me with enough information, so I could make sure, that the method I described above would work:

The game disc data is mirrored in a CBM partition on a *.d81 file, and the interpreter itself is copied over as regular file.
...
That alone does not do much good as far as saving is concerned, as save state would still overwrite z-machine data. If interpreter knows it's running from 1581 it can use 40 sectors / track and have plenty of room for saves.

(sorry about polluting this thread with discussion belonging here)

edit: to get this post somewhat hardware-related... I'm planning to mount activity LEDs on small switches - that way I don't need to drill additional holes for disk change buttons. Whether I can attach them securely to the case remains to be seen.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

In an earlier posting you wrote:
TNT wrote:Because Infocom games don't usually have enough space for save files on data disk, and I guess most FE3 owners have not installed disk change buttons.
... from which I inferred, that the save file should have been a regular one, present in the directory, and allocated via BAM.

As the game disc data of the *.d64 is transferred into a CBM partition, it is not affected by regular files, and also survives a validate.
That alone does not do much good as far as saving is concerned, as save state would still overwrite z-machine data.
If that still doesn't help because even the save disc data is done with direct access, I'd assume a more fundamental design issue in your interpreter, and/or raise the question why you didn't settle on a bigger format (*.d71 or *.d81) in the first place.
(sorry about polluting this thread with discussion belonging here)
Granted. Even though the topic deviation arose as orion70 asked how to use your Z-code interpreter without the necessity to swap disks in the FE3. Sorry I couldn't be more helpful in this regard.
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

Mike wrote:Iwhy you didn't settle on a bigger format (*.d71 or *.d81) in the first place.
To keep it usable on real hardware if someone wishes to have an ultimate oldschool-experience.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

FE3 + VIC-20 is a real hardware experience, indeed :D .

That's why I ask TNT now: given that I provided Mike with enough info to produce a *.d81 version of Infocom adventures, which includes both the interpreter AND the story disk, would it be a big issue for you to modify the engine, so that games can be saved without direct access to the disk?

See guys, we're now just a single step away from a great achievement, and it would be usable BOTH in FE3 and emulation. Plus, in the same way, this structure and plenty of room in a *.d81 could eventually lead to graphic/text adventures... :wink:
User avatar
Pedro Lambrini
Vic 20 Scientist
Posts: 1132
Joined: Mon Dec 01, 2008 11:36 am

Post by Pedro Lambrini »

So, to continue the OT, can I ask some ignorant questions? When reading the above few posts it sounds to me like the Infocom interpreter and games is both close to working and not really there yet?!? How close is this to being fully functional? And if it's close are there any caveats as to using it? Also, what are the game limits??

The reason I ask is because I bought a FE3 solely in the hope that this comes out. Spending £70 to play Infocom adventures on my Vic is well worth it! :wink:
"...That of the Eastern tribe being like a multitude of colours as if a rainbow had settled upon its brow..." Daniels 1:3
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Pedro Lambrini wrote:The reason I ask is because I bought a FE3 solely in the hope that this comes out. Spending £70 to play Infocom adventures on my Vic is well worth it! :wink:
I'm happy you're such an Infocom fan! :D

I can answer to your questions from my own point of view, i.e. the one of a game tester and final user. The goals accomplished to this point are:

1) TNT has done a great job in creating the Infocom interpreter ("Z-Machine", ZM) for the VIC-20, and adapting the adventure disks to be read from it.
2) The ZM and the adventure are placed in two different disks (or *.d64s, if you prefer).
3) Once you run the ZM, you have to choose the desired number of columns and rows, the colours of border, text and background, switch to the adventure disk ("story disk"), and press RETURN.
4) You can now enjoy your Infocom adventure. Most adventures of the first and second generation have been translated this way; others are simply too big to fit into a VIC story disk (e.g. Sherlock, unfortunately).
5) I tested almost every single adventure of the 24 (!) available, and found no problems, except for Seastalker which had an ASCII map not correctly dispalyed, requiring a patch. The patched adventure works flawlessly now.
6) If you want, you already can play them on real hardware, creating the physical disks and swapping between them with the 1541.
7) The problem with FE3 is: if you don't have the switch disk buttons, you simply can't swap between the ZM and the story disk.
8 ) To circumvent this issue, Mike produced a version of the adventures in which the ZM and the story disk reside both on the same *.d81 image, readable by the FE3.
9) Unfortunately, as the savegame function accesses directly the story disk, it corrupts the whole contents of the *.d81 disk (this point is not so clear for me :? ).
10) Producing a ZM which can save games without direct access seems to be quite difficult, and I asked TNT to which point this means re-writing the engine from scratch.

Summary: you reallly can play Infocom adventures on diskettes with a real VIC, or using either D64s or D81s in VICE; and even play them with a real VIC with FE3, but to this point of development you can't save games.

Hope this helps. :wink:
Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Post by Diddl »

Small question:

why not solder this disk change buttons at FE3? :?:



The firmware is a normal SD2IEC firmware and Disk change is supported.


The reason we don't have this two switch on our FE3 is simply, we (the FE3 team) doesn't know it is nessecary on a VIC. I believd all games for VIC fit on a single disk.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Because the cart is done and closed :mrgreen: and my friend and I are too lazy to 1) open it up, 2) solder the buttons and 3) modify the plastic for buttons to fit into!

My philosophy: why perform risky hardware changes, when you can obtain the same result with software changes? :P
TNT
Vic 20 Hobbyist
Posts: 121
Joined: Wed Apr 29, 2009 5:46 am

Post by TNT »

OTOH: why change software and risk adding new bugs when there is a tested hardware solution?
Post Reply