;Copyright (C) 2008 Pierre Baudemont ; ; This file is part of bf. ; ; bf is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; bf is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with bf; if not, write to the Free Software ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ;--screen content restoration-- ; PARAM : @ screen save ; OUTPT : none ; used ROM CALLs : ;HeapFreePtr equ $A3 ;memcpy equ $26A section ".data" include "OS.h" xdef restore_scr restore_scr: move.l a5,-(a7) ; save the used registry move.l $c8,a5 ; $C8 : @ ROM CALLs table move.l #3840,-(a7) ;param1 : size ;fetch procedure param on stack move.l 12(a7),-(a7) ;param2 : @source : @ screen save pea.l $4c00 ;param3 : @dest : LCD mem move.l memcpy*4(a5),a0 jsr (a0) ;it's done! addq.l #4,a7 ;clean the stack partially ; we need the @source next ;RAM deallocation move.l HeapFreePtr*4(a5),a0 jsr (a0) ;it's done! addq.l #8,a7 ;clean the stack move.l (a7)+,a5 ;saved registries restoration rts