Infocom games Z-machine

Want to talks about games you like, would like to see developed on the Oric, it's here.
User avatar
Hialmar
Flight Lieutenant
Posts: 349
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Infocom games Z-machine

Post by Hialmar »

While searching for info on Z-machines (the interpreter for Infocom games) I stumbled on an old interview of Dbug saying that someone actually ported a Z-machine to Oric.

Anyone knows where I could find it or even better the source code ?

Thanks.
Hialmar
CEO and Silicium member.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Infocom games Z-machine

Post by Chema »

Those were Fabrice and me, and the program is called pinforic :)

You can download it from http://isa.uniovi.es/~chema/bin/pinforic.zip

I can provide the sources, but need to get to my computer first. It is written in C and assembly.
User avatar
Hialmar
Flight Lieutenant
Posts: 349
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Infocom games Z-machine

Post by Hialmar »

Awesome !

I'd be interested in the sources in order to add the possibility (if it's not already possible) to add loading compressed pictures from a Sedoric disk.
So that it makes a sort of Hobbit like text/graphics game with all the power of the Z-machine.
Hialmar
CEO and Silicium member.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Infocom games Z-machine

Post by Dbug »

Hialmar wrote:Awesome !

I'd be interested in the sources in order to add the possibility (if it's not already possible) to add loading compressed pictures from a Sedoric disk.
So that it makes a sort of Hobbit like text/graphics game with all the power of the Z-machine.
If Pinforic does not use the ROM/Sedoric, it would be much simpler to do this project with FloppyBuilder: It natively supports loading compressed stuff, so you could just put a bunch of pictures and it will automatically decompress them to the screen.

Repeat after me: Sedoric is bad for games. When you use Sedoric:
- God kills a dozen kitten
- You waste 15 kilobytes of memory in average
- You waste kilobytes of disk space
- You waste even more memory because of the intermediate buffers required by decompression if you use Sedoric
User avatar
Hialmar
Flight Lieutenant
Posts: 349
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Infocom games Z-machine

Post by Hialmar »

I have read the readme file. If I understand correctly the code to read and write from/to a DOS disk was made to be fully compatible with existing Infocom games.
As we will be writing our games we could go instead to a full Sedoric solution, couldn't we ?
Hialmar
CEO and Silicium member.
User avatar
Hialmar
Flight Lieutenant
Posts: 349
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Infocom games Z-machine

Post by Hialmar »

Ah yes FloppyBuilder could be a solution if we can save/load games.

IIRC you were working on this, right ?

If I can help with this, I will of course.
Hialmar
CEO and Silicium member.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Infocom games Z-machine

Post by Chema »

Yes, the code is made to read the game data file from a MSDOS formatted disk and supports all the Oric disk drives, including Jasmin. Thank Fabrice for that :)

It also gets rid of the DOS and uses the overlay memory, as the emulator needs it. IIRC the Z machine is 128K and we had to use a virtual memory system to get it working. That did the original Pinfocom interpreter, that I just adapted.

And it also uses the Hires memory to gain space, so text mode only.

This does not mean it couldn't t be done. I'd start by getting rid of the C code and rewrite everything in assembly. This will give some extra space.
User avatar
Hialmar
Flight Lieutenant
Posts: 349
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Infocom games Z-machine

Post by Hialmar »

Ah ok. I'll look at it.
I thought that the first Infocom games worked on low end Apple IIs with 48K of memory.
Maybe I can disassemble one of the first Apple II interpreters and see if it's understandable.

Edit; I checked here and it looks like only the V6 (graphics ones) needed 128 Kbytes:
http://pdd.if-legends.org/infocom/fact-sheet.txt
Hialmar
CEO and Silicium member.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Infocom games Z-machine

Post by Chema »

Yes, you might be right and it is the data file which is at most 128K. Can't remember.

Will search for my sources. But I recall they did not use the OSDK, but the old LCC compiler and assembler. And we tweaked the oric library to include some routines we wanted and support switching the overlay ram on and off when needed (we also used the ROM for things like printf);
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Infocom games Z-machine

Post by Dbug »

