Zmachine for Apple IIe

9 posts / 0 new
Last post
Offline
Last seen: 1 year 1 week ago
Joined: Nov 9 2023 - 23:38
Posts: 2
Zmachine for Apple IIe

Hi! I'm trying to develop a zmachine game for the apple IIe and I'm running into some trouble with errors, and am feeling a bit out of my depth, I'm curious if anyone here might be able to help me

When I build my game for z3, it works, and when I build it for z5 I get INTERNAL ERROR 00

so far all of the other z5 games I've found also give me that error - I've been using the ones listed in this guide: https://www.kansasfest.org/wp-content/uploads/apple_ii_inform_paper.pdf

But I don't really know how to find other z5 apple IIe .dsk files to test, or how to figure out why I'm getting this error or what the error means

Any help would be appreciated!

Online
Last seen: 1 hour 37 min ago
Joined: Feb 27 2021 - 18:59
Posts: 599
Interpreter

Which interpreter are you using? If it was one that Infocom supplied with a Z3 game, it will only support Z3.

If you look about halfway down this extensive Infocom catalog, you can see that Z3 titles tend to be under 120KB, but Z5 titles are usually above that. An Apple II 5.25" disk can only hold 113K, so that would be a problem for Z5 files.

You could use larger files either by emulating a hard disk, an 800KB 3.5" floppy, or a Workstation card connected to a network file server.

Offline
Last seen: 1 year 1 week ago
Joined: Nov 9 2023 - 23:38
Posts: 2
Thanks!I'm currently using a

Thanks!

I'm currently using a Big Mess Of Wires virtual drive to load the discs onto the Apple IIe

For the interpereter we've been pulling them out of the z3 and z5 files supplied in the guide I linked in the first post.

The game is currently somewhere around 180k which presents a few problems. z3 discs are capped at 140k, and for z5 if it goes above 100k it wants to be split into two discs

I have managed to get 140k z3 games working, but so far all z5 games (built by us and supplied externally) have given the internal error 00. 

 

I have a few questions

Is the 113k disk size a physical limit of the magnetic media on the floppy, or a limit coded into the apple II for reading or writing discs?

Do you think it would be possible to emulate a 800k 3.5" floppy with the BMOW and have the Apple IIe run it? Would there be problems getting the Apple IIe to recognize a disk that big? And do you know if inform would even let me write a game file that large?

 

I'm really fumbling around in the dark here, so any info or suggestions will be incredibly helpful! We're hoping to exhibit the game at an event tonight, so it's somewhat urgent :)

magnusfalkirk's picture
Offline
Last seen: 1 day 1 hour ago
Joined: Feb 18 2007 - 11:46
Posts: 335
robespierre wrote:Which
robespierre wrote:

Which interpreter are you using? If it was one that Infocom supplied with a Z3 game, it will only support Z3.

If you look about halfway down this extensive Infocom catalog, you can see that Z3 titles tend to be under 120KB, but Z5 titles are usually above that. An Apple II 5.25" disk can only hold 113K

 

Where did you ge this information? the last time I knew Apple II disks were 140k

 

MacFly's picture
Online
Last seen: 1 hour 17 min ago
Joined: Nov 7 2019 - 13:49
Posts: 483
13 vs 16 sectors

113KB was the limit of the original Apple II floppy format, using 35 tracks with 13 sectors (= 35*13*256/1024=113.75KB).

Woz upgraded this to 16 sectors per track, which became the much more common floppy format storing 140KB (= 35*16*256/1024).

Online
Last seen: 1 hour 37 min ago
Joined: Feb 27 2021 - 18:59
Posts: 599
sorry

Right, the earliest version of Zork I for the Apple II was shipped on 13 sector disks, but everything after that used 16 sector disks, which hold 140KB. Mea culpa.

If anyone knows how the story files were segmented onto multiple disks, please do tell. The story file format doesn't have a provision to address segments on different disks: each game is seen as a single blob of bytes. I can imagine schemes where the interpreter handles disk switching, but it could lead to very frequent and annoying messages to switch disks.

Do you think it would be possible to emulate a 800k 3.5" floppy with the BMOW and have the Apple IIe run it? Would there be problems getting the Apple IIe to recognize a disk that big? And do you know if inform would even let me write a game file that large?

For emulating a 3.5" 800KB disk drive in an Apple IIe without a Liron or SuperDrive card, no, because the computer's disk interface doesn't know how to do that. But if the IIe has a card providing SmartPort routines, it can access the Floppy Emulator in SmartPort mode as a virtual hard disk in ProDOS. That mode supports 32MB of data per hard drive partition. There are a number of ways to do this so it would require some research. Note there is an issue that you need to study before using the Floppy Emulator in SmartPort mode.

Inform will let you compile stories up to the maximum size supported by the Z-code version. Z5 has a limit of 256KB, and Z7 extends that to 512KB. But all versions of the Z-machine share a limitation on the size of the memory the story can manipulate, which must be less than 64KB. This is a limit on the complexity of the game logic which has been proven adequate for many large and complex text adventures (the only one I know of that really requires more memory is Hadean Lands). Static text objects are not counted in the 64KB.

Online
Last seen: 1 hour 37 min ago
Joined: Feb 27 2021 - 18:59
Posts: 599
paging

Thinking about it some more (and replying to myself), it looks like it would be easy to load the interpreter and the "dynamic" part of the game (that must remain in RAM) from one floppy, then prompt for the user to switch to the other floppy so the game can page in the "static" data as needed. It would require switching to Floppy #1 again in case of a Load, Save, or Restart.

 

I don't have one of these games on Apple floppies, though, so I'm just speculating. I think AMFV and Trinity are large enough to use it.

Offline
Last seen: 8 hours 2 min ago
Joined: Sep 9 2021 - 01:43
Posts: 24
Pitch Dark

Maybe a z-machine game could be added to Pitch Dark for your own needs.   Pitch Dark is a collection of Infocom games for the 128k //e or better.  It is a ProDOS hard drive image and does not have a need for floppy swapping.   It uses the interpreter On Beyond Z-Machine! by qkumba .

Screwtape's picture
Offline
Last seen: 1 day 17 hours ago
Joined: Dec 29 2023 - 22:22
Posts: 8
I don't know about obtaining

I don't know about obtaining pre-made Apple IIe .dsk files, but the Obsessively Complete Infocom Catalog has Z-machine data files for all Infocom's official releases, along with links to (untested) source-code to official interpreters.

Looking at the source to the Apple II Z3 ("zip") terp, it seems that the "INTERNAL ERROR" message is printed by a subroutine called "ZERROR", and the code that emits error 0 is labelled "NORAM", so I'm guessing when you try to load a Z5 game into your terp it runs out of memory. That doesn't really surprise me, part of the reason for moving to Z5 was to increase the available space for game data. If you're building a modern text adventure for a retro platform, you might want to look into the PunyInform standard library (a cut down version of the regular Inform 6 standard library, designed for use with resource-limited hardware) and maybe a tool like Puny BuildTools to turn a source file into a bootable disk image.

Log in or register to post comments