Anybody here with Apple ][ experience?

Only 80 columns, but $200 on an Apple 2 is a user input buffer so it was easier to just shove it there for now and save the 2-3 instructions to catch it properly. I’ll fix it properly one of these days :slight_smile:

People in the retro community has a strong attachment to their first machines, the ones they owned, so me for example, I grew up with an Oric, and if a game is available on the Oric and on some better machine in a better version, I’ll generally going to take a look at the best version to see what it looks like… but play the Oric version because that’s the one I would have been able to experience back in the days.

Interestingly, quite a few Oric owners sent me photos of their machines running the game on the real hardware despite the fact that they bought it online pre-packaged with an emulator which is more practical to use than the real thing… but the feeling is not the same, the keyboard under your fingers does not feel the same either.

So that quick decision to move the character buffer to $200 to get it out of the way… cost me several hours.

I got Czech mostly passing (pull sp, pull [sp=spointer], and pull [spointer] all fail to pass although they work fine in my C++ interpreter) and moved onto getting banked memory worked so Adventure is playable.

Adventure mostly worked — but text was garbled in strange ways. I experimented with a different way of mapping text video memory, and eventually narrowed down the issue to abbreviations. If I did all the work for abbreviations but didn’t actually make the recursive call to print them, there was no garbled text. Of course there were no abbreviations either.

I eventually figured out that if I minimized my use of the macros that switched banking back to dynamic Z machine memory, that avoided most of the problems, but it still wasn’t perfect.

Then it finally occurred to me to stub out my buffered character (word wrapping) routine, and all the issues disappeared.

The reason? When I moved the character buffer to $200, I’d forgotten that was now banked memory, so any time I went to print an abbreviation (which live early in dynamic memory, which is not banked) but the rest of the string was in banked memory (which, for Adventure, it happened to be) the buffered character output was writing to $200 in either banked or unbanked memory, so depending on when the buffer was flushed, it would have any sort of gibberish in it.

In the end, the fix was to just move the character buffer to $100 instead, which is not part of that banked memory (and well below my normal stack use).

Sigh. Everything, no matter how mysterious it seems when you’re debugging it, always makes sense in the end once you figure it out.

-Dave

Can anybody recommend a .z3 story file that is no larger than 44k but is otherwise a reasonably complete adventure, preferably with a walkthrough?

I found dejavu.z3 which fit the bill but apparently that was more of an early proof of concept for Inform and I couldn’t figure out what I could actually do with it.

I suspect my z3 implementation is getting pretty close to complete, but I need to be able to identify the difference between z machine bugs and memory-banking-related bugs.

Thanks,

-Dave

Library of Horror with PunyLib 6.0 is 41k. (That’s not the newest PunyLib but you don’t need the newest for this.)

Walkthrough: Inform6-Testing/reg/library_of_horror.reg at master · erkyrath/Inform6-Testing · GitHub

(That’s actually three walkthroughs with different endings. Doesn’t show all the output, just enough to verify that the game is proceeding correctly. For an interpreter test, run in Frotz and get a complete transcript.)

Thank you Andrew! I’d forgotten about that one even though I’d played through all three endings a month or two ago.

I was so happy when I figured out put box on robot.

(Submarine Sabotage seemed promising but it was 64k)

-Dave

Is there a way to get inform to write the old binary debug info format but still be recent enough to handle PunyInform and z3? The -k switch is writing out a nasty xml instead of a nice simple binary format my tools already support.

-Dave

No, we switched over to the XML back in 2014.

Calypso: calypso/prebuilt at master · dave-f/calypso · GitHub

Solution available at :: CASA :: Calypso

Sigh. Never been a fan of the bloat inevitably associated with xml. The debug info for even a simple game is over a megabyte and has no carriage returns in it so it’s difficult to read even in a text editor.

It also refuses to load in Xcode.

It looks like it shouldn’t be too hard to convert the XML back into the old binary format. Just tedious. If I’m not dead tired this afternoon, I could write a little script to do that.

That would be helpful. Thanks.

Here is a function in C# (XmlToDbg) that does that. Shouldn’t be too hard to convert to the language of your choice.

The other option is I could hack up my local copy of Inform6 to dump the old format. Either that, or at least add some carriage returns so it’s legible in a text editor.

-Dave

It’ll be easier to post-process the XML than to hack up the Inform 6 compiler. Write some Perl or Python or whatever your favorite is to pretty-print it. Strip out the <sequence-point> tags, which I’m sure you’re not using, and it’ll get a lot smaller.

I dusted off an old Atari 2600/C64 emulator I’d written a cycle-accurate 6502 core for back in 2010 and reassembled it to work like an Apple 2e. I cheated for now and didn’t implement disk drive support - I just load the interpreter and story directly into memory.

Then I hacked my output routines to write to a magic port that goes to stdout and now I can compare runs of my Apple 2 interpreter and my much-less-buggy C++ interpreter!

Didn’t think of it at the time when I posted, but there’s a walkthrough for Calypso in the file benchmarks.json at GitHub - johanberntsson/ozmoo: A Z-machine interpreter for the Commodore 64 and similar computers · GitHub . Not sure, but I don’t think there’s any randomness that affects the solution, until the very last move, when you have to wait until a certain object points a certain direction.

If you’re still looking, the z3 version of Escape from the Troll’s Cave is 36 KB and The Babysitter is exactly 44 KB. Hints, map and solution are on the game page, as well as at CASA and on my GitHub site.

Slow going lately. I have a divergence pretty early in Library of Horror where a branch in Unsigned__Compare isn’t working properly. What’s driving me crazy is it seems to be correct in Virtual ][, but my bespoke Apple 2e emulator (based on a core that could play several Atari 2600 and C64 games years ago) doesn’t behave the same way and I haven’t tracked down the difference yet. It’s the one I use to generate debug spew that I’ve made match my C++ interpreter (which isn’t 100% perfect either, but can play just about everything I’ve thrown at it. I know Lost Pig has a few weird bugs).

Thank you to everybody who contributed 44k-or-smaller games I can use to weed out the other bugs!

(And yes, based on that other thread, I could just add unsigned versions of jg and jl and patch the story file and move along, but I suspect this isn’t the only place I have a weird bug, it’s just the first place)

-Dave

Does Czech pass without remarks?