Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New and updated Scott Adams-related interpreters #691

Merged
merged 15 commits into from Dec 16, 2022

Conversation

angstsmurf
Copy link
Contributor

@angstsmurf angstsmurf commented Dec 9, 2022

This PR adds the TaylorMade and Plus interpreters to Gargoyle, and updates ScottFree to support graphics in many games, along with the other improvements from #627.

cf07f08 fixes the lock-up problem previously seen during some animations on macOS. I haven't testes this PR on other operating systems.

In Spatterlight, Unp64 (for decompressing Commodore 64 releases) and c64diskimage (for reading Commodore 64 disk images) are shared dynamic libraries. I don't know how to do that in a cross-platform way, so here they are compiled twice or thrice along with each individual interpreter. There is more duplicated code that could potentially be shared.

TaylorMade has been ported from from Alan Cox's original code to Glk and now supports graphics and Questprobe 3. It also fixes some original bugs that made games uncompletable.

Rebel Planet emits some beeps that might be possible to reproduce witch the Gargoyle Z-Machine bleep functionality in a future update.

TaylorMade only supports the ZX Spectrum and Commodore 64 versions of the games, and can read files in z80, sna, tzx, tap, t64, and d64 formats, but all files must be renamed and given a .tay extension for Gargoyle to open them.

Plus supports all known S.A.G.A Plus games, in d64, dsk, atr, st, msa, and dat format, but all must be renamed and given a .plus extension.

Many Plus images have ugly edge artifacts that were not visible against the black background of the originals. I might look into cropping these in the future.

The updated ScottFree supports graphics in the UK cassette releases for Commodore 64 and ZX Spectrum, including the Mysterious Adventures series. It also supports graphics in many later S.A.G.A releases, except those that used vector graphics and Return to Pirate's Island. It can read the z80, sna, tzx, tap, t64, d64, dsk, woz, atr, dat, and fiad formats, but all must be given a .saga extension. For games distributed as two disk image files, both files must be renamed.

The unicode characters used to draw the borders and dice on the battle screen of Seas of Blood show up as question marks in Gargoyle. I haven't checked whether this is just a font problem or they are outside some Glk spec.

And sync with Spatterlight ScottFree code.
This makes keyboard input work in Rebel Planet and similar.
@curiousdannii
Copy link
Contributor

Does it really do animations in pure Glk just through glk_window_fill_rect? I've thought a little bit before about adding a Glk extension for drawing a bitmap from memory, which would surely help with this sort of thing.

@angstsmurf
Copy link
Contributor Author

angstsmurf commented Dec 9, 2022

Yes. This is not the most efficient way to do it, but even if you could draw a bitmap from memory, you would still have to create the bitmap pixel by pixel in the first place, so the difference may not be that great. The big gain would be the ability cache the final bitmaps and reuse them instead of redrawing them every time.

@cspiegel
Copy link
Contributor

Are any of the newly-supported games available anywhere with easy access? I'd love to give these a spin. But in any case, I'll merge this in very shortly. The timing is great, since we're close to a new release.

The unicode characters used to draw the borders and dice on the battle screen of Seas of Blood show up as question marks in Gargoyle. I haven't checked whether this is just a font problem or they are outside some Glk spec.

There should be no problems with Unicode characters. This is almost certainly a font issue. Of course, Gargoyle could help things along by using fallback fonts when glyphs don't exist, but that's another issue...

@cspiegel cspiegel closed this Dec 10, 2022
@cspiegel cspiegel reopened this Dec 10, 2022
@cspiegel
Copy link
Contributor

Pay no attention to the closing/opening, it's just somebody who can't tell the difference between buttons.

@angstsmurf
Copy link
Contributor Author

angstsmurf commented Dec 10, 2022

Are any of the newly-supported games available anywhere with easy access?

Most of them can be found on the Internet Archive. A simple search for scott adams games will give a lot of hits, perhaps too many. The hard part is finding the ones that work.

Perhaps it is easier to download the ZX Spectrum collections from if-archive. The adaminte.zip and mystsoft.zip archives contain plenty of supported games.

@cspiegel
Copy link
Contributor

I have a small pull request at angstsmurf#3. With that I think we can get this merged in.

I also verified that the box drawing characters in Seas of Blood do work with a font that has Unicode box-drawing support.

The image member is just a pointer to the original data from the caller
and should not be freed by the function. Would it make sense to make it a
copy instead?
We don't support the graphics in these two (Pirate Adventure and Voodoo Castle) yet.
Also make DecrunchC64() slightly less confusing.
The companion file name generation was hard-coded for three-letter
file extensions, which breaks when the extension is "saga" or "plus".
The code tries to shrink the image if it doesn't fit, but if it can't,
it might try to draw outside the window, which causes all kinds of problems.
The Time Machine, Claymorgue UK and Claymorgue US.
Found on Internet Archive.
@cspiegel
Copy link
Contributor

Things are looking good to me. Thanks for this!

Any reason to hold up the merge, or do you consider it ready now?

@cspiegel
Copy link
Contributor

One thing I didn't think of: can you add the new interpreters to the README, so they show up on the landing page?

Another thing that may be more problematic: licenses. First, there's no license in the "plus" interpreter, but since you wrote it (apart from the Atari drawing code, which is MIT, so is fine), I imagine that's easy to resolve.

But the unp64 code has this in the license:

Permission is granted to anyone to use this software, alter it and re-distribute it freely for any non-commercial, non-profit purpose subject to the following restrictions:

I believe this is incompatible with the GPL, since it restricts commercial/for-profit use of the code, which the GPL allows. Basically, it's putting restrictions on the code beyond what the GPL does, and the GPL doesn't allow that. I'm not sure the right way to go here. Unfortunately unp64 looks to be pretty big, meaning a clean rewrite isn't much of an option.

@angstsmurf
Copy link
Contributor Author

Right, I remember now that I was worried that would be a problem when they ported ScottFree to ScummVM. Of course it is a problem for Spatterlight as well, but I just didn't consider it before. I guess the ScummVM people either didn't notice the license or thought that rewriting it in C++ was enough to circumvent it.

I've mailed the author of UNP64, Ian Coog, and asked whether he would consider releasing it under a GPL-compatible license. For now I'll just remove the parts that rely on it, which is the European cassette-based C64 releases (mostly available only as D64 disk images). There are a few of those that have unprotected versions as well, and those will work without it.

@angstsmurf
Copy link
Contributor Author

I removed UNP64, and it seems to work.

Ian Coog replied that we can do whatever we want with the code as long as we don't remove the original names from the sources, but that it is based on another tool, Exomizer by Magnus Lind, so I've written to him as well.

@cspiegel
Copy link
Contributor

Great, thank you! I'm merging this in. We can always restore UNP64 later on if we're given the green light to relicense under something compatible with the GPL.

@cspiegel cspiegel merged commit 3d0126c into garglk:master Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants