Jump to content


Photo

[File] Screen Compress


  • Please log in to reply
16 replies to this topic

#1 Spider

Spider

    XOR (HL)

  • Administrator
  • 3,367 posts

Posted 26 May 2017 - 02:36 PM

Posted Image

 

File Name: Screen Compress

File Submitter: Spider

File Submitted: 26 May 2017

File Category: Other resources

System: Sinclair
Original Author(s): B. Jangeborg
Third Party Author(s): Andy Ford

 

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!

 

Click here to download this file


Changing order to chaos since 1984

#2 Spider

Spider

    XOR (HL)

  • Administrator
  • 3,367 posts

Posted 26 May 2017 - 02:41 PM

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.


Changing order to chaos since 1984

#3 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,913 posts

Posted 26 May 2017 - 07:29 PM

Thanks for this tool, Andy! :)



#4 Spider

Spider

    XOR (HL)

  • Administrator
  • 3,367 posts

Posted 27 May 2017 - 01:24 PM

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.


Changing order to chaos since 1984

#5 Spider

Spider

    XOR (HL)

  • Administrator
  • 3,367 posts

Posted 26 June 2017 - 07:57 PM

I'd consider this 'final' now. Its reliable and relatively stable.

 

Enjoy. :)


Changing order to chaos since 1984

#6 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,913 posts

Posted 15 February 2018 - 01:37 PM

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, 15 February 2018 - 01:38 PM.


#7 Spider

Spider

    XOR (HL)

  • Administrator
  • 3,367 posts

Posted 15 February 2018 - 01:51 PM

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, 15 February 2018 - 01:54 PM.

Changing order to chaos since 1984

#8 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,913 posts

Posted 15 February 2018 - 07:03 PM

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, 15 February 2018 - 07:05 PM.


#9 Spider

Spider

    XOR (HL)

  • Administrator
  • 3,367 posts

Posted 15 February 2018 - 07:22 PM

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.


Changing order to chaos since 1984

#10 Spider

Spider

    XOR (HL)

  • Administrator
  • 3,367 posts

Posted 15 February 2018 - 07:35 PM

Demo:

 

Just a modified full MM loading screen I made ages ago, so I just quickly whipped this up with it:

 

Attached File  demo.tap   2.45KB   31 downloads

 

Basic loader might be useful so you can see by a (not brilliant!) example. :)


Changing order to chaos since 1984




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users