As an exercise, why not add a new procedure called PSI to the code for PSI_CLS. This new procedure will carry out all the same work as PSI_CLS but it will not do the CLS part of it. This will be useful when you want to set the colours for a window but not clear it. I will NOT be giving the answers out next time, but here are a few hints :
update the definition table with details of the new procedure.
in the proc's code, set D6.B to zero for PSI and 1 for PSI_CLS. Do this as the first instruction in both procedures.
In the PSI procedure, simply set D6 and jump to the code in PSI_CLS.
Just before doing the actual CLS part of PSI_CLS, check the value in D6.B and if zero, don't do the CLS simply BRA.S to error_exit instead.
All in all, I think this can be done in about 10 extra lines of code, maybe less, not counting the extra lines in the definition block.
Adding even a few lines of code can sometimes cause any 'short' branches to go out of limit and this will cause errors in the assembly. If this happens, simply find the ones in error and remove the '.s' from the 'bsr' or 'bra' instructions.