|★ APPLICATIONS ★ DIVERS ★ PARTIAL-SCREEN SAVE ★|
|Partial - Screen Save|Your Computer)||Applications Divers|
The 16K Amstrad screen occupies a good deal of space in RAM, on tape and on disc, so it would seem sensible to be able to save small portions instead of having to save the entire block of video-RAM, which runs from &C000 to &FFFF.
The routines presented here are in machine code and they may be CALLed from Basic or converted into Locomotive-Basic RSX commands. To save part of the screen, use the command CALL &9014,XL,XH,YH,YL where XL is the low X co-ordinate, XH the high X coordinate,m YH the high Y co-ordinate and YL the low Y co-ordinate. To recall the screen segment use CALL &9010 on its own.
Because those screen-moving routines work on the screen coordinate number -0-639 and 0-199 - they are impervious to the screen-scrolling action which muddles the screen addresses. That means that the saved screen segment always returns to its correct position on the screen, even though the screen may have undergone drastic changes.
The screen portions are saved in user-RAM between &8000 and &9000. That is a 4K area, so portions as big as one-quarter of the screen may be saved there. The machine code does not check the coordinates supplied to it to see whether they represent a quarter screen or less. If you want to incorporate such checks, which might be advisable, you should do so in Basic before &9014 is called. The instructions to save and recall the screens from tape/disc are:
Saving: CALL &9014,XL,XH,YH,YL:SAVE "NAME.BIN",B,&8000,&1008
Recall: LOAD "NAME.BIN":CALL &9010 For economical folk who want to save only very small pictures taking up no more than one-sixteenth of the screen, there are simple changes which can be made to the code to permit it. The high-memory pointer can be bumped up by 3K using the command MEMORY &8BFF - that is 3K more space for Basic programs - and the POKE in the loading program will need changing from POKE &9001,&80 to POKE &9001,&8C. The save-to-tape/disc instruction also needs changing to SAVE "NAME.BIN",B,&8C00,&408 but everything else stays the same. The listing presented is for the quarter-screen version and it loads and saves the machine code bytes in one operation.