Jump to content
Jet Set Willy & Manic Miner Community

[File] Screen Compress


Spider

Recommended Posts

Screen Compress


This is a very much modified version of the Spectrum 'Artist' screen compressor.

 

I have rewritten most of it to make it a lot, lot easier to use as well as more friendly and more friendly by providing 'step by step' instructions during its use.

 

Simply load the compressor then load in your screen$. You can elect to load in a normal screen or a headerless file, the latter was added as it permits you to load in a screen that is shorter than standard length if necessary for any reason too.

 

Once a screen is loaded, the reduced size is shown and you are offered the option to save it or load a new one. Also offered is a simple colour change for the menu itself as its new default is black text on yellow, but a keypress will cycle through other combinations.

 

The code is saved at 28350 however it is completely relocatable (above this address) without further modification. It is generally recommended to issue a CLS after loading the screen code before executing it and ideally the paper and ink colours should be set the same before the CLS but this is completely optional.

 


Enjoy!


 

Link to comment
Share on other sites

Further to this, you simply need a tiny bit of Basic once you have your screen code.

 

Assuming you load it at the default address of 28350 then simply this will suffice:

10 LOAD "" CODE : RANDOMIZE USR 28350

It is however recommended to set the ink and paper colours the same before running it simply as when it 'draws' the pixels this way they won't show until the attributes are present. Assuming its going to be a black on black then...

10 BORDER 0 : PAPER 0 : INK 0 : CLS
20 LOAD "" CODE : CLS
30 RANDOMIZE USR 28350

As noted you're not restricted to loading it here, I do recommend loading it a little bit higher is possible, although in this case you'll need to issue a CLEAR if you have not already done so as part of of your loading program. :)

 

The 'screen file' used to create the screenshots was actually Kokotoni Wilf, simply as I had said tape file on my desktop. It compressed quite well down to 3888 bytes from 6912, a saving of 3024. The 'saving' is also shown in the compression program too.

 

Obviously results will vary depending on how much duplication is in the screen data as the routine relies on this to compress it. In very very rare cases (I can only recall one) it is possible that the screen may be the same size or (in theory at least) larger than the original although its highly unlikely this would happen and in 99% of cases you'll achieve a saving.

 

The other advantage of the compression is if loading at conventional speed on an emulator (no flash or edge loading) or on a real machine, you lose the 'draw the attributes down the screen' effect as the full screen will appear more or less instantly too.

Link to comment
Share on other sites

Updated.

 

The following changes were made:

 

1. Fixed the inability to cycle through the colours without generating an error. I was aware of this however it did not always occur. I have traced the concern and rectified it.

 

2. Slightly restructured the program so it is now possible to safely RUN it again if you need to without it either complaining about undefined variables, demanding the code being loaded again or (unlikely but was possible) simply crashing instead.

 

3. Fixed numerous typo's, some of which were generated by ZXEditor's tendency to attempt to tokenise words "Load in your" became " LOAD IN your" for example.

 

4. Ensured the 'I do not want to bother to pick a filename' automatic selection worked properly (just press the 'enter' key to auto fill a filename)

 

5. Changed and increased the example page instructions to make it clearer and simpler.

Link to comment
Share on other sites

  • 5 weeks later...
  • 7 months later...

Andy,

 

I've had a go at it, but I'm missing a key piece of information here, and so I'm unable to use this tool. How do I load and save files "within the emulation" on an emulator?

 

Here's what I mean:

 

I open an emulator. It is either ZX Spin or Spectaculator in my case.

 

I load Screen Compressor. I see the menu, like in the screenshot on top of this page.

 

I press "L" and I see the message "Load in your screen now...". And the program is waiting for my input.

 

What should I do at this stage, either in Spin or Spectaculator? How do I load something into the emulated program? I can't figure it out.

 

Your help on this will be appreciated :).

Edited by jetsetdanny
Link to comment
Share on other sites

When you press "L" to load a screen it expects a tape to be loaded (drag+drop into the emulator window) and it will load the first screen$ file on the tape, actually it will load probably any code file so it may be best to drag the tape there first then position it via the Tape Browser if needed to the screen$ part.

 

Its stopped 'waiting' as you describe as its more or less sat at a LOAD "" SCREEN$ command, so its expecting a screen$ file.

 

Once the screen has loaded in, it will then offer to save it for you and show you the savings.

 

The file is relocatable too if required, so you can load it at say 60000 if you want and run it via USR (load address) this being 60000. Don't forget a CLEAR first though. :)

 

Please let me know if you are struggling with this, as I rewrote quite a lot of it to make it easy to use. :)

 

 

 

EDIT... I do have a different version of this but its not quite been polished enough that simply asks for an .scr to be dragged into the emulator instead, then you just press a key to tell it you've "loaded" the .scr and it then compresses that.

Edited by Spider
Link to comment
Share on other sites

Andy,

 

OK, I've got the file loaded into Screen Compressor and processed. Now I've got the screen where it shows the total compressed size and the saving (how many bytes were saved).

 

So now I want to save my compressed screen to the PC. How do I do it? This time I cannot drag and drop anything. When I press "S" it asks me for the file name, then, when I have input the name, it shows me a screen with info that "The screen is relocatable...", etc. and it says, "Start tape, then press any key". When I press a key, the program does what it would do on a real Spectrum - it shows the moving border stripes and makes the sound typical of data transmission. However... it doesn't save any file on the PC, AFAICT, it only saves whatever it does save virtually "within the emulator".

 

So how do I save the processed (compressed) screen, please? :)

Edited by jetsetdanny
Link to comment
Share on other sites

You need to insert a tape. This is fractionally easier with Spin as you don't have to choose to record. Get back to where you were (so its asking you to press a key to save) , then go to the menu in Spin:

 

Recording > Tape Recording > Insert Tape For Saving (nb: Ensure 'Real Tape Mode' is not checked here) , choose a suitable location and filename for the 'tape file' now, choose either .tap or .tzx as the format. Type it in complete ie: mytesttape.tap

 

Now you've done that, press a key to save. There won't be any 'save output' this time, it will just save. Once its complete go back to the Recording menu and 'Eject' that saved tape. Now you can drag / drop it in to load it or edit it with BlockEdit if you wish to.

 

The default address tends to not need a CLEAR but its probably sensible to use something like this to load it in instead:

 

CLEAR 29999

LOAD "" CODE 30000

 

Then just USR it to call it, the execution / call address is the same as the loading address. You can load it anywhere within reason in memory.

 

Extra tip: See the small note in the last paragraph of the first post in this topic. :) , this if done correctly hides it until its displayed. Summary simply here being ensure the ink + paper are the same colour before USR'ing the code, in 99% of cases you'll want a CLS between the LOAD and the RANDOMIZE USR too, regardless of colour choice.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.