johanberntsson / ozmoo

A Z-machine interpreter for the Commodore 64 and similar computers
GNU General Public License v2.0
117 stars 19 forks source link

Feature request: Colored PETSCII #47

Closed oemsysadm closed 4 months ago

oemsysadm commented 2 years ago

It would be nice if there was a way to display colored PETSCII inline. For instance have an embedded keyword which will be interpreted to load a file (like those created by PETSCII-Editor by Fieserwolf) from disk, rather than be displayed by the intetpreter.

That way you could embed something like {PETSCII:filename} in your inform output, and when Ozmoo renders it, it will load the file inline.

This would bring relatively cheap graphics of any size to your adventure games. Bonus if text could flow around a smaller petscii image, to create stylized starting letters, etc. Maybe add a style to the command like {PETSCII:filename:flow}.

Similarly this could be used to load SID files for music and sound effects?

Maybe utilize REU support to speed this up further if available.

fredrikr commented 5 months ago

It seems unlikely that we'll do this.

If anyone wants to do this in their own fork, they can of course. There is room for a lot of extended opcodes in the Z-machine standard.

Without modifying the Inform 6 compiler, you can use say opcocde EXT:128 to show image 123, by writing:

@"EXT:128" 123;

Then you "just" need to modify Ozmoo to recognize the EXT:128 opcode and call a routine to load and show an image.

See https://inform-fiction.org/zmachine/standards/z1point1/sect14.html for details.