# > ScrSave/s v1.08 15-Dec-1992  Compessed screen saver # v1.08: added + option (: To fix: Too long to fit in memory, overflows to &Bxx 2: <OSBYTE=&FFF4:OSARGS=&FFDA FOSFIND=&FFCE:OSFILE=&FFDD POSBPUT=&FFD4:OSWORD=&FFF1 Z%lptr=&A8: colour=&A8:REM and &A9 dA_temp=&A9: handle=&A8 naddr=&AA: and &AB xScrFlag=&AC:mode=&AD $length=&AE:try_end=&AE: and &AF mcode%=&FFFF08C0 : P=0 1 P%=mcode% [OPT P*3 .palette .error =BRK:EQUB 220:EQUS "Syntax: ScrSave (+)":BRK .get_char LDA (lptr),Y:INY:CMP #13:RTS .start% &LDA #1:LDY #0:LDX #lptr:JSR OSARGS "LDA (lptr),Y:CMP #13:BEQ error $STY length:STY length+1:STY addr LDX ctblk:LDY ctblk+1 H!LDA #&80:JSR OSFIND:\ Openout RJSR try_to_save_block \JSR CloseFile f\ Rewrite addresses pLDX #3:.push_lp z%LDA ctblk+6,X:PHA:DEX:BPL push_lp LDA #2:JSR CallOsfile LDX #&FC:.pull_lp )PLA:STA ctblk+6-&FC,X:INX:BNE pull_lp LDA #3:JSR CallOsfile .SaveFinish LDA ScrFlag:BEQ EndAll CMP #2:BEQ EndMaster LDA #111:JSR osbyte192 LDA #34:JMP osbyte192 .EndAll:RTS .EndMaster LDA #108:LDX #0:JMP OSBYTE : .CloseFile LDA #0:JMP OSFIND : $.CallOsfile0 . LDA #0 8.CallOsfile B%LDX #ctblk 255:LDY #ctblk 256 LJMP OSFILE V\ `#\ Find length and create a file j.try_to_save_block t$PHA:\ Save handle (or zero flag) ~+LDA ctblk+11:STA addr+1:LDA #0:STA addr  .SaveLp LDY #0:LDX #0:LDA (addr),Y  .SaveSame (INC addr:BNE Save2:INC addr+1:.Save2 "LDY addr:CPY new_end:BNE Save3 (LDY addr+1:CPY new_end+1:BEQ SaveEnd  .Save3 INX:BEQ SaveOut $LDY #0:CMP (addr),Y:BEQ SaveSame  .SaveOut "STA A_temp:PLA:JSR OutputBytes PHA:JMP SaveLp  .SaveEnd  INX:STA A_temp:PLA .OutputBytes TAY:BEQ Output2 ((LDA A_temp:JSR OSBPUT:TXA:JSR OSBPUT 2 .Output2 <&LDA try_end:CLC:ADC #2:STA try_end F&LDA try_end+1:ADC #0:STA try_end+1 P TYA:RTS Z: d .osword11 n)LDX #palette 255:LDY #palette 256 xLDA #11:JSR OSWORD LDA palette+1 RTS  .pall1 STA ctblk,X:STY palette  .pall1a ASL ctblk,X:ROL ctblk+1,X ASL ctblk,X:ROL ctblk+1,X ASL ctblk,X:ROL ctblk+1,X TXA:PHA:\STY palette JSR osword11:PLA:TAX LDA palette+1: #7 A ctblk,X:STA ctblk,X DEC palette:LDA palette  #3:BNE pall1a:RTS :  .pall2 "LDA #8:STA palette:.pall2lp ,$JSR osword11:LDY #0:STA (addr),Y 6INC palette:JSR osword11 @"ASL A:ASL A:ASL A:ASL A:LDY #0 JA (addr),Y:STA (addr),Y TINC palette:INC addr ^#LDA palette:CMP #16:BNE pall2lp hRTS r\ | \.newbrk  \JSR swapbrk:\JSR SaveFinish \JMP (&202) :  \.swapbrk /\LDA &202:\LDX oldbrk:\STX &202:\STA oldbrk 3\LDA &203:\LDX oldbrk+1:\STX &203:\STA oldbrk+1 \RTS : .osbyte128 LDX #128:BNE CallOsbyte .osbyte192 LDX #192:.CallOsbyte JMP OSBYTE :  .ctblk  EQUW 0 &!EQUD &FFFF3000:EQUD &FFFF0000 0EQUD &FFFF3000 : .new_end DEQUD &FFFF8000 N .himems XEQUB &30:EQUB &30:EQUB &30 bEQUB &40:EQUB &58:EQUB &58 lEQUB &60:EQUB &7C v \.oldbrk \EQUW newbrk EQUS "v1.08":BRK ] ;"*SAVE ScrSave ";~mcode%;" ";~P%;" ";~start%&FFFF0000