Chema wrote:Yes, the code is made to read the game data file from a MSDOS formatted disk and supports all the Oric disk drives, including Jasmin. Thank Fabrice for that :)
It also gets rid of the DOS and uses the overlay memory, as the emulator needs it.
Cool, did not know that it was actually MSDOS compatible with a custom loading system, that's cool :)
So yeah not much opportunities for reducing the size except by crunching down the code of the zmachine I guess.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Infocom games Z-machine

Post by Chema »

Yep. You just have to fresh format an MSDOS (FAT) disk and copy the adventure data file there. After booting pinforic it asks for the game disk and uses it for loading but also for saving the game progress.

The sources are a bit of a mess, really. I have Fabrice's folder contents somewhere, but they include the intermediate files generated by the LCC compiler. I need to clean it up a bit.

Sources were originally written in C by adapting pinfocom's sources and are full of #ifdefs so I could compile it for msdos/linux or Oric and make tests. Fabrice converted many functions to asm to reduce the size and give more speed, and also tweaked the Oric library files to support switching Overlay RAM/ROM.

The only way I'd see to go, would be starting from scratch and making the program fully assembly code. That would crunch the size a lot, and give it more speed, maybe leaving room for the HIRES memory. Adding graphics will be more difficult, as v3 games did not include them in the game file, so they'd have to be drawn from scratch and loaded when needed too!

Supporting v5 datafiles which included graphics and more advanced adventures would be great, but that would need a complete rewrite of the interpreter.

What could be even cooler is using a smaller font to give more columns to the text! (not easy with the Oric's 6-pixel wide characters).

James Groom wrote a review of pinforic here http://freespace.virgin.net/james.groom/oric/rev2.htm

And you can download ready to run disk images with games from the Swedish Oric archive (Infocom section): http://www.skarstad.net/oric/archive.html

Currently pinforic runs at a speed equivalent (and even faster!) to the original implementation of the z-interpreter (measured by Fabrice).
User avatar
Hialmar
Flight Lieutenant
Posts: 349
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Infocom games Z-machine

Post by Hialmar »

In fact we (Silicium - being my association of old computers fans which includes artists ;) ) will be writing our own games with Inform and then run them with Z-machines.

The first target will be Apple IIs but of course I'd really like to have them running on the Oric ;)
Hialmar
CEO and Silicium member.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Infocom games Z-machine

Post by Dbug »

Chema wrote:Yep. You just have to fresh format an MSDOS (FAT) disk and copy the adventure data file there. After booting pinforic it asks for the game disk and uses it for loading but also for saving the game progress.
I guess a possibility would be to have an utility to convert the FAT format to something more adequate for the Oric and package the pinforic with it.
Chema wrote:maybe leaving room for the HIRES memory. Adding graphics will be more difficult, as v3 games did not include them in the game file, so they'd have to be drawn from scratch and loaded when needed too!
Technically, since it's still a text mode adventure, I guess a half HIRES/half TEXT video mode would be enough, that would just use 4 KB instead of 8.
Chema wrote:Supporting v5 datafiles which included graphics and more advanced adventures would be great, but that would need a complete rewrite of the interpreter.
Do you have examples of games using the v3 and the v5 format?
Chema wrote:What could be even cooler is using a smaller font to give more columns to the text! (not easy with the Oric's 6-pixel wide characters).
The Scribe word processor did just that: http://www.oric.org/software/oriscribe-210.html
(But of course in this case you need the full HIRES mode, not the half mode)
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Infocom games Z-machine

Post by Chema »

In the links above you have a list of v3 games (most of Infocom's adventures). About version 5 and graphics, I was wrong. V5 dir some character based graphics (Beyond Zork) but real graphics were not included up to V6, as Hialmar said, with Zork Zero.

Have a look at th Z-code section here http://www.infocom-if.org/more/glossary.html

Anyway still think that a complete rewrite, using FloppyBuilder as you suggest and including graphics is the best idea. But ask should be used, imho.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Infocom games Z-machine

Post by Symoon »

Chema wrote:Yep. You just have to fresh format an MSDOS (FAT) disk and copy the adventure data file there. After booting pinforic it asks for the game disk and uses it for loading but also for saving the game progress.
Wait wait wait.
My mind may be over-simplifying things as it often does, but are you saying that you have a program:
- that runs on Microdiscs and Jasmin
- that can save on a MS-DOS formated disk
???
Am I crazy thinking this could be used to easily make .DSK files form Oric real disks, to PC? :D
Post Reply